summaryrefslogtreecommitdiffstats
path: root/storage/spider
diff options
context:
space:
mode:
Diffstat (limited to 'storage/spider')
-rw-r--r--storage/spider/ha_spider.cc169
-rw-r--r--storage/spider/ha_spider.h17
-rw-r--r--storage/spider/mysql-test/spider/bg/my.cnf1
-rw-r--r--storage/spider/mysql-test/spider/bg/r/basic_sql.result11
-rw-r--r--storage/spider/mysql-test/spider/bg/r/basic_sql_part.result5
-rw-r--r--storage/spider/mysql-test/spider/bg/r/direct_aggregate.result3
-rw-r--r--storage/spider/mysql-test/spider/bg/r/direct_aggregate_part.result5
-rw-r--r--storage/spider/mysql-test/spider/bg/r/direct_update.result3
-rw-r--r--storage/spider/mysql-test/spider/bg/r/direct_update_part.result5
-rw-r--r--storage/spider/mysql-test/spider/bg/r/function.result5
-rw-r--r--storage/spider/mysql-test/spider/bg/r/ha.result25
-rw-r--r--storage/spider/mysql-test/spider/bg/r/ha_part.result47
-rw-r--r--storage/spider/mysql-test/spider/bg/r/spider3_fixes.result4
-rw-r--r--storage/spider/mysql-test/spider/bg/r/spider3_fixes_part.result10
-rw-r--r--storage/spider/mysql-test/spider/bg/r/spider_fixes.result28
-rw-r--r--storage/spider/mysql-test/spider/bg/r/spider_fixes_part.result20
-rw-r--r--storage/spider/mysql-test/spider/bg/r/vp_fixes.result9
-rw-r--r--storage/spider/mysql-test/spider/bg/t/direct_aggregate.test2
-rw-r--r--storage/spider/mysql-test/spider/bg/t/direct_aggregate_part.test2
-rw-r--r--storage/spider/mysql-test/spider/bg/t/direct_update.test2
-rw-r--r--storage/spider/mysql-test/spider/bg/t/direct_update_part.test2
-rw-r--r--storage/spider/mysql-test/spider/bg/t/function.test6
-rw-r--r--storage/spider/mysql-test/spider/bg/t/ha.test10
-rw-r--r--storage/spider/mysql-test/spider/bg/t/ha_part.test10
-rw-r--r--storage/spider/mysql-test/spider/bg/t/slave_test_init.inc3
-rw-r--r--storage/spider/mysql-test/spider/bg/t/spider3_fixes.test4
-rw-r--r--storage/spider/mysql-test/spider/bg/t/spider3_fixes_part.test4
-rw-r--r--storage/spider/mysql-test/spider/bg/t/spider_fixes.test24
-rw-r--r--storage/spider/mysql-test/spider/bg/t/spider_fixes_part.test8
-rw-r--r--storage/spider/mysql-test/spider/bg/t/vp_fixes.test6
-rw-r--r--storage/spider/mysql-test/spider/bugfix/disabled.def1
-rw-r--r--storage/spider/mysql-test/spider/bugfix/include/sql_mode_init.inc16
-rw-r--r--storage/spider/mysql-test/spider/bugfix/my.cnf1
-rw-r--r--storage/spider/mysql-test/spider/bugfix/r/checksum_table_with_quick_mode_3.result2
-rw-r--r--storage/spider/mysql-test/spider/bugfix/r/cp932_column.result2
-rw-r--r--storage/spider/mysql-test/spider/bugfix/r/delete_with_float_column_default.result2
-rw-r--r--storage/spider/mysql-test/spider/bugfix/r/delete_with_float_column_mariadb.result2
-rw-r--r--storage/spider/mysql-test/spider/bugfix/r/delete_with_float_column_mysql.result2
-rw-r--r--storage/spider/mysql-test/spider/bugfix/r/gbh_outer_fields_in_join.result6
-rw-r--r--storage/spider/mysql-test/spider/bugfix/r/group_by_order_by_limit.result5
-rw-r--r--storage/spider/mysql-test/spider/bugfix/r/index.result9
-rw-r--r--storage/spider/mysql-test/spider/bugfix/r/insert_select.result4
-rw-r--r--storage/spider/mysql-test/spider/bugfix/r/mdev_19866.result5
-rw-r--r--storage/spider/mysql-test/spider/bugfix/r/mdev_20100.result4
-rw-r--r--storage/spider/mysql-test/spider/bugfix/r/mdev_20502.result2
-rw-r--r--storage/spider/mysql-test/spider/bugfix/r/mdev_21884.result5
-rw-r--r--storage/spider/mysql-test/spider/bugfix/r/mdev_22246.result5
-rw-r--r--storage/spider/mysql-test/spider/bugfix/r/mdev_22265.result2
-rw-r--r--storage/spider/mysql-test/spider/bugfix/r/mdev_24020.result4
-rw-r--r--storage/spider/mysql-test/spider/bugfix/r/mdev_24343.result9
-rw-r--r--storage/spider/mysql-test/spider/bugfix/r/mdev_24517.result4
-rw-r--r--storage/spider/mysql-test/spider/bugfix/r/mdev_24523.result4
-rw-r--r--storage/spider/mysql-test/spider/bugfix/r/mdev_24760.result3
-rw-r--r--storage/spider/mysql-test/spider/bugfix/r/mdev_25116.result2
-rw-r--r--storage/spider/mysql-test/spider/bugfix/r/mdev_26013.result3
-rw-r--r--storage/spider/mysql-test/spider/bugfix/r/mdev_26151.result6
-rw-r--r--storage/spider/mysql-test/spider/bugfix/r/mdev_26158.result3
-rw-r--r--storage/spider/mysql-test/spider/bugfix/r/mdev_26247.result6
-rw-r--r--storage/spider/mysql-test/spider/bugfix/r/mdev_26539.result3
-rw-r--r--storage/spider/mysql-test/spider/bugfix/r/mdev_27172.result6
-rw-r--r--storage/spider/mysql-test/spider/bugfix/r/mdev_28739.result2
-rw-r--r--storage/spider/mysql-test/spider/bugfix/r/mdev_28739_simple.result2
-rw-r--r--storage/spider/mysql-test/spider/bugfix/r/mdev_28854.result2
-rw-r--r--storage/spider/mysql-test/spider/bugfix/r/mdev_28856.result34
-rw-r--r--storage/spider/mysql-test/spider/bugfix/r/mdev_28996.result2
-rw-r--r--storage/spider/mysql-test/spider/bugfix/r/mdev_28998.result2
-rw-r--r--storage/spider/mysql-test/spider/bugfix/r/mdev_29002.result10
-rw-r--r--storage/spider/mysql-test/spider/bugfix/r/mdev_29008.result2
-rw-r--r--storage/spider/mysql-test/spider/bugfix/r/mdev_29011.result2
-rw-r--r--storage/spider/mysql-test/spider/bugfix/r/mdev_29163.result6
-rw-r--r--storage/spider/mysql-test/spider/bugfix/r/mdev_29421.result2
-rw-r--r--storage/spider/mysql-test/spider/bugfix/r/mdev_29447.result2
-rw-r--r--storage/spider/mysql-test/spider/bugfix/r/mdev_29456.result6
-rw-r--r--storage/spider/mysql-test/spider/bugfix/r/mdev_29484.result2
-rw-r--r--storage/spider/mysql-test/spider/bugfix/r/mdev_29502.result6
-rw-r--r--storage/spider/mysql-test/spider/bugfix/r/mdev_29562.result4
-rw-r--r--storage/spider/mysql-test/spider/bugfix/r/mdev_29644.result2
-rw-r--r--storage/spider/mysql-test/spider/bugfix/r/mdev_29653.result2
-rw-r--r--storage/spider/mysql-test/spider/bugfix/r/mdev_29667.result2
-rw-r--r--storage/spider/mysql-test/spider/bugfix/r/mdev_29676.result47
-rw-r--r--storage/spider/mysql-test/spider/bugfix/r/mdev_29963.result10
-rw-r--r--storage/spider/mysql-test/spider/bugfix/r/mdev_30014.result4
-rw-r--r--storage/spider/mysql-test/spider/bugfix/r/mdev_30191.result2
-rw-r--r--storage/spider/mysql-test/spider/bugfix/r/mdev_30392.result2
-rw-r--r--storage/spider/mysql-test/spider/bugfix/r/mdev_31117.result1
-rw-r--r--storage/spider/mysql-test/spider/bugfix/r/mdev_31338.result2
-rw-r--r--storage/spider/mysql-test/spider/bugfix/r/mdev_31463.result44
-rw-r--r--storage/spider/mysql-test/spider/bugfix/r/mdev_31524.result51
-rw-r--r--storage/spider/mysql-test/spider/bugfix/r/mdev_31645.result2
-rw-r--r--storage/spider/mysql-test/spider/bugfix/r/mdev_31996.result8
-rw-r--r--storage/spider/mysql-test/spider/bugfix/r/mdev_32486.result20
-rw-r--r--storage/spider/mysql-test/spider/bugfix/r/mdev_32986.result2
-rw-r--r--storage/spider/mysql-test/spider/bugfix/r/mdev_32999.result18
-rw-r--r--storage/spider/mysql-test/spider/bugfix/r/mdev_33191.result2
-rw-r--r--storage/spider/mysql-test/spider/bugfix/r/mdev_33242.result2
-rw-r--r--storage/spider/mysql-test/spider/bugfix/r/mdev_33679.result4
-rw-r--r--storage/spider/mysql-test/spider/bugfix/r/mdev_34003.result2
-rw-r--r--storage/spider/mysql-test/spider/bugfix/r/quick_mode_0.result4
-rw-r--r--storage/spider/mysql-test/spider/bugfix/r/quick_mode_1.result8
-rw-r--r--storage/spider/mysql-test/spider/bugfix/r/quick_mode_2.result4
-rw-r--r--storage/spider/mysql-test/spider/bugfix/r/quick_mode_3.result4
-rw-r--r--storage/spider/mysql-test/spider/bugfix/r/return_found_rows_insert.result2
-rw-r--r--storage/spider/mysql-test/spider/bugfix/r/return_found_rows_update.result2
-rw-r--r--storage/spider/mysql-test/spider/bugfix/r/same_server_link.result2
-rw-r--r--storage/spider/mysql-test/spider/bugfix/r/select_by_null.result2
-rw-r--r--storage/spider/mysql-test/spider/bugfix/r/select_with_backquote.result2
-rw-r--r--storage/spider/mysql-test/spider/bugfix/r/self_reference.result2
-rw-r--r--storage/spider/mysql-test/spider/bugfix/r/self_reference_multi.result6
-rw-r--r--storage/spider/mysql-test/spider/bugfix/r/slave_trx_isolation.result4
-rw-r--r--storage/spider/mysql-test/spider/bugfix/r/spider_join_with_non_spider.result2
-rw-r--r--storage/spider/mysql-test/spider/bugfix/r/sql_mode_mariadb.result2
-rw-r--r--storage/spider/mysql-test/spider/bugfix/r/sql_mode_mysql.result2
-rw-r--r--storage/spider/mysql-test/spider/bugfix/r/strict_group_by.result5
-rw-r--r--storage/spider/mysql-test/spider/bugfix/r/subquery.result4
-rw-r--r--storage/spider/mysql-test/spider/bugfix/r/sysvar_params.result106
-rw-r--r--storage/spider/mysql-test/spider/bugfix/r/udf_mysql_func_early.result2
-rw-r--r--storage/spider/mysql-test/spider/bugfix/r/udf_mysql_func_early_init_file.result2
-rw-r--r--storage/spider/mysql-test/spider/bugfix/r/wrapper_mariadb.result2
-rw-r--r--storage/spider/mysql-test/spider/bugfix/r/xa_cmd.result2
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/checksum_table_with_quick_mode_3.cnf1
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/checksum_table_with_quick_mode_3.test2
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/cp932_column.cnf1
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/cp932_column.test4
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/delete_with_float_column_default.cnf1
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/delete_with_float_column_mariadb.cnf1
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/delete_with_float_column_mysql.cnf1
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/direct_sql_with_comma_pwd.cnf1
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/direct_sql_with_tmp_table.cnf1
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/gbh_outer_fields_in_join.cnf1
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/gbh_outer_fields_in_join.test1
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/group_by_order_by_limit.cnf1
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/group_by_order_by_limit.test2
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/index.test6
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/insert_select.cnf1
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/insert_select.test4
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/mdev_19866.cnf1
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/mdev_19866.test2
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/mdev_20100.cnf1
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/mdev_20100.test2
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/mdev_20502.cnf1
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/mdev_20502.test2
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/mdev_21884.cnf1
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/mdev_21884.test2
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/mdev_22246.cnf1
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/mdev_22246.test3
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/mdev_22265.cnf1
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/mdev_24020.cnf1
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/mdev_24020.test2
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/mdev_24343.cnf1
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/mdev_24343.test2
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/mdev_24517.cnf1
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/mdev_24517.test2
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/mdev_24523.cnf1
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/mdev_24523.test2
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/mdev_24760.cnf1
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/mdev_24760.test2
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/mdev_25116.cnf1
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/mdev_25116.test2
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/mdev_25684.cnf1
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/mdev_26013.cnf1
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/mdev_26013.test2
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/mdev_26151.test4
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/mdev_26158.cnf1
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/mdev_26247.cnf1
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/mdev_26247.test4
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/mdev_26539.cnf1
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/mdev_26539.test2
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/mdev_26544.cnf1
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/mdev_26582.cnf1
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/mdev_27172.cnf1
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/mdev_27172.test4
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/mdev_27184.cnf1
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/mdev_27239.cnf1
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/mdev_27240.cnf1
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/mdev_28739.cnf1
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/mdev_28739.test2
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/mdev_28739_simple.test1
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/mdev_28854.cnf1
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/mdev_28856.test22
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/mdev_28996.cnf1
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/mdev_28996.test2
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/mdev_28998.test2
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/mdev_29008.cnf1
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/mdev_29008.test2
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/mdev_29011.cnf1
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/mdev_29011.test2
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/mdev_29163.test2
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/mdev_29447.cnf1
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/mdev_29447.test4
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/mdev_29484.cnf1
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/mdev_29502.test6
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/mdev_29562.cnf1
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/mdev_29562.test2
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/mdev_29644.cnf1
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/mdev_29644.test2
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/mdev_29653.cnf1
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/mdev_29653.test2
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/mdev_29667.cnf1
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/mdev_29676.test41
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/mdev_30191.cnf1
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/mdev_30392.test2
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/mdev_31338.test2
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/mdev_31463.cnf4
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/mdev_31463.test65
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/mdev_31524.test74
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/mdev_31645.test2
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/mdev_31996.test1
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/mdev_32486.test26
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/mdev_32999.test22
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/quick_mode_0.cnf1
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/quick_mode_0.test5
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/quick_mode_1.cnf1
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/quick_mode_1.test6
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/quick_mode_2.cnf1
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/quick_mode_2.test5
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/quick_mode_3.cnf1
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/quick_mode_3.test5
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/return_found_rows_insert.cnf1
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/return_found_rows_insert.test2
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/return_found_rows_update.cnf1
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/return_found_rows_update.test2
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/same_server_link.cnf1
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/select_by_null.cnf1
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/select_by_null.test4
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/select_with_backquote.cnf1
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/select_with_backquote.test4
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/self_reference.cnf1
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/slave_transaction_retry_errors_5digit.cnf1
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/slave_trx_isolation.cnf1
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/spider_join_with_non_spider.test1
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/sql_mode.inc2
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/sql_mode_mariadb.cnf1
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/sql_mode_mysql.cnf1
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/strict_group_by.cnf1
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/strict_group_by.test4
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/subquery.test2
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/sysvar_params.test137
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/udf_mysql_func_early.cnf1
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/udf_mysql_func_early_init_file.cnf1
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/wait_timeout.cnf1
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/wrapper_mariadb.cnf1
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/wrapper_mariadb.test2
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/xa_cmd.cnf1
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/xa_cmd.test2
-rw-r--r--storage/spider/mysql-test/spider/feature/my.cnf1
-rw-r--r--storage/spider/mysql-test/spider/feature/r/checksum_table_parallel_extended.result5
-rw-r--r--storage/spider/mysql-test/spider/feature/r/checksum_table_parallel_no_opt.result5
-rw-r--r--storage/spider/mysql-test/spider/feature/r/checksum_table_parallel_quick.result5
-rw-r--r--storage/spider/mysql-test/spider/feature/r/engine_defined_attributes.result387
-rw-r--r--storage/spider/mysql-test/spider/feature/r/pushdown_case.result2
-rw-r--r--storage/spider/mysql-test/spider/feature/r/pushdown_timestamp_diff.result2
-rw-r--r--storage/spider/mysql-test/spider/feature/t/checksum_table_parallel.inc2
-rw-r--r--storage/spider/mysql-test/spider/feature/t/checksum_table_parallel_extended.cnf1
-rw-r--r--storage/spider/mysql-test/spider/feature/t/checksum_table_parallel_no_opt.cnf1
-rw-r--r--storage/spider/mysql-test/spider/feature/t/checksum_table_parallel_quick.cnf1
-rw-r--r--storage/spider/mysql-test/spider/feature/t/engine_defined_attributes.cnf1
-rw-r--r--storage/spider/mysql-test/spider/feature/t/engine_defined_attributes.test378
-rw-r--r--storage/spider/mysql-test/spider/feature/t/slave_transaction_retry_errors.cnf1
-rw-r--r--storage/spider/mysql-test/spider/my.cnf1
-rw-r--r--storage/spider/mysql-test/spider/r/auto_increment.result8
-rw-r--r--storage/spider/mysql-test/spider/r/basic_sql.result15
-rw-r--r--storage/spider/mysql-test/spider/r/basic_sql_part.result5
-rw-r--r--storage/spider/mysql-test/spider/r/checksum_table_with_quick_mode_3.result2
-rw-r--r--storage/spider/mysql-test/spider/r/direct_aggregate.result3
-rw-r--r--storage/spider/mysql-test/spider/r/direct_aggregate_part.result5
-rw-r--r--storage/spider/mysql-test/spider/r/direct_join.result14
-rw-r--r--storage/spider/mysql-test/spider/r/direct_join_using.result9
-rw-r--r--storage/spider/mysql-test/spider/r/direct_left_join.result9
-rw-r--r--storage/spider/mysql-test/spider/r/direct_left_join_nullable.result14
-rw-r--r--storage/spider/mysql-test/spider/r/direct_left_right_join_nullable.result14
-rw-r--r--storage/spider/mysql-test/spider/r/direct_left_right_left_join_nullable.result12
-rw-r--r--storage/spider/mysql-test/spider/r/direct_right_join.result9
-rw-r--r--storage/spider/mysql-test/spider/r/direct_right_join_nullable.result14
-rw-r--r--storage/spider/mysql-test/spider/r/direct_right_left_join_nullable.result12
-rw-r--r--storage/spider/mysql-test/spider/r/direct_right_left_right_join_nullable.result14
-rw-r--r--storage/spider/mysql-test/spider/r/direct_update.result3
-rw-r--r--storage/spider/mysql-test/spider/r/direct_update_part.result5
-rw-r--r--storage/spider/mysql-test/spider/r/error_row_number.result5
-rw-r--r--storage/spider/mysql-test/spider/r/function.result5
-rw-r--r--storage/spider/mysql-test/spider/r/ha.result25
-rw-r--r--storage/spider/mysql-test/spider/r/ha_part.result47
-rw-r--r--storage/spider/mysql-test/spider/r/partition_cond_push.result7
-rw-r--r--storage/spider/mysql-test/spider/r/partition_fulltext.result10
-rw-r--r--storage/spider/mysql-test/spider/r/partition_join_pushdown_for_single_partition.result14
-rw-r--r--storage/spider/mysql-test/spider/r/partition_mrr.result68
-rw-r--r--storage/spider/mysql-test/spider/r/pushdown_not_like.result3
-rw-r--r--storage/spider/mysql-test/spider/r/quick_mode_0.result4
-rw-r--r--storage/spider/mysql-test/spider/r/quick_mode_1.result4
-rw-r--r--storage/spider/mysql-test/spider/r/quick_mode_2.result4
-rw-r--r--storage/spider/mysql-test/spider/r/quick_mode_3.result4
-rw-r--r--storage/spider/mysql-test/spider/r/slave_trx_isolation.result4
-rw-r--r--storage/spider/mysql-test/spider/r/spider3_fixes.result4
-rw-r--r--storage/spider/mysql-test/spider/r/spider3_fixes_part.result10
-rw-r--r--storage/spider/mysql-test/spider/r/spider_fixes.result28
-rw-r--r--storage/spider/mysql-test/spider/r/spider_fixes_part.result31
-rw-r--r--storage/spider/mysql-test/spider/r/timestamp.result8
-rw-r--r--storage/spider/mysql-test/spider/r/variable_deprecation.result66
-rw-r--r--storage/spider/mysql-test/spider/r/vp_fixes.result9
-rw-r--r--storage/spider/mysql-test/spider/regression/e1121/my.cnf1
-rw-r--r--storage/spider/mysql-test/spider/regression/e1121/r/direct_join_by_pkey_key.result4
-rw-r--r--storage/spider/mysql-test/spider/regression/e1121/r/direct_join_by_pkey_pkey.result4
-rw-r--r--storage/spider/mysql-test/spider/regression/e1121/r/load_data_ddi0.result2
-rw-r--r--storage/spider/mysql-test/spider/regression/e1121/r/load_data_ddi1.result2
-rw-r--r--storage/spider/mysql-test/spider/regression/e1121/r/load_data_ignore_ddi0.result2
-rw-r--r--storage/spider/mysql-test/spider/regression/e1121/r/load_data_ignore_ddi1.result2
-rw-r--r--storage/spider/mysql-test/spider/regression/e1121/r/load_data_local_ddi0.result2
-rw-r--r--storage/spider/mysql-test/spider/regression/e1121/r/load_data_local_ddi1.result2
-rw-r--r--storage/spider/mysql-test/spider/regression/e1121/r/load_data_local_ignore_ddi0.result2
-rw-r--r--storage/spider/mysql-test/spider/regression/e1121/r/load_data_local_ignore_ddi1.result2
-rw-r--r--storage/spider/mysql-test/spider/regression/e1121/r/load_data_local_replace_ddi0.result2
-rw-r--r--storage/spider/mysql-test/spider/regression/e1121/r/load_data_local_replace_ddi1.result2
-rw-r--r--storage/spider/mysql-test/spider/regression/e1121/r/load_data_replace_ddi0.result2
-rw-r--r--storage/spider/mysql-test/spider/regression/e1121/r/load_data_replace_ddi1.result2
-rw-r--r--storage/spider/mysql-test/spider/regression/e1121/t/direct_join_by_pkey_key.test2
-rw-r--r--storage/spider/mysql-test/spider/regression/e1121/t/direct_join_by_pkey_pkey.test2
-rw-r--r--storage/spider/mysql-test/spider/regression/e1121/t/load_data.inc2
-rw-r--r--storage/spider/mysql-test/spider/regression/e112122/my.cnf1
-rw-r--r--storage/spider/mysql-test/spider/regression/e112122/r/group_by_order_by_limit_ok.result5
-rw-r--r--storage/spider/mysql-test/spider/regression/e112122/r/load_data_part_ddi0.result5
-rw-r--r--storage/spider/mysql-test/spider/regression/e112122/r/load_data_part_ddi1.result5
-rw-r--r--storage/spider/mysql-test/spider/regression/e112122/r/load_data_part_ignore_ddi0.result5
-rw-r--r--storage/spider/mysql-test/spider/regression/e112122/r/load_data_part_ignore_ddi1.result5
-rw-r--r--storage/spider/mysql-test/spider/regression/e112122/r/load_data_part_local_ddi0.result5
-rw-r--r--storage/spider/mysql-test/spider/regression/e112122/r/load_data_part_local_ddi1.result5
-rw-r--r--storage/spider/mysql-test/spider/regression/e112122/r/load_data_part_local_ignore_ddi0.result5
-rw-r--r--storage/spider/mysql-test/spider/regression/e112122/r/load_data_part_local_ignore_ddi1.result5
-rw-r--r--storage/spider/mysql-test/spider/regression/e112122/r/load_data_part_local_replace_ddi0.result5
-rw-r--r--storage/spider/mysql-test/spider/regression/e112122/r/load_data_part_local_replace_ddi1.result5
-rw-r--r--storage/spider/mysql-test/spider/regression/e112122/r/load_data_part_replace_ddi0.result5
-rw-r--r--storage/spider/mysql-test/spider/regression/e112122/r/load_data_part_replace_ddi1.result5
-rw-r--r--storage/spider/mysql-test/spider/regression/e112122/t/group_by_order_by_limit_ok.test2
-rw-r--r--storage/spider/mysql-test/spider/regression/e112122/t/load_data_part.inc2
-rw-r--r--storage/spider/mysql-test/spider/t/auto_increment.test12
-rw-r--r--storage/spider/mysql-test/spider/t/checksum_table_with_quick_mode_3.test2
-rw-r--r--storage/spider/mysql-test/spider/t/direct_aggregate.test2
-rw-r--r--storage/spider/mysql-test/spider/t/direct_aggregate_part.test2
-rw-r--r--storage/spider/mysql-test/spider/t/direct_join.test6
-rw-r--r--storage/spider/mysql-test/spider/t/direct_join_using.test2
-rw-r--r--storage/spider/mysql-test/spider/t/direct_left_join.test2
-rw-r--r--storage/spider/mysql-test/spider/t/direct_left_join_nullable.test2
-rw-r--r--storage/spider/mysql-test/spider/t/direct_left_right_join_nullable.test2
-rw-r--r--storage/spider/mysql-test/spider/t/direct_left_right_left_join_nullable.test2
-rw-r--r--storage/spider/mysql-test/spider/t/direct_right_join.test2
-rw-r--r--storage/spider/mysql-test/spider/t/direct_right_join_nullable.test2
-rw-r--r--storage/spider/mysql-test/spider/t/direct_right_left_join_nullable.test2
-rw-r--r--storage/spider/mysql-test/spider/t/direct_right_left_right_join_nullable.test2
-rw-r--r--storage/spider/mysql-test/spider/t/direct_update.test2
-rw-r--r--storage/spider/mysql-test/spider/t/direct_update_part.test2
-rw-r--r--storage/spider/mysql-test/spider/t/function.test6
-rw-r--r--storage/spider/mysql-test/spider/t/ha.test12
-rw-r--r--storage/spider/mysql-test/spider/t/ha_part.test10
-rw-r--r--storage/spider/mysql-test/spider/t/partition_cond_push.test2
-rw-r--r--storage/spider/mysql-test/spider/t/partition_fulltext.test2
-rw-r--r--storage/spider/mysql-test/spider/t/partition_join_pushdown_for_single_partition.test2
-rw-r--r--storage/spider/mysql-test/spider/t/partition_mrr.test1
-rw-r--r--storage/spider/mysql-test/spider/t/pushdown_not_like.test2
-rw-r--r--storage/spider/mysql-test/spider/t/quick_mode_0.test4
-rw-r--r--storage/spider/mysql-test/spider/t/quick_mode_1.test4
-rw-r--r--storage/spider/mysql-test/spider/t/quick_mode_2.test4
-rw-r--r--storage/spider/mysql-test/spider/t/quick_mode_3.test4
-rw-r--r--storage/spider/mysql-test/spider/t/slave_test_init.inc3
-rw-r--r--storage/spider/mysql-test/spider/t/spider3_fixes.test4
-rw-r--r--storage/spider/mysql-test/spider/t/spider3_fixes_part.test4
-rw-r--r--storage/spider/mysql-test/spider/t/spider_fixes.test24
-rw-r--r--storage/spider/mysql-test/spider/t/spider_fixes_part.test14
-rw-r--r--storage/spider/mysql-test/spider/t/timestamp.test4
-rw-r--r--storage/spider/mysql-test/spider/t/vp_fixes.test6
-rw-r--r--storage/spider/spd_conn.cc181
-rw-r--r--storage/spider/spd_conn.h3
-rw-r--r--storage/spider/spd_copy_tables.cc19
-rw-r--r--storage/spider/spd_db_conn.cc17
-rw-r--r--storage/spider/spd_db_include.h19
-rw-r--r--storage/spider/spd_db_mysql.cc1039
-rw-r--r--storage/spider/spd_db_mysql.h42
-rw-r--r--storage/spider/spd_direct_sql.cc2
-rw-r--r--storage/spider/spd_err.h6
-rw-r--r--storage/spider/spd_include.h60
-rw-r--r--storage/spider/spd_malloc.cc2
-rw-r--r--storage/spider/spd_param.cc30
-rw-r--r--storage/spider/spd_param.h3
-rw-r--r--storage/spider/spd_ping_table.cc58
-rw-r--r--storage/spider/spd_sys_table.cc188
-rw-r--r--storage/spider/spd_sys_table.h46
-rw-r--r--storage/spider/spd_table.cc3186
-rw-r--r--storage/spider/spd_table.h22
-rw-r--r--storage/spider/spd_trx.cc190
-rw-r--r--storage/spider/spd_trx.h6
387 files changed, 5235 insertions, 3131 deletions
diff --git a/storage/spider/ha_spider.cc b/storage/spider/ha_spider.cc
index c998fd18..c2fbb776 100644
--- a/storage/spider/ha_spider.cc
+++ b/storage/spider/ha_spider.cc
@@ -238,7 +238,6 @@ int ha_spider::open(
DBUG_PRINT("info",("spider this=%p", this));
dup_key_idx = (uint) -1;
- conn_kinds = SPIDER_CONN_KIND_MYSQL;
table->file->get_no_parts("", &part_num);
if (part_num)
{
@@ -310,10 +309,10 @@ int ha_spider::open(
my_bitmap_buffer_size(table->read_set));
wide_handler_alloc = TRUE;
- if (!share && !spider_get_share(name, table, thd, this, &error_num))
- goto error_get_share;
+ if (!share && !spider_get_share(name, table, thd, this, &error_num))
+ goto error_get_share;
- wide_share = share->wide_share;
+ wide_share = share->wide_share;
DBUG_PRINT("info",("spider create partition_handler"));
DBUG_PRINT("info",("spider table=%p", table));
@@ -598,22 +597,7 @@ int ha_spider::check_access_kind_for_connection(
int error_num, roop_count;
DBUG_ENTER("ha_spider::check_access_kind_for_connection");
DBUG_PRINT("info",("spider this=%p", this));
- conn_kinds = 0;
- switch (wide_handler->sql_command)
- {
- case SQLCOM_UPDATE:
- case SQLCOM_UPDATE_MULTI:
- case SQLCOM_DELETE:
- case SQLCOM_DELETE_MULTI:
- default:
- conn_kinds |= SPIDER_CONN_KIND_MYSQL;
- for (roop_count = 0; roop_count < (int) share->link_count; roop_count++)
- {
- conn_kind[roop_count] = SPIDER_CONN_KIND_MYSQL;
- }
- break;
- }
- if ((error_num = spider_check_trx_and_get_conn(thd, this, TRUE)))
+ if ((error_num= spider_check_trx_and_get_conn(thd, this)))
{
DBUG_RETURN(error_num);
}
@@ -1048,8 +1032,6 @@ int ha_spider::reset()
for (roop_count = share->link_count - 1; roop_count >= 0; roop_count--)
{
result_list.update_sqls[roop_count].length(0);
-
- conn_kind[roop_count] = SPIDER_CONN_KIND_MYSQL;
}
result_list.bulk_update_mode = 0;
result_list.bulk_update_size = 0;
@@ -1075,7 +1057,6 @@ int ha_spider::reset()
result_list.use_union = FALSE;
result_list.use_both_key = FALSE;
pt_clone_last_searcher = NULL;
- conn_kinds = SPIDER_CONN_KIND_MYSQL;
use_index_merge = FALSE;
init_rnd_handler = FALSE;
if (multi_range_keys)
@@ -3118,6 +3099,7 @@ ha_rows ha_spider::multi_range_read_info_const(
uint n_ranges,
uint *bufsz,
uint *flags,
+ ha_rows limit,
Cost_estimate *cost
)
{
@@ -3157,6 +3139,7 @@ ha_rows ha_spider::multi_range_read_info_const(
n_ranges,
bufsz,
flags,
+ limit,
cost
);
*flags &= ~HA_MRR_USE_DEFAULT_IMPL;
@@ -6443,13 +6426,6 @@ int ha_spider::info(
auto_inc_temporary = FALSE;
#endif
wide_handler->sql_command = thd_sql_command(thd);
-/*
- if (
- sql_command == SQLCOM_DROP_TABLE ||
- sql_command == SQLCOM_ALTER_TABLE ||
- sql_command == SQLCOM_SHOW_CREATE
- ) {
-*/
if (flag & HA_STATUS_AUTO)
{
if (share->lgtm_tblhnd_share->auto_increment_value)
@@ -6467,9 +6443,6 @@ int ha_spider::info(
wide_handler->sql_command == SQLCOM_ALTER_TABLE
)
DBUG_RETURN(0);
-/*
- }
-*/
if (flag &
(HA_STATUS_TIME | HA_STATUS_CONST | HA_STATUS_VARIABLE | HA_STATUS_AUTO))
@@ -6547,8 +6520,7 @@ int ha_spider::info(
pthread_mutex_lock(&share->sts_mutex);
if (difftime(tmp_time, share->sts_get_time) >= sts_interval)
{
- if ((error_num = spider_check_trx_and_get_conn(ha_thd(), this,
- FALSE)))
+ if ((error_num= spider_check_trx_and_get_conn(ha_thd(), this)))
{
pthread_mutex_unlock(&share->sts_mutex);
if (!share->sts_init)
@@ -7137,7 +7109,7 @@ int ha_spider::check_crd()
}
if (crd_mode == 3)
crd_mode = 1;
- if ((error_num = spider_check_trx_and_get_conn(ha_thd(), this, FALSE)))
+ if ((error_num= spider_check_trx_and_get_conn(ha_thd(), this)))
{
DBUG_RETURN(check_error_mode(error_num));
}
@@ -8325,7 +8297,7 @@ int ha_spider::truncate()
DBUG_RETURN(ER_SPIDER_READ_ONLY_NUM);
}
wide_handler->sql_command = SQLCOM_TRUNCATE;
- if ((error_num = spider_check_trx_and_get_conn(thd, this, FALSE)))
+ if ((error_num= spider_check_trx_and_get_conn(thd, this)))
{
DBUG_RETURN(error_num);
}
@@ -8349,38 +8321,47 @@ int ha_spider::truncate()
DBUG_RETURN(0);
}
-
-double ha_spider::scan_time()
+IO_AND_CPU_COST ha_spider::scan_time()
{
+ IO_AND_CPU_COST cost;
DBUG_ENTER("ha_spider::scan_time");
DBUG_PRINT("info",("spider this=%p", this));
- DBUG_PRINT("info",("spider scan_time = %.6f",
- share->scan_rate * share->stat.records * share->stat.mean_rec_length + 2));
- DBUG_RETURN(share->scan_rate * share->stat.records *
- share->stat.mean_rec_length + 2);
+ cost.io=0;
+ cost.cpu= (DISK_READ_COST * share->stat.records * share->stat.mean_rec_length);
+ DBUG_PRINT("info",("spider scan_time = %.6f", cost.cpu));
+ DBUG_RETURN(cost);
}
-double ha_spider::read_time(
- uint index,
- uint ranges,
- ha_rows rows
-) {
- DBUG_ENTER("ha_spider::read_time");
+IO_AND_CPU_COST ha_spider::rnd_pos_time(ha_rows rows)
+{
+ IO_AND_CPU_COST cost= { 0.0, 0.0}; // Row is in memory
+ return cost;
+}
+
+IO_AND_CPU_COST ha_spider::keyread_time(uint index, ulong ranges, ha_rows rows,
+ ulonglong blocks)
+{
+ IO_AND_CPU_COST cost;
+ DBUG_ENTER("ha_spider::keyread_time");
DBUG_PRINT("info",("spider this=%p", this));
+
+ /*
+ Here we only calculate transfer costs. The normal handler cost functions
+ will add costs for accessing a row/key.
+ */
if (wide_handler->keyread)
{
- DBUG_PRINT("info",("spider read_time(keyread) = %.6f",
- share->read_rate * table->key_info[index].key_length *
- rows / 2 + 2));
- DBUG_RETURN(share->read_rate * table->key_info[index].key_length *
- rows / 2 + 2);
+ cost.io= 0;
+ cost.cpu= DISK_READ_COST * rows * table->key_info[index].key_length;
} else {
- DBUG_PRINT("info",("spider read_time = %.6f",
- share->read_rate * share->stat.mean_rec_length * rows + 2));
- DBUG_RETURN(share->read_rate * share->stat.mean_rec_length * rows + 2);
+ cost.io= 0;
+ cost.cpu= DISK_READ_COST * rows * share->stat.mean_rec_length;
}
+ DBUG_PRINT("info",("spider scan_time(keyread) = %.6f", cost.cpu));
+ DBUG_RETURN(cost);
}
+
const key_map *ha_spider::keys_to_use_for_scanning()
{
DBUG_ENTER("ha_spider::keys_to_use_for_scanning");
@@ -8451,7 +8432,6 @@ int ha_spider::create(
SPIDER_TRX *trx;
TABLE *table_tables = NULL;
SPIDER_Open_tables_backup open_tables_backup;
- bool need_lock = FALSE;
DBUG_ENTER("ha_spider::create");
DBUG_PRINT("info",("spider this=%p", this));
DBUG_PRINT("info",("spider name=%s", name));
@@ -8529,7 +8509,7 @@ int ha_spider::create(
if (
!(table_tables = spider_open_sys_table(
current_thd, SPIDER_SYS_TABLES_TABLE_NAME_STR,
- SPIDER_SYS_TABLES_TABLE_NAME_LEN, TRUE, &open_tables_backup, FALSE,
+ SPIDER_SYS_TABLES_TABLE_NAME_LEN, TRUE, &open_tables_backup,
&error_num))
) {
goto error;
@@ -8549,8 +8529,7 @@ int ha_spider::create(
) {
goto error;
}
- spider_close_sys_table(current_thd, table_tables,
- &open_tables_backup, FALSE);
+ spider_sys_close_table(current_thd, &open_tables_backup);
table_tables = NULL;
} else if (
sql_command == SQLCOM_ALTER_TABLE
@@ -8583,11 +8562,10 @@ int ha_spider::create(
) &&
memcmp(name + strlen(name) - 5, "#TMP#", 5)
) {
- need_lock = TRUE;
if (
!(table_tables = spider_open_sys_table(
current_thd, SPIDER_SYS_TABLES_TABLE_NAME_STR,
- SPIDER_SYS_TABLES_TABLE_NAME_LEN, TRUE, &open_tables_backup, TRUE,
+ SPIDER_SYS_TABLES_TABLE_NAME_LEN, TRUE, &open_tables_backup,
&error_num))
) {
goto error;
@@ -8597,8 +8575,7 @@ int ha_spider::create(
) {
goto error;
}
- spider_close_sys_table(current_thd, table_tables,
- &open_tables_backup, TRUE);
+ spider_sys_close_table(current_thd, &open_tables_backup);
table_tables = NULL;
}
}
@@ -8627,8 +8604,7 @@ int ha_spider::create(
error:
if (table_tables)
- spider_close_sys_table(current_thd, table_tables,
- &open_tables_backup, need_lock);
+ spider_sys_close_table(current_thd, &open_tables_backup);
if (tmp_share.lgtm_tblhnd_share)
spider_free_lgtm_tblhnd_share_alloc(tmp_share.lgtm_tblhnd_share, FALSE);
if (tmp_share.static_key_cardinality)
@@ -8700,7 +8676,6 @@ int ha_spider::rename_table(
SPIDER_ALTER_TABLE *alter_table_from, *alter_table_to;
SPIDER_LGTM_TBLHND_SHARE *from_lgtm_tblhnd_share, *to_lgtm_tblhnd_share;
SPIDER_Open_tables_backup open_tables_backup;
- bool need_lock = FALSE;
DBUG_ENTER("ha_spider::rename_table");
DBUG_PRINT("info",("spider this=%p", this));
DBUG_PRINT("info",("spider from=%s", from));
@@ -8732,7 +8707,7 @@ int ha_spider::rename_table(
if (
!(table_tables = spider_open_sys_table(
current_thd, SPIDER_SYS_TABLES_TABLE_NAME_STR,
- SPIDER_SYS_TABLES_TABLE_NAME_LEN, TRUE, &open_tables_backup, FALSE,
+ SPIDER_SYS_TABLES_TABLE_NAME_LEN, TRUE, &open_tables_backup,
&error_num))
) {
goto error;
@@ -8743,8 +8718,7 @@ int ha_spider::rename_table(
) {
goto error;
}
- spider_close_sys_table(current_thd, table_tables,
- &open_tables_backup, FALSE);
+ spider_sys_close_table(current_thd, &open_tables_backup);
table_tables = NULL;
/* release table mon list */
@@ -8787,20 +8761,9 @@ int ha_spider::rename_table(
("spider alter_info.flags: %llu alter_info.partition_flags: %lu",
thd->lex->alter_info.flags, thd->lex->alter_info.partition_flags));
if (
- (thd->lex->alter_info.partition_flags &
- (
- SPIDER_ALTER_PARTITION_ADD | SPIDER_ALTER_PARTITION_DROP |
- SPIDER_ALTER_PARTITION_COALESCE | SPIDER_ALTER_PARTITION_REORGANIZE |
- SPIDER_ALTER_PARTITION_TABLE_REORG | SPIDER_ALTER_PARTITION_REBUILD
- )
- )
- )
- need_lock = TRUE;
-
- if (
!(table_tables = spider_open_sys_table(
current_thd, SPIDER_SYS_TABLES_TABLE_NAME_STR,
- SPIDER_SYS_TABLES_TABLE_NAME_LEN, TRUE, &open_tables_backup, need_lock,
+ SPIDER_SYS_TABLES_TABLE_NAME_LEN, TRUE, &open_tables_backup,
&error_num))
) {
goto error;
@@ -8829,8 +8792,7 @@ int ha_spider::rename_table(
goto error;
}
}
- spider_close_sys_table(current_thd, table_tables,
- &open_tables_backup, need_lock);
+ spider_sys_close_table(current_thd, &open_tables_backup);
table_tables = NULL;
if (!alter_table_from->now_create)
@@ -8888,8 +8850,7 @@ int ha_spider::rename_table(
error:
if (table_tables)
- spider_close_sys_table(current_thd, table_tables,
- &open_tables_backup, need_lock);
+ spider_sys_close_table(current_thd, &open_tables_backup);
pthread_mutex_lock(&spider_lgtm_tblhnd_share_mutex);
to_lgtm_tblhnd_share = spider_get_lgtm_tblhnd_share(
to, to_len, to_hash_value, TRUE, FALSE, &tmp_error_num);
@@ -8909,7 +8870,6 @@ int ha_spider::delete_table(
uint sql_command = thd_sql_command(thd);
SPIDER_ALTER_TABLE *alter_table;
SPIDER_Open_tables_backup open_tables_backup;
- bool need_lock = FALSE;
DBUG_ENTER("ha_spider::delete_table");
DBUG_PRINT("info",("spider this=%p", this));
DBUG_PRINT("info",("spider name=%s", name));
@@ -8956,21 +8916,9 @@ int ha_spider::delete_table(
("spider alter_info.flags: %llu alter_info.partition_flags: %lu",
thd->lex->alter_info.flags, thd->lex->alter_info.partition_flags));
if (
- sql_command == SQLCOM_ALTER_TABLE &&
- (thd->lex->alter_info.partition_flags &
- (
- SPIDER_ALTER_PARTITION_ADD | SPIDER_ALTER_PARTITION_DROP |
- SPIDER_ALTER_PARTITION_COALESCE | SPIDER_ALTER_PARTITION_REORGANIZE |
- SPIDER_ALTER_PARTITION_TABLE_REORG | SPIDER_ALTER_PARTITION_REBUILD
- )
- )
- )
- need_lock = TRUE;
-
- if (
!(table_tables = spider_open_sys_table(
current_thd, SPIDER_SYS_TABLES_TABLE_NAME_STR,
- SPIDER_SYS_TABLES_TABLE_NAME_LEN, TRUE, &open_tables_backup, need_lock,
+ SPIDER_SYS_TABLES_TABLE_NAME_LEN, TRUE, &open_tables_backup,
&error_num))
) {
goto error;
@@ -8985,8 +8933,7 @@ int ha_spider::delete_table(
error_num= HA_ERR_NO_SUCH_TABLE;
goto error;
}
- spider_close_sys_table(current_thd, table_tables,
- &open_tables_backup, need_lock);
+ spider_sys_close_table(current_thd, &open_tables_backup);
table_tables = NULL;
/* release table mon list */
@@ -9010,8 +8957,7 @@ int ha_spider::delete_table(
error:
if (table_tables)
- spider_close_sys_table(current_thd, table_tables,
- &open_tables_backup, need_lock);
+ spider_sys_close_table(current_thd, &open_tables_backup);
DBUG_RETURN(error_num);
}
@@ -11730,7 +11676,6 @@ int ha_spider::mk_bulk_tmp_table_and_bulk_start()
dbton_hdl->first_link_idx >= 0 &&
dbton_hdl->need_copy_for_update(roop_count)
) {
-#ifdef SPIDER_use_LEX_CSTRING_for_Field_blob_constructor
LEX_CSTRING field_name = {STRING_WITH_LEN("a")};
if (
!tmp_table[roop_count] &&
@@ -11739,15 +11684,6 @@ int ha_spider::mk_bulk_tmp_table_and_bulk_start()
&result_list.upd_tmp_tbl_prms[roop_count],
&field_name, result_list.update_sqls[roop_count].charset()))
)
-#else
- if (
- !tmp_table[roop_count] &&
- !(tmp_table[roop_count] = spider_mk_sys_tmp_table(
- wide_handler->trx->thd, table,
- &result_list.upd_tmp_tbl_prms[roop_count], "a",
- result_list.update_sqls[roop_count].charset()))
- )
-#endif
{
error_num = HA_ERR_OUT_OF_MEM;
goto error_2;
@@ -11903,8 +11839,7 @@ int ha_spider::append_lock_tables_list()
DBUG_PRINT("info",("spider lock_table_type=%u",
wide_handler->lock_table_type));
- if ((error_num = spider_check_trx_and_get_conn(wide_handler->trx->thd, this,
- FALSE)))
+ if ((error_num= spider_check_trx_and_get_conn(wide_handler->trx->thd, this)))
{
DBUG_RETURN(error_num);
}
diff --git a/storage/spider/ha_spider.h b/storage/spider/ha_spider.h
index 4c178a33..2e638269 100644
--- a/storage/spider/ha_spider.h
+++ b/storage/spider/ha_spider.h
@@ -60,13 +60,13 @@ public:
const char *mem_calc_file_name;
ulong mem_calc_line_no;
ulonglong *connection_ids;
- uint conn_kinds;
- uint *conn_kind;
char *conn_keys_first_ptr;
char **conn_keys;
SPIDER_CONN **conns;
- /* for active-standby mode */
+ /* array of indexes of active servers */
uint *conn_link_idx;
+ /* A bitmap indicating whether each active server have some higher
+ numbered server in the same "group" left to try (can fail over) */
uchar *conn_can_fo;
void **quick_targets;
int *need_mons;
@@ -252,6 +252,7 @@ public:
uint n_ranges,
uint *bufsz,
uint *flags,
+ ha_rows limit,
Cost_estimate *cost
);
ha_rows multi_range_read_info(
@@ -445,12 +446,10 @@ public:
);
int delete_all_rows();
int truncate();
- double scan_time();
- double read_time(
- uint index,
- uint ranges,
- ha_rows rows
- );
+ IO_AND_CPU_COST scan_time();
+ IO_AND_CPU_COST rnd_pos_time(ha_rows rows);
+ IO_AND_CPU_COST keyread_time(uint index, ulong ranges, ha_rows rows,
+ ulonglong blocks);
const key_map *keys_to_use_for_scanning();
ha_rows estimate_rows_upper_bound();
void print_error(
diff --git a/storage/spider/mysql-test/spider/bg/my.cnf b/storage/spider/mysql-test/spider/bg/my.cnf
index 246099c6..ef9a042c 100644
--- a/storage/spider/mysql-test/spider/bg/my.cnf
+++ b/storage/spider/mysql-test/spider/bg/my.cnf
@@ -1,5 +1,6 @@
# Use default setting for mysqld processes
!include include/default_mysqld.cnf
+!include include/default_client.cnf
[mysqld.1.1]
loose_handlersocket_port= 20000
diff --git a/storage/spider/mysql-test/spider/bg/r/basic_sql.result b/storage/spider/mysql-test/spider/bg/r/basic_sql.result
index 94a09fc3..74041ae4 100644
--- a/storage/spider/mysql-test/spider/bg/r/basic_sql.result
+++ b/storage/spider/mysql-test/spider/bg/r/basic_sql.result
@@ -48,6 +48,9 @@ CREATE TABLE ta_l (
PRIMARY KEY(a)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
SELECT a, b, c FROM tb_l
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
@@ -78,6 +81,8 @@ PRIMARY KEY(a)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
IGNORE SELECT a, b, c FROM tb_l
Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
Warning 1062 Duplicate entry '1' for key 'PRIMARY'
Warning 1062 Duplicate entry '2' for key 'PRIMARY'
Warning 1062 Duplicate entry '3' for key 'PRIMARY'
@@ -99,6 +104,9 @@ CREATE TABLE ta_l (
PRIMARY KEY(a)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
REPLACE SELECT a, b, c FROM tb_l
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
@@ -114,6 +122,9 @@ DROP TABLE IF EXISTS ta_l_no_idx;
CREATE TABLE ta_l_no_idx
MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT2_2_1
SELECT a, b, c FROM tb_l
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l_no_idx ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
diff --git a/storage/spider/mysql-test/spider/bg/r/basic_sql_part.result b/storage/spider/mysql-test/spider/bg/r/basic_sql_part.result
index 0f402940..4507d31b 100644
--- a/storage/spider/mysql-test/spider/bg/r/basic_sql_part.result
+++ b/storage/spider/mysql-test/spider/bg/r/basic_sql_part.result
@@ -48,6 +48,11 @@ CREATE TABLE ta_l2 (
PRIMARY KEY(a)
) MASTER_1_ENGINE MASTER_1_COMMENT_P_2_1
SELECT a, b, c FROM tb_l
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
diff --git a/storage/spider/mysql-test/spider/bg/r/direct_aggregate.result b/storage/spider/mysql-test/spider/bg/r/direct_aggregate.result
index 9a8660ba..a3e481bc 100644
--- a/storage/spider/mysql-test/spider/bg/r/direct_aggregate.result
+++ b/storage/spider/mysql-test/spider/bg/r/direct_aggregate.result
@@ -37,6 +37,9 @@ b CHAR(1),
c DATETIME,
PRIMARY KEY(a)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
INSERT INTO ta_l (a, b, c) VALUES
(1, 'a', '2008-08-01 10:21:39'),
(2, 'b', '2000-01-01 00:00:00'),
diff --git a/storage/spider/mysql-test/spider/bg/r/direct_aggregate_part.result b/storage/spider/mysql-test/spider/bg/r/direct_aggregate_part.result
index 9d65fcc2..35221a63 100644
--- a/storage/spider/mysql-test/spider/bg/r/direct_aggregate_part.result
+++ b/storage/spider/mysql-test/spider/bg/r/direct_aggregate_part.result
@@ -36,6 +36,11 @@ b CHAR(1),
c DATETIME,
PRIMARY KEY(a)
) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
set @old_spider_direct_aggregate=@@session.spider_direct_aggregate;
set spider_direct_aggregate=1;
SHOW STATUS LIKE 'Spider_direct_aggregate';
diff --git a/storage/spider/mysql-test/spider/bg/r/direct_update.result b/storage/spider/mysql-test/spider/bg/r/direct_update.result
index 0e536d48..587984a5 100644
--- a/storage/spider/mysql-test/spider/bg/r/direct_update.result
+++ b/storage/spider/mysql-test/spider/bg/r/direct_update.result
@@ -37,6 +37,9 @@ b CHAR(1),
c DATETIME,
PRIMARY KEY(a)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
INSERT INTO ta_l (a, b, c) VALUES
(1, 'a', '2008-08-01 10:21:39'),
(2, 'b', '2000-01-01 00:00:00'),
diff --git a/storage/spider/mysql-test/spider/bg/r/direct_update_part.result b/storage/spider/mysql-test/spider/bg/r/direct_update_part.result
index 7069cd72..a92fce72 100644
--- a/storage/spider/mysql-test/spider/bg/r/direct_update_part.result
+++ b/storage/spider/mysql-test/spider/bg/r/direct_update_part.result
@@ -36,6 +36,11 @@ b CHAR(1),
c DATETIME,
PRIMARY KEY(a)
) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
SHOW STATUS LIKE 'Spider_direct_update';
Variable_name Value
Spider_direct_update 0
diff --git a/storage/spider/mysql-test/spider/bg/r/function.result b/storage/spider/mysql-test/spider/bg/r/function.result
index c088a8a9..cd439f5f 100644
--- a/storage/spider/mysql-test/spider/bg/r/function.result
+++ b/storage/spider/mysql-test/spider/bg/r/function.result
@@ -34,6 +34,8 @@ CREATE TABLE t1 (
a VARCHAR(255),
PRIMARY KEY(a)
) MASTER_1_ENGINE MASTER_1_CHARSET3 MASTER_1_COMMENT_TEXT_PK1_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
insert into t1 values ('1');
insert into t1 select a + 1 from t1;
insert into t1 select a + 2 from t1;
@@ -61,6 +63,9 @@ b CHAR(1),
c DATETIME,
PRIMARY KEY(a)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
INSERT INTO ta_l (a, b, c) VALUES
(1, 'a', '2008-08-01 10:21:39'),
(2, 'b', '2000-01-01 00:00:00'),
diff --git a/storage/spider/mysql-test/spider/bg/r/ha.result b/storage/spider/mysql-test/spider/bg/r/ha.result
index 3c37c2d5..2ccff04b 100644
--- a/storage/spider/mysql-test/spider/bg/r/ha.result
+++ b/storage/spider/mysql-test/spider/bg/r/ha.result
@@ -63,8 +63,12 @@ c DATETIME,
PRIMARY KEY(a)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_HA_2_1
Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
Warning 138 The high availability feature of Spider has been deprecated and will be removed in a future release
Warning 138 The high availability feature of Spider has been deprecated and will be removed in a future release
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 1287 'msi' is deprecated and will be removed in a future release
+Warning 1287 'mkd' is deprecated and will be removed in a future release
Warning 138 The high availability feature of Spider has been deprecated and will be removed in a future release
INSERT INTO ta_l (a, b, c) VALUES
(1, 'a', '2008-08-01 10:21:39'),
@@ -122,9 +126,14 @@ CONNECTION='host "localhost", user "root", password "",
msi "5", mkd "2",
database "auto_test_remote auto_test_remote2", lst "0 2"';
Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
Warning 138 The high availability feature of Spider has been deprecated and will be removed in a future release
Warning 138 The high availability feature of Spider has been deprecated and will be removed in a future release
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 1287 'msi' is deprecated and will be removed in a future release
+Warning 1287 'mkd' is deprecated and will be removed in a future release
Warning 138 The high availability feature of Spider has been deprecated and will be removed in a future release
+Warning 1287 'lst' is deprecated and will be removed in a future release
SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables
ORDER BY db_name, table_name, link_id;
db_name table_name link_id link_status
@@ -139,9 +148,14 @@ CONNECTION='host "localhost", user "root", password "",
msi "5", mkd "2",
database "auto_test_remote auto_test_remote2", lst "0 1"';
Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
Warning 138 The high availability feature of Spider has been deprecated and will be removed in a future release
Warning 138 The high availability feature of Spider has been deprecated and will be removed in a future release
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 1287 'msi' is deprecated and will be removed in a future release
+Warning 1287 'mkd' is deprecated and will be removed in a future release
Warning 138 The high availability feature of Spider has been deprecated and will be removed in a future release
+Warning 1287 'lst' is deprecated and will be removed in a future release
SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables
ORDER BY db_name, table_name, link_id;
db_name table_name link_id link_status
@@ -175,8 +189,13 @@ c DATETIME,
PRIMARY KEY(a)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_HA_AS_2_1
Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
Warning 138 The high availability feature of Spider has been deprecated and will be removed in a future release
Warning 138 The high availability feature of Spider has been deprecated and will be removed in a future release
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 1287 'msi' is deprecated and will be removed in a future release
+Warning 1287 'mkd' is deprecated and will be removed in a future release
+Warning 1287 'alc' is deprecated and will be removed in a future release
Warning 138 The high availability feature of Spider has been deprecated and will be removed in a future release
INSERT INTO ta_l (a, b, c) VALUES
(1, 'a', '2008-08-01 10:21:39'),
@@ -230,9 +249,15 @@ CONNECTION='host "localhost", user "root", password "",
msi "5", mkd "2", alc "1",
database "auto_test_remote auto_test_remote2", lst "1 0"';
Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
Warning 138 The high availability feature of Spider has been deprecated and will be removed in a future release
Warning 138 The high availability feature of Spider has been deprecated and will be removed in a future release
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 1287 'msi' is deprecated and will be removed in a future release
+Warning 1287 'mkd' is deprecated and will be removed in a future release
+Warning 1287 'alc' is deprecated and will be removed in a future release
Warning 138 The high availability feature of Spider has been deprecated and will be removed in a future release
+Warning 1287 'lst' is deprecated and will be removed in a future release
SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables
ORDER BY db_name, table_name, link_id;
db_name table_name link_id link_status
diff --git a/storage/spider/mysql-test/spider/bg/r/ha_part.result b/storage/spider/mysql-test/spider/bg/r/ha_part.result
index 39fa2655..037cd29f 100644
--- a/storage/spider/mysql-test/spider/bg/r/ha_part.result
+++ b/storage/spider/mysql-test/spider/bg/r/ha_part.result
@@ -63,10 +63,18 @@ c DATETIME,
PRIMARY KEY(a)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_HA_P_2_1
Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
Warning 138 The high availability feature of Spider has been deprecated and will be removed in a future release
Warning 138 The high availability feature of Spider has been deprecated and will be removed in a future release
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 1287 'msi' is deprecated and will be removed in a future release
+Warning 1287 'mkd' is deprecated and will be removed in a future release
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
Warning 138 The high availability feature of Spider has been deprecated and will be removed in a future release
Warning 138 The high availability feature of Spider has been deprecated and will be removed in a future release
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 1287 'msi' is deprecated and will be removed in a future release
+Warning 1287 'mkd' is deprecated and will be removed in a future release
INSERT INTO ta_l2 (a, b, c) VALUES
(1, 'a', '2008-08-01 10:21:39'),
(2, 'b', '2000-01-01 00:00:00'),
@@ -128,10 +136,19 @@ PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
priority "1000001", lst "0 2"'
);
Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
Warning 138 The high availability feature of Spider has been deprecated and will be removed in a future release
Warning 138 The high availability feature of Spider has been deprecated and will be removed in a future release
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 1287 'msi' is deprecated and will be removed in a future release
+Warning 1287 'mkd' is deprecated and will be removed in a future release
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
Warning 138 The high availability feature of Spider has been deprecated and will be removed in a future release
Warning 138 The high availability feature of Spider has been deprecated and will be removed in a future release
+Warning 1287 'lst' is deprecated and will be removed in a future release
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 1287 'msi' is deprecated and will be removed in a future release
+Warning 1287 'mkd' is deprecated and will be removed in a future release
SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables
ORDER BY db_name, table_name, link_id;
db_name table_name link_id link_status
@@ -151,10 +168,19 @@ PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
priority "1000001", lst "0 1"'
);
Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
Warning 138 The high availability feature of Spider has been deprecated and will be removed in a future release
Warning 138 The high availability feature of Spider has been deprecated and will be removed in a future release
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 1287 'msi' is deprecated and will be removed in a future release
+Warning 1287 'mkd' is deprecated and will be removed in a future release
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
Warning 138 The high availability feature of Spider has been deprecated and will be removed in a future release
Warning 138 The high availability feature of Spider has been deprecated and will be removed in a future release
+Warning 1287 'lst' is deprecated and will be removed in a future release
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 1287 'msi' is deprecated and will be removed in a future release
+Warning 1287 'mkd' is deprecated and will be removed in a future release
SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables
ORDER BY db_name, table_name, link_id;
db_name table_name link_id link_status
@@ -187,10 +213,20 @@ c DATETIME,
PRIMARY KEY(a)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_HA_AS_P_2_1
Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
Warning 138 The high availability feature of Spider has been deprecated and will be removed in a future release
Warning 138 The high availability feature of Spider has been deprecated and will be removed in a future release
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 1287 'msi' is deprecated and will be removed in a future release
+Warning 1287 'mkd' is deprecated and will be removed in a future release
+Warning 1287 'alc' is deprecated and will be removed in a future release
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
Warning 138 The high availability feature of Spider has been deprecated and will be removed in a future release
Warning 138 The high availability feature of Spider has been deprecated and will be removed in a future release
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 1287 'msi' is deprecated and will be removed in a future release
+Warning 1287 'mkd' is deprecated and will be removed in a future release
+Warning 1287 'alc' is deprecated and will be removed in a future release
INSERT INTO ta_l2 (a, b, c) VALUES
(1, 'a', '2008-08-01 10:21:39'),
(2, 'b', '2000-01-01 00:00:00'),
@@ -251,10 +287,21 @@ PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
priority "1000001", lst "1 0"'
);
Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
Warning 138 The high availability feature of Spider has been deprecated and will be removed in a future release
Warning 138 The high availability feature of Spider has been deprecated and will be removed in a future release
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 1287 'msi' is deprecated and will be removed in a future release
+Warning 1287 'mkd' is deprecated and will be removed in a future release
+Warning 1287 'alc' is deprecated and will be removed in a future release
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
Warning 138 The high availability feature of Spider has been deprecated and will be removed in a future release
Warning 138 The high availability feature of Spider has been deprecated and will be removed in a future release
+Warning 1287 'lst' is deprecated and will be removed in a future release
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 1287 'msi' is deprecated and will be removed in a future release
+Warning 1287 'mkd' is deprecated and will be removed in a future release
+Warning 1287 'alc' is deprecated and will be removed in a future release
SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables
ORDER BY db_name, table_name, link_id;
db_name table_name link_id link_status
diff --git a/storage/spider/mysql-test/spider/bg/r/spider3_fixes.result b/storage/spider/mysql-test/spider/bg/r/spider3_fixes.result
index e3510042..17386c71 100644
--- a/storage/spider/mysql-test/spider/bg/r/spider3_fixes.result
+++ b/storage/spider/mysql-test/spider/bg/r/spider3_fixes.result
@@ -50,6 +50,10 @@ PRIMARY KEY (id)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_INCREMENT1_1
MASTER_1_AUTO_INCREMENT_INCREMENT2
MASTER_1_AUTO_INCREMENT_OFFSET2
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
spider_direct_sql('SET SESSION AUTO_INCREMENT_INCREMENT = 4', '',
'srv "s_2_1"')
1
diff --git a/storage/spider/mysql-test/spider/bg/r/spider3_fixes_part.result b/storage/spider/mysql-test/spider/bg/r/spider3_fixes_part.result
index 361fd336..0074197d 100644
--- a/storage/spider/mysql-test/spider/bg/r/spider3_fixes_part.result
+++ b/storage/spider/mysql-test/spider/bg/r/spider3_fixes_part.result
@@ -48,6 +48,16 @@ PRIMARY KEY (id)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_INCREMENT1_P_1
MASTER_1_AUTO_INCREMENT_INCREMENT2
MASTER_1_AUTO_INCREMENT_OFFSET2
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
spider_direct_sql('SET SESSION AUTO_INCREMENT_INCREMENT = 4', '',
'srv "s_2_1"')
1
diff --git a/storage/spider/mysql-test/spider/bg/r/spider_fixes.result b/storage/spider/mysql-test/spider/bg/r/spider_fixes.result
index a751d803..a1e503a0 100644
--- a/storage/spider/mysql-test/spider/bg/r/spider_fixes.result
+++ b/storage/spider/mysql-test/spider/bg/r/spider_fixes.result
@@ -53,6 +53,9 @@ DROP TABLE IF EXISTS ta_l;
CREATE TABLE ta_l (
PRIMARY KEY(a)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
INSERT INTO ta_l SELECT a, b, c FROM tb_l;
2.13
@@ -98,6 +101,9 @@ b char(1) DEFAULT NULL,
c datetime DEFAULT NULL,
PRIMARY KEY (a, b, c)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT5_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
INSERT INTO ta_l SELECT a, b, c FROM tb_l;
connection master_1;
SELECT a, b, c FROM ta_l FORCE INDEX(PRIMARY) WHERE a = 4 AND b >= 'b'
@@ -169,6 +175,9 @@ b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10',
PRIMARY KEY(a)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT3_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
CREATE TABLE tc_l (
a INT,
b CHAR(1),
@@ -206,6 +215,9 @@ PRIMARY KEY(a),
KEY idx1(b),
KEY idx2(c)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT4_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
INSERT INTO ta_l_int (a, b, c) VALUES (1, 2, 3);
INSERT INTO ta_l_int (a, b, c) SELECT a + 1, b + 1, c + 1 FROM ta_l_int;
INSERT INTO ta_l_int (a, b, c) SELECT a + 2, b + 2, c + 2 FROM ta_l_int;
@@ -230,6 +242,9 @@ c INT DEFAULT 11,
KEY idx1(b),
KEY idx2(c)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT4_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
SELECT a, b, c FROM ta_l_int ORDER BY a;
a b c
1 2 3
@@ -299,6 +314,7 @@ id int(11) NOT NULL,
PRIMARY KEY (id)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_LOCK1
Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
Warning 138 The high availability feature of Spider has been deprecated and will be removed in a future release
Warning 138 The high availability feature of Spider has been deprecated and will be removed in a future release
CREATE TABLE t2 (
@@ -306,6 +322,7 @@ id int(11) NOT NULL,
PRIMARY KEY (id)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_LOCK2
Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
Warning 138 The high availability feature of Spider has been deprecated and will be removed in a future release
Warning 138 The high availability feature of Spider has been deprecated and will be removed in a future release
LOCK TABLES t1 READ, t2 READ;
@@ -322,6 +339,8 @@ PRIMARY KEY (id)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_INCREMENT1_1
MASTER_1_AUTO_INCREMENT_INCREMENT2
MASTER_1_AUTO_INCREMENT_OFFSET2
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
spider_direct_sql('SET SESSION AUTO_INCREMENT_INCREMENT = 4', '',
'srv "s_2_1"')
1
@@ -425,6 +444,8 @@ CREATE TABLE t1 (
id int(11) NOT NULL,
PRIMARY KEY (id)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_READONLY1_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
SELECT id FROM t1 ORDER BY id;
id
777
@@ -457,6 +478,10 @@ CREATE TABLE t1 (
id int(11) NOT NULL,
PRIMARY KEY (id)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_ERROR_MODE1_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 1287 'erm' is deprecated and will be removed in a future release
+Warning 1287 'ewm' is deprecated and will be removed in a future release
SELECT id FROM t1 ORDER BY id;
id
Warnings:
@@ -469,7 +494,6 @@ DELETE FROM t1;
Warnings:
Error 12702 Remote table 'auto_test_remote.ter1_1' is not found
Error 12702 Remote table 'auto_test_remote.ter1_1' is not found
-Error 1146 Table 'auto_test_remote.ter1_1' doesn't exist
TRUNCATE t1;
Warnings:
Error 1146 Table 'auto_test_remote.ter1_1' doesn't exist
@@ -486,6 +510,8 @@ KEY idx1(a,b),
KEY idx2(b),
PRIMARY KEY(c)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_TEXT_KEY1_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
insert into t1 values (null, null, '2048');
insert into t1 values ('1', '1', '1');
insert into t1 select a + 1, b + 1, c + 1 from t1;
diff --git a/storage/spider/mysql-test/spider/bg/r/spider_fixes_part.result b/storage/spider/mysql-test/spider/bg/r/spider_fixes_part.result
index 3ce8dfbf..2a2700ef 100644
--- a/storage/spider/mysql-test/spider/bg/r/spider_fixes_part.result
+++ b/storage/spider/mysql-test/spider/bg/r/spider_fixes_part.result
@@ -57,6 +57,11 @@ b CHAR(1),
c DATETIME,
PRIMARY KEY(a)
) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
INSERT INTO ta_l2 SELECT a, b, c FROM tb_l;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 WHERE a > 1
ORDER BY a;
@@ -77,6 +82,11 @@ b CHAR(1),
c DATETIME,
PRIMARY KEY(a)
) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
INSERT INTO ta_l2 (a, b, c) VALUES (3, 'B', '2010-09-26 00:00:00');
UPDATE ta_l2 SET a = 4 WHERE a = 3;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2;
@@ -94,6 +104,11 @@ PRIMARY KEY(a),
KEY idx1(b),
KEY idx2(c)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT3_P_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
INSERT INTO ta_l_int (a, b, c) VALUES (1, 2, 3);
INSERT INTO ta_l_int (a, b, c) SELECT a + 1, b + 1, c + 1 FROM ta_l_int;
INSERT INTO ta_l_int (a, b, c) SELECT a + 2, b + 2, c + 2 FROM ta_l_int;
@@ -119,6 +134,11 @@ PRIMARY KEY (id)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_INCREMENT1_P_1
MASTER_1_AUTO_INCREMENT_INCREMENT2
MASTER_1_AUTO_INCREMENT_OFFSET2
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
spider_direct_sql('SET SESSION AUTO_INCREMENT_INCREMENT = 4', '',
'srv "s_2_1"')
1
diff --git a/storage/spider/mysql-test/spider/bg/r/vp_fixes.result b/storage/spider/mysql-test/spider/bg/r/vp_fixes.result
index cc0e4105..0a38e3cd 100644
--- a/storage/spider/mysql-test/spider/bg/r/vp_fixes.result
+++ b/storage/spider/mysql-test/spider/bg/r/vp_fixes.result
@@ -47,6 +47,9 @@ DROP TABLE IF EXISTS ta_l;
CREATE TABLE ta_l (
PRIMARY KEY(a)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
INSERT INTO ta_l SELECT a, b, c FROM tb_l;
0.9
@@ -58,6 +61,9 @@ b INT AUTO_INCREMENT,
c INT DEFAULT 11,
PRIMARY KEY(b)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT4_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
connection master_1;
INSERT INTO ta_l_int (a, b, c) VALUES (2, NULL, 3);
create un-correspond primary key table
@@ -70,6 +76,9 @@ b INT DEFAULT 12,
c INT DEFAULT 11,
PRIMARY KEY(c)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT4_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
connection master_1;
INSERT INTO ta_l_int (a, b, c) VALUES (2, NULL, 3);
diff --git a/storage/spider/mysql-test/spider/bg/t/direct_aggregate.test b/storage/spider/mysql-test/spider/bg/t/direct_aggregate.test
index 4b330692..9f7e87eb 100644
--- a/storage/spider/mysql-test/spider/bg/t/direct_aggregate.test
+++ b/storage/spider/mysql-test/spider/bg/t/direct_aggregate.test
@@ -98,12 +98,14 @@ eval CREATE TABLE ta_l (
PRIMARY KEY(a)
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1;
--enable_query_log
+--disable_ps_protocol
INSERT INTO ta_l (a, b, c) VALUES
(1, 'a', '2008-08-01 10:21:39'),
(2, 'b', '2000-01-01 00:00:00'),
(3, 'e', '2007-06-04 20:03:11'),
(4, 'd', '2003-11-30 05:01:03'),
(5, 'c', '2001-12-31 23:59:59');
+--enable_ps_protocol
--echo
--echo direct_aggregating test
diff --git a/storage/spider/mysql-test/spider/bg/t/direct_aggregate_part.test b/storage/spider/mysql-test/spider/bg/t/direct_aggregate_part.test
index af35adb0..b84825d0 100644
--- a/storage/spider/mysql-test/spider/bg/t/direct_aggregate_part.test
+++ b/storage/spider/mysql-test/spider/bg/t/direct_aggregate_part.test
@@ -125,12 +125,14 @@ if ($HAVE_PARTITION)
c DATETIME,
PRIMARY KEY(a)
) $MASTER_1_ENGINE $MASTER_1_COMMENT2_P_2_1;
+ --disable_ps_protocol
INSERT INTO ta_l2 (a, b, c) VALUES
(1, 'a', '2008-08-01 10:21:39'),
(2, 'b', '2000-01-01 00:00:00'),
(3, 'e', '2007-06-04 20:03:11'),
(4, 'd', '2003-11-30 05:01:03'),
(5, 'c', '2001-12-31 23:59:59');
+ --enable_ps_protocol
--enable_query_log
--disable_ps2_protocol
set @old_spider_direct_aggregate=@@session.spider_direct_aggregate;
diff --git a/storage/spider/mysql-test/spider/bg/t/direct_update.test b/storage/spider/mysql-test/spider/bg/t/direct_update.test
index 94f27e28..8b8bb1e5 100644
--- a/storage/spider/mysql-test/spider/bg/t/direct_update.test
+++ b/storage/spider/mysql-test/spider/bg/t/direct_update.test
@@ -98,12 +98,14 @@ eval CREATE TABLE ta_l (
PRIMARY KEY(a)
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1;
--enable_query_log
+--disable_ps_protocol
INSERT INTO ta_l (a, b, c) VALUES
(1, 'a', '2008-08-01 10:21:39'),
(2, 'b', '2000-01-01 00:00:00'),
(3, 'e', '2007-06-04 20:03:11'),
(4, 'd', '2003-11-30 05:01:03'),
(5, 'c', '2001-12-31 23:59:59');
+--enable_ps_protocol
--echo
--echo direct_updating test
diff --git a/storage/spider/mysql-test/spider/bg/t/direct_update_part.test b/storage/spider/mysql-test/spider/bg/t/direct_update_part.test
index e8f18825..690fa834 100644
--- a/storage/spider/mysql-test/spider/bg/t/direct_update_part.test
+++ b/storage/spider/mysql-test/spider/bg/t/direct_update_part.test
@@ -125,12 +125,14 @@ if ($HAVE_PARTITION)
c DATETIME,
PRIMARY KEY(a)
) $MASTER_1_ENGINE $MASTER_1_COMMENT2_P_2_1;
+ --disable_ps_protocol
INSERT INTO ta_l2 (a, b, c) VALUES
(1, 'a', '2008-08-01 10:21:39'),
(2, 'b', '2000-01-01 00:00:00'),
(3, 'e', '2007-06-04 20:03:11'),
(4, 'd', '2003-11-30 05:01:03'),
(5, 'c', '2001-12-31 23:59:59');
+ --enable_ps_protocol
--enable_query_log
eval $MASTER_1_CHECK_DIRECT_UPDATE_STATUS;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a;
diff --git a/storage/spider/mysql-test/spider/bg/t/function.test b/storage/spider/mysql-test/spider/bg/t/function.test
index 2472e774..2b81a130 100644
--- a/storage/spider/mysql-test/spider/bg/t/function.test
+++ b/storage/spider/mysql-test/spider/bg/t/function.test
@@ -83,7 +83,9 @@ eval CREATE TABLE t1 (
PRIMARY KEY(a)
) $MASTER_1_ENGINE $MASTER_1_CHARSET3 $MASTER_1_COMMENT_TEXT_PK1_1;
--enable_query_log
+--disable_ps_protocol
insert into t1 values ('1');
+--enable_ps_protocol
insert into t1 select a + 1 from t1;
insert into t1 select a + 2 from t1;
insert into t1 select a + 4 from t1;
@@ -114,7 +116,9 @@ if ($USE_CHILD_GROUP2)
}
}
--connection master_1
+--disable_ps_protocol
select a from t1 where a in ('15', '120');
+--enable_ps_protocol
if ($USE_CHILD_GROUP2)
{
if (!$OUTPUT_CHILD_GROUP2)
@@ -187,12 +191,14 @@ eval CREATE TABLE ta_l (
PRIMARY KEY(a)
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1;
--enable_query_log
+--disable_ps_protocol
INSERT INTO ta_l (a, b, c) VALUES
(1, 'a', '2008-08-01 10:21:39'),
(2, 'b', '2000-01-01 00:00:00'),
(3, 'e', '2007-06-04 20:03:11'),
(4, 'd', '2003-11-30 05:01:03'),
(5, 'c', '2001-12-31 23:59:59');
+--enable_ps_protocol
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
UPDATE ta_l SET c = DATE_SUB(c, INTERVAL 1 YEAR);
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
diff --git a/storage/spider/mysql-test/spider/bg/t/ha.test b/storage/spider/mysql-test/spider/bg/t/ha.test
index 1924b908..f86e98c5 100644
--- a/storage/spider/mysql-test/spider/bg/t/ha.test
+++ b/storage/spider/mysql-test/spider/bg/t/ha.test
@@ -189,12 +189,14 @@ eval CREATE TABLE ta_l (
PRIMARY KEY(a)
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_HA_2_1;
--enable_query_log
+--disable_ps_protocol
INSERT INTO ta_l (a, b, c) VALUES
(1, 'a', '2008-08-01 10:21:39'),
(2, 'b', '2000-01-01 00:00:00'),
(3, 'e', '2007-06-04 20:03:11'),
(4, 'd', '2003-11-30 05:01:03'),
(5, 'c', '2001-12-31 23:59:59');
+--enable_ps_protocol
--echo
--echo select test
@@ -395,7 +397,9 @@ if ($USE_CHILD_GROUP3)
--connection master_1
eval $MASTER_1_SET_RECOVERY_STATUS_2_1;
eval $MASTER_1_CHECK_LINK_STATUS;
+--disable_ps_protocol
eval $MASTER_1_COPY_TABLES_2_1;
+--enable_ps_protocol
if ($USE_CHILD_GROUP3)
{
if (!$OUTPUT_CHILD_GROUP3)
@@ -421,8 +425,10 @@ if ($USE_CHILD_GROUP3)
--connection master_1
eval $MASTER_1_SET_OK_STATUS_2_1;
eval $MASTER_1_CHECK_LINK_STATUS;
+--disable_ps_protocol
INSERT INTO ta_l (a, b, c) VALUES
(8, 'g', '2011-05-05 21:33:30');
+--enable_ps_protocol
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
DROP TABLE ta_l;
if ($USE_CHILD_GROUP2)
@@ -581,12 +587,14 @@ eval CREATE TABLE ta_l (
PRIMARY KEY(a)
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_HA_AS_2_1;
--enable_query_log
+--disable_ps_protocol
INSERT INTO ta_l (a, b, c) VALUES
(1, 'a', '2008-08-01 10:21:39'),
(2, 'b', '2000-01-01 00:00:00'),
(3, 'e', '2007-06-04 20:03:11'),
(4, 'd', '2003-11-30 05:01:03'),
(5, 'c', '2001-12-31 23:59:59');
+--enable_ps_protocol
--echo
--echo select test
@@ -787,8 +795,10 @@ if ($USE_CHILD_GROUP3)
--connection master_1
eval $MASTER_1_SET_OK_STATUS_AS_2_1;
eval $MASTER_1_CHECK_LINK_STATUS;
+--disable_ps_protocol
INSERT INTO ta_l (a, b, c) VALUES
(8, 'g', '2011-05-05 21:33:30');
+--enable_ps_protocol
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
DROP TABLE ta_l;
if ($USE_CHILD_GROUP2)
diff --git a/storage/spider/mysql-test/spider/bg/t/ha_part.test b/storage/spider/mysql-test/spider/bg/t/ha_part.test
index 33fe9850..9767607a 100644
--- a/storage/spider/mysql-test/spider/bg/t/ha_part.test
+++ b/storage/spider/mysql-test/spider/bg/t/ha_part.test
@@ -225,12 +225,14 @@ if ($HAVE_PARTITION)
PRIMARY KEY(a)
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_HA_P_2_1;
--enable_query_log
+ --disable_ps_protocol
INSERT INTO ta_l2 (a, b, c) VALUES
(1, 'a', '2008-08-01 10:21:39'),
(2, 'b', '2000-01-01 00:00:00'),
(3, 'e', '2007-06-04 20:03:11'),
(4, 'd', '2003-11-30 05:01:03'),
(5, 'c', '2001-12-31 23:59:59');
+ --enable_ps_protocol
--echo
--echo select test
@@ -460,7 +462,9 @@ if ($HAVE_PARTITION)
--connection master_1
eval $MASTER_1_SET_RECOVERY_STATUS_P_2_1;
eval $MASTER_1_CHECK_LINK_STATUS;
+ --disable_ps_protocol
eval $MASTER_1_COPY_TABLES_P_2_1;
+ --enable_ps_protocol
if ($USE_CHILD_GROUP3)
{
if (!$OUTPUT_CHILD_GROUP3)
@@ -486,9 +490,11 @@ if ($HAVE_PARTITION)
--connection master_1
eval $MASTER_1_SET_OK_STATUS_P_2_1;
eval $MASTER_1_CHECK_LINK_STATUS;
+ --disable_ps_protocol
INSERT INTO ta_l2 (a, b, c) VALUES
(8, 'g', '2011-05-05 21:33:30'),
(9, 'h', '2011-05-05 22:32:10');
+ --enable_ps_protocol
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a;
DROP TABLE ta_l2;
if ($USE_CHILD_GROUP2)
@@ -674,12 +680,14 @@ if ($HAVE_PARTITION)
PRIMARY KEY(a)
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_HA_AS_P_2_1;
--enable_query_log
+ --disable_ps_protocol
INSERT INTO ta_l2 (a, b, c) VALUES
(1, 'a', '2008-08-01 10:21:39'),
(2, 'b', '2000-01-01 00:00:00'),
(3, 'e', '2007-06-04 20:03:11'),
(4, 'd', '2003-11-30 05:01:03'),
(5, 'c', '2001-12-31 23:59:59');
+ --enable_ps_protocol
--echo
--echo select test
@@ -918,9 +926,11 @@ if ($HAVE_PARTITION)
--connection master_1
eval $MASTER_1_SET_OK_STATUS_AS_P_2_1;
eval $MASTER_1_CHECK_LINK_STATUS;
+ --disable_ps_protocol
INSERT INTO ta_l2 (a, b, c) VALUES
(8, 'g', '2011-05-05 21:33:30'),
(9, 'h', '2011-05-05 22:32:10');
+ --enable_ps_protocol
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a;
DROP TABLE ta_l2;
if ($USE_CHILD_GROUP2)
diff --git a/storage/spider/mysql-test/spider/bg/t/slave_test_init.inc b/storage/spider/mysql-test/spider/bg/t/slave_test_init.inc
index 84de2c7d..4f7a6bba 100644
--- a/storage/spider/mysql-test/spider/bg/t/slave_test_init.inc
+++ b/storage/spider/mysql-test/spider/bg/t/slave_test_init.inc
@@ -16,7 +16,8 @@ if (!$SLAVE1_1_SLAVE_STATUS)
MASTER_HOST = '127.0.0.1',
MASTER_USER = 'root',
MASTER_PASSWORD = '',
- MASTER_PORT = $MASTER_1_MYPORT
+ MASTER_PORT = $MASTER_1_MYPORT,
+ MASTER_SSL_VERIFY_SERVER_CERT=0
;
}
--source include/start_slave.inc
diff --git a/storage/spider/mysql-test/spider/bg/t/spider3_fixes.test b/storage/spider/mysql-test/spider/bg/t/spider3_fixes.test
index 64d3b657..d10ac1ce 100644
--- a/storage/spider/mysql-test/spider/bg/t/spider3_fixes.test
+++ b/storage/spider/mysql-test/spider/bg/t/spider3_fixes.test
@@ -159,10 +159,14 @@ if ($USE_REPLICATION)
--connection master_1
}
--enable_query_log
+--disable_ps_protocol
INSERT INTO t1 () VALUES ();
+--enable_ps_protocol
SELECT LAST_INSERT_ID();
SELECT MAX(id) FROM t1;
+--disable_ps_protocol
INSERT INTO t2 () VALUES ();
+--enable_ps_protocol
SELECT LAST_INSERT_ID();
SELECT MAX(id) FROM t2;
--disable_query_log
diff --git a/storage/spider/mysql-test/spider/bg/t/spider3_fixes_part.test b/storage/spider/mysql-test/spider/bg/t/spider3_fixes_part.test
index bcd85f42..6f43274f 100644
--- a/storage/spider/mysql-test/spider/bg/t/spider3_fixes_part.test
+++ b/storage/spider/mysql-test/spider/bg/t/spider3_fixes_part.test
@@ -193,10 +193,14 @@ if ($HAVE_PARTITION)
--connection master_1
}
--enable_query_log
+ --disable_ps_protocol
INSERT INTO t1 () VALUES ();
+ --enable_ps_protocol
SELECT LAST_INSERT_ID();
SELECT MAX(id) FROM t1;
+ --disable_ps_protocol
INSERT INTO t2 () VALUES ();
+ --enable_ps_protocol
SELECT LAST_INSERT_ID();
SELECT MAX(id) FROM t2;
--disable_query_log
diff --git a/storage/spider/mysql-test/spider/bg/t/spider_fixes.test b/storage/spider/mysql-test/spider/bg/t/spider_fixes.test
index 061dbac2..6ed0b936 100644
--- a/storage/spider/mysql-test/spider/bg/t/spider_fixes.test
+++ b/storage/spider/mysql-test/spider/bg/t/spider_fixes.test
@@ -128,7 +128,9 @@ eval CREATE TABLE ta_l (
PRIMARY KEY(a)
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1;
--enable_query_log
+--disable_ps_protocol
INSERT INTO ta_l SELECT a, b, c FROM tb_l;
+--enable_ps_protocol
--echo
--echo 2.13
@@ -309,7 +311,9 @@ eval CREATE TABLE ta_l (
PRIMARY KEY (a, b, c)
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT5_2_1;
--enable_query_log
+--disable_ps_protocol
INSERT INTO ta_l SELECT a, b, c FROM tb_l;
+--enable_ps_protocol
if ($USE_CHILD_GROUP2)
{
if (!$OUTPUT_CHILD_GROUP2)
@@ -668,8 +672,10 @@ if ($HAVE_TRIGGER)
}
}
--connection master_1
+ --disable_ps_protocol
INSERT INTO ta_l_auto_inc (a, b, c) VALUES
(NULL, 's', '2008-12-31 20:59:59');
+ --enable_ps_protocol
if ($USE_CHILD_GROUP2)
{
if (!$OUTPUT_CHILD_GROUP2)
@@ -780,7 +786,9 @@ eval CREATE TABLE ta_l_int (
KEY idx2(c)
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT4_2_1;
--enable_query_log
+--disable_ps_protocol
INSERT INTO ta_l_int (a, b, c) VALUES (1, 2, 3);
+--enable_ps_protocol
INSERT INTO ta_l_int (a, b, c) SELECT a + 1, b + 1, c + 1 FROM ta_l_int;
INSERT INTO ta_l_int (a, b, c) SELECT a + 2, b + 2, c + 2 FROM ta_l_int;
INSERT INTO ta_l_int (a, b, c) SELECT a + 4, b + 4, c + 4 FROM ta_l_int;
@@ -870,7 +878,9 @@ if (!$MASTER_1_NEEDPK)
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT4_2_1;
}
--enable_query_log
+--disable_ps_protocol
SELECT a, b, c FROM ta_l_int ORDER BY a;
+--enable_ps_protocol
INSERT INTO ta_l_int (a, b, c) VALUES (0, 2, 3);
INSERT INTO ta_l_int (a, b, c) VALUES (18, 2, 3);
if ($USE_CHILD_GROUP2)
@@ -1101,7 +1111,9 @@ if ($USE_REPLICATION)
--connection master_1
}
--enable_query_log
+--disable_ps_protocol
INSERT INTO t1 () VALUES ();
+--enable_ps_protocol
SELECT LAST_INSERT_ID();
SELECT MAX(id) FROM t1;
INSERT INTO t1 () VALUES ();
@@ -1115,7 +1127,9 @@ SELECT LAST_INSERT_ID();
SELECT MAX(id) FROM t1;
INSERT INTO t1 () VALUES (),(),(),();
SELECT LAST_INSERT_ID();
+--disable_ps_protocol
SELECT id FROM t1 ORDER BY id;
+--enable_ps_protocol
SET INSERT_ID=5000;
INSERT INTO t1 () VALUES ();
SELECT LAST_INSERT_ID();
@@ -1192,7 +1206,9 @@ if ($MASTER_1_ENGINE_IS_SPIDER)
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_READONLY1_1;
--let $MIN_VAL= `SELECT MIN(id) FROM t1`
--enable_query_log
+ --disable_ps_protocol
SELECT id FROM t1 ORDER BY id;
+ --enable_ps_protocol
--error 12518
INSERT INTO t1 (id) VALUES (1);
--error 12518
@@ -1229,7 +1245,9 @@ if ($MASTER_1_ENGINE_IS_SPIDER)
PRIMARY KEY (id)
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_ERROR_MODE1_1;
--enable_query_log
+ --disable_ps_protocol
SELECT id FROM t1 ORDER BY id;
+ --enable_ps_protocol
INSERT INTO t1 (id) VALUES (1);
DELETE FROM t1;
TRUNCATE t1;
@@ -1288,7 +1306,9 @@ eval CREATE TABLE t1 (
PRIMARY KEY(c)
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_TEXT_KEY1_1;
--enable_query_log
+--disable_ps_protocol
insert into t1 values (null, null, '2048');
+--enable_ps_protocol
insert into t1 values ('1', '1', '1');
insert into t1 select a + 1, b + 1, c + 1 from t1;
insert into t1 select a + 2, b + 2, c + 2 from t1;
@@ -1320,7 +1340,9 @@ if ($USE_CHILD_GROUP2)
}
}
--connection master_1
+--disable_ps_protocol
select a from t1 where a is null order by a limit 30;
+--enable_ps_protocol
select b from t1 where b is null order by b limit 30;
if ($USE_CHILD_GROUP2)
{
@@ -1376,7 +1398,9 @@ if ($USE_CHILD_GROUP2)
}
}
--connection master_1
+--disable_ps_protocol
select a, b, c from t1 where a = '10' and b <> '100' order by c desc limit 5;
+--enable_ps_protocol
select a, c from t1 where a = '10' order by b desc limit 5;
if ($USE_CHILD_GROUP2)
{
diff --git a/storage/spider/mysql-test/spider/bg/t/spider_fixes_part.test b/storage/spider/mysql-test/spider/bg/t/spider_fixes_part.test
index e6c4456e..1f9c11eb 100644
--- a/storage/spider/mysql-test/spider/bg/t/spider_fixes_part.test
+++ b/storage/spider/mysql-test/spider/bg/t/spider_fixes_part.test
@@ -163,7 +163,9 @@ if ($HAVE_PARTITION)
PRIMARY KEY(a)
) $MASTER_1_ENGINE $MASTER_1_COMMENT2_P_2_1;
--enable_query_log
+ --disable_ps_protocol
INSERT INTO ta_l2 SELECT a, b, c FROM tb_l;
+ --enable_ps_protocol
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 WHERE a > 1
ORDER BY a;
if ($USE_CHILD_GROUP2)
@@ -268,7 +270,9 @@ if ($HAVE_PARTITION)
PRIMARY KEY(a)
) $MASTER_1_ENGINE $MASTER_1_COMMENT2_P_2_1;
--enable_query_log
+ --disable_ps_protocol
INSERT INTO ta_l2 (a, b, c) VALUES (3, 'B', '2010-09-26 00:00:00');
+ --enable_ps_protocol
UPDATE ta_l2 SET a = 4 WHERE a = 3;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2;
if ($USE_CHILD_GROUP2)
@@ -363,7 +367,9 @@ if ($HAVE_PARTITION)
KEY idx2(c)
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT3_P_2_1;
--enable_query_log
+ --disable_ps_protocol
INSERT INTO ta_l_int (a, b, c) VALUES (1, 2, 3);
+ --enable_ps_protocol
INSERT INTO ta_l_int (a, b, c) SELECT a + 1, b + 1, c + 1 FROM ta_l_int;
INSERT INTO ta_l_int (a, b, c) SELECT a + 2, b + 2, c + 2 FROM ta_l_int;
INSERT INTO ta_l_int (a, b, c) SELECT a + 4, b + 4, c + 4 FROM ta_l_int;
@@ -531,7 +537,9 @@ if ($HAVE_PARTITION)
--connection master_1
}
--enable_query_log
+ --disable_ps_protocol
INSERT INTO t1 () VALUES ();
+ --enable_ps_protocol
SELECT LAST_INSERT_ID();
SELECT MAX(id) FROM t1;
INSERT INTO t1 () VALUES ();
diff --git a/storage/spider/mysql-test/spider/bg/t/vp_fixes.test b/storage/spider/mysql-test/spider/bg/t/vp_fixes.test
index 2c3e1523..2061cf25 100644
--- a/storage/spider/mysql-test/spider/bg/t/vp_fixes.test
+++ b/storage/spider/mysql-test/spider/bg/t/vp_fixes.test
@@ -119,7 +119,9 @@ eval CREATE TABLE ta_l (
PRIMARY KEY(a)
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1;
--enable_query_log
+--disable_ps_protocol
INSERT INTO ta_l SELECT a, b, c FROM tb_l;
+--enable_ps_protocol
--echo
--echo 0.9
@@ -182,6 +184,7 @@ if ($USE_CHILD_GROUP2)
}
--connection master_1
--let $MASTER_1_IS_VP= `SELECT IF('$MASTER_1_ENGINE_TYPE' = 'VP', 1, 0)`
+--disable_ps_protocol
if ($MASTER_1_IS_VP)
{
--error 14514
@@ -215,6 +218,7 @@ if ($USE_CHILD_GROUP2)
--enable_result_log
}
}
+--enable_ps_protocol
--echo create un-correspond primary key table
--connection master_1
@@ -279,6 +283,7 @@ if ($USE_CHILD_GROUP2)
}
}
--connection master_1
+--disable_ps_protocol
if ($MASTER_1_IS_VP)
{
--error 14514
@@ -312,6 +317,7 @@ if ($USE_CHILD_GROUP2)
--enable_result_log
}
}
+--enable_ps_protocol
--echo
--echo deinit
diff --git a/storage/spider/mysql-test/spider/bugfix/disabled.def b/storage/spider/mysql-test/spider/bugfix/disabled.def
index 530b2825..9009cd25 100644
--- a/storage/spider/mysql-test/spider/bugfix/disabled.def
+++ b/storage/spider/mysql-test/spider/bugfix/disabled.def
@@ -1,4 +1,5 @@
wait_timeout : MDEV-26045
+mdev_29676 : MDEV-31138
mdev_27239: MDEV-32046
mdev_27575 : MDEV-32997
mdev_28739_simple : MDEV-33343
diff --git a/storage/spider/mysql-test/spider/bugfix/include/sql_mode_init.inc b/storage/spider/mysql-test/spider/bugfix/include/sql_mode_init.inc
index 09ab2934..337979a4 100644
--- a/storage/spider/mysql-test/spider/bugfix/include/sql_mode_init.inc
+++ b/storage/spider/mysql-test/spider/bugfix/include/sql_mode_init.inc
@@ -5,21 +5,7 @@
--enable_result_log
--enable_query_log
--enable_warnings
---let $SQL_MODES= 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,allow_invalid_dates,error_for_division_by_zero,traditional,no_auto_create_user,high_not_precedence,no_engine_substitution,pad_char_to_full_length
-if (`SELECT IF(STRCMP('$SERVER_NAME', 'MariaDB') = 0, 1, 0)`)
-{
- if (`SELECT IF($SERVER_MAJOR_VERSION = 10, 1, 0)`)
- {
- if (`SELECT IF($SERVER_MINOR_VERSION >= 3, 1, 0)`)
- {
- --let $SQL_MODES= $SQL_MODES,empty_string_is_null,simultaneous_assignment
- }
- if (`SELECT IF($SERVER_MINOR_VERSION >= 4, 1, 0)`)
- {
- --let $SQL_MODES= $SQL_MODES,time_round_fractional
- }
- }
-}
+--let $SQL_MODES= 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,allow_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
--connection master_1
set @old_sql_mode= @@sql_mode;
eval set session sql_mode= '$SQL_MODES';
diff --git a/storage/spider/mysql-test/spider/bugfix/my.cnf b/storage/spider/mysql-test/spider/bugfix/my.cnf
index b7f76a63..d34c836d 100644
--- a/storage/spider/mysql-test/spider/bugfix/my.cnf
+++ b/storage/spider/mysql-test/spider/bugfix/my.cnf
@@ -1,2 +1,3 @@
!include include/default_mysqld.cnf
+!include include/default_client.cnf
!include my_1_1.cnf
diff --git a/storage/spider/mysql-test/spider/bugfix/r/checksum_table_with_quick_mode_3.result b/storage/spider/mysql-test/spider/bugfix/r/checksum_table_with_quick_mode_3.result
index 033e1593..4a082872 100644
--- a/storage/spider/mysql-test/spider/bugfix/r/checksum_table_with_quick_mode_3.result
+++ b/storage/spider/mysql-test/spider/bugfix/r/checksum_table_with_quick_mode_3.result
@@ -31,6 +31,8 @@ CREATE TABLE tbl_a (
pkey int NOT NULL,
PRIMARY KEY (pkey)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
INSERT INTO tbl_a (pkey) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
INSERT INTO tbl_a (pkey) VALUES (10),(11),(12),(13),(14),(15),(16),(17),(18),(19);
INSERT INTO tbl_a (pkey) VALUES (20),(21),(22),(23),(24),(25),(26),(27),(28),(29);
diff --git a/storage/spider/mysql-test/spider/bugfix/r/cp932_column.result b/storage/spider/mysql-test/spider/bugfix/r/cp932_column.result
index c0566840..3011b40f 100644
--- a/storage/spider/mysql-test/spider/bugfix/r/cp932_column.result
+++ b/storage/spider/mysql-test/spider/bugfix/r/cp932_column.result
@@ -31,6 +31,8 @@ txt_utf8 char(8) NOT NULL,
txt_cp932 char(8) NOT NULL COLLATE cp932_japanese_ci,
PRIMARY KEY (pkey)
) MASTER_1_ENGINE DEFAULT CHARACTER SET utf8 MASTER_1_COMMENT_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
INSERT INTO tbl_a (pkey,txt_utf8,txt_cp932) VALUES (0,'',''),(1,'',''),(2,'',''),(3,'',''),(4,'',''),(5,'',''),(6,'',''),(7,'',''),(8,'',''),(9,'','');
FLUSH TABLES;
diff --git a/storage/spider/mysql-test/spider/bugfix/r/delete_with_float_column_default.result b/storage/spider/mysql-test/spider/bugfix/r/delete_with_float_column_default.result
index 8b193975..eae04ad0 100644
--- a/storage/spider/mysql-test/spider/bugfix/r/delete_with_float_column_default.result
+++ b/storage/spider/mysql-test/spider/bugfix/r/delete_with_float_column_default.result
@@ -44,6 +44,8 @@ pkey int NOT NULL,
f float DEFAULT NULL,
PRIMARY KEY (pkey)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
connection master_1;
INSERT INTO tbl_a (pkey, f) VALUES (0,NULL);
INSERT INTO tbl_a (pkey, f) VALUES (1,0.671437);
diff --git a/storage/spider/mysql-test/spider/bugfix/r/delete_with_float_column_mariadb.result b/storage/spider/mysql-test/spider/bugfix/r/delete_with_float_column_mariadb.result
index 8b193975..eae04ad0 100644
--- a/storage/spider/mysql-test/spider/bugfix/r/delete_with_float_column_mariadb.result
+++ b/storage/spider/mysql-test/spider/bugfix/r/delete_with_float_column_mariadb.result
@@ -44,6 +44,8 @@ pkey int NOT NULL,
f float DEFAULT NULL,
PRIMARY KEY (pkey)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
connection master_1;
INSERT INTO tbl_a (pkey, f) VALUES (0,NULL);
INSERT INTO tbl_a (pkey, f) VALUES (1,0.671437);
diff --git a/storage/spider/mysql-test/spider/bugfix/r/delete_with_float_column_mysql.result b/storage/spider/mysql-test/spider/bugfix/r/delete_with_float_column_mysql.result
index 1e5d7d31..e9b258a1 100644
--- a/storage/spider/mysql-test/spider/bugfix/r/delete_with_float_column_mysql.result
+++ b/storage/spider/mysql-test/spider/bugfix/r/delete_with_float_column_mysql.result
@@ -44,6 +44,8 @@ pkey int NOT NULL,
f float DEFAULT NULL,
PRIMARY KEY (pkey)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
connection master_1;
INSERT INTO tbl_a (pkey, f) VALUES (0,NULL);
INSERT INTO tbl_a (pkey, f) VALUES (1,0.671437);
diff --git a/storage/spider/mysql-test/spider/bugfix/r/gbh_outer_fields_in_join.result b/storage/spider/mysql-test/spider/bugfix/r/gbh_outer_fields_in_join.result
index 75c2f2c2..4f8f59b3 100644
--- a/storage/spider/mysql-test/spider/bugfix/r/gbh_outer_fields_in_join.result
+++ b/storage/spider/mysql-test/spider/bugfix/r/gbh_outer_fields_in_join.result
@@ -20,8 +20,14 @@ connection master_1;
CREATE DATABASE auto_test_local;
USE auto_test_local;
CREATE TABLE t1 (a int) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='srv "s_2_1", table "t1"';
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
CREATE TABLE t2 (a int) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='srv "s_2_1", table "t2"';
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
CREATE TABLE t3 (a int) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='srv "s_2_1", table "t3"';
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
select * from t3 left join t1 on t3.a = t1.a left join t2 on t3.a = t2.a;
a a a
1 1 1
diff --git a/storage/spider/mysql-test/spider/bugfix/r/group_by_order_by_limit.result b/storage/spider/mysql-test/spider/bugfix/r/group_by_order_by_limit.result
index e9054a17..677022b3 100644
--- a/storage/spider/mysql-test/spider/bugfix/r/group_by_order_by_limit.result
+++ b/storage/spider/mysql-test/spider/bugfix/r/group_by_order_by_limit.result
@@ -36,6 +36,11 @@ skey int NOT NULL,
PRIMARY KEY (pkey),
KEY idx1 (skey)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
INSERT INTO tbl_a (pkey,skey) VALUES (0,0),(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9);
INSERT INTO tbl_a (pkey,skey) VALUES (10,10),(11,11),(12,12),(13,13),(14,14),(15,15),(16,16),(17,17),(18,18),(19,19);
INSERT INTO tbl_a (pkey,skey) VALUES (20,5),(21,6),(22,7),(23,8),(24,9),(25,10),(26,11),(27,12),(28,13),(29,14);
diff --git a/storage/spider/mysql-test/spider/bugfix/r/index.result b/storage/spider/mysql-test/spider/bugfix/r/index.result
index 801fec2e..85e1d310 100644
--- a/storage/spider/mysql-test/spider/bugfix/r/index.result
+++ b/storage/spider/mysql-test/spider/bugfix/r/index.result
@@ -12,6 +12,8 @@ select @@spider_auto_increment_mode;
create or replace table auto_test_local.t (id int primary key) engine=InnoDB;
create or replace table t_sp1 (id int auto_increment, primary key(id desc))
engine=Spider COMMENT='wrapper "mysql", srv "s_1", table "t"';
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
insert into t_sp1 () values (),(),();
insert into t_sp1 () values (),(),();
select * from t_sp1;
@@ -33,6 +35,11 @@ engine=spider comment='wrapper "mysql", srv "s_1"'
partition by range (a)
(partition p1 values less than (4) comment "table 't1'",
partition p2 values less than (maxvalue) comment "table 't2'");
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
insert into t values (1),(2),(10),(11);
select * from t where a > 1 order by a;
a
@@ -47,6 +54,8 @@ create table auto_test_local.t (a int, b char(1), primary key(a desc));
insert into auto_test_local.t VALUES (1,'f'),(2,'g'),(3,'j'), (4,'i'),(5,'h');
create table ts (a int, b char(1), primary key(a desc))
engine=spider comment='wrapper "mysql", srv "s_1", table "t"';
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
select a, b from ts where a > 0 and b = 'g' order by a;
a b
2 g
diff --git a/storage/spider/mysql-test/spider/bugfix/r/insert_select.result b/storage/spider/mysql-test/spider/bugfix/r/insert_select.result
index 670777d9..05b2022e 100644
--- a/storage/spider/mysql-test/spider/bugfix/r/insert_select.result
+++ b/storage/spider/mysql-test/spider/bugfix/r/insert_select.result
@@ -32,12 +32,16 @@ dt date NOT NULL,
tm time NOT NULL,
KEY idx1 (skey,dt,tm)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
CREATE TABLE tbl_b (
pkey int NOT NULL,
dt datetime NOT NULL,
PRIMARY KEY (pkey),
KEY idx1 (dt)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1_2
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
INSERT INTO tbl_a (skey, dt, tm) VALUES (0, '2012-01-01', '12:00:00'),(1, '2012-02-01', '12:00:00'),(2, '2012-03-01', '12:00:00'),(3, '2012-04-01', '12:00:00'),(4, '2012-05-01', '12:00:00'),(5, '2012-06-01', '12:00:00'),(6, '2012-07-01', '12:00:00'),(7, '2012-08-01', '12:00:00'),(8, '2012-09-01', '12:00:00'),(9, '2012-10-01', '12:00:00');
INSERT INTO tbl_a (skey, dt, tm) VALUES (0, '2013-01-01', '13:00:00'),(1, '2013-02-01', '13:00:00'),(2, '2013-03-01', '13:00:00'),(3, '2013-04-01', '13:00:00'),(4, '2013-05-01', '13:00:00'),(5, '2013-06-01', '13:00:00'),(6, '2013-07-01', '13:00:00'),(7, '2013-08-01', '13:00:00'),(8, '2013-09-01', '13:00:00'),(9, '2013-10-01', '13:00:00');
INSERT INTO tbl_a (skey, dt, tm) VALUES (0, '2012-11-01', '11:00:00'),(1, '2012-12-01', '11:00:00'),(2, '2012-11-30', '11:00:00'),(3, '2012-11-29', '11:00:00'),(4, '2012-11-28', '11:00:00'),(5, '2012-11-27', '11:00:00'),(6, '2012-11-26', '11:00:00'),(7, '2012-11-25', '11:00:00'),(8, '2012-11-24', '11:00:00'),(9, '2012-11-23', '11:00:00');
diff --git a/storage/spider/mysql-test/spider/bugfix/r/mdev_19866.result b/storage/spider/mysql-test/spider/bugfix/r/mdev_19866.result
index dbf0f54c..e52843d9 100644
--- a/storage/spider/mysql-test/spider/bugfix/r/mdev_19866.result
+++ b/storage/spider/mysql-test/spider/bugfix/r/mdev_19866.result
@@ -35,6 +35,11 @@ pkey int NOT NULL,
val char(1) NOT NULL,
PRIMARY KEY (pkey)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
INSERT INTO tbl_a (pkey,val) VALUES (1,'1'),(2,'2'),(3,'3'),(4,'4');
select test 1
diff --git a/storage/spider/mysql-test/spider/bugfix/r/mdev_20100.result b/storage/spider/mysql-test/spider/bugfix/r/mdev_20100.result
index 52876c34..2fbefb72 100644
--- a/storage/spider/mysql-test/spider/bugfix/r/mdev_20100.result
+++ b/storage/spider/mysql-test/spider/bugfix/r/mdev_20100.result
@@ -32,6 +32,10 @@ PARTITION pt1 VALUES LESS THAN (5) COMMENT='srv "s_2_1", table "ta_r2"',
PARTITION pt2 VALUES LESS THAN (10) COMMENT='srv "s_2_1", table "ta_r3"',
PARTITION pt3 VALUES LESS THAN MAXVALUE COMMENT='srv "s_2_1", table "ta_r4"'
)
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
INSERT INTO tbl_a (a, b, c) VALUES
(1, 'a', '2008-08-01 10:21:39'),
(2, 'b', '2000-01-01 00:00:00'),
diff --git a/storage/spider/mysql-test/spider/bugfix/r/mdev_20502.result b/storage/spider/mysql-test/spider/bugfix/r/mdev_20502.result
index ee06e449..f51bb1c8 100644
--- a/storage/spider/mysql-test/spider/bugfix/r/mdev_20502.result
+++ b/storage/spider/mysql-test/spider/bugfix/r/mdev_20502.result
@@ -27,6 +27,8 @@ id int(10) unsigned NOT NULL AUTO_INCREMENT,
val int(10) unsigned DEFAULT NULL,
PRIMARY KEY(id)
) ENGINE=Spider COMMENT='table "tbl_a", srv "s_2_1"'
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
INSERT INTO tbl_a (val) VALUES (1);
test 1
diff --git a/storage/spider/mysql-test/spider/bugfix/r/mdev_21884.result b/storage/spider/mysql-test/spider/bugfix/r/mdev_21884.result
index 7a9c58e6..cf206f72 100644
--- a/storage/spider/mysql-test/spider/bugfix/r/mdev_21884.result
+++ b/storage/spider/mysql-test/spider/bugfix/r/mdev_21884.result
@@ -38,6 +38,11 @@ PARTITION pt1 VALUES LESS THAN (10) COMMENT='srv "s_2_1", table "ta_r2",
priority "1000"',
PARTITION pt2 VALUES LESS THAN MAXVALUE COMMENT='srv "s_2_1", priority "1000001"'
)
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
CREATE TABLE tb_l (
a INT,
b CHAR(1),
diff --git a/storage/spider/mysql-test/spider/bugfix/r/mdev_22246.result b/storage/spider/mysql-test/spider/bugfix/r/mdev_22246.result
index 0254d8bf..a4019fb3 100644
--- a/storage/spider/mysql-test/spider/bugfix/r/mdev_22246.result
+++ b/storage/spider/mysql-test/spider/bugfix/r/mdev_22246.result
@@ -35,6 +35,11 @@ id bigint NOT NULL,
node text,
PRIMARY KEY (id)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
INSERT INTO tbl_a (id,node) VALUES (1,'DB-G0'),(2,'DB-G1');
select test 1
diff --git a/storage/spider/mysql-test/spider/bugfix/r/mdev_22265.result b/storage/spider/mysql-test/spider/bugfix/r/mdev_22265.result
index 0331943a..3cf28d6c 100644
--- a/storage/spider/mysql-test/spider/bugfix/r/mdev_22265.result
+++ b/storage/spider/mysql-test/spider/bugfix/r/mdev_22265.result
@@ -12,6 +12,8 @@ USE auto_test_local;
create table
connection master_1;
create table t2345678911234567892123456789312345678941234567895123(id int) ENGINE=SPIDER DEFAULT CHARSET=latin1 COMMENT='host "h114", user "spider", password "spider", port "3306", database "test32738"';
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
deinit
connection master_1;
diff --git a/storage/spider/mysql-test/spider/bugfix/r/mdev_24020.result b/storage/spider/mysql-test/spider/bugfix/r/mdev_24020.result
index 164c68fb..b7280b9a 100644
--- a/storage/spider/mysql-test/spider/bugfix/r/mdev_24020.result
+++ b/storage/spider/mysql-test/spider/bugfix/r/mdev_24020.result
@@ -28,6 +28,10 @@ PARTITION pt1 VALUES IN (0) COMMENT='srv "s_2_1", table "ta_r2"',
PARTITION pt2 VALUES IN (1) COMMENT='srv "s_2_1", table "ta_r3"',
PARTITION pt3 VALUES IN (2) COMMENT='srv "s_2_1", table "ta_r4"'
)
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
INSERT INTO tbl_a VALUES(10000, " abcd ");
INSERT INTO tbl_a VALUES(10001, " abcd ");
INSERT INTO tbl_a VALUES(10002, " abcd ");
diff --git a/storage/spider/mysql-test/spider/bugfix/r/mdev_24343.result b/storage/spider/mysql-test/spider/bugfix/r/mdev_24343.result
index 1d154daa..3f6e560f 100644
--- a/storage/spider/mysql-test/spider/bugfix/r/mdev_24343.result
+++ b/storage/spider/mysql-test/spider/bugfix/r/mdev_24343.result
@@ -43,6 +43,9 @@ PRIMARY KEY (`id`)
PARTITION BY LIST COLUMNS(`id`) (
PARTITION `pt1` DEFAULT COMMENT = 'srv "s_2_1"'
);
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
CREATE TABLE `tbl_b` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`last_name` varchar(255) DEFAULT NULL,
@@ -51,6 +54,9 @@ PRIMARY KEY (`id`)
PARTITION BY LIST COLUMNS(`id`) (
PARTITION `pt1` DEFAULT COMMENT = 'srv "s_2_1"'
);
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
CREATE TABLE `tbl_c` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`surname` varchar(255) DEFAULT NULL,
@@ -59,6 +65,9 @@ PRIMARY KEY (`id`)
PARTITION BY LIST COLUMNS(`id`) (
PARTITION `pt1` DEFAULT COMMENT = 'srv "s_2_1"'
);
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
SELECT * from tbl_b JOIN tbl_c ON tbl_b.id = tbl_c.id LEFT OUTER JOIN tbl_a ON tbl_a.id = tbl_b.id;
id last_name id surname id first_name
1 DEMONGEOT 1 CON 1 RICHARD
diff --git a/storage/spider/mysql-test/spider/bugfix/r/mdev_24517.result b/storage/spider/mysql-test/spider/bugfix/r/mdev_24517.result
index f084c967..c0f5d9b4 100644
--- a/storage/spider/mysql-test/spider/bugfix/r/mdev_24517.result
+++ b/storage/spider/mysql-test/spider/bugfix/r/mdev_24517.result
@@ -31,6 +31,10 @@ PARTITION pt1 VALUES LESS THAN (5) COMMENT='srv "s_2_1", table "ta_r2"',
PARTITION pt2 VALUES LESS THAN (10) COMMENT='srv "s_2_1", table "ta_r3"',
PARTITION pt3 VALUES LESS THAN MAXVALUE COMMENT='srv "s_2_1", table "ta_r4"'
)
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
INSERT INTO tbl_a (i, j) VALUES
(1, '{"ID": "3", "Name": "Barney", "Age": 18}'),
(2, '{"ID": "4", "Name": "Betty", "Age": 19}'),
diff --git a/storage/spider/mysql-test/spider/bugfix/r/mdev_24523.result b/storage/spider/mysql-test/spider/bugfix/r/mdev_24523.result
index 0b3d6c31..94e0935b 100644
--- a/storage/spider/mysql-test/spider/bugfix/r/mdev_24523.result
+++ b/storage/spider/mysql-test/spider/bugfix/r/mdev_24523.result
@@ -28,6 +28,10 @@ PARTITION pt1 VALUES LESS THAN (5) COMMENT='srv "s_2_1", table "ta_r2"',
PARTITION pt2 VALUES LESS THAN (10) COMMENT='srv "s_2_1", table "ta_r3"',
PARTITION pt3 VALUES LESS THAN MAXVALUE COMMENT='srv "s_2_1", table "ta_r4"'
)
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
INSERT INTO tbl_a VALUES (1, '{ "a": 1, "b": [2, 3]}');
test 1
diff --git a/storage/spider/mysql-test/spider/bugfix/r/mdev_24760.result b/storage/spider/mysql-test/spider/bugfix/r/mdev_24760.result
index 08481cd1..2a37e1f2 100644
--- a/storage/spider/mysql-test/spider/bugfix/r/mdev_24760.result
+++ b/storage/spider/mysql-test/spider/bugfix/r/mdev_24760.result
@@ -30,6 +30,9 @@ PRIMARY KEY (id)
PARTITION BY HASH(id) (
PARTITION pt1 COMMENT='srv "s_2_1"'
);
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
SELECT id, CASE WHEN name='Alice' THEN "A" WHEN name='Bob' THEN "B" END FROM tbl_a;
id CASE WHEN name='Alice' THEN "A" WHEN name='Bob' THEN "B" END
1 A
diff --git a/storage/spider/mysql-test/spider/bugfix/r/mdev_25116.result b/storage/spider/mysql-test/spider/bugfix/r/mdev_25116.result
index 09efba25..ad9f4028 100644
--- a/storage/spider/mysql-test/spider/bugfix/r/mdev_25116.result
+++ b/storage/spider/mysql-test/spider/bugfix/r/mdev_25116.result
@@ -17,6 +17,8 @@ USE auto_test_local;
CREATE TABLE tbl_a (
id INT
) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='table "tbl_a", srv "s_2_1"';
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
connection master_1;
set @old_spider_direct_aggregate=@@session.spider_direct_aggregate;
set spider_direct_aggregate=1;
diff --git a/storage/spider/mysql-test/spider/bugfix/r/mdev_26013.result b/storage/spider/mysql-test/spider/bugfix/r/mdev_26013.result
index 3af1f7df..3ec2db14 100644
--- a/storage/spider/mysql-test/spider/bugfix/r/mdev_26013.result
+++ b/storage/spider/mysql-test/spider/bugfix/r/mdev_26013.result
@@ -26,6 +26,9 @@ PRIMARY KEY (`a`)
) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='table "tbl_a"' PARTITION BY LIST COLUMNS(`a`) (
PARTITION `pt1` DEFAULT COMMENT = 'srv "s_2_1"'
);
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
connection master_1;
SELECT distinct b FROM tbl_a WHERE b=999;
b
diff --git a/storage/spider/mysql-test/spider/bugfix/r/mdev_26151.result b/storage/spider/mysql-test/spider/bugfix/r/mdev_26151.result
index 326b84a0..10fec21d 100644
--- a/storage/spider/mysql-test/spider/bugfix/r/mdev_26151.result
+++ b/storage/spider/mysql-test/spider/bugfix/r/mdev_26151.result
@@ -12,6 +12,9 @@ set global spider_same_server_link=1;
CREATE SERVER $srv FOREIGN DATA WRAPPER MYSQL OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
create table td (a int, PRIMARY KEY (a));
create table ts (a int, PRIMARY KEY (a)) ENGINE=Spider COMMENT='WRAPPER "mysql", srv "srv_mdev_26151",TABLE "td", casual_read "3"';
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 1287 'casual_read' is deprecated and will be removed in a future release
insert into td values (11), (42);
select max(a) from ts;
max(a)
@@ -19,6 +22,9 @@ max(a)
drop table td, ts;
create table td (a int, PRIMARY KEY (a));
create table ts (a int, PRIMARY KEY (a)) ENGINE=Spider COMMENT='WRAPPER "mysql", srv "srv_mdev_26151",TABLE "td", casual_read "1"';
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 1287 'casual_read' is deprecated and will be removed in a future release
insert into td values (11), (42);
select max(a) from ts;
max(a)
diff --git a/storage/spider/mysql-test/spider/bugfix/r/mdev_26158.result b/storage/spider/mysql-test/spider/bugfix/r/mdev_26158.result
index 2870dab2..0e92da2d 100644
--- a/storage/spider/mysql-test/spider/bugfix/r/mdev_26158.result
+++ b/storage/spider/mysql-test/spider/bugfix/r/mdev_26158.result
@@ -16,6 +16,9 @@ c INT
PARTITION BY LIST COLUMNS(`c`) (
PARTITION `pt1` DEFAULT COMMENT = 'srv "s_2_1"'
);
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
INSERT INTO t SELECT * FROM t;
ERROR 42000: Unknown database 'auto_test_remote'
DROP DATABASE auto_test_local;
diff --git a/storage/spider/mysql-test/spider/bugfix/r/mdev_26247.result b/storage/spider/mysql-test/spider/bugfix/r/mdev_26247.result
index 6eddf9a7..05a0e104 100644
--- a/storage/spider/mysql-test/spider/bugfix/r/mdev_26247.result
+++ b/storage/spider/mysql-test/spider/bugfix/r/mdev_26247.result
@@ -34,16 +34,22 @@ CREATE TABLE t1 (
a11 int,
primary key (a11)
) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='srv "s_2_1", table "t1"';
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
CREATE TABLE t2 (
a21 int,
a22 int,
primary key (a21, a22)
) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='srv "s_2_1", table "t2"';
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
CREATE TABLE t3 (
a31 int,
a32 int,
primary key (a31, a32)
) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='srv "s_2_1", table "t3"';
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
SELECT a22 FROM t1 LEFT JOIN t2 ON a11 = a21 WHERE a11 IN (1);
a22
11
diff --git a/storage/spider/mysql-test/spider/bugfix/r/mdev_26539.result b/storage/spider/mysql-test/spider/bugfix/r/mdev_26539.result
index 4e195fdd..34fa6fbf 100644
--- a/storage/spider/mysql-test/spider/bugfix/r/mdev_26539.result
+++ b/storage/spider/mysql-test/spider/bugfix/r/mdev_26539.result
@@ -21,6 +21,9 @@ c INT
) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='table "tbl_a"' PARTITION BY LIST COLUMNS (c) (
PARTITION pt1 DEFAULT COMMENT = 'srv "s_2_1"'
);
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
INSERT INTO tbl_a VALUES (1);
ALTER TABLE tbl_a CHECK PARTITION ALL;
Table Op Msg_type Msg_text
diff --git a/storage/spider/mysql-test/spider/bugfix/r/mdev_27172.result b/storage/spider/mysql-test/spider/bugfix/r/mdev_27172.result
index 60ef8e2d..f824c787 100644
--- a/storage/spider/mysql-test/spider/bugfix/r/mdev_27172.result
+++ b/storage/spider/mysql-test/spider/bugfix/r/mdev_27172.result
@@ -38,6 +38,8 @@ id int NOT NULL,
greeting VARCHAR(255),
KEY k (greeting)
) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='table "tbl_a", srv "s_2_1"';
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
INSERT INTO tbl_a VALUES (1, "Hi!"),(2, "Aloha!"),(3, "Aloha!!!");
SELECT * FROM tbl_a WHERE greeting = "Aloha!"
AND CASE greeting WHEN "Aloha!" THEN "one" ELSE 'more' END = "one";
@@ -48,6 +50,8 @@ id int NOT NULL,
greeting VARCHAR(255),
KEY k (greeting(5))
) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='table "tbl_b", srv "s_2_1"';
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
INSERT INTO tbl_b VALUES (1, "Hi!"),(2, "Aloha!"),(3, "Aloha!!!");
SELECT * FROM tbl_b WHERE greeting = "Aloha!"
AND CASE greeting WHEN "Aloha!" THEN "one" ELSE 'more' END = "one";
@@ -58,6 +62,8 @@ id int NOT NULL,
greeting TEXT,
KEY k (greeting(5))
) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='table "tbl_c", srv "s_2_1"';
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
INSERT INTO tbl_c VALUES (1, "Hi!"),(2, "Aloha!"),(3, "Aloha!!!");
SELECT * FROM tbl_c WHERE greeting = "Aloha!"
AND CASE greeting WHEN "Aloha!" THEN "one" ELSE 'more' END = "one";
diff --git a/storage/spider/mysql-test/spider/bugfix/r/mdev_28739.result b/storage/spider/mysql-test/spider/bugfix/r/mdev_28739.result
index ee497bb3..385957e2 100644
--- a/storage/spider/mysql-test/spider/bugfix/r/mdev_28739.result
+++ b/storage/spider/mysql-test/spider/bugfix/r/mdev_28739.result
@@ -19,6 +19,8 @@ set spider_same_server_link = on;
CREATE TABLE tbl_a (
id INT
) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='table "tbl_a", srv "s_2_1"';
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
SELECT * FROM tbl_a;
id
# restart
diff --git a/storage/spider/mysql-test/spider/bugfix/r/mdev_28739_simple.result b/storage/spider/mysql-test/spider/bugfix/r/mdev_28739_simple.result
index 1c337c3d..685a58e9 100644
--- a/storage/spider/mysql-test/spider/bugfix/r/mdev_28739_simple.result
+++ b/storage/spider/mysql-test/spider/bugfix/r/mdev_28739_simple.result
@@ -11,6 +11,8 @@ OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
create table t2 (c int);
create table t1 (c int) ENGINE=Spider
COMMENT='WRAPPER "mysql", srv "srv",TABLE "t2"';
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
SELECT * FROM t1;
c
# restart
diff --git a/storage/spider/mysql-test/spider/bugfix/r/mdev_28854.result b/storage/spider/mysql-test/spider/bugfix/r/mdev_28854.result
index e5cee8d4..65c59efe 100644
--- a/storage/spider/mysql-test/spider/bugfix/r/mdev_28854.result
+++ b/storage/spider/mysql-test/spider/bugfix/r/mdev_28854.result
@@ -17,6 +17,8 @@ USE auto_test_local;
CREATE TABLE tbl_a (
id INT
) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='table "tbl_a", srv "s_2_1"';
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
connection master_1;
INSERT DELAYED INTO tbl_a VALUES (1);
ERROR HY000: DELAYED option not supported for table 'tbl_a'
diff --git a/storage/spider/mysql-test/spider/bugfix/r/mdev_28856.result b/storage/spider/mysql-test/spider/bugfix/r/mdev_28856.result
index 5fd412b6..9a79bceb 100644
--- a/storage/spider/mysql-test/spider/bugfix/r/mdev_28856.result
+++ b/storage/spider/mysql-test/spider/bugfix/r/mdev_28856.result
@@ -15,6 +15,9 @@ INSERT INTO mysql.spider_link_mon_servers
('test', 't1', '0', 1, 'srv');
create table t1 (c int) ENGINE=Spider
COMMENT='WRAPPER "mysql", srv "srv",TABLE "t2", monitoring_kind "2"';
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 1287 'monitoring_kind' is deprecated and will be removed in a future release
/* 1 */ insert into t1 values (42);
ERROR HY000: Table 'test.t2' get a problem
/* 2 */ insert into t1 values (42);
@@ -26,12 +29,18 @@ drop table t1, t2;
create table t1 (c int) ENGINE=Spider
COMMENT='WRAPPER "mysql", srv "srv",TABLE "t2", monitoring_bg_kind "2",
monitoring_bg_interval "500000"';
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 1287 'monitoring_bg_kind' is deprecated and will be removed in a future release
+Warning 1287 'monitoring_bg_interval' is deprecated and will be removed in a future release
/* 4 */ insert into t1 values (42);
ERROR 42S02: Table 'test.t2' doesn't exist
drop table t1;
# testing query_cache_sync
create table t1 (c int) ENGINE=Spider
COMMENT='WRAPPER "mysql", srv "srv",TABLE "t2", query_cache_sync "3"';
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
create table t2 (c int);
/* 5 */ insert into t1 values (42);
select sql_cache * from t1;
@@ -45,6 +54,8 @@ drop table t1, t2;
create table t2 (c int);
create table t1 (c int, primary key (c)) ENGINE=Spider
COMMENT='WRAPPER "mysql", srv "srv",TABLE "t2"';
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
/* 6 */ insert ignore into t1 values (42), (42);
select * from t1;
c
@@ -54,6 +65,8 @@ drop table t1, t2;
create table t2 (c int, primary key (c));
create table t1 (c int) ENGINE=Spider
COMMENT='WRAPPER "mysql", srv "srv",TABLE "t2"';
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
/* 7 */ insert ignore into t1 values (42), (42);
Warnings:
Warning 1022 Can't write; duplicate key in table 't1'
@@ -64,6 +77,8 @@ drop table t1, t2;
create table t2 (c int, primary key (c));
create table t1 (c int, primary key (c)) ENGINE=Spider
COMMENT='WRAPPER "mysql", srv "srv",TABLE "t2"';
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
/* 8 */ insert ignore into t1 values (42), (42);
Warnings:
Warning 1062 Duplicate entry '42' for key 'PRIMARY'
@@ -74,6 +89,9 @@ drop table t1, t2;
create table t2 (c int, primary key (c));
create table t1 (c int, primary key (c)) ENGINE=Spider
COMMENT='WRAPPER "mysql", srv "srv",TABLE "t2", pk_name "c"';
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 1287 'pk_name' is deprecated and will be removed in a future release
/* 9 */ insert ignore into t1 values (42), (42);
Warnings:
Warning 1022 Can't write; duplicate key in table 't1'
@@ -84,6 +102,9 @@ drop table t1, t2;
create table t2 (c int, unique key (c));
create table t1 (c int, primary key (c)) ENGINE=Spider
COMMENT='WRAPPER "mysql", srv "srv",TABLE "t2", pk_name "c"';
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 1287 'pk_name' is deprecated and will be removed in a future release
/* 9.1 */ insert ignore into t1 values (42), (42);
Warnings:
Warning 1062 Duplicate entry '42' for key 'PRIMARY'
@@ -94,6 +115,9 @@ drop table t1, t2;
create table t2 (c int, unique key (c));
create table t1 (c int, key (c)) ENGINE=Spider
COMMENT='WRAPPER "mysql", srv "srv",TABLE "t2", pk_name "f"';
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 1287 'pk_name' is deprecated and will be removed in a future release
/* 10 */ insert ignore into t1 values (42), (42);
Warnings:
Warning 1062 Duplicate entry '42' for key 'c'
@@ -104,6 +128,9 @@ drop table t1, t2;
create table t2 (c int, primary key (c));
create table t1 (c int, key (c)) ENGINE=Spider
COMMENT='WRAPPER "mysql", srv "srv",TABLE "t2", pk_name "blah"';
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 1287 'pk_name' is deprecated and will be removed in a future release
/* 11 */ insert ignore into t1 values (42), (42);
Warnings:
Warning 1022 Can't write; duplicate key in table 't1'
@@ -114,6 +141,9 @@ drop table t1, t2;
create table t2 (c int, d int, unique key (c), unique key (d));
create table t1 (c int, d int, key (c), key (d)) ENGINE=Spider
COMMENT='WRAPPER "mysql", srv "srv",TABLE "t2", pk_name "blah"';
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 1287 'pk_name' is deprecated and will be removed in a future release
/* 12 */ insert ignore into t1 values (42, 43), (43, 43);
Warnings:
Warning 1062 Duplicate entry '43' for key 'd'
@@ -133,6 +163,8 @@ t2 CREATE TABLE `t2` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
create table t1 (c int, d int, primary key (c), key (d)) ENGINE=Spider
COMMENT='WRAPPER "mysql", srv "srv",TABLE "t2", idx000 "f d"';
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -159,6 +191,8 @@ t2 CREATE TABLE `t2` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
create table t1 (c int, d int, e int, primary key (c), key (d), unique key (e)) ENGINE=Spider
COMMENT='WRAPPER "mysql", srv "srv",TABLE "t2", idx000 "f PRIMARY", idx001 "u d", idx002 "ig e"';
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
diff --git a/storage/spider/mysql-test/spider/bugfix/r/mdev_28996.result b/storage/spider/mysql-test/spider/bugfix/r/mdev_28996.result
index f805e7ef..16052d69 100644
--- a/storage/spider/mysql-test/spider/bugfix/r/mdev_28996.result
+++ b/storage/spider/mysql-test/spider/bugfix/r/mdev_28996.result
@@ -20,6 +20,8 @@ USE auto_test_local;
CREATE TABLE tbl_a (
a CHAR(8)
) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='table "tbl_a", srv "s_2_1"';
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
SELECT MAX(BINARY a) FROM tbl_a;
MAX(BINARY a)
foo
diff --git a/storage/spider/mysql-test/spider/bugfix/r/mdev_28998.result b/storage/spider/mysql-test/spider/bugfix/r/mdev_28998.result
index e92fb199..7dd03cca 100644
--- a/storage/spider/mysql-test/spider/bugfix/r/mdev_28998.result
+++ b/storage/spider/mysql-test/spider/bugfix/r/mdev_28998.result
@@ -9,6 +9,8 @@ CREATE SERVER s FOREIGN DATA WRAPPER MYSQL OPTIONS (SOCKET "$MASTER_1_MYSOCK", D
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (1),(2);
CREATE TABLE t1_SPIDER (a INT) ENGINE=SPIDER COMMENT = "wrapper 'mysql', srv 's', table 't1'";
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
CREATE TABLE t2 AS SELECT a FROM t1_SPIDER;
SELECT * FROM t2;
a
diff --git a/storage/spider/mysql-test/spider/bugfix/r/mdev_29002.result b/storage/spider/mysql-test/spider/bugfix/r/mdev_29002.result
index 894f51c5..94f441d6 100644
--- a/storage/spider/mysql-test/spider/bugfix/r/mdev_29002.result
+++ b/storage/spider/mysql-test/spider/bugfix/r/mdev_29002.result
@@ -6,7 +6,11 @@ CREATE SERVER s FOREIGN DATA WRAPPER mysql
OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
CREATE TABLE t (a INT);
CREATE TABLE t1_spider (a INT) ENGINE=SPIDER COMMENT = "wrapper 'mysql', srv 's', table 't'";
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
CREATE TABLE t2_spider (a INT) ENGINE=SPIDER COMMENT = "wrapper 'mysql', srv 's', table 't'";
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
SELECT * FROM t1_spider, t2_spider;
a a
SELECT table_name, index_name, cardinality FROM INFORMATION_SCHEMA.STATISTICS WHERE table_name IN ('t1_spider','t2_spider');
@@ -17,8 +21,14 @@ a
DROP TABLE t3_spider, t2_spider, t;
drop server s;
CREATE TABLE t1 (c INT) ENGINE=Spider COMMENT='WRAPPER "mysql",HOST "srv",TABLE "t"';
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
CREATE TABLE t2 (c INT) ENGINE=Spider COMMENT='WRAPPER "mysql",HOST "srv",TABLE "t"';
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
CREATE TABLE t3 (c INT) ENGINE=Spider COMMENT='WRAPPER "mysql",HOST "srv",TABLE "t"';
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
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
t1 SPIDER 10 NULL 0 0 0 0 0 NULL NULL NULL NULL latin1_swedish_ci NULL Unable to connect to foreign data source: srv 0
diff --git a/storage/spider/mysql-test/spider/bugfix/r/mdev_29008.result b/storage/spider/mysql-test/spider/bugfix/r/mdev_29008.result
index 66e33f42..9a360fdd 100644
--- a/storage/spider/mysql-test/spider/bugfix/r/mdev_29008.result
+++ b/storage/spider/mysql-test/spider/bugfix/r/mdev_29008.result
@@ -22,6 +22,8 @@ CREATE TABLE tbl_a (
a INT,
b INT
) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='table "tbl_a", srv "s_2_1"';
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
SELECT MIN(t2.a) AS f1, t1.b AS f2 FROM tbl_a AS t1 JOIN tbl_a AS t2 GROUP BY f2 ORDER BY f1, f2;
f1 f2
1 2
diff --git a/storage/spider/mysql-test/spider/bugfix/r/mdev_29011.result b/storage/spider/mysql-test/spider/bugfix/r/mdev_29011.result
index 04f9651b..5664690e 100644
--- a/storage/spider/mysql-test/spider/bugfix/r/mdev_29011.result
+++ b/storage/spider/mysql-test/spider/bugfix/r/mdev_29011.result
@@ -22,6 +22,8 @@ CREATE TABLE tbl_a (
a INT,
b INT
) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='table "tbl_a", srv "s_2_1"';
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
SELECT a XOR b AS f FROM tbl_a;
f
0
diff --git a/storage/spider/mysql-test/spider/bugfix/r/mdev_29163.result b/storage/spider/mysql-test/spider/bugfix/r/mdev_29163.result
index f58ab605..126c8591 100644
--- a/storage/spider/mysql-test/spider/bugfix/r/mdev_29163.result
+++ b/storage/spider/mysql-test/spider/bugfix/r/mdev_29163.result
@@ -10,8 +10,14 @@ CREATE TABLE t1 (a INT);
CREATE TABLE t2 (b INT);
CREATE TABLE t3 (c INT, PRIMARY KEY(c));
CREATE TABLE t1_spider (a INT) ENGINE=SPIDER COMMENT = "wrapper 'mysql', srv 's', table 't1'";
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
CREATE TABLE t2_spider (b INT) ENGINE=SPIDER COMMENT = "wrapper 'mysql', srv 's', table 't2'";
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
CREATE TABLE t3_spider (c INT, PRIMARY KEY(c)) ENGINE=SPIDER COMMENT = "wrapper 'mysql', srv 's', table 't3'";
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
SELECT t1_spider.* FROM t1_spider LEFT JOIN t2_spider LEFT JOIN t3_spider ON b = c ON a = b;
a
DROP TABLE t1_spider, t2_spider, t3_spider, t1, t2, t3;
diff --git a/storage/spider/mysql-test/spider/bugfix/r/mdev_29421.result b/storage/spider/mysql-test/spider/bugfix/r/mdev_29421.result
index bcbf050d..ee53da74 100644
--- a/storage/spider/mysql-test/spider/bugfix/r/mdev_29421.result
+++ b/storage/spider/mysql-test/spider/bugfix/r/mdev_29421.result
@@ -7,6 +7,8 @@ CREATE SERVER srv FOREIGN DATA WRAPPER mysql
OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
CREATE TABLE t (c INT) ENGINE=InnoDB;
CREATE TABLE t_s (c INT) ENGINE=Spider COMMENT='WRAPPER "mysql", srv "srv", TABLE "t"';
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
CREATE TABLE t1 (a INT) ENGINE=Spider;
SELECT * FROM t1;
ERROR HY000: Unable to connect to foreign data source: localhost
diff --git a/storage/spider/mysql-test/spider/bugfix/r/mdev_29447.result b/storage/spider/mysql-test/spider/bugfix/r/mdev_29447.result
index 358e131f..33f04c06 100644
--- a/storage/spider/mysql-test/spider/bugfix/r/mdev_29447.result
+++ b/storage/spider/mysql-test/spider/bugfix/r/mdev_29447.result
@@ -19,6 +19,8 @@ USE auto_test_local;
CREATE TABLE tbl_a (
a INT
) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='table "tbl_a", srv "s_2_1"';
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
SELECT TRIM(LEADING 'c' FROM a) FROM tbl_a;
TRIM(LEADING 'c' FROM a)
connection child2_1;
diff --git a/storage/spider/mysql-test/spider/bugfix/r/mdev_29456.result b/storage/spider/mysql-test/spider/bugfix/r/mdev_29456.result
index 365c3d63..5f64908d 100644
--- a/storage/spider/mysql-test/spider/bugfix/r/mdev_29456.result
+++ b/storage/spider/mysql-test/spider/bugfix/r/mdev_29456.result
@@ -10,6 +10,8 @@ OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
create table t1 (c int);
create table t2 (c int) ENGINE=Spider
COMMENT='WRAPPER "mysql", srv "srv",TABLE "t1"';
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
CREATE TABLE t3 (c INT KEY) ENGINE=Spider;
LOCK TABLE t2 WRITE;
LOCK TABLE t3 WRITE;
@@ -19,6 +21,8 @@ drop table t1, t2, t3;
CREATE TABLE t (c INT) ENGINE=InnoDB;
CREATE TABLE t1 (c INT) ENGINE=Spider;
CREATE TABLE t2 (c INT) ENGINE=Spider COMMENT='WRAPPER "mysql",srv "srv",TABLE "t"';
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
LOCK TABLES t2 WRITE;
LOCK TABLES t1 READ;
ERROR HY000: Unable to connect to foreign data source: localhost
@@ -27,6 +31,8 @@ ERROR 42S01: Table 't' already exists
drop table t, t1, t2;
CREATE TABLE t (c INT) ENGINE=InnoDB;
CREATE TABLE t2 (c INT) ENGINE=Spider COMMENT='WRAPPER "mysql",srv "srv",TABLE "t"';
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
CREATE TABLE t3 (c INT) ENGINE=InnoDB;
LOCK TABLES t2 WRITE;
LOCK TABLES mysql.proc WRITE,mysql.user WRITE;
diff --git a/storage/spider/mysql-test/spider/bugfix/r/mdev_29484.result b/storage/spider/mysql-test/spider/bugfix/r/mdev_29484.result
index cc950ac0..26bf2df4 100644
--- a/storage/spider/mysql-test/spider/bugfix/r/mdev_29484.result
+++ b/storage/spider/mysql-test/spider/bugfix/r/mdev_29484.result
@@ -19,6 +19,8 @@ USE auto_test_local;
CREATE TABLE tbl_a (
a INT
) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='table "tbl_a", srv "s_2_1"';
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
CREATE TABLE tbl_b (
a INT
) ENGINE=Spider DEFAULT CHARSET=utf8;
diff --git a/storage/spider/mysql-test/spider/bugfix/r/mdev_29502.result b/storage/spider/mysql-test/spider/bugfix/r/mdev_29502.result
index 7749898e..0d0ad383 100644
--- a/storage/spider/mysql-test/spider/bugfix/r/mdev_29502.result
+++ b/storage/spider/mysql-test/spider/bugfix/r/mdev_29502.result
@@ -11,6 +11,8 @@ INSERT INTO t VALUES (23),(48);
set @old_spider_direct_aggregate=@@session.spider_direct_aggregate;
set spider_direct_aggregate=1;
CREATE TABLE t1 (a INT KEY) ENGINE=Spider COMMENT='WRAPPER "mysql",srv "srv_mdev_29502",TABLE "t"';
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
SELECT MAX(a) FROM t1;
MAX(a)
48
@@ -39,6 +41,8 @@ DROP TABLE t, t1;
CREATE TABLE t (a INT, b INT);
INSERT INTO t VALUES (23, -1),(48, 97);
CREATE TABLE t1 (a INT, b INT) ENGINE=Spider COMMENT='WRAPPER "mysql",srv "srv_mdev_29502",TABLE "t"';
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
SELECT MAX(a + b), SUM(a - b) FROM t1;
MAX(a + b) SUM(a - b)
145 -25
@@ -49,6 +53,8 @@ DROP TABLE t, t1;
CREATE TABLE t (a INT);
INSERT INTO t VALUES (23),(97),(42);
CREATE TABLE t1 (a INT) ENGINE=Spider COMMENT='WRAPPER "mysql",srv "srv_mdev_29502",TABLE "t"';
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
SELECT IF(COUNT(a > 0),'Y','N'), MAX(a) FROM t1;
IF(COUNT(a > 0),'Y','N') MAX(a)
Y 97
diff --git a/storage/spider/mysql-test/spider/bugfix/r/mdev_29562.result b/storage/spider/mysql-test/spider/bugfix/r/mdev_29562.result
index 561ce18a..d22e7cda 100644
--- a/storage/spider/mysql-test/spider/bugfix/r/mdev_29562.result
+++ b/storage/spider/mysql-test/spider/bugfix/r/mdev_29562.result
@@ -28,6 +28,8 @@ ERROR HY000: Table storage engine 'SPIDER' does not support the create option 'C
CREATE TABLE tbl_a (
a INT
) ENGINE=Spider CHARSET utf8 COMMENT='table "tbl_a", srv "s_2_1"';
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
SELECT * FROM tbl_a;
a
ALTER TABLE tbl_a CONVERT TO CHARACTER SET utf16;
@@ -35,6 +37,8 @@ ERROR HY000: Table storage engine 'SPIDER' does not support the create option 'C
ALTER TABLE tbl_a CONVERT TO CHARACTER SET utf16le;
ERROR HY000: Table storage engine 'SPIDER' does not support the create option 'CHARSET utf16le'
ALTER TABLE tbl_a CONVERT TO CHARACTER SET latin1;
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
connection child2_1;
diff --git a/storage/spider/mysql-test/spider/bugfix/r/mdev_29644.result b/storage/spider/mysql-test/spider/bugfix/r/mdev_29644.result
index b52cecc5..7c63867a 100644
--- a/storage/spider/mysql-test/spider/bugfix/r/mdev_29644.result
+++ b/storage/spider/mysql-test/spider/bugfix/r/mdev_29644.result
@@ -20,6 +20,8 @@ USE auto_test_local;
CREATE TABLE tbl_a (
a CHAR(255)
) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='table "tbl_a", srv "s_2_1"';
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
SET sql_mode='';
INSERT INTO tbl_a VALUES ("this will be truncated");
NOT FOUND /\[WARN SPIDER RESULT\].* Warning 1265 Data truncated for column 'a' at row 1.*/ in mysqld.1.1.err
diff --git a/storage/spider/mysql-test/spider/bugfix/r/mdev_29653.result b/storage/spider/mysql-test/spider/bugfix/r/mdev_29653.result
index abbcfcb7..269791b3 100644
--- a/storage/spider/mysql-test/spider/bugfix/r/mdev_29653.result
+++ b/storage/spider/mysql-test/spider/bugfix/r/mdev_29653.result
@@ -19,6 +19,8 @@ USE auto_test_local;
CREATE TABLE ts (
c INT
) ENGINE=Spider COMMENT='table "t", srv "s_2_1"';
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
SELECT 1 FROM ts WHERE ROW(c, c) NOT IN ((0,0),(1,1));
1
connection master_1;
diff --git a/storage/spider/mysql-test/spider/bugfix/r/mdev_29667.result b/storage/spider/mysql-test/spider/bugfix/r/mdev_29667.result
index f2e90760..896acc0f 100644
--- a/storage/spider/mysql-test/spider/bugfix/r/mdev_29667.result
+++ b/storage/spider/mysql-test/spider/bugfix/r/mdev_29667.result
@@ -19,6 +19,8 @@ USE auto_test_local;
CREATE TABLE tbl_a (
a INT
) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='table "tbl_a", srv "s_2_1"';
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
CREATE TABLE tbl_b (
a INT
) ENGINE=Spider DEFAULT CHARSET=utf8;
diff --git a/storage/spider/mysql-test/spider/bugfix/r/mdev_29676.result b/storage/spider/mysql-test/spider/bugfix/r/mdev_29676.result
new file mode 100644
index 00000000..72c624c9
--- /dev/null
+++ b/storage/spider/mysql-test/spider/bugfix/r/mdev_29676.result
@@ -0,0 +1,47 @@
+#
+# MDEV-29676 Dual thread hang in 'closing tables' and 'Waiting for table metadata lock' on Spider CREATE OR REPLACE TABLE
+#
+for master_1
+for child2
+for child3
+CREATE SERVER srv FOREIGN DATA WRAPPER MYSQL OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
+
+# length-0 self-reference
+
+CREATE TABLE t (c INT) ENGINE=Spider COMMENT='WRAPPER "mysql", srv "srv",TABLE "t"';
+CREATE OR REPLACE TABLE t (c INT);
+Warnings:
+Error 1205 Lock wait timeout exceeded; try restarting transaction
+Error 12722 Table test.t open lock wait timeout. Please check for self-reference.
+SHOW CREATE TABLE t;
+Table Create Table
+t CREATE TABLE `t` (
+ `c` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+DROP TABLE t;
+
+# length-2 self-reference
+
+CREATE TABLE t2 (c int);
+CREATE TABLE t1 (c int) ENGINE=Spider COMMENT='WRAPPER "mysql", srv "srv",TABLE "t2"';
+CREATE TABLE t0 (c int) ENGINE=Spider COMMENT='WRAPPER "mysql", srv "srv",TABLE "t1"';
+ALTER TABLE t2 ENGINE=Spider COMMENT='WRAPPER "mysql", srv "srv",TABLE "t0"';
+CREATE OR REPLACE TABLE t0 (c int);
+Warnings:
+Error 1205 Lock wait timeout exceeded; try restarting transaction
+Error 12722 Table test.t1 open lock wait timeout. Please check for self-reference.
+SHOW CREATE TABLE t0;
+Table Create Table
+t0 CREATE TABLE `t0` (
+ `c` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+CREATE OR REPLACE TABLE t1 (c int);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+drop TABLE t0, t1, t2;
+for master_1
+for child2
+for child3
diff --git a/storage/spider/mysql-test/spider/bugfix/r/mdev_29963.result b/storage/spider/mysql-test/spider/bugfix/r/mdev_29963.result
index 60451596..52a923eb 100644
--- a/storage/spider/mysql-test/spider/bugfix/r/mdev_29963.result
+++ b/storage/spider/mysql-test/spider/bugfix/r/mdev_29963.result
@@ -9,25 +9,35 @@ CREATE SERVER srv FOREIGN DATA WRAPPER mysql
OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
CREATE TABLE t (a INT) ENGINE=Spider;
CREATE TABLE t2 (b INT) ENGINE=Spider COMMENT='WRAPPER "mysql",srv "srv",TABLE "t"';
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
LOCK TABLES t AS a READ,t2 AS b LOW_PRIORITY WRITE,t2 AS c WRITE;
ERROR HY000: Unable to connect to foreign data source: localhost
DROP TABLE t2;
CREATE TABLE t2 (c INT) ENGINE=Spider COMMENT='WRAPPER "mysql",srv "srv",TABLE "t"';
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
LOCK TABLES t2 WRITE;
ERROR HY000: Unable to connect to foreign data source: localhost
DROP TABLE t2,t;
CREATE TABLE t (a INT);
CREATE TABLE t1 (a INT) ENGINE=Spider;
CREATE TABLE t2 (b INT) ENGINE=Spider COMMENT='WRAPPER "mysql",srv "srv",TABLE "t"';
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
LOCK TABLES t1 READ, t2 WRITE;
ERROR HY000: Unable to connect to foreign data source: localhost
DROP TABLE t2;
CREATE TABLE t2 (c INT) ENGINE=Spider COMMENT='WRAPPER "mysql",srv "srv",TABLE "t"';
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
LOCK TABLES t2 WRITE;
UNLOCK TABLES;
DROP TABLE t, t1, t2;
CREATE TABLE t1 (c INT) ENGINE=Spider;
CREATE TABLE t2 (c INT) ENGINE=Spider COMMENT="WRAPPER 'mysql',srv 'srv',TABLE 't1'";
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
LOCK TABLES t1 WRITE,t2 WRITE;
ERROR HY000: Unable to connect to foreign data source: localhost
TRUNCATE t2;
diff --git a/storage/spider/mysql-test/spider/bugfix/r/mdev_30014.result b/storage/spider/mysql-test/spider/bugfix/r/mdev_30014.result
index e971f323..94fdcd20 100644
--- a/storage/spider/mysql-test/spider/bugfix/r/mdev_30014.result
+++ b/storage/spider/mysql-test/spider/bugfix/r/mdev_30014.result
@@ -10,6 +10,8 @@ OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
create table t1 (c int);
create table t2 (c int) ENGINE=Spider
COMMENT='WRAPPER "mysql", srv "srv",TABLE "t1"';
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
CREATE TABLE t3 (c INT KEY) ENGINE=Spider;
LOCK TABLE t2 WRITE,t3 WRITE;
ERROR HY000: Unable to connect to foreign data source: localhost
@@ -23,6 +25,8 @@ drop table t1, t2, t3, t4;
create table t1 (c int);
create table t2 (c int) ENGINE=Spider
COMMENT='WRAPPER "mysql", srv "srv",TABLE "t1"';
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
CREATE TABLE t3 (c INT KEY) ENGINE=Spider;
LOCK TABLE t2 WRITE, t3 WRITE;
ERROR HY000: Unable to connect to foreign data source: localhost
diff --git a/storage/spider/mysql-test/spider/bugfix/r/mdev_30191.result b/storage/spider/mysql-test/spider/bugfix/r/mdev_30191.result
index 941f210c..e2b5ab57 100644
--- a/storage/spider/mysql-test/spider/bugfix/r/mdev_30191.result
+++ b/storage/spider/mysql-test/spider/bugfix/r/mdev_30191.result
@@ -17,6 +17,8 @@ USE auto_test_local;
CREATE TABLE tbl_a (
c INT
) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='table "tbl_a", srv "s_2_1"';
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
CREATE TABLE tbl_b (c INT);
CREATE PROCEDURE sp() BEGIN
DECLARE v1 DATE;
diff --git a/storage/spider/mysql-test/spider/bugfix/r/mdev_30392.result b/storage/spider/mysql-test/spider/bugfix/r/mdev_30392.result
index cefa5248..6f569dd2 100644
--- a/storage/spider/mysql-test/spider/bugfix/r/mdev_30392.result
+++ b/storage/spider/mysql-test/spider/bugfix/r/mdev_30392.result
@@ -9,6 +9,8 @@ CREATE SERVER srv FOREIGN DATA WRAPPER MYSQL OPTIONS (SOCKET "$MASTER_1_MYSOCK",
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (1),(2);
CREATE TABLE t2 (a INT) ENGINE=SPIDER COMMENT = "wrapper 'mysql', srv 'srv', table 't1'";
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
SELECT a FROM t2 WHERE a IN ( SELECT a FROM t2 );
a
1
diff --git a/storage/spider/mysql-test/spider/bugfix/r/mdev_31117.result b/storage/spider/mysql-test/spider/bugfix/r/mdev_31117.result
index 2fb7a658..dfff5a79 100644
--- a/storage/spider/mysql-test/spider/bugfix/r/mdev_31117.result
+++ b/storage/spider/mysql-test/spider/bugfix/r/mdev_31117.result
@@ -14,6 +14,7 @@ create table t1 (c int) ENGINE=Spider COMMENT='WRAPPER "mysql", "srv" "srv",TABL
ERROR HY000: The connect info '"srv" "srv",TABLE "t2"' is invalid
create table t1 (c int) ENGINE=Spider CONNECTION='WRAPPER "mysql", srv \'srv\',TABLE "t2", password "say \\"hello\\ world!\\""';
Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
Warning 138 The high availability feature of Spider has been deprecated and will be removed in a future release
drop table t1, t2;
drop server srv;
diff --git a/storage/spider/mysql-test/spider/bugfix/r/mdev_31338.result b/storage/spider/mysql-test/spider/bugfix/r/mdev_31338.result
index f156cf38..ccd91256 100644
--- a/storage/spider/mysql-test/spider/bugfix/r/mdev_31338.result
+++ b/storage/spider/mysql-test/spider/bugfix/r/mdev_31338.result
@@ -8,6 +8,8 @@ set spider_same_server_link=1;
CREATE SERVER srv FOREIGN DATA WRAPPER MYSQL OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
CREATE TABLE t (c BLOB) ENGINE=InnoDB;
CREATE TABLE ts (c BLOB) ENGINE=Spider COMMENT='WRAPPER "mysql",srv "srv",TABLE "t"';
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
SELECT TRIM(BOTH ' ' FROM c) FROM ts ORDER BY c;
TRIM(BOTH ' ' FROM c)
drop table t, ts;
diff --git a/storage/spider/mysql-test/spider/bugfix/r/mdev_31463.result b/storage/spider/mysql-test/spider/bugfix/r/mdev_31463.result
new file mode 100644
index 00000000..60e24cfc
--- /dev/null
+++ b/storage/spider/mysql-test/spider/bugfix/r/mdev_31463.result
@@ -0,0 +1,44 @@
+#
+# MDEV-31463 SIGSEGV in server_mysql_send_query | server_mysql_real_query
+#
+for master_1
+for child2
+child2_1
+child2_2
+child2_3
+for child3
+connection child2_1;
+CREATE DATABASE auto_test_remote;
+USE auto_test_remote;
+CREATE TABLE t1 (a INT) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+connection master_1;
+CREATE DATABASE auto_test_local;
+USE auto_test_local;
+CREATE TABLE t2 (a INT) ENGINE=Spider COMMENT='table "t1", srv "s_2_1"';
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+connect master_1_another, localhost, root, , auto_test_local, $MASTER_1_MYPORT, $MASTER_1_MYSOCK;
+SET DEBUG_SYNC='spider_set_lock_wait_timeout_before_query SIGNAL ready WAIT_FOR go';
+insert into t2 values (42);
+connection master_1;
+SET DEBUG_SYNC='now WAIT_FOR ready';
+connection child2_1;
+connection master_1;
+SET DEBUG_SYNC='now SIGNAL go';
+connection master_1_another;
+ERROR HY000: Got an error writing communication packets
+connection master_1;
+DROP DATABASE IF EXISTS auto_test_local;
+connection child2_1;
+# restart
+connection child2_1;
+DROP DATABASE IF EXISTS auto_test_remote;
+for master_1
+for child2
+child2_1
+child2_2
+child2_3
+for child3
+#
+# end test
+#
diff --git a/storage/spider/mysql-test/spider/bugfix/r/mdev_31524.result b/storage/spider/mysql-test/spider/bugfix/r/mdev_31524.result
deleted file mode 100644
index 26877967..00000000
--- a/storage/spider/mysql-test/spider/bugfix/r/mdev_31524.result
+++ /dev/null
@@ -1,51 +0,0 @@
-
-MDEV-31524 Spider variables that double as table params overriding mechanism is buggy
-
-for master_1
-for child2
-for child3
-SET @old_spider_read_only_mode = @@session.spider_read_only_mode;
-set spider_same_server_link=1;
-CREATE SERVER $srv FOREIGN DATA WRAPPER MYSQL OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
-set session spider_read_only_mode = default;
-create table t2 (c int);
-create table t1 (c int) ENGINE=Spider COMMENT='WRAPPER "mysql", srv "srv_mdev_31524",TABLE "t2"';
-/* 1 */ insert into t1 values (42);
-drop table t1, t2;
-set session spider_read_only_mode = 1;
-create table t2 (c int);
-create table t1 (c int) ENGINE=Spider COMMENT='WRAPPER "mysql", srv "srv_mdev_31524",TABLE "t2"';
-/* 2 */ insert into t1 values (42);
-ERROR HY000: Table 'test.t1' is read only
-drop table t1, t2;
-set session spider_read_only_mode = -1;
-Warnings:
-Warning 138 The option value -1 (fallback to default) is deprecated and will be removed in a future release
-create table t2 (c int);
-create table t1 (c int) ENGINE=Spider COMMENT='WRAPPER "mysql", srv "srv_mdev_31524",TABLE "t2"';
-/* 3 */ insert into t1 values (42);
-drop table t1, t2;
-SET session spider_read_only_mode = default;
-create table t2 (c int);
-create table t1 (c int) ENGINE=Spider COMMENT='read_only_mode "1", WRAPPER "mysql", srv "srv_mdev_31524",TABLE "t2"';
-/* 4 */ insert into t1 values (42);
-ERROR HY000: Table 'test.t1' is read only
-drop table t1, t2;
-set session spider_read_only_mode = 1;
-create table t2 (c int);
-create table t1 (c int) ENGINE=Spider COMMENT='read_only_mode "0", WRAPPER "mysql", srv "srv_mdev_31524",TABLE "t2"';
-/* 5 */ insert into t1 values (42);
-drop table t1, t2;
-SET session spider_read_only_mode = -1;
-Warnings:
-Warning 138 The option value -1 (fallback to default) is deprecated and will be removed in a future release
-create table t2 (c int);
-create table t1 (c int) ENGINE=Spider COMMENT='read_only_mode "1", WRAPPER "mysql", srv "srv_mdev_31524",TABLE "t2"';
-/* 6 */ insert into t1 values (42);
-ERROR HY000: Table 'test.t1' is read only
-drop table t1, t2;
-drop server srv_mdev_31524;
-SET session spider_read_only_mode = @old_spider_read_only_mode;
-for master_1
-for child2
-for child3
diff --git a/storage/spider/mysql-test/spider/bugfix/r/mdev_31645.result b/storage/spider/mysql-test/spider/bugfix/r/mdev_31645.result
index 5197abd3..5bfee3b1 100644
--- a/storage/spider/mysql-test/spider/bugfix/r/mdev_31645.result
+++ b/storage/spider/mysql-test/spider/bugfix/r/mdev_31645.result
@@ -8,6 +8,8 @@ set spider_same_server_link=1;
CREATE SERVER srv FOREIGN DATA WRAPPER MYSQL OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
CREATE TABLE t1 ( a bigint(20) NOT NULL, b bigint(20) DEFAULT 0, PRIMARY KEY (a));
CREATE TABLE t2 ( a bigint(20) NOT NULL, b bigint(20) DEFAULT 0, PRIMARY KEY (a)) ENGINE=SPIDER COMMENT='srv "srv", WRAPPER "mysql", TABLE "t1"';
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
SELECT * FROM t2 WHERE b IN (SELECT b FROM t2 WHERE a > 10);
a b
SELECT * FROM t2
diff --git a/storage/spider/mysql-test/spider/bugfix/r/mdev_31996.result b/storage/spider/mysql-test/spider/bugfix/r/mdev_31996.result
index cbc91432..0f8915d4 100644
--- a/storage/spider/mysql-test/spider/bugfix/r/mdev_31996.result
+++ b/storage/spider/mysql-test/spider/bugfix/r/mdev_31996.result
@@ -8,11 +8,15 @@ set session spider_delete_all_rows_type=0;
create table t2 (c int);
create table t1 (c int) ENGINE=Spider
COMMENT='WRAPPER "mysql", srv "srv",TABLE "t2", delete_all_rows_type "0"';
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
delete from t1;
drop table t1, t2;
create table t2 (c int);
create table t1 (c int) ENGINE=Spider
COMMENT='WRAPPER "mysql", srv "srv",TABLE "t2", delete_all_rows_type "0"';
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
insert ignore into t1 values (42), (378);
select * from t1;
c
@@ -25,11 +29,15 @@ drop table t1, t2;
create table t2 (c int);
create table t1 (c int) ENGINE=Spider
COMMENT='WRAPPER "mysql", srv "srv",TABLE "t2", delete_all_rows_type "0"';
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
truncate t1;
drop table t1, t2;
create table t2 (c int);
create table t1 (c int) ENGINE=Spider
COMMENT='WRAPPER "mysql", srv "srv",TABLE "t2", delete_all_rows_type "0"';
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
insert ignore into t1 values (42), (378);
select * from t1;
c
diff --git a/storage/spider/mysql-test/spider/bugfix/r/mdev_32486.result b/storage/spider/mysql-test/spider/bugfix/r/mdev_32486.result
new file mode 100644
index 00000000..9e8b9c5a
--- /dev/null
+++ b/storage/spider/mysql-test/spider/bugfix/r/mdev_32486.result
@@ -0,0 +1,20 @@
+#
+# MDEV-32486 Assertion `!trx->alloc_line_no[id] || trx->alloc_line_no[id] == line_no' failed in spider_alloc_mem_calc
+#
+for master_1
+for child2
+for child3
+CREATE TABLE t (c INT) ENGINE=Spider REMOTE_PORT="1";
+DROP TABLE t;
+CREATE TABLE t (c INT) ENGINE=Spider COMMENT="WRAPPER 'mysql', SERVER 's',MONITORING_KIND '1'";
+ERROR HY000: The foreign server name you are trying to reference does not exist. Data source error: s
+CREATE TABLE t (c INT) ENGINE=Spider COMMENT="WRAPPER 'mysql',SRV 's',MONITORING_KIND '2'";
+ERROR HY000: The foreign server name you are trying to reference does not exist. Data source error: s
+CREATE TABLE t (c INT) ENGINE=Spider REMOTE_PORT="1";
+drop table t;
+for master_1
+for child2
+for child3
+#
+# end of test mdev_32486
+#
diff --git a/storage/spider/mysql-test/spider/bugfix/r/mdev_32986.result b/storage/spider/mysql-test/spider/bugfix/r/mdev_32986.result
index c3bdef98..e3b4da29 100644
--- a/storage/spider/mysql-test/spider/bugfix/r/mdev_32986.result
+++ b/storage/spider/mysql-test/spider/bugfix/r/mdev_32986.result
@@ -10,6 +10,8 @@ OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
create table t2 (c varchar(16));
create table t1 (c varchar(16)) ENGINE=Spider
COMMENT='WRAPPER "mysql", srv "srv",TABLE "t2"';
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
insert into t1 values ('TestSpiderRegex');
select c from t1 where c regexp '(Test|Spider|Regex)';
c
diff --git a/storage/spider/mysql-test/spider/bugfix/r/mdev_32999.result b/storage/spider/mysql-test/spider/bugfix/r/mdev_32999.result
new file mode 100644
index 00000000..42288a2f
--- /dev/null
+++ b/storage/spider/mysql-test/spider/bugfix/r/mdev_32999.result
@@ -0,0 +1,18 @@
+#
+# MDEV-32999 ERROR 138 instead of warning, and potential error masking
+#
+for master_1
+for child2
+for child3
+set spider_same_server_link=on;
+CREATE SERVER srv FOREIGN DATA WRAPPER mysql
+OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
+CREATE TABLE t ENGINE=Spider COMMENT='srv "srv",table "t1"';
+ERROR HY000: Remote table 'test.t1' is not found
+drop server srv;
+for master_1
+for child2
+for child3
+#
+# end of test mdev_32999
+#
diff --git a/storage/spider/mysql-test/spider/bugfix/r/mdev_33191.result b/storage/spider/mysql-test/spider/bugfix/r/mdev_33191.result
index 75ca6c2f..d4c5a74a 100644
--- a/storage/spider/mysql-test/spider/bugfix/r/mdev_33191.result
+++ b/storage/spider/mysql-test/spider/bugfix/r/mdev_33191.result
@@ -3,9 +3,11 @@ set spider_same_server_link=on;
CREATE TABLE t2(c INT);
CREATE TABLE t1(c INT) ENGINE=Spider COMMENT='socket "$SOCKET", user "root", table "t2 t3"';
Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
Warning 138 The high availability feature of Spider has been deprecated and will be removed in a future release
ALTER TABLE t1 ENGINE=Spider;
Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
Warning 138 The high availability feature of Spider has been deprecated and will be removed in a future release
TRUNCATE TABLE t1;
ERROR 42S02: Table 'test.t3' doesn't exist
diff --git a/storage/spider/mysql-test/spider/bugfix/r/mdev_33242.result b/storage/spider/mysql-test/spider/bugfix/r/mdev_33242.result
index bbbc4499..1be8d48e 100644
--- a/storage/spider/mysql-test/spider/bugfix/r/mdev_33242.result
+++ b/storage/spider/mysql-test/spider/bugfix/r/mdev_33242.result
@@ -1,4 +1,6 @@
set @old_old_mode=@@global.old_mode;
set global old_mode=4;
+Warnings:
+Warning 1287 'ZERO_DATE_TIME_CAST' is deprecated and will be removed in a future release
INSTALL SONAME 'ha_spider.so';
set global old_mode=@old_old_mode;
diff --git a/storage/spider/mysql-test/spider/bugfix/r/mdev_33679.result b/storage/spider/mysql-test/spider/bugfix/r/mdev_33679.result
index c021bc70..0f7f2048 100644
--- a/storage/spider/mysql-test/spider/bugfix/r/mdev_33679.result
+++ b/storage/spider/mysql-test/spider/bugfix/r/mdev_33679.result
@@ -10,9 +10,13 @@ CREATE TABLE `t1` (`c` INT(10) UNSIGNED NOT NULL, `b` VARCHAR(255) NOT NULL , PR
CREATE TABLE `t2` (`a` INT(10) UNSIGNED NOT NULL, `c` INT(10) UNSIGNED NOT NULL ) ENGINE=MYISAM;
SET spider_same_server_link= on;
CREATE TABLE `t1_spider` (`c` INT(10) UNSIGNED NOT NULL, `b` VARCHAR(255) NOT NULL , PRIMARY KEY (`c`) USING BTREE ) COMMENT='wrapper "mysql",srv "srv", table "t1"' ENGINE=SPIDER;
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
CREATE TABLE `t2_spider` (`a` INT(10) UNSIGNED NOT NULL, `c` INT(10) UNSIGNED NOT NULL
, PRIMARY KEY (`a`) USING BTREE
) COMMENT='wrapper "mysql",srv "srv",table "t2"' ENGINE=SPIDER;
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
INSERT INTO t1_spider VALUES(1,'oooo');
INSERT INTO t2_spider VALUES(1,1);
SELECT t2_spider.a,t1_spider.c FRoM t2_spider LEFT join t1_spider ON (t2_spider.c = t1_spider.c) WHERE t2_spider.a = 1;
diff --git a/storage/spider/mysql-test/spider/bugfix/r/mdev_34003.result b/storage/spider/mysql-test/spider/bugfix/r/mdev_34003.result
index b78f18d1..a661d5bc 100644
--- a/storage/spider/mysql-test/spider/bugfix/r/mdev_34003.result
+++ b/storage/spider/mysql-test/spider/bugfix/r/mdev_34003.result
@@ -8,6 +8,8 @@ create table t2 (c INT KEY,c1 BLOB,c2 TEXT) ENGINE=InnoDB;
INSERT INTO t2 VALUES (0,1,0),(1,0,0),(2,0,0);
create table t1 (c INT KEY,c1 BLOB,c2 TEXT) ENGINE=Spider
COMMENT='WRAPPER "mysql", srv "srv",TABLE "t2"';
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
SELECT * FROM t1 WHERE c=0;
c c1 c2
0 1 0
diff --git a/storage/spider/mysql-test/spider/bugfix/r/quick_mode_0.result b/storage/spider/mysql-test/spider/bugfix/r/quick_mode_0.result
index f785ad35..7181294d 100644
--- a/storage/spider/mysql-test/spider/bugfix/r/quick_mode_0.result
+++ b/storage/spider/mysql-test/spider/bugfix/r/quick_mode_0.result
@@ -44,6 +44,10 @@ CREATE TABLE tbl_b (
pkey int NOT NULL,
PRIMARY KEY (pkey)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_2
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
INSERT INTO tbl_a (pkey) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
INSERT INTO tbl_a (pkey) VALUES (10),(11),(12),(13),(14),(15),(16),(17),(18),(19);
INSERT INTO tbl_a (pkey) VALUES (20),(21),(22),(23),(24),(25),(26),(27),(28),(29);
diff --git a/storage/spider/mysql-test/spider/bugfix/r/quick_mode_1.result b/storage/spider/mysql-test/spider/bugfix/r/quick_mode_1.result
index 89a07bf6..4ec6dd81 100644
--- a/storage/spider/mysql-test/spider/bugfix/r/quick_mode_1.result
+++ b/storage/spider/mysql-test/spider/bugfix/r/quick_mode_1.result
@@ -44,6 +44,10 @@ CREATE TABLE tbl_b (
pkey int NOT NULL,
PRIMARY KEY (pkey)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_2
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
INSERT INTO tbl_a (pkey) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
INSERT INTO tbl_a (pkey) VALUES (10),(11),(12),(13),(14),(15),(16),(17),(18),(19);
INSERT INTO tbl_a (pkey) VALUES (20),(21),(22),(23),(24),(25),(26),(27),(28),(29);
@@ -57,6 +61,10 @@ TRUNCATE TABLE mysql.general_log;
connection child2_2;
TRUNCATE TABLE mysql.general_log;
connection master_1;
+explain SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE a index PRIMARY PRIMARY 4 NULL 2 Using index
+1 SIMPLE b eq_ref PRIMARY PRIMARY 4 auto_test_local.a.pkey 1 Using index
SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey;
pkey
0
diff --git a/storage/spider/mysql-test/spider/bugfix/r/quick_mode_2.result b/storage/spider/mysql-test/spider/bugfix/r/quick_mode_2.result
index cc94cfe4..6e50a263 100644
--- a/storage/spider/mysql-test/spider/bugfix/r/quick_mode_2.result
+++ b/storage/spider/mysql-test/spider/bugfix/r/quick_mode_2.result
@@ -44,6 +44,10 @@ CREATE TABLE tbl_b (
pkey int NOT NULL,
PRIMARY KEY (pkey)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_2
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
INSERT INTO tbl_a (pkey) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
INSERT INTO tbl_a (pkey) VALUES (10),(11),(12),(13),(14),(15),(16),(17),(18),(19);
INSERT INTO tbl_a (pkey) VALUES (20),(21),(22),(23),(24),(25),(26),(27),(28),(29);
diff --git a/storage/spider/mysql-test/spider/bugfix/r/quick_mode_3.result b/storage/spider/mysql-test/spider/bugfix/r/quick_mode_3.result
index bc1daa77..e614c724 100644
--- a/storage/spider/mysql-test/spider/bugfix/r/quick_mode_3.result
+++ b/storage/spider/mysql-test/spider/bugfix/r/quick_mode_3.result
@@ -44,6 +44,10 @@ CREATE TABLE tbl_b (
pkey int NOT NULL,
PRIMARY KEY (pkey)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_2
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
INSERT INTO tbl_a (pkey) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
INSERT INTO tbl_a (pkey) VALUES (10),(11),(12),(13),(14),(15),(16),(17),(18),(19);
INSERT INTO tbl_a (pkey) VALUES (20),(21),(22),(23),(24),(25),(26),(27),(28),(29);
diff --git a/storage/spider/mysql-test/spider/bugfix/r/return_found_rows_insert.result b/storage/spider/mysql-test/spider/bugfix/r/return_found_rows_insert.result
index 24f9cf7c..d77f7b0a 100644
--- a/storage/spider/mysql-test/spider/bugfix/r/return_found_rows_insert.result
+++ b/storage/spider/mysql-test/spider/bugfix/r/return_found_rows_insert.result
@@ -28,6 +28,8 @@ dt date NOT NULL,
tm time NOT NULL,
PRIMARY KEY (skey)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
INSERT INTO tbl_a (skey, dt, tm) VALUES (0, '2012-01-01', '12:00:00'),(1, '2012-02-01', '12:00:00'),(2, '2012-03-01', '12:00:00'),(3, '2012-04-01', '12:00:00'),(4, '2012-05-01', '12:00:00'),(5, '2012-06-01', '12:00:00'),(6, '2012-07-01', '12:00:00'),(7, '2012-08-01', '12:00:00'),(8, '2012-09-01', '12:00:00'),(9, '2012-10-01', '12:00:00');
FLUSH TABLES;
diff --git a/storage/spider/mysql-test/spider/bugfix/r/return_found_rows_update.result b/storage/spider/mysql-test/spider/bugfix/r/return_found_rows_update.result
index ecca29c8..d857c7ff 100644
--- a/storage/spider/mysql-test/spider/bugfix/r/return_found_rows_update.result
+++ b/storage/spider/mysql-test/spider/bugfix/r/return_found_rows_update.result
@@ -28,6 +28,8 @@ dt date NOT NULL,
tm time NOT NULL,
KEY idx1 (skey,dt)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
INSERT INTO tbl_a (skey, dt, tm) VALUES (0, '2012-01-01', '12:00:00'),(1, '2012-02-01', '12:00:00'),(2, '2012-03-01', '12:00:00'),(3, '2012-04-01', '12:00:00'),(4, '2012-05-01', '12:00:00'),(5, '2012-06-01', '12:00:00'),(6, '2012-07-01', '12:00:00'),(7, '2012-08-01', '12:00:00'),(8, '2012-09-01', '12:00:00'),(9, '2012-10-01', '12:00:00');
INSERT INTO tbl_a (skey, dt, tm) VALUES (0, '2013-01-01', '13:00:00'),(1, '2013-02-01', '13:00:00'),(2, '2013-03-01', '13:00:00'),(3, '2013-04-01', '13:00:00'),(4, '2013-05-01', '13:00:00'),(5, '2013-06-01', '13:00:00'),(6, '2013-07-01', '13:00:00'),(7, '2013-08-01', '13:00:00'),(8, '2013-09-01', '13:00:00'),(9, '2013-10-01', '13:00:00');
INSERT INTO tbl_a (skey, dt, tm) VALUES (0, '2012-11-01', '11:00:00'),(1, '2012-12-01', '11:00:00'),(2, '2012-11-30', '11:00:00'),(3, '2012-11-29', '11:00:00'),(4, '2012-11-28', '11:00:00'),(5, '2012-11-27', '11:00:00'),(6, '2012-11-26', '11:00:00'),(7, '2012-11-25', '11:00:00'),(8, '2012-11-24', '11:00:00'),(9, '2012-11-23', '11:00:00');
diff --git a/storage/spider/mysql-test/spider/bugfix/r/same_server_link.result b/storage/spider/mysql-test/spider/bugfix/r/same_server_link.result
index 1f417756..d0bb091a 100644
--- a/storage/spider/mysql-test/spider/bugfix/r/same_server_link.result
+++ b/storage/spider/mysql-test/spider/bugfix/r/same_server_link.result
@@ -20,6 +20,8 @@ CREATE TABLE tbl_a (
pkey int NOT NULL,
PRIMARY KEY (pkey)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
CREATE TABLE tbl_b (
pkey int NOT NULL,
PRIMARY KEY (pkey)
diff --git a/storage/spider/mysql-test/spider/bugfix/r/select_by_null.result b/storage/spider/mysql-test/spider/bugfix/r/select_by_null.result
index 182dd31a..9acd4e5b 100644
--- a/storage/spider/mysql-test/spider/bugfix/r/select_by_null.result
+++ b/storage/spider/mysql-test/spider/bugfix/r/select_by_null.result
@@ -26,6 +26,8 @@ CREATE TABLE tbl_a (
pkey int NOT NULL,
PRIMARY KEY (pkey)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
INSERT INTO tbl_a (pkey) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
INSERT INTO tbl_a (pkey) VALUES (10),(11),(12),(13),(14),(15),(16),(17),(18),(19);
INSERT INTO tbl_a (pkey) VALUES (20),(21),(22),(23),(24),(25),(26),(27),(28),(29);
diff --git a/storage/spider/mysql-test/spider/bugfix/r/select_with_backquote.result b/storage/spider/mysql-test/spider/bugfix/r/select_with_backquote.result
index bfdf8796..1e02093e 100644
--- a/storage/spider/mysql-test/spider/bugfix/r/select_with_backquote.result
+++ b/storage/spider/mysql-test/spider/bugfix/r/select_with_backquote.result
@@ -27,6 +27,8 @@ pkey int NOT NULL,
txt_utf8 char(8) NOT NULL,
PRIMARY KEY (pkey)
) MASTER_1_ENGINE DEFAULT CHARACTER SET utf8 MASTER_1_COMMENT_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
INSERT INTO tbl_a (pkey,txt_utf8) VALUES (0,'01234567'),(1,'12345678'),(2,'23456789'),(3,'34567890'),(4,'45678901'),(5,'56789012'),(6,'67890123'),(7,'78901234'),(8,'89012345'),(9,'90123456');
FLUSH TABLES;
diff --git a/storage/spider/mysql-test/spider/bugfix/r/self_reference.result b/storage/spider/mysql-test/spider/bugfix/r/self_reference.result
index 1ce9c60a..3be2de03 100644
--- a/storage/spider/mysql-test/spider/bugfix/r/self_reference.result
+++ b/storage/spider/mysql-test/spider/bugfix/r/self_reference.result
@@ -18,6 +18,8 @@ CREATE TABLE tbl_a (
pkey int NOT NULL,
PRIMARY KEY (pkey)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
select test 1
connection master_1;
diff --git a/storage/spider/mysql-test/spider/bugfix/r/self_reference_multi.result b/storage/spider/mysql-test/spider/bugfix/r/self_reference_multi.result
index 0118f575..043cd95d 100644
--- a/storage/spider/mysql-test/spider/bugfix/r/self_reference_multi.result
+++ b/storage/spider/mysql-test/spider/bugfix/r/self_reference_multi.result
@@ -10,8 +10,14 @@ set global spider_same_server_link=1;
CREATE SERVER $srv FOREIGN DATA WRAPPER MYSQL OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
create table t2 (c int);
create table t1 (c int) ENGINE=Spider COMMENT='WRAPPER "mysql", srv "srv_self_reference_multi",TABLE "t2"';
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
create table t0 (c int) ENGINE=Spider COMMENT='WRAPPER "mysql", srv "srv_self_reference_multi",TABLE "t1"';
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
alter table t2 ENGINE=Spider COMMENT='WRAPPER "mysql", srv "srv_self_reference_multi",TABLE "t0"';
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
select * from t0;
ERROR HY000: An infinite loop is detected when opening table test.t0
select * from t1;
diff --git a/storage/spider/mysql-test/spider/bugfix/r/slave_trx_isolation.result b/storage/spider/mysql-test/spider/bugfix/r/slave_trx_isolation.result
index 239402a5..2282ecee 100644
--- a/storage/spider/mysql-test/spider/bugfix/r/slave_trx_isolation.result
+++ b/storage/spider/mysql-test/spider/bugfix/r/slave_trx_isolation.result
@@ -41,6 +41,8 @@ CREATE TABLE tbl_a (
pkey int NOT NULL,
PRIMARY KEY (pkey)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
connection master_1;
INSERT INTO tbl_a (pkey) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
connection slave1_1;
@@ -51,6 +53,8 @@ SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argum
argument
set session time_zone = '+00:00';set @`spider_lc_./auto_test_remote/tbl_a` = '-xxxxxxxxxxxx-xxxxx-./auto_test_local/tbl_a-'
SET NAMES utf8mb3
+set @old_lock_wait_timeout=@@session.lock_wait_timeout;set session lock_wait_timeout=1
+set session lock_wait_timeout=@old_lock_wait_timeout
set session transaction isolation level read committed;set session autocommit = 1;set session wait_timeout = 604800;set session sql_mode = 'strict_trans_tables,error_for_division_by_zero,no_auto_create_user,no_engine_substitution';start transaction
SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%set %'
SELECT pkey FROM tbl_a ORDER BY pkey;
diff --git a/storage/spider/mysql-test/spider/bugfix/r/spider_join_with_non_spider.result b/storage/spider/mysql-test/spider/bugfix/r/spider_join_with_non_spider.result
index 420ca657..b537f142 100644
--- a/storage/spider/mysql-test/spider/bugfix/r/spider_join_with_non_spider.result
+++ b/storage/spider/mysql-test/spider/bugfix/r/spider_join_with_non_spider.result
@@ -10,6 +10,8 @@ create table t1 (c int);
create table t2 (d int);
insert into t2 values (1), (2);
create table t3 (c int) ENGINE=Spider COMMENT='WRAPPER "mysql", srv "srv",TABLE "t1"';
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
insert into t3 values (2), (3);
select c from t3 join t2 on c = d;
c
diff --git a/storage/spider/mysql-test/spider/bugfix/r/sql_mode_mariadb.result b/storage/spider/mysql-test/spider/bugfix/r/sql_mode_mariadb.result
index a0103695..18770935 100644
--- a/storage/spider/mysql-test/spider/bugfix/r/sql_mode_mariadb.result
+++ b/storage/spider/mysql-test/spider/bugfix/r/sql_mode_mariadb.result
@@ -29,6 +29,8 @@ CREATE TABLE tbl_a (
pkey int NOT NULL,
PRIMARY KEY (pkey)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
INSERT INTO tbl_a (pkey) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
select test
diff --git a/storage/spider/mysql-test/spider/bugfix/r/sql_mode_mysql.result b/storage/spider/mysql-test/spider/bugfix/r/sql_mode_mysql.result
index e75378a5..5aecdea0 100644
--- a/storage/spider/mysql-test/spider/bugfix/r/sql_mode_mysql.result
+++ b/storage/spider/mysql-test/spider/bugfix/r/sql_mode_mysql.result
@@ -29,6 +29,8 @@ CREATE TABLE tbl_a (
pkey int NOT NULL,
PRIMARY KEY (pkey)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
INSERT INTO tbl_a (pkey) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
select test
diff --git a/storage/spider/mysql-test/spider/bugfix/r/strict_group_by.result b/storage/spider/mysql-test/spider/bugfix/r/strict_group_by.result
index fcdab4c7..6682a2ab 100644
--- a/storage/spider/mysql-test/spider/bugfix/r/strict_group_by.result
+++ b/storage/spider/mysql-test/spider/bugfix/r/strict_group_by.result
@@ -42,6 +42,11 @@ skey int NOT NULL,
PRIMARY KEY (pkey),
KEY idx1 (skey)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
INSERT INTO tbl_a (pkey,skey) VALUES (0,0),(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9);
INSERT INTO tbl_a (pkey,skey) VALUES (10,10),(11,11),(12,12),(13,13),(14,14),(15,15),(16,16),(17,17),(18,18),(19,19);
INSERT INTO tbl_a (pkey,skey) VALUES (20,5),(21,6),(22,7),(23,8),(24,9),(25,10),(26,11),(27,12),(28,13),(29,14);
diff --git a/storage/spider/mysql-test/spider/bugfix/r/subquery.result b/storage/spider/mysql-test/spider/bugfix/r/subquery.result
index 280f5715..2bc55e0c 100644
--- a/storage/spider/mysql-test/spider/bugfix/r/subquery.result
+++ b/storage/spider/mysql-test/spider/bugfix/r/subquery.result
@@ -11,7 +11,11 @@ create table t2 (c2 int);
insert into t1 values (1), (2);
insert into t2 values (0), (1), (2);
create table t1s (c1 int) ENGINE=Spider COMMENT='WRAPPER "mysql", srv "srv",TABLE "t1"';
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
create table t2s (c2 int) ENGINE=Spider COMMENT='WRAPPER "mysql", srv "srv",TABLE "t2"';
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
select c1 from t1s, (select c2 from t2s where c2 > 0) t where c1 + 1 = c2;
c1
1
diff --git a/storage/spider/mysql-test/spider/bugfix/r/sysvar_params.result b/storage/spider/mysql-test/spider/bugfix/r/sysvar_params.result
new file mode 100644
index 00000000..dae04be4
--- /dev/null
+++ b/storage/spider/mysql-test/spider/bugfix/r/sysvar_params.result
@@ -0,0 +1,106 @@
+
+Testing spider sysvar and table params / options, including default values and overriding mechanisms
+
+for master_1
+for child2
+for child3
+SET @old_spider_read_only_mode = @@session.spider_read_only_mode;
+set spider_same_server_link=on;
+CREATE SERVER srv FOREIGN DATA WRAPPER MYSQL OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
+# Cases where table params/options are not set
+set session spider_read_only_mode = default;
+create table t2 (c int);
+create table t1 (c int) ENGINE=Spider COMMENT='WRAPPER "mysql", srv "srv",TABLE "t2"';
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+/* 1 */ insert into t1 values (42);
+drop table t1, t2;
+set session spider_read_only_mode = 1;
+create table t2 (c int);
+create table t1 (c int) ENGINE=Spider COMMENT='WRAPPER "mysql", srv "srv",TABLE "t2"';
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+/* 2 */ insert into t1 values (42);
+ERROR HY000: Table 'test.t1' is read only
+drop table t1, t2;
+set session spider_read_only_mode = -1;
+Warnings:
+Warning 138 The option value -1 (fallback to default) is deprecated and will be removed in a future release
+create table t2 (c int);
+create table t1 (c int) ENGINE=Spider COMMENT='WRAPPER "mysql", srv "srv",TABLE "t2"';
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+/* 3 */ insert into t1 values (42);
+drop table t1, t2;
+# Cases where table params are set
+SET session spider_read_only_mode = default;
+create table t2 (c int);
+create table t1 (c int) ENGINE=Spider COMMENT='read_only_mode "1", WRAPPER "mysql", srv "srv",TABLE "t2"';
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+/* 4 */ insert into t1 values (42);
+ERROR HY000: Table 'test.t1' is read only
+drop table t1, t2;
+set session spider_read_only_mode = 1;
+create table t2 (c int);
+create table t1 (c int) ENGINE=Spider COMMENT='read_only_mode "0", WRAPPER "mysql", srv "srv",TABLE "t2"';
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+/* 5 */ insert into t1 values (42);
+drop table t1, t2;
+SET session spider_read_only_mode = -1;
+Warnings:
+Warning 138 The option value -1 (fallback to default) is deprecated and will be removed in a future release
+create table t2 (c int);
+create table t1 (c int) ENGINE=Spider COMMENT='read_only_mode "1", WRAPPER "mysql", srv "",TABLE "t2"';
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+/* 6 */ insert into t1 values (42);
+ERROR HY000: Table 'test.t1' is read only
+drop table t1, t2;
+# Cases where table options are set
+SET session spider_read_only_mode = default;
+create table t2 (c int);
+create table t1 (c int) ENGINE=Spider REMOTE_SERVER=srv REMOTE_TABLE=t2 READ_ONLY=1 WRAPPER=mysql;
+/* 7 */ insert into t1 values (42);
+ERROR HY000: Table 'test.t1' is read only
+drop table t1, t2;
+set session spider_read_only_mode = 1;
+create table t2 (c int);
+create table t1 (c int) ENGINE=Spider READ_ONLY=0 REMOTE_SERVER=srv REMOTE_TABLE=t2 WRAPPER=mysql;
+/* 8 */ insert into t1 values (42);
+drop table t1, t2;
+SET session spider_read_only_mode = -1;
+Warnings:
+Warning 138 The option value -1 (fallback to default) is deprecated and will be removed in a future release
+create table t2 (c int);
+create table t1 (c int) ENGINE=Spider READ_ONLY=1 REMOTE_SERVER=srv REMOTE_TABLE=t2 WRAPPER=mysql;
+/* 9 */ insert into t1 values (42);
+ERROR HY000: Table 'test.t1' is read only
+drop table t1, t2;
+SET session spider_read_only_mode = 0;
+create table t2 (c int);
+create table t1 (c int) ENGINE=Spider READ_ONLY=default REMOTE_SERVER=srv REMOTE_TABLE=t2 WRAPPER=mysql;
+/* 10 */ insert into t1 values (42);
+drop table t1, t2;
+SET session spider_read_only_mode = 1;
+create table t2 (c int);
+create table t1 (c int) ENGINE=Spider READ_ONLY=default REMOTE_SERVER=srv REMOTE_TABLE=t2 WRAPPER=mysql;
+/* 11 */ insert into t1 values (42);
+ERROR HY000: Table 'test.t1' is read only
+drop table t1, t2;
+SET session spider_read_only_mode = -1;
+Warnings:
+Warning 138 The option value -1 (fallback to default) is deprecated and will be removed in a future release
+create table t2 (c int);
+create table t1 (c int) ENGINE=Spider READ_ONLY=default REMOTE_SERVER=srv REMOTE_TABLE=t2 WRAPPER=mysql;
+/* 12 */ insert into t1 values (42);
+drop table t1, t2;
+drop server srv;
+SET session spider_read_only_mode = @old_spider_read_only_mode;
+for master_1
+for child2
+for child3
+#
+# End of test sysvar_params
+#
diff --git a/storage/spider/mysql-test/spider/bugfix/r/udf_mysql_func_early.result b/storage/spider/mysql-test/spider/bugfix/r/udf_mysql_func_early.result
index b84f60a6..35bd8335 100644
--- a/storage/spider/mysql-test/spider/bugfix/r/udf_mysql_func_early.result
+++ b/storage/spider/mysql-test/spider/bugfix/r/udf_mysql_func_early.result
@@ -30,6 +30,8 @@ USE auto_test_local;
CREATE TABLE tbl_a (
a INT
) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='table "tbl_a", srv "s_2_1"';
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
create temporary table results (a int);
SELECT SPIDER_DIRECT_SQL('select * from tbl_a', 'results', 'srv "s_2_1", database "auto_test_remote"');
SPIDER_DIRECT_SQL('select * from tbl_a', 'results', 'srv "s_2_1", database "auto_test_remote"')
diff --git a/storage/spider/mysql-test/spider/bugfix/r/udf_mysql_func_early_init_file.result b/storage/spider/mysql-test/spider/bugfix/r/udf_mysql_func_early_init_file.result
index b84f60a6..35bd8335 100644
--- a/storage/spider/mysql-test/spider/bugfix/r/udf_mysql_func_early_init_file.result
+++ b/storage/spider/mysql-test/spider/bugfix/r/udf_mysql_func_early_init_file.result
@@ -30,6 +30,8 @@ USE auto_test_local;
CREATE TABLE tbl_a (
a INT
) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='table "tbl_a", srv "s_2_1"';
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
create temporary table results (a int);
SELECT SPIDER_DIRECT_SQL('select * from tbl_a', 'results', 'srv "s_2_1", database "auto_test_remote"');
SPIDER_DIRECT_SQL('select * from tbl_a', 'results', 'srv "s_2_1", database "auto_test_remote"')
diff --git a/storage/spider/mysql-test/spider/bugfix/r/wrapper_mariadb.result b/storage/spider/mysql-test/spider/bugfix/r/wrapper_mariadb.result
index ef50d3a3..dbe6a391 100644
--- a/storage/spider/mysql-test/spider/bugfix/r/wrapper_mariadb.result
+++ b/storage/spider/mysql-test/spider/bugfix/r/wrapper_mariadb.result
@@ -26,6 +26,8 @@ CREATE TABLE tbl_a (
pkey int NOT NULL,
PRIMARY KEY (pkey)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
INSERT INTO tbl_a (pkey) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
select test
diff --git a/storage/spider/mysql-test/spider/bugfix/r/xa_cmd.result b/storage/spider/mysql-test/spider/bugfix/r/xa_cmd.result
index 8e1b2994..48f86f42 100644
--- a/storage/spider/mysql-test/spider/bugfix/r/xa_cmd.result
+++ b/storage/spider/mysql-test/spider/bugfix/r/xa_cmd.result
@@ -26,6 +26,8 @@ CREATE TABLE tbl_a (
pkey int NOT NULL,
PRIMARY KEY (pkey)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
connection child2_1;
TRUNCATE TABLE mysql.general_log;
connection master_1;
diff --git a/storage/spider/mysql-test/spider/bugfix/t/checksum_table_with_quick_mode_3.cnf b/storage/spider/mysql-test/spider/bugfix/t/checksum_table_with_quick_mode_3.cnf
index 05dfd8a0..bd19b855 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/checksum_table_with_quick_mode_3.cnf
+++ b/storage/spider/mysql-test/spider/bugfix/t/checksum_table_with_quick_mode_3.cnf
@@ -1,3 +1,4 @@
!include include/default_mysqld.cnf
+!include include/default_client.cnf
!include ../my_1_1.cnf
!include ../my_2_1.cnf
diff --git a/storage/spider/mysql-test/spider/bugfix/t/checksum_table_with_quick_mode_3.test b/storage/spider/mysql-test/spider/bugfix/t/checksum_table_with_quick_mode_3.test
index de2dd90a..dca9c661 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/checksum_table_with_quick_mode_3.test
+++ b/storage/spider/mysql-test/spider/bugfix/t/checksum_table_with_quick_mode_3.test
@@ -37,7 +37,9 @@ eval CREATE TABLE tbl_a (
PRIMARY KEY (pkey)
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1;
--enable_query_log
+--disable_ps_protocol
INSERT INTO tbl_a (pkey) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+--enable_ps_protocol
INSERT INTO tbl_a (pkey) VALUES (10),(11),(12),(13),(14),(15),(16),(17),(18),(19);
INSERT INTO tbl_a (pkey) VALUES (20),(21),(22),(23),(24),(25),(26),(27),(28),(29);
FLUSH TABLES;
diff --git a/storage/spider/mysql-test/spider/bugfix/t/cp932_column.cnf b/storage/spider/mysql-test/spider/bugfix/t/cp932_column.cnf
index 05dfd8a0..bd19b855 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/cp932_column.cnf
+++ b/storage/spider/mysql-test/spider/bugfix/t/cp932_column.cnf
@@ -1,3 +1,4 @@
!include include/default_mysqld.cnf
+!include include/default_client.cnf
!include ../my_1_1.cnf
!include ../my_2_1.cnf
diff --git a/storage/spider/mysql-test/spider/bugfix/t/cp932_column.test b/storage/spider/mysql-test/spider/bugfix/t/cp932_column.test
index 11917970..cae39318 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/cp932_column.test
+++ b/storage/spider/mysql-test/spider/bugfix/t/cp932_column.test
@@ -41,7 +41,9 @@ eval CREATE TABLE tbl_a (
PRIMARY KEY (pkey)
) $MASTER_1_ENGINE DEFAULT CHARACTER SET utf8 $MASTER_1_COMMENT_2_1;
--enable_query_log
+--disable_ps_protocol
INSERT INTO tbl_a (pkey,txt_utf8,txt_cp932) VALUES (0,'',''),(1,'',''),(2,'',''),(3,'',''),(4,'',''),(5,'',''),(6,'',''),(7,'',''),(8,'',''),(9,'','');
+--enable_ps_protocol
FLUSH TABLES;
--echo
@@ -52,7 +54,9 @@ TRUNCATE TABLE mysql.general_log;
--connection master_1
SET NAMES cp932;
+--disable_ps_protocol
INSERT INTO tbl_a (pkey,txt_utf8,txt_cp932) VALUES (10,'','’†‘');
+--enable_ps_protocol
INSERT INTO tbl_a (pkey,txt_utf8,txt_cp932) VALUES (0,'','') ON DUPLICATE KEY UPDATE txt_cp932 = '’†‘';
UPDATE tbl_a SET txt_cp932 = '’†‘' WHERE pkey = 2;
SET NAMES utf8;
diff --git a/storage/spider/mysql-test/spider/bugfix/t/delete_with_float_column_default.cnf b/storage/spider/mysql-test/spider/bugfix/t/delete_with_float_column_default.cnf
index 45019d6c..7c33a8af 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/delete_with_float_column_default.cnf
+++ b/storage/spider/mysql-test/spider/bugfix/t/delete_with_float_column_default.cnf
@@ -1,4 +1,5 @@
!include include/default_mysqld.cnf
+!include include/default_client.cnf
!include ../my_1_1.cnf
!include ../my_2_1.cnf
!include ../my_4_1.cnf
diff --git a/storage/spider/mysql-test/spider/bugfix/t/delete_with_float_column_mariadb.cnf b/storage/spider/mysql-test/spider/bugfix/t/delete_with_float_column_mariadb.cnf
index 45019d6c..7c33a8af 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/delete_with_float_column_mariadb.cnf
+++ b/storage/spider/mysql-test/spider/bugfix/t/delete_with_float_column_mariadb.cnf
@@ -1,4 +1,5 @@
!include include/default_mysqld.cnf
+!include include/default_client.cnf
!include ../my_1_1.cnf
!include ../my_2_1.cnf
!include ../my_4_1.cnf
diff --git a/storage/spider/mysql-test/spider/bugfix/t/delete_with_float_column_mysql.cnf b/storage/spider/mysql-test/spider/bugfix/t/delete_with_float_column_mysql.cnf
index 45019d6c..7c33a8af 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/delete_with_float_column_mysql.cnf
+++ b/storage/spider/mysql-test/spider/bugfix/t/delete_with_float_column_mysql.cnf
@@ -1,4 +1,5 @@
!include include/default_mysqld.cnf
+!include include/default_client.cnf
!include ../my_1_1.cnf
!include ../my_2_1.cnf
!include ../my_4_1.cnf
diff --git a/storage/spider/mysql-test/spider/bugfix/t/direct_sql_with_comma_pwd.cnf b/storage/spider/mysql-test/spider/bugfix/t/direct_sql_with_comma_pwd.cnf
index 05dfd8a0..bd19b855 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/direct_sql_with_comma_pwd.cnf
+++ b/storage/spider/mysql-test/spider/bugfix/t/direct_sql_with_comma_pwd.cnf
@@ -1,3 +1,4 @@
!include include/default_mysqld.cnf
+!include include/default_client.cnf
!include ../my_1_1.cnf
!include ../my_2_1.cnf
diff --git a/storage/spider/mysql-test/spider/bugfix/t/direct_sql_with_tmp_table.cnf b/storage/spider/mysql-test/spider/bugfix/t/direct_sql_with_tmp_table.cnf
index 05dfd8a0..bd19b855 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/direct_sql_with_tmp_table.cnf
+++ b/storage/spider/mysql-test/spider/bugfix/t/direct_sql_with_tmp_table.cnf
@@ -1,3 +1,4 @@
!include include/default_mysqld.cnf
+!include include/default_client.cnf
!include ../my_1_1.cnf
!include ../my_2_1.cnf
diff --git a/storage/spider/mysql-test/spider/bugfix/t/gbh_outer_fields_in_join.cnf b/storage/spider/mysql-test/spider/bugfix/t/gbh_outer_fields_in_join.cnf
index 05dfd8a0..bd19b855 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/gbh_outer_fields_in_join.cnf
+++ b/storage/spider/mysql-test/spider/bugfix/t/gbh_outer_fields_in_join.cnf
@@ -1,3 +1,4 @@
!include include/default_mysqld.cnf
+!include include/default_client.cnf
!include ../my_1_1.cnf
!include ../my_2_1.cnf
diff --git a/storage/spider/mysql-test/spider/bugfix/t/gbh_outer_fields_in_join.test b/storage/spider/mysql-test/spider/bugfix/t/gbh_outer_fields_in_join.test
index f60abc30..3f42558c 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/gbh_outer_fields_in_join.test
+++ b/storage/spider/mysql-test/spider/bugfix/t/gbh_outer_fields_in_join.test
@@ -8,6 +8,7 @@
--enable_result_log
--enable_query_log
+--enable_prepare_warnings
--connection child2_1
CREATE DATABASE auto_test_remote;
USE auto_test_remote;
diff --git a/storage/spider/mysql-test/spider/bugfix/t/group_by_order_by_limit.cnf b/storage/spider/mysql-test/spider/bugfix/t/group_by_order_by_limit.cnf
index e0ffb99c..37792498 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/group_by_order_by_limit.cnf
+++ b/storage/spider/mysql-test/spider/bugfix/t/group_by_order_by_limit.cnf
@@ -1,4 +1,5 @@
!include include/default_mysqld.cnf
+!include include/default_client.cnf
!include ../my_1_1.cnf
!include ../my_2_1.cnf
!include ../my_2_2.cnf
diff --git a/storage/spider/mysql-test/spider/bugfix/t/group_by_order_by_limit.test b/storage/spider/mysql-test/spider/bugfix/t/group_by_order_by_limit.test
index d694230b..2d0de344 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/group_by_order_by_limit.test
+++ b/storage/spider/mysql-test/spider/bugfix/t/group_by_order_by_limit.test
@@ -53,7 +53,9 @@ eval CREATE TABLE tbl_a (
KEY idx1 (skey)
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1;
--enable_query_log
+--disable_ps_protocol
INSERT INTO tbl_a (pkey,skey) VALUES (0,0),(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9);
+--enable_ps_protocol
INSERT INTO tbl_a (pkey,skey) VALUES (10,10),(11,11),(12,12),(13,13),(14,14),(15,15),(16,16),(17,17),(18,18),(19,19);
INSERT INTO tbl_a (pkey,skey) VALUES (20,5),(21,6),(22,7),(23,8),(24,9),(25,10),(26,11),(27,12),(28,13),(29,14);
diff --git a/storage/spider/mysql-test/spider/bugfix/t/index.test b/storage/spider/mysql-test/spider/bugfix/t/index.test
index 641fa164..1ecc7a84 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/index.test
+++ b/storage/spider/mysql-test/spider/bugfix/t/index.test
@@ -14,7 +14,9 @@ select @@spider_auto_increment_mode;
create or replace table auto_test_local.t (id int primary key) engine=InnoDB;
create or replace table t_sp1 (id int auto_increment, primary key(id desc))
engine=Spider COMMENT='wrapper "mysql", srv "s_1", table "t"';
+--disable_ps_protocol
insert into t_sp1 () values (),(),();
+--enable_ps_protocol
insert into t_sp1 () values (),(),();
select * from t_sp1;
drop table t_sp1, auto_test_local.t;
@@ -30,7 +32,9 @@ partition by range (a)
(partition p1 values less than (4) comment "table 't1'",
partition p2 values less than (maxvalue) comment "table 't2'");
+--disable_ps_protocol
insert into t values (1),(2),(10),(11);
+--enable_ps_protocol
select * from t where a > 1 order by a;
drop table t, auto_test_local.t1, auto_test_local.t2;
@@ -42,7 +46,9 @@ create table auto_test_local.t (a int, b char(1), primary key(a desc));
insert into auto_test_local.t VALUES (1,'f'),(2,'g'),(3,'j'), (4,'i'),(5,'h');
create table ts (a int, b char(1), primary key(a desc))
engine=spider comment='wrapper "mysql", srv "s_1", table "t"';
+--disable_ps_protocol
select a, b from ts where a > 0 and b = 'g' order by a;
+--enable_ps_protocol
drop table ts, auto_test_local.t;
drop database auto_test_local;
diff --git a/storage/spider/mysql-test/spider/bugfix/t/insert_select.cnf b/storage/spider/mysql-test/spider/bugfix/t/insert_select.cnf
index 05dfd8a0..bd19b855 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/insert_select.cnf
+++ b/storage/spider/mysql-test/spider/bugfix/t/insert_select.cnf
@@ -1,3 +1,4 @@
!include include/default_mysqld.cnf
+!include include/default_client.cnf
!include ../my_1_1.cnf
!include ../my_2_1.cnf
diff --git a/storage/spider/mysql-test/spider/bugfix/t/insert_select.test b/storage/spider/mysql-test/spider/bugfix/t/insert_select.test
index c2ac615e..77a4540c 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/insert_select.test
+++ b/storage/spider/mysql-test/spider/bugfix/t/insert_select.test
@@ -55,7 +55,9 @@ eval CREATE TABLE tbl_b (
KEY idx1 (dt)
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1_2;
--enable_query_log
+--disable_ps_protocol
INSERT INTO tbl_a (skey, dt, tm) VALUES (0, '2012-01-01', '12:00:00'),(1, '2012-02-01', '12:00:00'),(2, '2012-03-01', '12:00:00'),(3, '2012-04-01', '12:00:00'),(4, '2012-05-01', '12:00:00'),(5, '2012-06-01', '12:00:00'),(6, '2012-07-01', '12:00:00'),(7, '2012-08-01', '12:00:00'),(8, '2012-09-01', '12:00:00'),(9, '2012-10-01', '12:00:00');
+--enable_ps_protocol
INSERT INTO tbl_a (skey, dt, tm) VALUES (0, '2013-01-01', '13:00:00'),(1, '2013-02-01', '13:00:00'),(2, '2013-03-01', '13:00:00'),(3, '2013-04-01', '13:00:00'),(4, '2013-05-01', '13:00:00'),(5, '2013-06-01', '13:00:00'),(6, '2013-07-01', '13:00:00'),(7, '2013-08-01', '13:00:00'),(8, '2013-09-01', '13:00:00'),(9, '2013-10-01', '13:00:00');
INSERT INTO tbl_a (skey, dt, tm) VALUES (0, '2012-11-01', '11:00:00'),(1, '2012-12-01', '11:00:00'),(2, '2012-11-30', '11:00:00'),(3, '2012-11-29', '11:00:00'),(4, '2012-11-28', '11:00:00'),(5, '2012-11-27', '11:00:00'),(6, '2012-11-26', '11:00:00'),(7, '2012-11-25', '11:00:00'),(8, '2012-11-24', '11:00:00'),(9, '2012-11-23', '11:00:00');
FLUSH TABLES;
@@ -67,7 +69,9 @@ FLUSH TABLES;
TRUNCATE TABLE mysql.general_log;
--connection master_1
+--disable_ps_protocol
INSERT IGNORE INTO tbl_b (SELECT skey, CAST(CONCAT(dt, ' ', tm) AS datetime) FROM tbl_a WHERE skey = 4 AND dt > DATE_ADD('2012-12-01', INTERVAL -10 DAY));
+--enable_ps_protocol
INSERT IGNORE INTO tbl_b (SELECT skey, CAST(CONCAT(dt, ' ', tm) AS datetime) FROM tbl_a WHERE skey = 3 AND dt > DATE_ADD('2012-12-01', INTERVAL -10 DAY));
INSERT IGNORE INTO tbl_b (SELECT skey, CAST(CONCAT(dt, ' ', tm) AS datetime) FROM tbl_a WHERE skey = 2 AND dt > DATE_ADD('2012-12-01', INTERVAL -10 DAY));
INSERT IGNORE INTO tbl_b (SELECT skey, CAST(CONCAT(dt, ' ', tm) AS datetime) FROM tbl_a WHERE skey = 1 AND dt > DATE_ADD('2012-12-01', INTERVAL -10 DAY));
diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_19866.cnf b/storage/spider/mysql-test/spider/bugfix/t/mdev_19866.cnf
index e0ffb99c..37792498 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/mdev_19866.cnf
+++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_19866.cnf
@@ -1,4 +1,5 @@
!include include/default_mysqld.cnf
+!include include/default_client.cnf
!include ../my_1_1.cnf
!include ../my_2_1.cnf
!include ../my_2_2.cnf
diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_19866.test b/storage/spider/mysql-test/spider/bugfix/t/mdev_19866.test
index 0b8ce69c..bf4334ba 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/mdev_19866.test
+++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_19866.test
@@ -51,7 +51,9 @@ eval CREATE TABLE tbl_a (
PRIMARY KEY (pkey)
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1;
--enable_query_log
+--disable_ps_protocol
INSERT INTO tbl_a (pkey,val) VALUES (1,'1'),(2,'2'),(3,'3'),(4,'4');
+--enable_ps_protocol
--echo
--echo select test 1
diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_20100.cnf b/storage/spider/mysql-test/spider/bugfix/t/mdev_20100.cnf
index 05dfd8a0..bd19b855 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/mdev_20100.cnf
+++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_20100.cnf
@@ -1,3 +1,4 @@
!include include/default_mysqld.cnf
+!include include/default_client.cnf
!include ../my_1_1.cnf
!include ../my_2_1.cnf
diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_20100.test b/storage/spider/mysql-test/spider/bugfix/t/mdev_20100.test
index 3d1ccf3c..c0310d62 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/mdev_20100.test
+++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_20100.test
@@ -43,12 +43,14 @@ eval CREATE TABLE tbl_a (
PRIMARY KEY(a)
) $MASTER_1_ENGINE $MASTER_1_COMMENT_P_2_1;
--enable_query_log
+--disable_ps_protocol
INSERT INTO tbl_a (a, b, c) VALUES
(1, 'a', '2008-08-01 10:21:39'),
(2, 'b', '2000-01-01 00:00:00'),
(3, 'e', '2007-06-04 20:03:11'),
(4, 'd', '2003-11-30 05:01:03'),
(5, 'c', '2001-12-31 23:59:59');
+--enable_ps_protocol
--echo
--echo test 1
diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_20502.cnf b/storage/spider/mysql-test/spider/bugfix/t/mdev_20502.cnf
index 05dfd8a0..bd19b855 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/mdev_20502.cnf
+++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_20502.cnf
@@ -1,3 +1,4 @@
!include include/default_mysqld.cnf
+!include include/default_client.cnf
!include ../my_1_1.cnf
!include ../my_2_1.cnf
diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_20502.test b/storage/spider/mysql-test/spider/bugfix/t/mdev_20502.test
index 1cd1c689..479e1006 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/mdev_20502.test
+++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_20502.test
@@ -39,7 +39,9 @@ eval CREATE TABLE tbl_a (
PRIMARY KEY(id)
) $MASTER_1_ENGINE $MASTER_1_COMMENT_2_1;
--enable_query_log
+--disable_ps_protocol
INSERT INTO tbl_a (val) VALUES (1);
+--enable_ps_protocol
--echo
--echo test 1
diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_21884.cnf b/storage/spider/mysql-test/spider/bugfix/t/mdev_21884.cnf
index 05dfd8a0..bd19b855 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/mdev_21884.cnf
+++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_21884.cnf
@@ -1,3 +1,4 @@
!include include/default_mysqld.cnf
+!include include/default_client.cnf
!include ../my_1_1.cnf
!include ../my_2_1.cnf
diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_21884.test b/storage/spider/mysql-test/spider/bugfix/t/mdev_21884.test
index c1a9aaa4..71b4725b 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/mdev_21884.test
+++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_21884.test
@@ -55,12 +55,14 @@ eval CREATE TABLE tb_l (
PRIMARY KEY(a)
) $MASTER_1_ENGINE2 $MASTER_1_CHARSET2;
--enable_query_log
+--disable_ps_protocol
INSERT INTO tbl_a (a, b, c) VALUES
(11, 'a', '2008-08-01 10:21:39'),
(11, 'b', '2000-01-01 00:00:00'),
(12, 'e', '2007-06-04 20:03:11'),
(12, 'd', '2003-11-30 05:01:03'),
(13, 'c', '2001-12-31 23:59:59');
+--enable_ps_protocol
INSERT INTO tb_l (a, b, c) VALUES
(11, 'a', '2008-08-01 10:21:39'),
(12, 'b', '2000-01-01 00:00:00'),
diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_22246.cnf b/storage/spider/mysql-test/spider/bugfix/t/mdev_22246.cnf
index e0ffb99c..37792498 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/mdev_22246.cnf
+++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_22246.cnf
@@ -1,4 +1,5 @@
!include include/default_mysqld.cnf
+!include include/default_client.cnf
!include ../my_1_1.cnf
!include ../my_2_1.cnf
!include ../my_2_2.cnf
diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_22246.test b/storage/spider/mysql-test/spider/bugfix/t/mdev_22246.test
index 9e58bc1a..5449a057 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/mdev_22246.test
+++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_22246.test
@@ -51,7 +51,9 @@ eval CREATE TABLE tbl_a (
PRIMARY KEY (id)
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1;
--enable_query_log
+--disable_ps_protocol
INSERT INTO tbl_a (id,node) VALUES (1,'DB-G0'),(2,'DB-G1');
+--enable_ps_protocol
--echo
--echo select test 1
@@ -64,6 +66,7 @@ TRUNCATE TABLE mysql.general_log;
--connection master_1
SELECT * FROM tbl_a;
+--sorted_result
SELECT * FROM tbl_a WHERE id <0 || id >0;
--connection child2_1
diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_22265.cnf b/storage/spider/mysql-test/spider/bugfix/t/mdev_22265.cnf
index b0853e32..0ef6f319 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/mdev_22265.cnf
+++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_22265.cnf
@@ -1,2 +1,3 @@
!include include/default_mysqld.cnf
+!include include/default_client.cnf
!include ../my_1_1.cnf
diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_24020.cnf b/storage/spider/mysql-test/spider/bugfix/t/mdev_24020.cnf
index 05dfd8a0..bd19b855 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/mdev_24020.cnf
+++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_24020.cnf
@@ -1,3 +1,4 @@
!include include/default_mysqld.cnf
+!include include/default_client.cnf
!include ../my_1_1.cnf
!include ../my_2_1.cnf
diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_24020.test b/storage/spider/mysql-test/spider/bugfix/t/mdev_24020.test
index ac06d860..afa37287 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/mdev_24020.test
+++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_24020.test
@@ -38,7 +38,9 @@ eval CREATE TABLE tbl_a (
PRIMARY KEY(a)
) $MASTER_1_ENGINE $MASTER_1_COMMENT_P_2_1;
--enable_query_log
+--disable_ps_protocol
INSERT INTO tbl_a VALUES(10000, " abcd ");
+--enable_ps_protocol
INSERT INTO tbl_a VALUES(10001, " abcd ");
INSERT INTO tbl_a VALUES(10002, " abcd ");
INSERT INTO tbl_a VALUES(10003, "[[[abcd][[");
diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_24343.cnf b/storage/spider/mysql-test/spider/bugfix/t/mdev_24343.cnf
index 05dfd8a0..bd19b855 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/mdev_24343.cnf
+++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_24343.cnf
@@ -1,3 +1,4 @@
!include include/default_mysqld.cnf
+!include include/default_client.cnf
!include ../my_1_1.cnf
!include ../my_2_1.cnf
diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_24343.test b/storage/spider/mysql-test/spider/bugfix/t/mdev_24343.test
index 5756cbac..da304078 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/mdev_24343.test
+++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_24343.test
@@ -69,7 +69,9 @@ PARTITION BY LIST COLUMNS(`id`) (
PARTITION `pt1` DEFAULT COMMENT = 'srv "s_2_1"'
);
+--disable_ps_protocol
SELECT * from tbl_b JOIN tbl_c ON tbl_b.id = tbl_c.id LEFT OUTER JOIN tbl_a ON tbl_a.id = tbl_b.id;
+--enable_ps_protocol
--connection master_1
DROP DATABASE auto_test_local;
diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_24517.cnf b/storage/spider/mysql-test/spider/bugfix/t/mdev_24517.cnf
index 05dfd8a0..bd19b855 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/mdev_24517.cnf
+++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_24517.cnf
@@ -1,3 +1,4 @@
!include include/default_mysqld.cnf
+!include include/default_client.cnf
!include ../my_1_1.cnf
!include ../my_2_1.cnf
diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_24517.test b/storage/spider/mysql-test/spider/bugfix/t/mdev_24517.test
index 21b9dda4..c3951c4c 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/mdev_24517.test
+++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_24517.test
@@ -41,11 +41,13 @@ eval CREATE TABLE tbl_a (
PRIMARY KEY(i)
) $MASTER_1_ENGINE $MASTER_1_COMMENT_P_2_1;
--enable_query_log
+--disable_ps_protocol
INSERT INTO tbl_a (i, j) VALUES
(1, '{"ID": "3", "Name": "Barney", "Age": 18}'),
(2, '{"ID": "4", "Name": "Betty", "Age": 19}'),
(3, '{"ID": "2", "Name": "Wilma", "Age": 20}'),
(4, '[10, 20, [30, 40]]');
+--enable_ps_protocol
--echo
--echo test 1
diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_24523.cnf b/storage/spider/mysql-test/spider/bugfix/t/mdev_24523.cnf
index 05dfd8a0..bd19b855 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/mdev_24523.cnf
+++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_24523.cnf
@@ -1,3 +1,4 @@
!include include/default_mysqld.cnf
+!include include/default_client.cnf
!include ../my_1_1.cnf
!include ../my_2_1.cnf
diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_24523.test b/storage/spider/mysql-test/spider/bugfix/t/mdev_24523.test
index 00c0c873..f351a252 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/mdev_24523.test
+++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_24523.test
@@ -38,7 +38,9 @@ eval CREATE TABLE tbl_a (
PRIMARY KEY(i)
) $MASTER_1_ENGINE $MASTER_1_COMMENT_P_2_1;
--enable_query_log
+--disable_ps_protocol
INSERT INTO tbl_a VALUES (1, '{ "a": 1, "b": [2, 3]}');
+--enable_ps_protocol
--echo
--echo test 1
diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_24760.cnf b/storage/spider/mysql-test/spider/bugfix/t/mdev_24760.cnf
index 05dfd8a0..bd19b855 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/mdev_24760.cnf
+++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_24760.cnf
@@ -1,3 +1,4 @@
!include include/default_mysqld.cnf
+!include include/default_client.cnf
!include ../my_1_1.cnf
!include ../my_2_1.cnf
diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_24760.test b/storage/spider/mysql-test/spider/bugfix/t/mdev_24760.test
index 149b057d..122a1970 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/mdev_24760.test
+++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_24760.test
@@ -34,7 +34,9 @@ PARTITION BY HASH(id) (
PARTITION pt1 COMMENT='srv "s_2_1"'
);
+--disable_ps_protocol
SELECT id, CASE WHEN name='Alice' THEN "A" WHEN name='Bob' THEN "B" END FROM tbl_a;
+--enable_ps_protocol
SELECT id, CASE name WHEN 'Alice' THEN "A" WHEN 'Bob' THEN "B" END FROM tbl_a;
DROP DATABASE auto_test_local;
diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_25116.cnf b/storage/spider/mysql-test/spider/bugfix/t/mdev_25116.cnf
index 05dfd8a0..bd19b855 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/mdev_25116.cnf
+++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_25116.cnf
@@ -1,3 +1,4 @@
!include include/default_mysqld.cnf
+!include include/default_client.cnf
!include ../my_1_1.cnf
!include ../my_2_1.cnf
diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_25116.test b/storage/spider/mysql-test/spider/bugfix/t/mdev_25116.test
index 7ef23538..3b37e733 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/mdev_25116.test
+++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_25116.test
@@ -27,7 +27,9 @@ eval CREATE TABLE tbl_a (
set @old_spider_direct_aggregate=@@session.spider_direct_aggregate;
set spider_direct_aggregate=1;
SHOW STATUS LIKE 'Spider_direct_aggregate';
+--disable_ps_protocol
SELECT IF(COUNT(id > 0),'Y','N') FROM tbl_a;
+--enable_ps_protocol
SHOW STATUS LIKE 'Spider_direct_aggregate';
set spider_direct_aggregate=@old_spider_direct_aggregate;
--enable_ps2_protocol
diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_25684.cnf b/storage/spider/mysql-test/spider/bugfix/t/mdev_25684.cnf
index 05dfd8a0..bd19b855 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/mdev_25684.cnf
+++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_25684.cnf
@@ -1,3 +1,4 @@
!include include/default_mysqld.cnf
+!include include/default_client.cnf
!include ../my_1_1.cnf
!include ../my_2_1.cnf
diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_26013.cnf b/storage/spider/mysql-test/spider/bugfix/t/mdev_26013.cnf
index 05dfd8a0..bd19b855 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/mdev_26013.cnf
+++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_26013.cnf
@@ -1,3 +1,4 @@
!include include/default_mysqld.cnf
+!include include/default_client.cnf
!include ../my_1_1.cnf
!include ../my_2_1.cnf
diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_26013.test b/storage/spider/mysql-test/spider/bugfix/t/mdev_26013.test
index e31041c3..d56deba3 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/mdev_26013.test
+++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_26013.test
@@ -35,7 +35,9 @@ eval CREATE TABLE tbl_a (
);
--connection master_1
+--disable_ps_protocol
SELECT distinct b FROM tbl_a WHERE b=999;
+--enable_ps_protocol
--connection master_1
DROP DATABASE IF EXISTS auto_test_remote;
diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_26151.test b/storage/spider/mysql-test/spider/bugfix/t/mdev_26151.test
index dcf1438f..d458a12e 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/mdev_26151.test
+++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_26151.test
@@ -27,7 +27,9 @@ eval create table ts (a int, PRIMARY KEY (a)) ENGINE=Spider COMMENT='WRAPPER "my
insert into td values (11), (42);
+--disable_ps_protocol
select max(a) from ts;
+--enable_ps_protocol
drop table td, ts;
@@ -38,7 +40,9 @@ eval create table ts (a int, PRIMARY KEY (a)) ENGINE=Spider COMMENT='WRAPPER "my
insert into td values (11), (42);
+--disable_ps_protocol
select max(a) from ts;
+--enable_ps_protocol
select min(a) from ts;
diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_26158.cnf b/storage/spider/mysql-test/spider/bugfix/t/mdev_26158.cnf
index 05dfd8a0..bd19b855 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/mdev_26158.cnf
+++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_26158.cnf
@@ -1,3 +1,4 @@
!include include/default_mysqld.cnf
+!include include/default_client.cnf
!include ../my_1_1.cnf
!include ../my_2_1.cnf
diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_26247.cnf b/storage/spider/mysql-test/spider/bugfix/t/mdev_26247.cnf
index 05dfd8a0..bd19b855 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/mdev_26247.cnf
+++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_26247.cnf
@@ -1,3 +1,4 @@
!include include/default_mysqld.cnf
+!include include/default_client.cnf
!include ../my_1_1.cnf
!include ../my_2_1.cnf
diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_26247.test b/storage/spider/mysql-test/spider/bugfix/t/mdev_26247.test
index 80328e05..5c54cc2e 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/mdev_26247.test
+++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_26247.test
@@ -54,11 +54,15 @@ eval CREATE TABLE t3 (
primary key (a31, a32)
) $MASTER_1_ENGINE $MASTER_1_CHARSET COMMENT='srv "s_2_1", table "t3"';
+--disable_ps_protocol
SELECT a22 FROM t1 LEFT JOIN t2 ON a11 = a21 WHERE a11 IN (1);
+--enable_ps_protocol
SELECT a22 FROM t1 LEFT JOIN t2 ON a11 = a21 - a21 WHERE a11 IN (1);
SELECT a22 FROM t2 RIGHT JOIN t1 ON a21 = a11 WHERE a11 IN (1);
SELECT a22 FROM t2 RIGHT JOIN t1 ON a21 = a11 WHERE a11 IN (1,2);
+--disable_ps_protocol
SELECT a22, a32 FROM t1 LEFT JOIN t2 ON a11 = a21 RIGHT JOIN t3 on a21 = a31 WHERE a11 IN (1);
+--enable_ps_protocol
SELECT a22, a32 FROM t1 LEFT JOIN t2 ON a11 = a21 - a21 RIGHT JOIN t3 on a21 = a31 - a31 WHERE a11 IN (1);
SELECT a22, a32 FROM t1 LEFT JOIN t2 ON a11 = a21 RIGHT JOIN t3 on a21 = a31 WHERE a11 IN (1,2);
SELECT a22 FROM t2 LEFT JOIN t1 ON a11 = a21 WHERE a11 IN (1);
diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_26539.cnf b/storage/spider/mysql-test/spider/bugfix/t/mdev_26539.cnf
index 05dfd8a0..bd19b855 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/mdev_26539.cnf
+++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_26539.cnf
@@ -1,3 +1,4 @@
!include include/default_mysqld.cnf
+!include include/default_client.cnf
!include ../my_1_1.cnf
!include ../my_2_1.cnf
diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_26539.test b/storage/spider/mysql-test/spider/bugfix/t/mdev_26539.test
index f2561f8c..036e3ffa 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/mdev_26539.test
+++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_26539.test
@@ -25,7 +25,9 @@ eval CREATE TABLE tbl_a (
PARTITION pt1 DEFAULT COMMENT = 'srv "s_2_1"'
);
+--disable_ps_protocol
INSERT INTO tbl_a VALUES (1);
+--enable_ps_protocol
ALTER TABLE tbl_a CHECK PARTITION ALL;
DROP DATABASE auto_test_local;
diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_26544.cnf b/storage/spider/mysql-test/spider/bugfix/t/mdev_26544.cnf
index b0853e32..0ef6f319 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/mdev_26544.cnf
+++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_26544.cnf
@@ -1,2 +1,3 @@
!include include/default_mysqld.cnf
+!include include/default_client.cnf
!include ../my_1_1.cnf
diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_26582.cnf b/storage/spider/mysql-test/spider/bugfix/t/mdev_26582.cnf
index b0853e32..0ef6f319 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/mdev_26582.cnf
+++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_26582.cnf
@@ -1,2 +1,3 @@
!include include/default_mysqld.cnf
+!include include/default_client.cnf
!include ../my_1_1.cnf
diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_27172.cnf b/storage/spider/mysql-test/spider/bugfix/t/mdev_27172.cnf
index 05dfd8a0..bd19b855 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/mdev_27172.cnf
+++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_27172.cnf
@@ -1,3 +1,4 @@
!include include/default_mysqld.cnf
+!include include/default_client.cnf
!include ../my_1_1.cnf
!include ../my_2_1.cnf
diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_27172.test b/storage/spider/mysql-test/spider/bugfix/t/mdev_27172.test
index d6e2ff2c..6e506e9a 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/mdev_27172.test
+++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_27172.test
@@ -2,6 +2,10 @@
--echo # MDEV-27172 Prefix indices on Spider tables may lead to wrong query results
--echo #
+# Disable test for ps-protocol as the general log has different number of
+# commands for --ps
+--source include/no_protocol.inc
+
--disable_query_log
--disable_result_log
--source ../../t/test_init.inc
diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_27184.cnf b/storage/spider/mysql-test/spider/bugfix/t/mdev_27184.cnf
index b0853e32..0ef6f319 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/mdev_27184.cnf
+++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_27184.cnf
@@ -1,2 +1,3 @@
!include include/default_mysqld.cnf
+!include include/default_client.cnf
!include ../my_1_1.cnf
diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_27239.cnf b/storage/spider/mysql-test/spider/bugfix/t/mdev_27239.cnf
index b0853e32..0ef6f319 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/mdev_27239.cnf
+++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_27239.cnf
@@ -1,2 +1,3 @@
!include include/default_mysqld.cnf
+!include include/default_client.cnf
!include ../my_1_1.cnf
diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_27240.cnf b/storage/spider/mysql-test/spider/bugfix/t/mdev_27240.cnf
index b0853e32..0ef6f319 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/mdev_27240.cnf
+++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_27240.cnf
@@ -1,2 +1,3 @@
!include include/default_mysqld.cnf
+!include include/default_client.cnf
!include ../my_1_1.cnf
diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_28739.cnf b/storage/spider/mysql-test/spider/bugfix/t/mdev_28739.cnf
index 05dfd8a0..bd19b855 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/mdev_28739.cnf
+++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_28739.cnf
@@ -1,3 +1,4 @@
!include include/default_mysqld.cnf
+!include include/default_client.cnf
!include ../my_1_1.cnf
!include ../my_2_1.cnf
diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_28739.test b/storage/spider/mysql-test/spider/bugfix/t/mdev_28739.test
index d4ac8e42..78a83b6b 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/mdev_28739.test
+++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_28739.test
@@ -8,6 +8,8 @@
--enable_result_log
--enable_query_log
+--enable_prepare_warnings
+
--connection child2_1
CREATE DATABASE auto_test_remote;
USE auto_test_remote;
diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_28739_simple.test b/storage/spider/mysql-test/spider/bugfix/t/mdev_28739_simple.test
index feff85df..29825536 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/mdev_28739_simple.test
+++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_28739_simple.test
@@ -11,6 +11,7 @@
# set @@global.debug_dbug="+d,xid_thd_trace,enter,exit,info,error:o,/tmp/trace2.out:i:F:L";
#set @@global.debug_dbug="d:t:i:o,mysqld.trace";
+--enable_prepare_warnings
set global query_cache_type= on;
set spider_same_server_link=1;
evalp CREATE SERVER srv FOREIGN DATA WRAPPER mysql
diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_28854.cnf b/storage/spider/mysql-test/spider/bugfix/t/mdev_28854.cnf
index 05dfd8a0..bd19b855 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/mdev_28854.cnf
+++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_28854.cnf
@@ -1,3 +1,4 @@
!include include/default_mysqld.cnf
+!include include/default_client.cnf
!include ../my_1_1.cnf
!include ../my_2_1.cnf
diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_28856.test b/storage/spider/mysql-test/spider/bugfix/t/mdev_28856.test
index 9ccfc378..b2781771 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/mdev_28856.test
+++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_28856.test
@@ -49,7 +49,9 @@ drop table t1;
create table t1 (c int) ENGINE=Spider
COMMENT='WRAPPER "mysql", srv "srv",TABLE "t2", query_cache_sync "3"';
create table t2 (c int);
+--disable_ps_protocol
/* 5 */ insert into t1 values (42);
+--enable_ps_protocol
select sql_cache * from t1;
select sql_no_cache * from t1;
@@ -60,7 +62,9 @@ drop table t1, t2;
create table t2 (c int);
create table t1 (c int, primary key (c)) ENGINE=Spider
COMMENT='WRAPPER "mysql", srv "srv",TABLE "t2"';
+--disable_ps_protocol
/* 6 */ insert ignore into t1 values (42), (42);
+--enable_ps_protocol
select * from t1;
drop table t1, t2;
@@ -69,7 +73,9 @@ drop table t1, t2;
create table t2 (c int, primary key (c));
create table t1 (c int) ENGINE=Spider
COMMENT='WRAPPER "mysql", srv "srv",TABLE "t2"';
+--disable_ps_protocol
/* 7 */ insert ignore into t1 values (42), (42);
+--enable_ps_protocol
select * from t1;
drop table t1, t2;
@@ -78,7 +84,9 @@ drop table t1, t2;
create table t2 (c int, primary key (c));
create table t1 (c int, primary key (c)) ENGINE=Spider
COMMENT='WRAPPER "mysql", srv "srv",TABLE "t2"';
+--disable_ps_protocol
/* 8 */ insert ignore into t1 values (42), (42);
+--enable_ps_protocol
select * from t1;
drop table t1, t2;
@@ -87,7 +95,9 @@ drop table t1, t2;
create table t2 (c int, primary key (c));
create table t1 (c int, primary key (c)) ENGINE=Spider
COMMENT='WRAPPER "mysql", srv "srv",TABLE "t2", pk_name "c"';
+--disable_ps_protocol
/* 9 */ insert ignore into t1 values (42), (42);
+--enable_ps_protocol
select * from t1;
drop table t1, t2;
@@ -98,7 +108,9 @@ drop table t1, t2;
create table t2 (c int, unique key (c));
create table t1 (c int, primary key (c)) ENGINE=Spider
COMMENT='WRAPPER "mysql", srv "srv",TABLE "t2", pk_name "c"';
+--disable_ps_protocol
/* 9.1 */ insert ignore into t1 values (42), (42);
+--enable_ps_protocol
select * from t1;
drop table t1, t2;
@@ -108,7 +120,9 @@ drop table t1, t2;
create table t2 (c int, unique key (c));
create table t1 (c int, key (c)) ENGINE=Spider
COMMENT='WRAPPER "mysql", srv "srv",TABLE "t2", pk_name "f"';
+--disable_ps_protocol
/* 10 */ insert ignore into t1 values (42), (42);
+--enable_ps_protocol
select * from t1;
drop table t1, t2;
@@ -118,7 +132,9 @@ drop table t1, t2;
create table t2 (c int, primary key (c));
create table t1 (c int, key (c)) ENGINE=Spider
COMMENT='WRAPPER "mysql", srv "srv",TABLE "t2", pk_name "blah"';
+--disable_ps_protocol
/* 11 */ insert ignore into t1 values (42), (42);
+--enable_ps_protocol
select * from t1;
drop table t1, t2;
@@ -128,7 +144,9 @@ drop table t1, t2;
create table t2 (c int, d int, unique key (c), unique key (d));
create table t1 (c int, d int, key (c), key (d)) ENGINE=Spider
COMMENT='WRAPPER "mysql", srv "srv",TABLE "t2", pk_name "blah"';
+--disable_ps_protocol
/* 12 */ insert ignore into t1 values (42, 43), (43, 43);
+--enable_ps_protocol
select * from t1;
drop table t1, t2;
@@ -138,7 +156,9 @@ create table t2 (c int, d int, primary key (c), key (d));
show create table t2;
create table t1 (c int, d int, primary key (c), key (d)) ENGINE=Spider
COMMENT='WRAPPER "mysql", srv "srv",TABLE "t2", idx000 "f d"';
+--disable_ps_protocol
show create table t1;
+--enable_ps_protocol
/* 13 */ insert into t1 values (42, 23), (37, 93);
select max(d) from t1;
@@ -149,7 +169,9 @@ create table t2 (c int, d int, e int, primary key (c), key (d), unique key (e));
show create table t2;
create table t1 (c int, d int, e int, primary key (c), key (d), unique key (e)) ENGINE=Spider
COMMENT='WRAPPER "mysql", srv "srv",TABLE "t2", idx000 "f PRIMARY", idx001 "u d", idx002 "ig e"';
+--disable_ps_protocol
show create table t1;
+--enable_ps_protocol
/* 14 */ insert into t1 values (42, 23, 89), (37, 93, 47);
select max(d) from t1;
diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_28996.cnf b/storage/spider/mysql-test/spider/bugfix/t/mdev_28996.cnf
index 05dfd8a0..bd19b855 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/mdev_28996.cnf
+++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_28996.cnf
@@ -1,3 +1,4 @@
!include include/default_mysqld.cnf
+!include include/default_client.cnf
!include ../my_1_1.cnf
!include ../my_2_1.cnf
diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_28996.test b/storage/spider/mysql-test/spider/bugfix/t/mdev_28996.test
index 8097fe7e..2b8e6cfb 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/mdev_28996.test
+++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_28996.test
@@ -26,7 +26,9 @@ eval CREATE TABLE tbl_a (
a CHAR(8)
) $MASTER_1_ENGINE $MASTER_1_CHARSET COMMENT='table "tbl_a", srv "s_2_1"';
+--disable_ps_protocol
SELECT MAX(BINARY a) FROM tbl_a;
+--enable_ps_protocol
DROP DATABASE auto_test_local;
diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_28998.test b/storage/spider/mysql-test/spider/bugfix/t/mdev_28998.test
index 51d4c5c9..04d084b2 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/mdev_28998.test
+++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_28998.test
@@ -16,7 +16,9 @@ CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (1),(2);
CREATE TABLE t1_SPIDER (a INT) ENGINE=SPIDER COMMENT = "wrapper 'mysql', srv 's', table 't1'";
+--disable_ps_protocol
CREATE TABLE t2 AS SELECT a FROM t1_SPIDER;
+--enable_ps_protocol
SELECT * FROM t2;
# Cleanup
diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_29008.cnf b/storage/spider/mysql-test/spider/bugfix/t/mdev_29008.cnf
index 05dfd8a0..bd19b855 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/mdev_29008.cnf
+++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_29008.cnf
@@ -1,3 +1,4 @@
!include include/default_mysqld.cnf
+!include include/default_client.cnf
!include ../my_1_1.cnf
!include ../my_2_1.cnf
diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_29008.test b/storage/spider/mysql-test/spider/bugfix/t/mdev_29008.test
index 28d9a924..f7a27cb8 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/mdev_29008.test
+++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_29008.test
@@ -25,7 +25,9 @@ eval CREATE TABLE tbl_a (
b INT
) $MASTER_1_ENGINE $MASTER_1_CHARSET COMMENT='table "tbl_a", srv "s_2_1"';
+--disable_ps_protocol
SELECT MIN(t2.a) AS f1, t1.b AS f2 FROM tbl_a AS t1 JOIN tbl_a AS t2 GROUP BY f2 ORDER BY f1, f2;
+--enable_ps_protocol
--connection master_1
DROP DATABASE IF EXISTS auto_test_local;
diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_29011.cnf b/storage/spider/mysql-test/spider/bugfix/t/mdev_29011.cnf
index 05dfd8a0..bd19b855 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/mdev_29011.cnf
+++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_29011.cnf
@@ -1,3 +1,4 @@
!include include/default_mysqld.cnf
+!include include/default_client.cnf
!include ../my_1_1.cnf
!include ../my_2_1.cnf
diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_29011.test b/storage/spider/mysql-test/spider/bugfix/t/mdev_29011.test
index 6aaf9305..8426dc9c 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/mdev_29011.test
+++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_29011.test
@@ -25,7 +25,9 @@ eval CREATE TABLE tbl_a (
b INT
) $MASTER_1_ENGINE $MASTER_1_CHARSET COMMENT='table "tbl_a", srv "s_2_1"';
+--disable_ps_protocol
SELECT a XOR b AS f FROM tbl_a;
+--enable_ps_protocol
--connection master_1
DROP DATABASE IF EXISTS auto_test_local;
diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_29163.test b/storage/spider/mysql-test/spider/bugfix/t/mdev_29163.test
index 2e56583d..a4e8d080 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/mdev_29163.test
+++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_29163.test
@@ -17,7 +17,9 @@ CREATE TABLE t1_spider (a INT) ENGINE=SPIDER COMMENT = "wrapper 'mysql', srv 's'
CREATE TABLE t2_spider (b INT) ENGINE=SPIDER COMMENT = "wrapper 'mysql', srv 's', table 't2'";
CREATE TABLE t3_spider (c INT, PRIMARY KEY(c)) ENGINE=SPIDER COMMENT = "wrapper 'mysql', srv 's', table 't3'";
+--disable_ps_protocol
SELECT t1_spider.* FROM t1_spider LEFT JOIN t2_spider LEFT JOIN t3_spider ON b = c ON a = b;
+--enable_ps_protocol
# Cleanup
DROP TABLE t1_spider, t2_spider, t3_spider, t1, t2, t3;
diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_29447.cnf b/storage/spider/mysql-test/spider/bugfix/t/mdev_29447.cnf
index 05dfd8a0..bd19b855 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/mdev_29447.cnf
+++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_29447.cnf
@@ -1,3 +1,4 @@
!include include/default_mysqld.cnf
+!include include/default_client.cnf
!include ../my_1_1.cnf
!include ../my_2_1.cnf
diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_29447.test b/storage/spider/mysql-test/spider/bugfix/t/mdev_29447.test
index 60250be6..470bb002 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/mdev_29447.test
+++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_29447.test
@@ -22,8 +22,10 @@ eval CREATE TABLE tbl_a (
a INT
) $MASTER_1_ENGINE $MASTER_1_CHARSET COMMENT='table "tbl_a", srv "s_2_1"';
+--disable_ps_protocol
SELECT TRIM(LEADING 'c' FROM a) FROM tbl_a;
-
+--enable_ps_protocol
+
--connection child2_1
DROP DATABASE auto_test_remote;
diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_29484.cnf b/storage/spider/mysql-test/spider/bugfix/t/mdev_29484.cnf
index 05dfd8a0..bd19b855 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/mdev_29484.cnf
+++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_29484.cnf
@@ -1,3 +1,4 @@
!include include/default_mysqld.cnf
+!include include/default_client.cnf
!include ../my_1_1.cnf
!include ../my_2_1.cnf
diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_29502.test b/storage/spider/mysql-test/spider/bugfix/t/mdev_29502.test
index bacf5073..246c405d 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/mdev_29502.test
+++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_29502.test
@@ -20,7 +20,9 @@ set spider_direct_aggregate=1;
eval CREATE TABLE t1 (a INT KEY) ENGINE=Spider COMMENT='WRAPPER "mysql",srv "$srv",TABLE "t"';
+--disable_ps_protocol
SELECT MAX(a) FROM t1;
+--enable_ps_protocol
SELECT SUM(a) FROM t1;
SELECT COUNT(a) FROM t1;
SELECT MAX(a), SUM(a) FROM t1;
@@ -36,7 +38,9 @@ INSERT INTO t VALUES (23, -1),(48, 97);
eval CREATE TABLE t1 (a INT, b INT) ENGINE=Spider COMMENT='WRAPPER "mysql",srv "$srv",TABLE "t"';
+--disable_ps_protocol
SELECT MAX(a + b), SUM(a - b) FROM t1;
+--enable_ps_protocol
SHOW STATUS LIKE 'Spider_direct_aggregate';
DROP TABLE t, t1;
@@ -49,7 +53,9 @@ INSERT INTO t VALUES (23),(97),(42);
eval CREATE TABLE t1 (a INT) ENGINE=Spider COMMENT='WRAPPER "mysql",srv "$srv",TABLE "t"';
--disable_ps2_protocol
+--disable_ps_protocol
SELECT IF(COUNT(a > 0),'Y','N'), MAX(a) FROM t1;
+--enable_ps_protocol
SHOW STATUS LIKE 'Spider_direct_aggregate';
SELECT MAX(a), IF(COUNT(a > 0),'Y','N') FROM t1;
SHOW STATUS LIKE 'Spider_direct_aggregate';
diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_29562.cnf b/storage/spider/mysql-test/spider/bugfix/t/mdev_29562.cnf
index 05dfd8a0..bd19b855 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/mdev_29562.cnf
+++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_29562.cnf
@@ -1,3 +1,4 @@
!include include/default_mysqld.cnf
+!include include/default_client.cnf
!include ../my_1_1.cnf
!include ../my_2_1.cnf
diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_29562.test b/storage/spider/mysql-test/spider/bugfix/t/mdev_29562.test
index 5ddb2cef..df93a32e 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/mdev_29562.test
+++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_29562.test
@@ -32,7 +32,9 @@ eval CREATE TABLE tbl_a (
eval CREATE TABLE tbl_a (
a INT
) $MASTER_1_ENGINE CHARSET utf8 COMMENT='table "tbl_a", srv "s_2_1"';
+--disable_ps_protocol
SELECT * FROM tbl_a;
+--enable_ps_protocol
--error ER_ILLEGAL_HA_CREATE_OPTION
ALTER TABLE tbl_a CONVERT TO CHARACTER SET utf16;
diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_29644.cnf b/storage/spider/mysql-test/spider/bugfix/t/mdev_29644.cnf
index 05dfd8a0..bd19b855 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/mdev_29644.cnf
+++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_29644.cnf
@@ -1,3 +1,4 @@
!include include/default_mysqld.cnf
+!include include/default_client.cnf
!include ../my_1_1.cnf
!include ../my_2_1.cnf
diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_29644.test b/storage/spider/mysql-test/spider/bugfix/t/mdev_29644.test
index 3a8fbb25..05e62e12 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/mdev_29644.test
+++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_29644.test
@@ -32,7 +32,9 @@ SET sql_mode='';
let SEARCH_FILE= $MYSQLTEST_VARDIR/log/mysqld.1.1.err;
let SEARCH_PATTERN= \[WARN SPIDER RESULT\].* Warning 1265 Data truncated for column 'a' at row 1.*;
+--disable_ps_protocol
INSERT INTO tbl_a VALUES ("this will be truncated");
+--enable_ps_protocol
--source include/search_pattern_in_file.inc # should not find
SET GLOBAL spider_log_result_errors=4;
diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_29653.cnf b/storage/spider/mysql-test/spider/bugfix/t/mdev_29653.cnf
index 05dfd8a0..bd19b855 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/mdev_29653.cnf
+++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_29653.cnf
@@ -1,3 +1,4 @@
!include include/default_mysqld.cnf
+!include include/default_client.cnf
!include ../my_1_1.cnf
!include ../my_2_1.cnf
diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_29653.test b/storage/spider/mysql-test/spider/bugfix/t/mdev_29653.test
index 6accaed3..f0f5c55a 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/mdev_29653.test
+++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_29653.test
@@ -22,7 +22,9 @@ eval CREATE TABLE ts (
c INT
) $MASTER_1_ENGINE COMMENT='table "t", srv "s_2_1"';
+--disable_ps_protocol
SELECT 1 FROM ts WHERE ROW(c, c) NOT IN ((0,0),(1,1));
+--enable_ps_protocol
--connection master_1
DROP DATABASE IF EXISTS auto_test_local;
diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_29667.cnf b/storage/spider/mysql-test/spider/bugfix/t/mdev_29667.cnf
index 05dfd8a0..bd19b855 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/mdev_29667.cnf
+++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_29667.cnf
@@ -1,3 +1,4 @@
!include include/default_mysqld.cnf
+!include include/default_client.cnf
!include ../my_1_1.cnf
!include ../my_2_1.cnf
diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_29676.test b/storage/spider/mysql-test/spider/bugfix/t/mdev_29676.test
new file mode 100644
index 00000000..565d95df
--- /dev/null
+++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_29676.test
@@ -0,0 +1,41 @@
+--echo #
+--echo # MDEV-29676 Dual thread hang in 'closing tables' and 'Waiting for table metadata lock' on Spider CREATE OR REPLACE TABLE
+--echo #
+
+--disable_query_log
+--disable_result_log
+--source ../../t/test_init.inc
+--enable_result_log
+--enable_query_log
+
+--replace_regex /SOCKET ".*"/SOCKET "$MASTER_1_MYSOCK"/
+eval CREATE SERVER srv FOREIGN DATA WRAPPER MYSQL OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
+
+--echo
+--echo # length-0 self-reference
+--echo
+CREATE TABLE t (c INT) ENGINE=Spider COMMENT='WRAPPER "mysql", srv "srv",TABLE "t"';
+CREATE OR REPLACE TABLE t (c INT);
+SHOW CREATE TABLE t;
+DROP TABLE t;
+
+--echo
+--echo # length-2 self-reference
+--echo
+CREATE TABLE t2 (c int);
+CREATE TABLE t1 (c int) ENGINE=Spider COMMENT='WRAPPER "mysql", srv "srv",TABLE "t2"';
+CREATE TABLE t0 (c int) ENGINE=Spider COMMENT='WRAPPER "mysql", srv "srv",TABLE "t1"';
+ALTER TABLE t2 ENGINE=Spider COMMENT='WRAPPER "mysql", srv "srv",TABLE "t0"';
+# warnings
+CREATE OR REPLACE TABLE t0 (c int);
+SHOW CREATE TABLE t0;
+# no warnings
+CREATE OR REPLACE TABLE t1 (c int);
+SHOW CREATE TABLE t1;
+drop TABLE t0, t1, t2;
+
+--disable_query_log
+--disable_result_log
+--source ../../t/test_deinit.inc
+--enable_result_log
+--enable_query_log
diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_30191.cnf b/storage/spider/mysql-test/spider/bugfix/t/mdev_30191.cnf
index 05dfd8a0..bd19b855 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/mdev_30191.cnf
+++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_30191.cnf
@@ -1,3 +1,4 @@
!include include/default_mysqld.cnf
+!include include/default_client.cnf
!include ../my_1_1.cnf
!include ../my_2_1.cnf
diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_30392.test b/storage/spider/mysql-test/spider/bugfix/t/mdev_30392.test
index 36e06f3f..a664c7ec 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/mdev_30392.test
+++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_30392.test
@@ -13,7 +13,9 @@ CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (1),(2);
CREATE TABLE t2 (a INT) ENGINE=SPIDER COMMENT = "wrapper 'mysql', srv 'srv', table 't1'";
+--disable_ps_protocol
SELECT a FROM t2 WHERE a IN ( SELECT a FROM t2 );
+--enable_ps_protocol
# Cleanup
diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_31338.test b/storage/spider/mysql-test/spider/bugfix/t/mdev_31338.test
index a3698c97..61859902 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/mdev_31338.test
+++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_31338.test
@@ -13,8 +13,10 @@ set spider_same_server_link=1;
evalp CREATE SERVER srv FOREIGN DATA WRAPPER MYSQL OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
CREATE TABLE t (c BLOB) ENGINE=InnoDB;
CREATE TABLE ts (c BLOB) ENGINE=Spider COMMENT='WRAPPER "mysql",srv "srv",TABLE "t"';
+--disable_ps_protocol
SELECT TRIM(BOTH ' ' FROM c) FROM ts ORDER BY c;
drop table t, ts;
+--enable_ps_protocol
drop server srv;
--disable_query_log
diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_31463.cnf b/storage/spider/mysql-test/spider/bugfix/t/mdev_31463.cnf
new file mode 100644
index 00000000..bd19b855
--- /dev/null
+++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_31463.cnf
@@ -0,0 +1,4 @@
+!include include/default_mysqld.cnf
+!include include/default_client.cnf
+!include ../my_1_1.cnf
+!include ../my_2_1.cnf
diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_31463.test b/storage/spider/mysql-test/spider/bugfix/t/mdev_31463.test
new file mode 100644
index 00000000..f7f27489
--- /dev/null
+++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_31463.test
@@ -0,0 +1,65 @@
+--source include/have_debug.inc
+--echo #
+--echo # MDEV-31463 SIGSEGV in server_mysql_send_query | server_mysql_real_query
+--echo #
+
+# The original test in the report of MDEV-31463 is contrived and
+# nondeterministic, causing MDEV-31586. This test more directly
+# addresses the underlying issue causing MDEV-31463, namely errors
+# from queries sent to the data node not consumed when trying to set
+# lock wait timeout.
+
+--disable_query_log
+--disable_result_log
+--source ../../t/test_init.inc
+--enable_result_log
+--enable_query_log
+
+connection child2_1;
+CREATE DATABASE auto_test_remote;
+USE auto_test_remote;
+eval CREATE TABLE t1 (a INT) $CHILD2_1_ENGINE $CHILD2_1_CHARSET;
+
+connection master_1;
+CREATE DATABASE auto_test_local;
+USE auto_test_local;
+eval CREATE TABLE t2 (a INT) $MASTER_1_ENGINE COMMENT='table "t1", srv "s_2_1"';
+
+# Create a new thread on the spider node server, send an insert query
+# to the spider node. Shutdown the data node server when the query
+# reaches and waits at set lockwait timeout so it fails there. Check
+# the error code is correct.
+connect (master_1_another, localhost, root, , auto_test_local, $MASTER_1_MYPORT, $MASTER_1_MYSOCK);
+SET DEBUG_SYNC='spider_set_lock_wait_timeout_before_query SIGNAL ready WAIT_FOR go';
+send insert into t2 values (42);
+connection master_1;
+SET DEBUG_SYNC='now WAIT_FOR ready';
+
+connection child2_1;
+let $shutdown_timeout=0;
+--source include/shutdown_mysqld.inc
+
+connection master_1;
+SET DEBUG_SYNC='now SIGNAL go';
+connection master_1_another;
+--error ER_CONNECT_TO_FOREIGN_DATA_SOURCE
+reap;
+
+# Cleanup
+connection master_1;
+DROP DATABASE IF EXISTS auto_test_local;
+
+connection child2_1;
+--source include/start_mysqld.inc
+connection child2_1;
+DROP DATABASE IF EXISTS auto_test_remote;
+
+--disable_query_log
+--disable_result_log
+--source ../t/test_deinit.inc
+--enable_query_log
+--enable_result_log
+
+--echo #
+--echo # end test
+--echo #
diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_31524.test b/storage/spider/mysql-test/spider/bugfix/t/mdev_31524.test
deleted file mode 100644
index a5942fad..00000000
--- a/storage/spider/mysql-test/spider/bugfix/t/mdev_31524.test
+++ /dev/null
@@ -1,74 +0,0 @@
---echo
---echo MDEV-31524 Spider variables that double as table params overriding mechanism is buggy
---echo
-
---disable_query_log
---disable_result_log
---source ../../t/test_init.inc
---enable_result_log
---enable_query_log
-
---let $srv=srv_mdev_31524
-SET @old_spider_read_only_mode = @@session.spider_read_only_mode;
-set spider_same_server_link=1;
-evalp CREATE SERVER $srv FOREIGN DATA WRAPPER MYSQL OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
-
-# when the user does not set var nor the table option, the default
-# value (0 in this case) takes effect.
-set session spider_read_only_mode = default;
-create table t2 (c int);
-eval create table t1 (c int) ENGINE=Spider COMMENT='WRAPPER "mysql", srv "$srv",TABLE "t2"';
-/* 1 */ insert into t1 values (42);
-drop table t1, t2;
-
-# when the user sets var but not the table option, the var should be
-# take effect.
-set session spider_read_only_mode = 1;
-create table t2 (c int);
-eval create table t1 (c int) ENGINE=Spider COMMENT='WRAPPER "mysql", srv "$srv",TABLE "t2"';
---error 12518
-/* 2 */ insert into t1 values (42);
-drop table t1, t2;
-
-# when the user sets var to -1 and does not set the table option, the
-# default value takes effect.
-set session spider_read_only_mode = -1;
-create table t2 (c int);
-eval create table t1 (c int) ENGINE=Spider COMMENT='WRAPPER "mysql", srv "$srv",TABLE "t2"';
-/* 3 */ insert into t1 values (42);
-drop table t1, t2;
-
-# when the user does not set the var, but sets the table option, the
-# table option should take effect
-SET session spider_read_only_mode = default;
-create table t2 (c int);
-eval create table t1 (c int) ENGINE=Spider COMMENT='read_only_mode "1", WRAPPER "mysql", srv "$srv",TABLE "t2"';
---error 12518
-/* 4 */ insert into t1 values (42);
-drop table t1, t2;
-
-# when the user sets both var and table option, the table option
-# should take precedence
-set session spider_read_only_mode = 1;
-create table t2 (c int);
-eval create table t1 (c int) ENGINE=Spider COMMENT='read_only_mode "0", WRAPPER "mysql", srv "$srv",TABLE "t2"';
-/* 5 */ insert into t1 values (42);
-drop table t1, t2;
-
-# when the user sets the var to -1 and sets the table option, the
-# table option should take effect
-SET session spider_read_only_mode = -1;
-create table t2 (c int);
-eval create table t1 (c int) ENGINE=Spider COMMENT='read_only_mode "1", WRAPPER "mysql", srv "$srv",TABLE "t2"';
---error 12518
-/* 6 */ insert into t1 values (42);
-drop table t1, t2;
-
-eval drop server $srv;
-
-SET session spider_read_only_mode = @old_spider_read_only_mode;
---disable_query_log
---disable_result_log
---source ../../t/test_deinit.inc
---enable_result_log
---enable_query_log
diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_31645.test b/storage/spider/mysql-test/spider/bugfix/t/mdev_31645.test
index 4dfe3b57..b0883f8f 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/mdev_31645.test
+++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_31645.test
@@ -6,6 +6,8 @@
--source ../../t/test_init.inc
--enable_result_log
--enable_query_log
+
+--enable_prepare_warnings
set spider_same_server_link=1;
evalp CREATE SERVER srv FOREIGN DATA WRAPPER MYSQL OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_31996.test b/storage/spider/mysql-test/spider/bugfix/t/mdev_31996.test
index 93b004a0..7dfa5af9 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/mdev_31996.test
+++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_31996.test
@@ -4,6 +4,7 @@
--enable_result_log
--enable_query_log
+--enable_prepare_warnings
set spider_same_server_link=1;
evalp CREATE SERVER srv FOREIGN DATA WRAPPER mysql
OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_32486.test b/storage/spider/mysql-test/spider/bugfix/t/mdev_32486.test
new file mode 100644
index 00000000..af974ecd
--- /dev/null
+++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_32486.test
@@ -0,0 +1,26 @@
+--echo #
+--echo # MDEV-32486 Assertion `!trx->alloc_line_no[id] || trx->alloc_line_no[id] == line_no' failed in spider_alloc_mem_calc
+--echo #
+--disable_query_log
+--disable_result_log
+--source ../../t/test_init.inc
+--enable_result_log
+--enable_query_log
+CREATE TABLE t (c INT) ENGINE=Spider REMOTE_PORT="1";
+DROP TABLE t;
+--error ER_FOREIGN_SERVER_DOESNT_EXIST
+CREATE TABLE t (c INT) ENGINE=Spider COMMENT="WRAPPER 'mysql', SERVER 's',MONITORING_KIND '1'";
+
+--error ER_FOREIGN_SERVER_DOESNT_EXIST
+CREATE TABLE t (c INT) ENGINE=Spider COMMENT="WRAPPER 'mysql',SRV 's',MONITORING_KIND '2'";
+CREATE TABLE t (c INT) ENGINE=Spider REMOTE_PORT="1";
+drop table t;
+
+--disable_query_log
+--disable_result_log
+--source ../../t/test_deinit.inc
+--enable_result_log
+--enable_query_log
+--echo #
+--echo # end of test mdev_32486
+--echo #
diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_32999.test b/storage/spider/mysql-test/spider/bugfix/t/mdev_32999.test
new file mode 100644
index 00000000..b85fe76e
--- /dev/null
+++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_32999.test
@@ -0,0 +1,22 @@
+--echo #
+--echo # MDEV-32999 ERROR 138 instead of warning, and potential error masking
+--echo #
+--disable_query_log
+--disable_result_log
+--source ../../t/test_init.inc
+--enable_result_log
+--enable_query_log
+set spider_same_server_link=on;
+evalp CREATE SERVER srv FOREIGN DATA WRAPPER mysql
+OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
+--error 12702
+CREATE TABLE t ENGINE=Spider COMMENT='srv "srv",table "t1"';
+drop server srv;
+--disable_query_log
+--disable_result_log
+--source ../../t/test_deinit.inc
+--enable_result_log
+--enable_query_log
+--echo #
+--echo # end of test mdev_32999
+--echo #
diff --git a/storage/spider/mysql-test/spider/bugfix/t/quick_mode_0.cnf b/storage/spider/mysql-test/spider/bugfix/t/quick_mode_0.cnf
index e0ffb99c..37792498 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/quick_mode_0.cnf
+++ b/storage/spider/mysql-test/spider/bugfix/t/quick_mode_0.cnf
@@ -1,4 +1,5 @@
!include include/default_mysqld.cnf
+!include include/default_client.cnf
!include ../my_1_1.cnf
!include ../my_2_1.cnf
!include ../my_2_2.cnf
diff --git a/storage/spider/mysql-test/spider/bugfix/t/quick_mode_0.test b/storage/spider/mysql-test/spider/bugfix/t/quick_mode_0.test
index 3fd9e623..b50ac793 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/quick_mode_0.test
+++ b/storage/spider/mysql-test/spider/bugfix/t/quick_mode_0.test
@@ -1,3 +1,4 @@
+--source include/not_valgrind.inc
--source ../include/quick_mode_0_init.inc
--echo
--echo this test is for MDEV-16520
@@ -57,10 +58,14 @@ eval CREATE TABLE tbl_b (
PRIMARY KEY (pkey)
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_2;
--enable_query_log
+--disable_ps_protocol
INSERT INTO tbl_a (pkey) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+--enable_ps_protocol
INSERT INTO tbl_a (pkey) VALUES (10),(11),(12),(13),(14),(15),(16),(17),(18),(19);
INSERT INTO tbl_a (pkey) VALUES (20),(21),(22),(23),(24),(25),(26),(27),(28),(29);
+--disable_ps_protocol
INSERT INTO tbl_b (pkey) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+--enable_ps_protocol
INSERT INTO tbl_b (pkey) VALUES (10),(11),(12),(13),(14),(15),(16),(17),(18),(19);
INSERT INTO tbl_b (pkey) VALUES (20),(21),(22),(23),(24),(25),(26),(27),(28),(29);
diff --git a/storage/spider/mysql-test/spider/bugfix/t/quick_mode_1.cnf b/storage/spider/mysql-test/spider/bugfix/t/quick_mode_1.cnf
index e0ffb99c..37792498 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/quick_mode_1.cnf
+++ b/storage/spider/mysql-test/spider/bugfix/t/quick_mode_1.cnf
@@ -1,4 +1,5 @@
!include include/default_mysqld.cnf
+!include include/default_client.cnf
!include ../my_1_1.cnf
!include ../my_2_1.cnf
!include ../my_2_2.cnf
diff --git a/storage/spider/mysql-test/spider/bugfix/t/quick_mode_1.test b/storage/spider/mysql-test/spider/bugfix/t/quick_mode_1.test
index 940fa61c..0d86286a 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/quick_mode_1.test
+++ b/storage/spider/mysql-test/spider/bugfix/t/quick_mode_1.test
@@ -1,3 +1,4 @@
+--source include/not_valgrind.inc
--source ../include/quick_mode_1_init.inc
--echo
--echo this test is for MDEV-16520
@@ -57,10 +58,14 @@ eval CREATE TABLE tbl_b (
PRIMARY KEY (pkey)
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_2;
--enable_query_log
+--disable_ps_protocol
INSERT INTO tbl_a (pkey) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+--enable_ps_protocol
INSERT INTO tbl_a (pkey) VALUES (10),(11),(12),(13),(14),(15),(16),(17),(18),(19);
INSERT INTO tbl_a (pkey) VALUES (20),(21),(22),(23),(24),(25),(26),(27),(28),(29);
+--disable_ps_protocol
INSERT INTO tbl_b (pkey) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+--enable_ps_protocol
INSERT INTO tbl_b (pkey) VALUES (10),(11),(12),(13),(14),(15),(16),(17),(18),(19);
INSERT INTO tbl_b (pkey) VALUES (20),(21),(22),(23),(24),(25),(26),(27),(28),(29);
@@ -75,6 +80,7 @@ TRUNCATE TABLE mysql.general_log;
--disable_ps2_protocol
--connection master_1
+explain SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey;
SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey;
--connection child2_1
diff --git a/storage/spider/mysql-test/spider/bugfix/t/quick_mode_2.cnf b/storage/spider/mysql-test/spider/bugfix/t/quick_mode_2.cnf
index e0ffb99c..37792498 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/quick_mode_2.cnf
+++ b/storage/spider/mysql-test/spider/bugfix/t/quick_mode_2.cnf
@@ -1,4 +1,5 @@
!include include/default_mysqld.cnf
+!include include/default_client.cnf
!include ../my_1_1.cnf
!include ../my_2_1.cnf
!include ../my_2_2.cnf
diff --git a/storage/spider/mysql-test/spider/bugfix/t/quick_mode_2.test b/storage/spider/mysql-test/spider/bugfix/t/quick_mode_2.test
index e9270a2e..84af65f0 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/quick_mode_2.test
+++ b/storage/spider/mysql-test/spider/bugfix/t/quick_mode_2.test
@@ -1,3 +1,4 @@
+--source include/not_valgrind.inc
--source ../include/quick_mode_2_init.inc
--echo
--echo this test is for MDEV-16520
@@ -57,10 +58,14 @@ eval CREATE TABLE tbl_b (
PRIMARY KEY (pkey)
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_2;
--enable_query_log
+--disable_ps_protocol
INSERT INTO tbl_a (pkey) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+--enable_ps_protocol
INSERT INTO tbl_a (pkey) VALUES (10),(11),(12),(13),(14),(15),(16),(17),(18),(19);
INSERT INTO tbl_a (pkey) VALUES (20),(21),(22),(23),(24),(25),(26),(27),(28),(29);
+--disable_ps_protocol
INSERT INTO tbl_b (pkey) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+--enable_ps_protocol
INSERT INTO tbl_b (pkey) VALUES (10),(11),(12),(13),(14),(15),(16),(17),(18),(19);
INSERT INTO tbl_b (pkey) VALUES (20),(21),(22),(23),(24),(25),(26),(27),(28),(29);
diff --git a/storage/spider/mysql-test/spider/bugfix/t/quick_mode_3.cnf b/storage/spider/mysql-test/spider/bugfix/t/quick_mode_3.cnf
index e0ffb99c..37792498 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/quick_mode_3.cnf
+++ b/storage/spider/mysql-test/spider/bugfix/t/quick_mode_3.cnf
@@ -1,4 +1,5 @@
!include include/default_mysqld.cnf
+!include include/default_client.cnf
!include ../my_1_1.cnf
!include ../my_2_1.cnf
!include ../my_2_2.cnf
diff --git a/storage/spider/mysql-test/spider/bugfix/t/quick_mode_3.test b/storage/spider/mysql-test/spider/bugfix/t/quick_mode_3.test
index ad042aad..19063b63 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/quick_mode_3.test
+++ b/storage/spider/mysql-test/spider/bugfix/t/quick_mode_3.test
@@ -1,3 +1,4 @@
+--source include/not_valgrind.inc
--source ../include/quick_mode_3_init.inc
--echo
--echo this test is for MDEV-16520
@@ -58,10 +59,14 @@ eval CREATE TABLE tbl_b (
PRIMARY KEY (pkey)
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_2;
--enable_query_log
+--disable_ps_protocol
INSERT INTO tbl_a (pkey) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+--enable_ps_protocol
INSERT INTO tbl_a (pkey) VALUES (10),(11),(12),(13),(14),(15),(16),(17),(18),(19);
INSERT INTO tbl_a (pkey) VALUES (20),(21),(22),(23),(24),(25),(26),(27),(28),(29);
+--disable_ps_protocol
INSERT INTO tbl_b (pkey) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+--enable_ps_protocol
INSERT INTO tbl_b (pkey) VALUES (10),(11),(12),(13),(14),(15),(16),(17),(18),(19);
INSERT INTO tbl_b (pkey) VALUES (20),(21),(22),(23),(24),(25),(26),(27),(28),(29);
diff --git a/storage/spider/mysql-test/spider/bugfix/t/return_found_rows_insert.cnf b/storage/spider/mysql-test/spider/bugfix/t/return_found_rows_insert.cnf
index 05dfd8a0..bd19b855 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/return_found_rows_insert.cnf
+++ b/storage/spider/mysql-test/spider/bugfix/t/return_found_rows_insert.cnf
@@ -1,3 +1,4 @@
!include include/default_mysqld.cnf
+!include include/default_client.cnf
!include ../my_1_1.cnf
!include ../my_2_1.cnf
diff --git a/storage/spider/mysql-test/spider/bugfix/t/return_found_rows_insert.test b/storage/spider/mysql-test/spider/bugfix/t/return_found_rows_insert.test
index d4c0db1e..280f362e 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/return_found_rows_insert.test
+++ b/storage/spider/mysql-test/spider/bugfix/t/return_found_rows_insert.test
@@ -41,7 +41,9 @@ eval CREATE TABLE tbl_a (
PRIMARY KEY (skey)
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1;
--enable_query_log
+--disable_ps_protocol
INSERT INTO tbl_a (skey, dt, tm) VALUES (0, '2012-01-01', '12:00:00'),(1, '2012-02-01', '12:00:00'),(2, '2012-03-01', '12:00:00'),(3, '2012-04-01', '12:00:00'),(4, '2012-05-01', '12:00:00'),(5, '2012-06-01', '12:00:00'),(6, '2012-07-01', '12:00:00'),(7, '2012-08-01', '12:00:00'),(8, '2012-09-01', '12:00:00'),(9, '2012-10-01', '12:00:00');
+--enable_ps_protocol
FLUSH TABLES;
--echo
diff --git a/storage/spider/mysql-test/spider/bugfix/t/return_found_rows_update.cnf b/storage/spider/mysql-test/spider/bugfix/t/return_found_rows_update.cnf
index 05dfd8a0..bd19b855 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/return_found_rows_update.cnf
+++ b/storage/spider/mysql-test/spider/bugfix/t/return_found_rows_update.cnf
@@ -1,3 +1,4 @@
!include include/default_mysqld.cnf
+!include include/default_client.cnf
!include ../my_1_1.cnf
!include ../my_2_1.cnf
diff --git a/storage/spider/mysql-test/spider/bugfix/t/return_found_rows_update.test b/storage/spider/mysql-test/spider/bugfix/t/return_found_rows_update.test
index a5f63978..dd046fce 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/return_found_rows_update.test
+++ b/storage/spider/mysql-test/spider/bugfix/t/return_found_rows_update.test
@@ -41,7 +41,9 @@ eval CREATE TABLE tbl_a (
KEY idx1 (skey,dt)
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1;
--enable_query_log
+--disable_ps_protocol
INSERT INTO tbl_a (skey, dt, tm) VALUES (0, '2012-01-01', '12:00:00'),(1, '2012-02-01', '12:00:00'),(2, '2012-03-01', '12:00:00'),(3, '2012-04-01', '12:00:00'),(4, '2012-05-01', '12:00:00'),(5, '2012-06-01', '12:00:00'),(6, '2012-07-01', '12:00:00'),(7, '2012-08-01', '12:00:00'),(8, '2012-09-01', '12:00:00'),(9, '2012-10-01', '12:00:00');
+--enable_ps_protocol
INSERT INTO tbl_a (skey, dt, tm) VALUES (0, '2013-01-01', '13:00:00'),(1, '2013-02-01', '13:00:00'),(2, '2013-03-01', '13:00:00'),(3, '2013-04-01', '13:00:00'),(4, '2013-05-01', '13:00:00'),(5, '2013-06-01', '13:00:00'),(6, '2013-07-01', '13:00:00'),(7, '2013-08-01', '13:00:00'),(8, '2013-09-01', '13:00:00'),(9, '2013-10-01', '13:00:00');
INSERT INTO tbl_a (skey, dt, tm) VALUES (0, '2012-11-01', '11:00:00'),(1, '2012-12-01', '11:00:00'),(2, '2012-11-30', '11:00:00'),(3, '2012-11-29', '11:00:00'),(4, '2012-11-28', '11:00:00'),(5, '2012-11-27', '11:00:00'),(6, '2012-11-26', '11:00:00'),(7, '2012-11-25', '11:00:00'),(8, '2012-11-24', '11:00:00'),(9, '2012-11-23', '11:00:00');
FLUSH TABLES;
diff --git a/storage/spider/mysql-test/spider/bugfix/t/same_server_link.cnf b/storage/spider/mysql-test/spider/bugfix/t/same_server_link.cnf
index b0853e32..0ef6f319 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/same_server_link.cnf
+++ b/storage/spider/mysql-test/spider/bugfix/t/same_server_link.cnf
@@ -1,2 +1,3 @@
!include include/default_mysqld.cnf
+!include include/default_client.cnf
!include ../my_1_1.cnf
diff --git a/storage/spider/mysql-test/spider/bugfix/t/select_by_null.cnf b/storage/spider/mysql-test/spider/bugfix/t/select_by_null.cnf
index 05dfd8a0..bd19b855 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/select_by_null.cnf
+++ b/storage/spider/mysql-test/spider/bugfix/t/select_by_null.cnf
@@ -1,3 +1,4 @@
!include include/default_mysqld.cnf
+!include include/default_client.cnf
!include ../my_1_1.cnf
!include ../my_2_1.cnf
diff --git a/storage/spider/mysql-test/spider/bugfix/t/select_by_null.test b/storage/spider/mysql-test/spider/bugfix/t/select_by_null.test
index feb7df57..9864ac7b 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/select_by_null.test
+++ b/storage/spider/mysql-test/spider/bugfix/t/select_by_null.test
@@ -37,7 +37,9 @@ eval CREATE TABLE tbl_a (
PRIMARY KEY (pkey)
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1;
--enable_query_log
+--disable_ps_protocol
INSERT INTO tbl_a (pkey) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+--enable_ps_protocol
INSERT INTO tbl_a (pkey) VALUES (10),(11),(12),(13),(14),(15),(16),(17),(18),(19);
INSERT INTO tbl_a (pkey) VALUES (20),(21),(22),(23),(24),(25),(26),(27),(28),(29);
FLUSH TABLES;
@@ -49,7 +51,9 @@ FLUSH TABLES;
TRUNCATE TABLE mysql.general_log;
--connection master_1
+--disable_ps_protocol
SELECT pkey FROM tbl_a WHERE NULL;
+--enable_ps_protocol
--connection child2_1
--disable_ps2_protocol
diff --git a/storage/spider/mysql-test/spider/bugfix/t/select_with_backquote.cnf b/storage/spider/mysql-test/spider/bugfix/t/select_with_backquote.cnf
index 05dfd8a0..bd19b855 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/select_with_backquote.cnf
+++ b/storage/spider/mysql-test/spider/bugfix/t/select_with_backquote.cnf
@@ -1,3 +1,4 @@
!include include/default_mysqld.cnf
+!include include/default_client.cnf
!include ../my_1_1.cnf
!include ../my_2_1.cnf
diff --git a/storage/spider/mysql-test/spider/bugfix/t/select_with_backquote.test b/storage/spider/mysql-test/spider/bugfix/t/select_with_backquote.test
index b511b05b..3713befa 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/select_with_backquote.test
+++ b/storage/spider/mysql-test/spider/bugfix/t/select_with_backquote.test
@@ -39,7 +39,9 @@ eval CREATE TABLE tbl_a (
PRIMARY KEY (pkey)
) $MASTER_1_ENGINE DEFAULT CHARACTER SET utf8 $MASTER_1_COMMENT_2_1;
--enable_query_log
+--disable_ps_protocol
INSERT INTO tbl_a (pkey,txt_utf8) VALUES (0,'01234567'),(1,'12345678'),(2,'23456789'),(3,'34567890'),(4,'45678901'),(5,'56789012'),(6,'67890123'),(7,'78901234'),(8,'89012345'),(9,'90123456');
+--enable_ps_protocol
FLUSH TABLES;
--echo
@@ -51,7 +53,9 @@ TRUNCATE TABLE mysql.general_log;
--disable_ps2_protocol
--connection master_1
SET NAMES utf8;
+--disable_ps_protocol
SELECT `pkey`, LEFT(`txt_utf8`, 4) FROM `auto_test_local`.`tbl_a` ORDER BY LEFT(`txt_utf8`, 4) LIMIT 3;
+--enable_ps_protocol
--connection child2_1
SET NAMES utf8;
diff --git a/storage/spider/mysql-test/spider/bugfix/t/self_reference.cnf b/storage/spider/mysql-test/spider/bugfix/t/self_reference.cnf
index b0853e32..0ef6f319 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/self_reference.cnf
+++ b/storage/spider/mysql-test/spider/bugfix/t/self_reference.cnf
@@ -1,2 +1,3 @@
!include include/default_mysqld.cnf
+!include include/default_client.cnf
!include ../my_1_1.cnf
diff --git a/storage/spider/mysql-test/spider/bugfix/t/slave_transaction_retry_errors_5digit.cnf b/storage/spider/mysql-test/spider/bugfix/t/slave_transaction_retry_errors_5digit.cnf
index c861d27b..f267ad51 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/slave_transaction_retry_errors_5digit.cnf
+++ b/storage/spider/mysql-test/spider/bugfix/t/slave_transaction_retry_errors_5digit.cnf
@@ -1,4 +1,5 @@
!include include/default_mysqld.cnf
+!include include/default_client.cnf
!include ../my_1_1.cnf
!include ../my_2_1.cnf
!include ../my_4_1.cnf
diff --git a/storage/spider/mysql-test/spider/bugfix/t/slave_trx_isolation.cnf b/storage/spider/mysql-test/spider/bugfix/t/slave_trx_isolation.cnf
index 45019d6c..7c33a8af 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/slave_trx_isolation.cnf
+++ b/storage/spider/mysql-test/spider/bugfix/t/slave_trx_isolation.cnf
@@ -1,4 +1,5 @@
!include include/default_mysqld.cnf
+!include include/default_client.cnf
!include ../my_1_1.cnf
!include ../my_2_1.cnf
!include ../my_4_1.cnf
diff --git a/storage/spider/mysql-test/spider/bugfix/t/spider_join_with_non_spider.test b/storage/spider/mysql-test/spider/bugfix/t/spider_join_with_non_spider.test
index 294b469a..349da90a 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/spider_join_with_non_spider.test
+++ b/storage/spider/mysql-test/spider/bugfix/t/spider_join_with_non_spider.test
@@ -8,6 +8,7 @@
--enable_result_log
--enable_query_log
+--enable_prepare_warnings
set spider_same_server_link=1;
evalp CREATE SERVER srv FOREIGN DATA WRAPPER MYSQL OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
create table t1 (c int);
diff --git a/storage/spider/mysql-test/spider/bugfix/t/sql_mode.inc b/storage/spider/mysql-test/spider/bugfix/t/sql_mode.inc
index c4b17f6a..22173000 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/sql_mode.inc
+++ b/storage/spider/mysql-test/spider/bugfix/t/sql_mode.inc
@@ -36,7 +36,9 @@ eval CREATE TABLE tbl_a (
PRIMARY KEY (pkey)
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1;
--enable_query_log
+--disable_ps_protocol
INSERT INTO tbl_a (pkey) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+--enable_ps_protocol
--echo
--echo select test
diff --git a/storage/spider/mysql-test/spider/bugfix/t/sql_mode_mariadb.cnf b/storage/spider/mysql-test/spider/bugfix/t/sql_mode_mariadb.cnf
index 05dfd8a0..bd19b855 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/sql_mode_mariadb.cnf
+++ b/storage/spider/mysql-test/spider/bugfix/t/sql_mode_mariadb.cnf
@@ -1,3 +1,4 @@
!include include/default_mysqld.cnf
+!include include/default_client.cnf
!include ../my_1_1.cnf
!include ../my_2_1.cnf
diff --git a/storage/spider/mysql-test/spider/bugfix/t/sql_mode_mysql.cnf b/storage/spider/mysql-test/spider/bugfix/t/sql_mode_mysql.cnf
index 05dfd8a0..bd19b855 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/sql_mode_mysql.cnf
+++ b/storage/spider/mysql-test/spider/bugfix/t/sql_mode_mysql.cnf
@@ -1,3 +1,4 @@
!include include/default_mysqld.cnf
+!include include/default_client.cnf
!include ../my_1_1.cnf
!include ../my_2_1.cnf
diff --git a/storage/spider/mysql-test/spider/bugfix/t/strict_group_by.cnf b/storage/spider/mysql-test/spider/bugfix/t/strict_group_by.cnf
index e0ffb99c..37792498 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/strict_group_by.cnf
+++ b/storage/spider/mysql-test/spider/bugfix/t/strict_group_by.cnf
@@ -1,4 +1,5 @@
!include include/default_mysqld.cnf
+!include include/default_client.cnf
!include ../my_1_1.cnf
!include ../my_2_1.cnf
!include ../my_2_2.cnf
diff --git a/storage/spider/mysql-test/spider/bugfix/t/strict_group_by.test b/storage/spider/mysql-test/spider/bugfix/t/strict_group_by.test
index eaf149fa..3dd9a740 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/strict_group_by.test
+++ b/storage/spider/mysql-test/spider/bugfix/t/strict_group_by.test
@@ -53,7 +53,9 @@ eval CREATE TABLE tbl_a (
KEY idx1 (skey)
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1;
--enable_query_log
+--disable_ps_protocol
INSERT INTO tbl_a (pkey,skey) VALUES (0,0),(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9);
+--enable_ps_protocol
INSERT INTO tbl_a (pkey,skey) VALUES (10,10),(11,11),(12,12),(13,13),(14,14),(15,15),(16,16),(17,17),(18,18),(19,19);
INSERT INTO tbl_a (pkey,skey) VALUES (20,5),(21,6),(22,7),(23,8),(24,9),(25,10),(26,11),(27,12),(28,13),(29,14);
@@ -72,7 +74,9 @@ set @old_spider_direct_aggregate=@@session.spider_direct_aggregate;
set spider_direct_aggregate=1;
SHOW STATUS LIKE 'Spider_direct_aggregate';
--disable_ps2_protocol
+--disable_ps_protocol
SELECT count(pkey) cnt, skey FROM tbl_a;
+--enable_ps_protocol
--enable_ps2_protocol
SHOW STATUS LIKE 'Spider_direct_aggregate';
set spider_direct_aggregate=@old_spider_direct_aggregate;
diff --git a/storage/spider/mysql-test/spider/bugfix/t/subquery.test b/storage/spider/mysql-test/spider/bugfix/t/subquery.test
index 70238a52..d40b4597 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/subquery.test
+++ b/storage/spider/mysql-test/spider/bugfix/t/subquery.test
@@ -6,6 +6,8 @@
--source ../../t/test_init.inc
--enable_result_log
--enable_query_log
+
+--enable_prepare_warnings
set spider_same_server_link=1;
evalp CREATE SERVER srv FOREIGN DATA WRAPPER MYSQL OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
create table t1 (c1 int);
diff --git a/storage/spider/mysql-test/spider/bugfix/t/sysvar_params.test b/storage/spider/mysql-test/spider/bugfix/t/sysvar_params.test
new file mode 100644
index 00000000..96c0338f
--- /dev/null
+++ b/storage/spider/mysql-test/spider/bugfix/t/sysvar_params.test
@@ -0,0 +1,137 @@
+--echo
+--echo Testing spider sysvar and table params / options, including default values and overriding mechanisms
+--echo
+
+--disable_query_log
+--disable_result_log
+--source ../../t/test_init.inc
+--enable_result_log
+--enable_query_log
+
+# For tests covering overriding mechanism between params and options,
+# including a mix of different levels (partition vs table), see
+# spider/features.engine_defined_attributes.
+SET @old_spider_read_only_mode = @@session.spider_read_only_mode;
+set spider_same_server_link=on;
+evalp CREATE SERVER srv FOREIGN DATA WRAPPER MYSQL OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
+
+--echo # Cases where table params/options are not set
+# when the user does not set var nor the table param/option, the default
+# value (0 in this case) takes effect.
+set session spider_read_only_mode = default;
+create table t2 (c int);
+create table t1 (c int) ENGINE=Spider COMMENT='WRAPPER "mysql", srv "srv",TABLE "t2"';
+--disable_ps_protocol
+/* 1 */ insert into t1 values (42);
+--enable_ps_protocol
+drop table t1, t2;
+
+# when the user sets var but not the table param/option, the var
+# should be take effect.
+set session spider_read_only_mode = 1;
+create table t2 (c int);
+create table t1 (c int) ENGINE=Spider COMMENT='WRAPPER "mysql", srv "srv",TABLE "t2"';
+
+--error 12518
+/* 2 */ insert into t1 values (42);
+drop table t1, t2;
+
+# When the user sets a sysvar to -1, it falls back to default
+set session spider_read_only_mode = -1;
+create table t2 (c int);
+create table t1 (c int) ENGINE=Spider COMMENT='WRAPPER "mysql", srv "srv",TABLE "t2"';
+--disable_ps_protocol
+/* 3 */ insert into t1 values (42);
+--enable_ps_protocol
+drop table t1, t2;
+
+--echo # Cases where table params are set
+# when the user does not set the var, but sets the table param, the
+# table param takes effect
+SET session spider_read_only_mode = default;
+create table t2 (c int);
+create table t1 (c int) ENGINE=Spider COMMENT='read_only_mode "1", WRAPPER "mysql", srv "srv",TABLE "t2"';
+--error 12518
+/* 4 */ insert into t1 values (42);
+drop table t1, t2;
+
+# when the user sets both var and table param, the table param takes
+# precedence
+set session spider_read_only_mode = 1;
+create table t2 (c int);
+create table t1 (c int) ENGINE=Spider COMMENT='read_only_mode "0", WRAPPER "mysql", srv "srv",TABLE "t2"';
+--disable_ps_protocol
+/* 5 */ insert into t1 values (42);
+--enable_ps_protocol
+drop table t1, t2;
+
+# when the user sets the var to -1 and sets the table param, the
+# table param takes effect
+SET session spider_read_only_mode = -1;
+create table t2 (c int);
+eval create table t1 (c int) ENGINE=Spider COMMENT='read_only_mode "1", WRAPPER "mysql", srv "$srv",TABLE "t2"';
+--error 12518
+/* 6 */ insert into t1 values (42);
+drop table t1, t2;
+
+--echo # Cases where table options are set
+# when the user does not set the var, but sets the table option, the
+# table option should take effect
+SET session spider_read_only_mode = default;
+create table t2 (c int);
+create table t1 (c int) ENGINE=Spider REMOTE_SERVER=srv REMOTE_TABLE=t2 READ_ONLY=1 WRAPPER=mysql;
+--error 12518
+/* 7 */ insert into t1 values (42);
+drop table t1, t2;
+
+# when the user sets both var and table option, the table option
+# should take precedence
+set session spider_read_only_mode = 1;
+create table t2 (c int);
+create table t1 (c int) ENGINE=Spider READ_ONLY=0 REMOTE_SERVER=srv REMOTE_TABLE=t2 WRAPPER=mysql;
+/* 8 */ insert into t1 values (42);
+drop table t1, t2;
+
+# when the user sets the var to -1 and sets the table option, the
+# table option takes effect
+SET session spider_read_only_mode = -1;
+create table t2 (c int);
+create table t1 (c int) ENGINE=Spider READ_ONLY=1 REMOTE_SERVER=srv REMOTE_TABLE=t2 WRAPPER=mysql;
+--error 12518
+/* 9 */ insert into t1 values (42);
+drop table t1, t2;
+
+# the default table option falls back to sysvar
+SET session spider_read_only_mode = 0;
+create table t2 (c int);
+create table t1 (c int) ENGINE=Spider READ_ONLY=default REMOTE_SERVER=srv REMOTE_TABLE=t2 WRAPPER=mysql;
+/* 10 */ insert into t1 values (42);
+drop table t1, t2;
+
+# the default table option falls back to sysvar
+SET session spider_read_only_mode = 1;
+create table t2 (c int);
+create table t1 (c int) ENGINE=Spider READ_ONLY=default REMOTE_SERVER=srv REMOTE_TABLE=t2 WRAPPER=mysql;
+--error 12518
+/* 11 */ insert into t1 values (42);
+drop table t1, t2;
+
+# the default table option falls back to sysvar
+SET session spider_read_only_mode = -1;
+create table t2 (c int);
+create table t1 (c int) ENGINE=Spider READ_ONLY=default REMOTE_SERVER=srv REMOTE_TABLE=t2 WRAPPER=mysql;
+/* 12 */ insert into t1 values (42);
+drop table t1, t2;
+
+drop server srv;
+
+SET session spider_read_only_mode = @old_spider_read_only_mode;
+--disable_query_log
+--disable_result_log
+--source ../../t/test_deinit.inc
+--enable_result_log
+--enable_query_log
+
+--echo #
+--echo # End of test sysvar_params
+--echo #
diff --git a/storage/spider/mysql-test/spider/bugfix/t/udf_mysql_func_early.cnf b/storage/spider/mysql-test/spider/bugfix/t/udf_mysql_func_early.cnf
index 05dfd8a0..bd19b855 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/udf_mysql_func_early.cnf
+++ b/storage/spider/mysql-test/spider/bugfix/t/udf_mysql_func_early.cnf
@@ -1,3 +1,4 @@
!include include/default_mysqld.cnf
+!include include/default_client.cnf
!include ../my_1_1.cnf
!include ../my_2_1.cnf
diff --git a/storage/spider/mysql-test/spider/bugfix/t/udf_mysql_func_early_init_file.cnf b/storage/spider/mysql-test/spider/bugfix/t/udf_mysql_func_early_init_file.cnf
index 05dfd8a0..bd19b855 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/udf_mysql_func_early_init_file.cnf
+++ b/storage/spider/mysql-test/spider/bugfix/t/udf_mysql_func_early_init_file.cnf
@@ -1,3 +1,4 @@
!include include/default_mysqld.cnf
+!include include/default_client.cnf
!include ../my_1_1.cnf
!include ../my_2_1.cnf
diff --git a/storage/spider/mysql-test/spider/bugfix/t/wait_timeout.cnf b/storage/spider/mysql-test/spider/bugfix/t/wait_timeout.cnf
index e0ffb99c..37792498 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/wait_timeout.cnf
+++ b/storage/spider/mysql-test/spider/bugfix/t/wait_timeout.cnf
@@ -1,4 +1,5 @@
!include include/default_mysqld.cnf
+!include include/default_client.cnf
!include ../my_1_1.cnf
!include ../my_2_1.cnf
!include ../my_2_2.cnf
diff --git a/storage/spider/mysql-test/spider/bugfix/t/wrapper_mariadb.cnf b/storage/spider/mysql-test/spider/bugfix/t/wrapper_mariadb.cnf
index 05dfd8a0..bd19b855 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/wrapper_mariadb.cnf
+++ b/storage/spider/mysql-test/spider/bugfix/t/wrapper_mariadb.cnf
@@ -1,3 +1,4 @@
!include include/default_mysqld.cnf
+!include include/default_client.cnf
!include ../my_1_1.cnf
!include ../my_2_1.cnf
diff --git a/storage/spider/mysql-test/spider/bugfix/t/wrapper_mariadb.test b/storage/spider/mysql-test/spider/bugfix/t/wrapper_mariadb.test
index d32af316..3add8d18 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/wrapper_mariadb.test
+++ b/storage/spider/mysql-test/spider/bugfix/t/wrapper_mariadb.test
@@ -37,7 +37,9 @@ eval CREATE TABLE tbl_a (
PRIMARY KEY (pkey)
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1;
--enable_query_log
+--disable_ps_protocol
INSERT INTO tbl_a (pkey) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+--enable_ps_protocol
--echo
--echo select test
diff --git a/storage/spider/mysql-test/spider/bugfix/t/xa_cmd.cnf b/storage/spider/mysql-test/spider/bugfix/t/xa_cmd.cnf
index 05dfd8a0..bd19b855 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/xa_cmd.cnf
+++ b/storage/spider/mysql-test/spider/bugfix/t/xa_cmd.cnf
@@ -1,3 +1,4 @@
!include include/default_mysqld.cnf
+!include include/default_client.cnf
!include ../my_1_1.cnf
!include ../my_2_1.cnf
diff --git a/storage/spider/mysql-test/spider/bugfix/t/xa_cmd.test b/storage/spider/mysql-test/spider/bugfix/t/xa_cmd.test
index 1e831453..4039bdaf 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/xa_cmd.test
+++ b/storage/spider/mysql-test/spider/bugfix/t/xa_cmd.test
@@ -43,7 +43,9 @@ TRUNCATE TABLE mysql.general_log;
--connection master_1
XA START 'test';
+--disable_ps_protocol
INSERT INTO tbl_a (pkey) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+--enable_ps_protocol
XA END 'test';
XA PREPARE 'test';
XA COMMIT 'test';
diff --git a/storage/spider/mysql-test/spider/feature/my.cnf b/storage/spider/mysql-test/spider/feature/my.cnf
index b7f76a63..d34c836d 100644
--- a/storage/spider/mysql-test/spider/feature/my.cnf
+++ b/storage/spider/mysql-test/spider/feature/my.cnf
@@ -1,2 +1,3 @@
!include include/default_mysqld.cnf
+!include include/default_client.cnf
!include my_1_1.cnf
diff --git a/storage/spider/mysql-test/spider/feature/r/checksum_table_parallel_extended.result b/storage/spider/mysql-test/spider/feature/r/checksum_table_parallel_extended.result
index 91f162a6..dec338aa 100644
--- a/storage/spider/mysql-test/spider/feature/r/checksum_table_parallel_extended.result
+++ b/storage/spider/mysql-test/spider/feature/r/checksum_table_parallel_extended.result
@@ -41,6 +41,11 @@ CREATE TABLE tbl_a (
pkey int NOT NULL,
PRIMARY KEY (pkey)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
INSERT INTO tbl_a (pkey) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
INSERT INTO tbl_a (pkey) VALUES (10),(11),(12),(13),(14),(15),(16),(17),(18),(19);
INSERT INTO tbl_a (pkey) VALUES (20),(21),(22),(23),(24),(25),(26),(27),(28),(29);
diff --git a/storage/spider/mysql-test/spider/feature/r/checksum_table_parallel_no_opt.result b/storage/spider/mysql-test/spider/feature/r/checksum_table_parallel_no_opt.result
index ac114702..b705ecab 100644
--- a/storage/spider/mysql-test/spider/feature/r/checksum_table_parallel_no_opt.result
+++ b/storage/spider/mysql-test/spider/feature/r/checksum_table_parallel_no_opt.result
@@ -41,6 +41,11 @@ CREATE TABLE tbl_a (
pkey int NOT NULL,
PRIMARY KEY (pkey)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
INSERT INTO tbl_a (pkey) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
INSERT INTO tbl_a (pkey) VALUES (10),(11),(12),(13),(14),(15),(16),(17),(18),(19);
INSERT INTO tbl_a (pkey) VALUES (20),(21),(22),(23),(24),(25),(26),(27),(28),(29);
diff --git a/storage/spider/mysql-test/spider/feature/r/checksum_table_parallel_quick.result b/storage/spider/mysql-test/spider/feature/r/checksum_table_parallel_quick.result
index 34786113..6285890f 100644
--- a/storage/spider/mysql-test/spider/feature/r/checksum_table_parallel_quick.result
+++ b/storage/spider/mysql-test/spider/feature/r/checksum_table_parallel_quick.result
@@ -41,6 +41,11 @@ CREATE TABLE tbl_a (
pkey int NOT NULL,
PRIMARY KEY (pkey)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
INSERT INTO tbl_a (pkey) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
INSERT INTO tbl_a (pkey) VALUES (10),(11),(12),(13),(14),(15),(16),(17),(18),(19);
INSERT INTO tbl_a (pkey) VALUES (20),(21),(22),(23),(24),(25),(26),(27),(28),(29);
diff --git a/storage/spider/mysql-test/spider/feature/r/engine_defined_attributes.result b/storage/spider/mysql-test/spider/feature/r/engine_defined_attributes.result
index c772ecf7..fcdc1ac8 100644
--- a/storage/spider/mysql-test/spider/feature/r/engine_defined_attributes.result
+++ b/storage/spider/mysql-test/spider/feature/r/engine_defined_attributes.result
@@ -26,6 +26,270 @@ a INT,
b VARCHAR(255),
PRIMARY KEY(a)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+# Every option all at once
+connection master_1;
+CREATE TABLE tbl_a (
+a INT,
+b VARCHAR(255),
+c1 INT,
+c2 INT,
+PRIMARY KEY(a), UNIQUE KEY(c1), KEY(c2)
+) ENGINE=Spider DEFAULT CHARSET=utf8
+AUTO_INCREMENT_MODE=1
+BGS_MODE=1
+BULK_SIZE=41
+BULK_UPDATE_SIZE=42
+CONNECT_TIMEOUT="43 44"
+REMOTE_DATABASE=foo63
+DEFAULT_FILE=foo44
+DEFAULT_GROUP=foo45
+DELETE_ALL_ROWS_TYPE=0
+DRIVER=foo47
+DSN=foo48
+FILEDSN=foo49
+FORCE_BULK_DELETE=1
+FORCE_BULK_UPDATE=NO
+REMOTE_HOST=foo52
+IDX="f c1 ig PRIMARY u c2"
+MULTI_SPLIT_READ=54
+NET_READ_TIMEOUT=" 55 56"
+NET_WRITE_TIMEOUT=" 56 "
+REMOTE_PASSWORD=foo57
+REMOTE_PORT="234 837 "
+PRIORITY=59
+QUERY_CACHE=2
+QUERY_CACHE_SYNC=3
+READ_ONLY=1
+REMOTE_SERVER=s_2_1
+SKIP_PARALLEL_SEARCH=2
+REMOTE_SOCKET=foo67
+SSL_CAPATH=foo68
+SSL_CA=foo69
+SSL_CERT=foo70
+SSL_CIPHER=foo71
+SSL_KEY=foo72
+SSL_VSC=1
+REMOTE_TABLE=foo65
+TABLE_COUNT_MODE=3
+REMOTE_USERNAME=foo75
+USE_PUSHDOWN_UDF=YES
+WRAPPER=mysql;
+Warnings:
+Warning 138 The high availability feature of Spider has been deprecated and will be removed in a future release
+Warning 138 The high availability feature of Spider has been deprecated and will be removed in a future release
+Warning 138 The high availability feature of Spider has been deprecated and will be removed in a future release
+drop table tbl_a;
+# different option types
+## bool
+CREATE TABLE tbl_a (
+a INT,
+b VARCHAR(255),
+PRIMARY KEY(a)
+) ENGINE=Spider DEFAULT CHARSET=utf8
+REMOTE_SERVER="s_2_1" REMOTE_TABLE="tbl_a" READ_ONLY=1;
+show create table tbl_a;
+Table Create Table
+tbl_a CREATE TABLE `tbl_a` (
+ `a` int(11) NOT NULL,
+ `b` varchar(255) DEFAULT NULL,
+ PRIMARY KEY (`a`)
+) ENGINE=SPIDER DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci `REMOTE_SERVER`='s_2_1' `REMOTE_TABLE`='tbl_a' `READ_ONLY`=1
+INSERT INTO tbl_a VALUES (1, "aaa"), (2, "bbb"), (3, "ccc"), (4, "ddd");
+ERROR HY000: Table 'auto_test_local.tbl_a' is read only
+SELECT * FROM tbl_a;
+a b
+DROP TABLE tbl_a;
+CREATE TABLE tbl_a (a INT) ENGINE=Spider DEFAULT CHARSET=utf8
+READ_ONLY=1k;
+ERROR HY000: The table option READ_ONLY=1k is invalid
+CREATE TABLE tbl_a (a INT) ENGINE=Spider DEFAULT CHARSET=utf8
+READ_ONLY=k1;
+ERROR HY000: The table option READ_ONLY=k1 is invalid
+CREATE TABLE tbl_a (a INT) ENGINE=Spider DEFAULT CHARSET=utf8
+READ_ONLY=2;
+ERROR HY000: The table option READ_ONLY=2 is invalid
+CREATE TABLE tbl_a (a INT) ENGINE=Spider DEFAULT CHARSET=utf8
+READ_ONLY=NOPE;
+ERROR HY000: The table option READ_ONLY=NOPE is invalid
+## bounded_nat
+CREATE TABLE tbl_a (
+a INT,
+b VARCHAR(255),
+PRIMARY KEY(a)
+) ENGINE=Spider DEFAULT CHARSET=utf8
+REMOTE_SERVER=s_2_1 REMOTE_TABLE=tbl_a QUERY_CACHE=2;
+INSERT INTO tbl_a VALUES (1, "aaa"), (2, "bbb"), (3, "ccc"), (4, "ddd");
+connection child2_1;
+SET @old_general_log = @@global.general_log;
+SET @old_log_output = @@global.log_output;
+SET global general_log = 1;
+SET global log_output = "TABLE";
+connection master_1;
+SELECT * FROM tbl_a;
+a b
+1 aaa
+2 bbb
+3 ccc
+4 ddd
+connection child2_1;
+select argument from mysql.general_log where argument like "select sql_no_cache%" limit 1;
+argument
+select sql_no_cache t0.`a` `a`,t0.`b` `b` from `auto_test_remote`.`tbl_a` t0
+SET global general_log = @old_general_log;
+SET global log_output = @old_log_output;
+truncate table mysql.general_log;
+connection master_1;
+DELETE FROM tbl_a;
+DROP TABLE tbl_a;
+CREATE TABLE tbl_a (a INT) ENGINE=Spider DEFAULT CHARSET=utf8
+AUTO_INCREMENT_MODE=1k;
+ERROR HY000: The table option AUTO_INCREMENT_MODE=1k is invalid
+CREATE TABLE tbl_a (a INT) ENGINE=Spider DEFAULT CHARSET=utf8
+AUTO_INCREMENT_MODE=k1;
+ERROR HY000: The table option AUTO_INCREMENT_MODE=k1 is invalid
+CREATE TABLE tbl_a (a INT) ENGINE=Spider DEFAULT CHARSET=utf8
+AUTO_INCREMENT_MODE=4;
+ERROR HY000: The table option AUTO_INCREMENT_MODE=4 is invalid
+CREATE TABLE tbl_a (a INT) ENGINE=Spider DEFAULT CHARSET=utf8
+AUTO_INCREMENT_MODE=-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 '-1' at line 2
+CREATE TABLE tbl_a (a INT) ENGINE=Spider DEFAULT CHARSET=utf8
+AUTO_INCREMENT_MODE="-1";
+ERROR HY000: The table option AUTO_INCREMENT_MODE=-1 is invalid
+## bounded_nat_list
+CREATE TABLE tbl_a (a INT) ENGINE=Spider DEFAULT CHARSET=utf8
+REMOTE_PORT="123 456";
+Warnings:
+Warning 138 The high availability feature of Spider has been deprecated and will be removed in a future release
+select db_name, table_name, port from mysql.spider_tables;
+db_name table_name port
+auto_test_local tbl_a 123
+auto_test_local tbl_a 456
+drop table tbl_a;
+CREATE TABLE tbl_a (a INT) ENGINE=Spider DEFAULT CHARSET=utf8
+REMOTE_PORT="123 999a";
+ERROR HY000: The table option REMOTE_PORT=123 999a is invalid
+CREATE TABLE tbl_a (a INT) ENGINE=Spider DEFAULT CHARSET=utf8
+REMOTE_PORT="123 a999";
+ERROR HY000: The table option REMOTE_PORT=123 a999 is invalid
+CREATE TABLE tbl_a (a INT) ENGINE=Spider DEFAULT CHARSET=utf8
+REMOTE_PORT="123 99999";
+ERROR HY000: The table option REMOTE_PORT=123 99999 is invalid
+## nat_longlong
+CREATE TABLE tbl_a (a INT) ENGINE=Spider DEFAULT CHARSET=utf8
+PRIORITY=1234567890123456789;
+select db_name, table_name, priority from mysql.spider_tables;
+db_name table_name priority
+auto_test_local tbl_a 1234567890123456789
+drop table tbl_a;
+## hint
+CREATE TABLE tbl_a (
+a INT,
+b VARCHAR(255),
+PRIMARY KEY(a)
+) ENGINE=Spider DEFAULT CHARSET=utf8
+REMOTE_SERVER=s_2_1 REMOTE_TABLE=tbl_a IDX="f PRIMARY";
+INSERT INTO tbl_a VALUES (1, "aaa"), (2, "bbb"), (3, "ccc"), (4, "ddd");
+connection child2_1;
+SET @old_general_log = @@global.general_log;
+SET @old_log_output = @@global.log_output;
+SET global general_log = 1;
+SET global log_output = "TABLE";
+connection master_1;
+SELECT max(a) FROM tbl_a;
+max(a)
+4
+connection child2_1;
+select argument from mysql.general_log
+where argument like "select `a` %force index (primary)%" limit 1;
+argument
+select `a` from `auto_test_remote`.`tbl_a` FORCE INDEX (PRIMARY) order by `a` desc limit 1
+SET global general_log = @old_general_log;
+SET global log_output = @old_log_output;
+truncate table mysql.general_log;
+connection master_1;
+DELETE FROM tbl_a;
+DROP TABLE tbl_a;
+CREATE TABLE tbl_a (a1 INT, a2 INT, UNIQUE KEY (a2)) ENGINE=Spider DEFAULT CHARSET=utf8
+IDX="f a1 u c";
+ERROR HY000: The table option IDX=f a1 u c is invalid
+CREATE TABLE tbl_a (a1 INT, a2 INT, UNIQUE KEY (a2)) ENGINE=Spider DEFAULT CHARSET=utf8
+IDX="f a2 u a1";
+ERROR HY000: The table option IDX=f a2 u a1 is invalid
+CREATE TABLE tbl_a (a INT, b INT, UNIQUE KEY (b)) ENGINE=Spider DEFAULT CHARSET=utf8
+IDX="f b f";
+ERROR HY000: The table option IDX=f b f is invalid
+CREATE TABLE tbl_a (
+a INT,
+b VARCHAR(255),
+c1 INT,
+c2 INT,
+PRIMARY KEY(a), UNIQUE KEY(c1), KEY(c2)
+) ENGINE=Spider DEFAULT CHARSET=utf8
+IDX=" f c2 ig c1 u PRIMARY ";
+drop table tbl_a;
+# Misc cases
+set session spider_suppress_comment_ignored_warning=1;
+CREATE TABLE tbl_a (a INT) ENGINE=Spider DEFAULT CHARSET=utf8
+REMOTE_TABLE=t COMMENT="My favourite spider table";
+drop table tbl_a;
+set session spider_suppress_comment_ignored_warning=0;
+CREATE TABLE tbl_a (a INT) ENGINE=Spider DEFAULT CHARSET=utf8
+REMOTE_TABLE=t CONNECTION="srv s_2_1";
+Warnings:
+Warning 12529 The table or partition COMMENT or CONNECTION string 'srv s_2_1' is not used as connection info because spider_ignore_comment is 1 or at least one table option has been specified
+drop table tbl_a;
+CREATE TABLE tbl_a (
+a INT,
+b VARCHAR(255),
+PRIMARY KEY(a)
+) ENGINE=Spider DEFAULT CHARSET=utf8
+REMOTE_SERVER="s_2_1" REMOTE_TABLE="tbl_a" READ_ONLY=0 READ_ONLY=1;
+show create table tbl_a;
+Table Create Table
+tbl_a CREATE TABLE `tbl_a` (
+ `a` int(11) NOT NULL,
+ `b` varchar(255) DEFAULT NULL,
+ PRIMARY KEY (`a`)
+) ENGINE=SPIDER DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci `REMOTE_SERVER`='s_2_1' `REMOTE_TABLE`='tbl_a' `READ_ONLY`=1
+INSERT INTO tbl_a VALUES (1, "aaa"), (2, "bbb"), (3, "ccc"), (4, "ddd");
+ERROR HY000: Table 'auto_test_local.tbl_a' is read only
+SELECT * FROM tbl_a;
+a b
+DROP TABLE tbl_a;
+connection master_1;
+CREATE TABLE tbl_a (
+a INT,
+b VARCHAR(255),
+PRIMARY KEY(a)
+) ENGINE=Spider DEFAULT CHARSET=utf8
+REMOTE_SERVER="s_2_1" REMOTE_TABLE="tbl_a" READ_ONLY=1;
+show create table tbl_a;
+Table Create Table
+tbl_a CREATE TABLE `tbl_a` (
+ `a` int(11) NOT NULL,
+ `b` varchar(255) DEFAULT NULL,
+ PRIMARY KEY (`a`)
+) ENGINE=SPIDER DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci `REMOTE_SERVER`='s_2_1' `REMOTE_TABLE`='tbl_a' `READ_ONLY`=1
+INSERT INTO tbl_a VALUES (1, "aaa"), (2, "bbb"), (3, "ccc"), (4, "ddd");
+ERROR HY000: Table 'auto_test_local.tbl_a' is read only
+ALTER TABLE tbl_a READ_ONLY=0;
+INSERT INTO tbl_a VALUES (1, "aaa"), (2, "bbb"), (3, "ccc"), (4, "ddd");
+show create table tbl_a;
+Table Create Table
+tbl_a CREATE TABLE `tbl_a` (
+ `a` int(11) NOT NULL,
+ `b` varchar(255) DEFAULT NULL,
+ PRIMARY KEY (`a`)
+) ENGINE=SPIDER DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci `REMOTE_SERVER`='s_2_1' `REMOTE_TABLE`='tbl_a' `READ_ONLY`=0
+SELECT * FROM tbl_a;
+a b
+1 aaa
+2 bbb
+3 ccc
+4 ddd
+DELETE FROM tbl_a;
+DROP TABLE tbl_a;
# Single data node
connection master_1;
CREATE TABLE tbl_a (
@@ -51,6 +315,8 @@ b VARCHAR(255),
PRIMARY KEY(a)
) ENGINE=Spider DEFAULT CHARSET=utf8
REMOTE_SERVER="s_2_1 s_2_2" REMOTE_TABLE="tbl_a";
+Warnings:
+Warning 138 The high availability feature of Spider has been deprecated and will be removed in a future release
INSERT INTO tbl_a VALUES (1, "aaa"), (2, "bbb"), (3, "ccc"), (4, "ddd");
SELECT * FROM tbl_a;
a b
@@ -95,6 +361,14 @@ a b
4 ddd
DELETE FROM tbl_a;
DROP TABLE tbl_a;
+connection master_1;
+CREATE TABLE tbl_a (
+a INT,
+b VARCHAR(255),
+PRIMARY KEY(a)
+) ENGINE=Spider DEFAULT CHARSET=utf8
+REMOTE_SERVER="s_2_1" REMOTE_TABLE="tbl_a" READ_ONLY=maybe;
+ERROR HY000: The table option READ_ONLY=maybe is invalid
# Multiple data nodes with table options + partition options
connection master_1;
CREATE TABLE tbl_a (
@@ -122,7 +396,7 @@ a b
connection master_1;
DELETE FROM tbl_a;
DROP TABLE tbl_a;
-# COMMENT + engine-defined option
+# COMMENT + engine-defined option, COMMENT ignored, invalid (missing table name)
connection master_1;
CREATE TABLE tbl_a (
a INT,
@@ -134,81 +408,103 @@ PARTITION BY RANGE (a) (
PARTITION p1 VALUES LESS THAN (3) COMMENT='srv "s_2_1"',
PARTITION p2 VALUES LESS THAN MAXVALUE REMOTE_SERVER="s_2_2"
);
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 12529 The table or partition COMMENT or CONNECTION string 'tbl "tbl_a"' is not used as connection info because spider_ignore_comment is 1 or at least one table option has been specified
INSERT INTO tbl_a VALUES (1, "aaa"), (2, "bbb"), (3, "ccc"), (4, "ddd");
-SELECT * FROM tbl_a;
-a b
-1 aaa
-2 bbb
-3 ccc
-4 ddd
-connection child2_1;
-SELECT * FROM tbl_a;
-a b
-1 aaa
-2 bbb
-connection master_1;
-DELETE FROM tbl_a;
+ERROR HY000: Remote table 'auto_test_remote2.tbl_a#P#p2' is not found
DROP TABLE tbl_a;
-# COMMENT + engine-defined option (invalid)
-connection master_1;
+set session spider_ignore_comments=1;
CREATE TABLE tbl_a (
a INT,
b VARCHAR(255),
PRIMARY KEY(a)
) ENGINE=Spider DEFAULT CHARSET=utf8
-REMOTE_SERVER="s_2_1" REMOTE_TABLE="tbl_a" COMMENT='tbl "tbl_b"';
-ERROR HY000: Can't create table `auto_test_local`.`tbl_a` (errno: 12501 "Unknown error 12501")
-CREATE TABLE tbl_a (
-a INT,
-b VARCHAR(255),
-PRIMARY KEY(a)
-) ENGINE=Spider DEFAULT CHARSET=utf8
-COMMENT='srv "s_2_1"' REMOTE_TABLE="tbl_a"
+COMMENT='tbl "tbl_a"'
PARTITION BY RANGE (a) (
-PARTITION p1 VALUES LESS THAN (3),
+PARTITION p1 VALUES LESS THAN (3) COMMENT='srv "s_2_1"',
PARTITION p2 VALUES LESS THAN MAXVALUE REMOTE_SERVER="s_2_2"
);
-ERROR HY000: Can't create table `auto_test_local`.`tbl_a` (errno: 12501 "Unknown error 12501")
-# Various combinations of COMMENTs and options
+Warnings:
+Warning 12529 The table or partition COMMENT or CONNECTION string 'srv "s_2_1"' is not used as connection info because spider_ignore_comment is 1 or at least one table option has been specified
+Warning 12529 The table or partition COMMENT or CONNECTION string 'tbl "tbl_a"' is not used as connection info because spider_ignore_comment is 1 or at least one table option has been specified
+Warning 12529 The table or partition COMMENT or CONNECTION string 'tbl "tbl_a"' is not used as connection info because spider_ignore_comment is 1 or at least one table option has been specified
+INSERT INTO tbl_a VALUES (1, "aaa"), (2, "bbb"), (3, "ccc"), (4, "ddd");
+ERROR HY000: Unable to connect to foreign data source: localhost
+DROP TABLE tbl_a;
+set session spider_ignore_comments=0;
+# COMMENT + engine-defined option, COMMENT ignored, ok
+connection master_1;
CREATE TABLE tbl_a (
a INT,
b VARCHAR(255),
PRIMARY KEY(a)
) ENGINE=Spider DEFAULT CHARSET=utf8
-REMOTE_SERVER="s_2_1" REMOTE_DATABASE="auto_test_remote" REMOTE_TABLE="tbl_a";
+REMOTE_SERVER="s_2_1" REMOTE_TABLE="tbl_a"
+PARTITION BY RANGE (a) (
+PARTITION p1 VALUES LESS THAN (3) COMMENT='srv "s_2_2"',
+PARTITION p2 VALUES LESS THAN MAXVALUE REMOTE_SERVER="s_2_2"
+);
+Warnings:
+Warning 12529 The table or partition COMMENT or CONNECTION string 'srv "s_2_2"' is not used as connection info because spider_ignore_comment is 1 or at least one table option has been specified
+INSERT INTO tbl_a VALUES (1, "aaa"), (2, "bbb"), (3, "ccc"), (4, "ddd");
+Warnings:
+Warning 12529 The table or partition COMMENT or CONNECTION string 'srv "s_2_2"' is not used as connection info because spider_ignore_comment is 1 or at least one table option has been specified
+connection child2_1;
SELECT * FROM tbl_a;
a b
+1 aaa
+2 bbb
+connection child2_2;
+SELECT * FROM tbl_a;
+a b
+3 ccc
+4 ddd
+connection master_1;
+DELETE FROM tbl_a;
DROP TABLE tbl_a;
+# COMMENT + engine-defined option, COMMENT ignored, ok
+connection master_1;
CREATE TABLE tbl_a (
a INT,
b VARCHAR(255),
PRIMARY KEY(a)
) ENGINE=Spider DEFAULT CHARSET=utf8
-REMOTE_TABLE="tbl_a"
+REMOTE_SERVER="s_2_1" REMOTE_TABLE="tbl_a" READ_ONLY=YES
PARTITION BY RANGE (a) (
-PARTITION p1 VALUES LESS THAN (3)
-REMOTE_SERVER="s_2_1" COMMENT='database "auto_test_remote"',
-PARTITION p2 VALUES LESS THAN MAXVALUE
-REMOTE_SERVER="s_2_2" REMOTE_DATABASE="auto_test_remote2"
+PARTITION p1 VALUES LESS THAN (3) COMMENT='srv "s_2_2" read_only_mode "0"',
+PARTITION p2 VALUES LESS THAN MAXVALUE REMOTE_SERVER="s_2_2" READ_ONLY=NO
);
+Warnings:
+Warning 12529 The table or partition COMMENT or CONNECTION string 'srv "s_2_2" read_only_mode "0"' is not used as connection info because spider_ignore_comment is 1 or at least one table option has been specified
+INSERT INTO tbl_a VALUES (1, "aaa"), (2, "bbb");
+ERROR HY000: Table 'auto_test_local.tbl_a' is read only
+INSERT INTO tbl_a VALUES (3, "ccc"), (4, "ddd");
+connection child2_1;
SELECT * FROM tbl_a;
a b
+connection child2_2;
+SELECT * FROM tbl_a;
+a b
+3 ccc
+4 ddd
+DELETE FROM tbl_a;
+connection master_1;
DROP TABLE tbl_a;
+connection master_1;
CREATE TABLE tbl_a (
a INT,
b VARCHAR(255),
PRIMARY KEY(a)
) ENGINE=Spider DEFAULT CHARSET=utf8
-COMMENT='tbl "tbl_a"'
-PARTITION BY RANGE (a) (
-PARTITION p1 VALUES LESS THAN (3)
-REMOTE_SERVER="s_2_1" REMOTE_DATABASE="auto_test_remote",
-PARTITION p2 VALUES LESS THAN MAXVALUE
-REMOTE_SERVER="s_2_2" REMOTE_DATABASE="auto_test_remote2"
-);
-SELECT * FROM tbl_a;
-a b
-DROP TABLE tbl_a;
+REMOTE_SERVER="s_2_1" COMMENT='tbl "tbl_b"' REMOTE_TABLE="tbl_a";
+Warnings:
+Warning 12529 The table or partition COMMENT or CONNECTION string 'tbl "tbl_b"' is not used as connection info because spider_ignore_comment is 1 or at least one table option has been specified
+select table_name, server, tgt_table_name from mysql.spider_tables;
+table_name server tgt_table_name
+tbl_a s_2_1 tbl_a
+drop table tbl_a;
CREATE TABLE tbl_a (
a INT
) ENGINE=Spider DEFAULT CHARSET=utf8
@@ -217,7 +513,7 @@ SELECT * FROM tbl_a;
ERROR HY000: Unable to connect to foreign data source: localhost
DROP TABLE tbl_a;
# MDEV-27860 SIGSEGV in spider_parse_connect_info on CREATE TABLE
-CREATE TABLE tbl_a ENGINE=SPIDER COMMENT="TABLE 'unknown_table'"
+CREATE TABLE tbl_a (c INT) ENGINE=SPIDER COMMENT="TABLE 'unknown_table'"
PARTITION BY LIST COLUMNS (c) (
PARTITION p DEFAULT COMMENT="srv 'unknown_server'" ENGINE=SPIDER
);
@@ -234,3 +530,6 @@ child2_1
child2_2
child2_3
for child3
+#
+# end of test engine_defined_attributes
+#
diff --git a/storage/spider/mysql-test/spider/feature/r/pushdown_case.result b/storage/spider/mysql-test/spider/feature/r/pushdown_case.result
index 613ce377..bf373874 100644
--- a/storage/spider/mysql-test/spider/feature/r/pushdown_case.result
+++ b/storage/spider/mysql-test/spider/feature/r/pushdown_case.result
@@ -10,6 +10,8 @@ OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
create table t2 (c int);
create table t1 (c int) ENGINE=Spider
COMMENT='WRAPPER "mysql", srv "srv",TABLE "t2"';
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
insert into t1 values (42), (3), (848), (100);
explain select case c when 3 then "three" when 42 then "answer" else "other" end from t1;
id select_type table type possible_keys key key_len ref rows Extra
diff --git a/storage/spider/mysql-test/spider/feature/r/pushdown_timestamp_diff.result b/storage/spider/mysql-test/spider/feature/r/pushdown_timestamp_diff.result
index 3acd8912..874297d5 100644
--- a/storage/spider/mysql-test/spider/feature/r/pushdown_timestamp_diff.result
+++ b/storage/spider/mysql-test/spider/feature/r/pushdown_timestamp_diff.result
@@ -19,6 +19,8 @@ b CHAR(1),
c DATETIME,
PRIMARY KEY(a)
) ENGINE=Spider COMMENT='WRAPPER "mysql", srv "srv",TABLE "t2"';
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
INSERT INTO t1 (a, b, c) VALUES
(1, 'a', '2018-11-01 10:21:39'),
(2, 'b', '2015-06-30 23:59:59'),
diff --git a/storage/spider/mysql-test/spider/feature/t/checksum_table_parallel.inc b/storage/spider/mysql-test/spider/feature/t/checksum_table_parallel.inc
index 83c3ffd6..1b1b31a5 100644
--- a/storage/spider/mysql-test/spider/feature/t/checksum_table_parallel.inc
+++ b/storage/spider/mysql-test/spider/feature/t/checksum_table_parallel.inc
@@ -53,7 +53,9 @@ eval CREATE TABLE tbl_a (
PRIMARY KEY (pkey)
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1;
--enable_query_log
+--disable_ps_protocol
INSERT INTO tbl_a (pkey) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+--enable_ps_protocol
INSERT INTO tbl_a (pkey) VALUES (10),(11),(12),(13),(14),(15),(16),(17),(18),(19);
INSERT INTO tbl_a (pkey) VALUES (20),(21),(22),(23),(24),(25),(26),(27),(28),(29);
diff --git a/storage/spider/mysql-test/spider/feature/t/checksum_table_parallel_extended.cnf b/storage/spider/mysql-test/spider/feature/t/checksum_table_parallel_extended.cnf
index e0ffb99c..37792498 100644
--- a/storage/spider/mysql-test/spider/feature/t/checksum_table_parallel_extended.cnf
+++ b/storage/spider/mysql-test/spider/feature/t/checksum_table_parallel_extended.cnf
@@ -1,4 +1,5 @@
!include include/default_mysqld.cnf
+!include include/default_client.cnf
!include ../my_1_1.cnf
!include ../my_2_1.cnf
!include ../my_2_2.cnf
diff --git a/storage/spider/mysql-test/spider/feature/t/checksum_table_parallel_no_opt.cnf b/storage/spider/mysql-test/spider/feature/t/checksum_table_parallel_no_opt.cnf
index e0ffb99c..37792498 100644
--- a/storage/spider/mysql-test/spider/feature/t/checksum_table_parallel_no_opt.cnf
+++ b/storage/spider/mysql-test/spider/feature/t/checksum_table_parallel_no_opt.cnf
@@ -1,4 +1,5 @@
!include include/default_mysqld.cnf
+!include include/default_client.cnf
!include ../my_1_1.cnf
!include ../my_2_1.cnf
!include ../my_2_2.cnf
diff --git a/storage/spider/mysql-test/spider/feature/t/checksum_table_parallel_quick.cnf b/storage/spider/mysql-test/spider/feature/t/checksum_table_parallel_quick.cnf
index e0ffb99c..37792498 100644
--- a/storage/spider/mysql-test/spider/feature/t/checksum_table_parallel_quick.cnf
+++ b/storage/spider/mysql-test/spider/feature/t/checksum_table_parallel_quick.cnf
@@ -1,4 +1,5 @@
!include include/default_mysqld.cnf
+!include include/default_client.cnf
!include ../my_1_1.cnf
!include ../my_2_1.cnf
!include ../my_2_2.cnf
diff --git a/storage/spider/mysql-test/spider/feature/t/engine_defined_attributes.cnf b/storage/spider/mysql-test/spider/feature/t/engine_defined_attributes.cnf
index e0ffb99c..37792498 100644
--- a/storage/spider/mysql-test/spider/feature/t/engine_defined_attributes.cnf
+++ b/storage/spider/mysql-test/spider/feature/t/engine_defined_attributes.cnf
@@ -1,4 +1,5 @@
!include include/default_mysqld.cnf
+!include include/default_client.cnf
!include ../my_1_1.cnf
!include ../my_2_1.cnf
!include ../my_2_2.cnf
diff --git a/storage/spider/mysql-test/spider/feature/t/engine_defined_attributes.test b/storage/spider/mysql-test/spider/feature/t/engine_defined_attributes.test
index 0d5c8490..70b55a83 100644
--- a/storage/spider/mysql-test/spider/feature/t/engine_defined_attributes.test
+++ b/storage/spider/mysql-test/spider/feature/t/engine_defined_attributes.test
@@ -30,6 +30,266 @@ eval CREATE TABLE tbl_a (
PRIMARY KEY(a)
) $CHILD2_1_ENGINE $CHILD2_1_CHARSET;
+--echo # Every option all at once
+--connection master_1
+eval CREATE TABLE tbl_a (
+ a INT,
+ b VARCHAR(255),
+ c1 INT,
+ c2 INT,
+ PRIMARY KEY(a), UNIQUE KEY(c1), KEY(c2)
+) $MASTER_1_ENGINE $MASTER_1_CHARSET
+AUTO_INCREMENT_MODE=1
+BGS_MODE=1
+BULK_SIZE=41
+BULK_UPDATE_SIZE=42
+CONNECT_TIMEOUT="43 44"
+REMOTE_DATABASE=foo63
+DEFAULT_FILE=foo44
+DEFAULT_GROUP=foo45
+DELETE_ALL_ROWS_TYPE=0
+DRIVER=foo47
+DSN=foo48
+FILEDSN=foo49
+FORCE_BULK_DELETE=1
+FORCE_BULK_UPDATE=NO
+REMOTE_HOST=foo52
+IDX="f c1 ig PRIMARY u c2"
+MULTI_SPLIT_READ=54
+NET_READ_TIMEOUT=" 55 56"
+NET_WRITE_TIMEOUT=" 56 "
+REMOTE_PASSWORD=foo57
+REMOTE_PORT="234 837 "
+PRIORITY=59
+QUERY_CACHE=2
+QUERY_CACHE_SYNC=3
+READ_ONLY=1
+REMOTE_SERVER=s_2_1
+SKIP_PARALLEL_SEARCH=2
+REMOTE_SOCKET=foo67
+SSL_CAPATH=foo68
+SSL_CA=foo69
+SSL_CERT=foo70
+SSL_CIPHER=foo71
+SSL_KEY=foo72
+SSL_VSC=1
+REMOTE_TABLE=foo65
+TABLE_COUNT_MODE=3
+REMOTE_USERNAME=foo75
+USE_PUSHDOWN_UDF=YES
+WRAPPER=mysql;
+drop table tbl_a;
+
+--echo # different option types
+--echo ## bool
+# test that it has expected effects
+eval CREATE TABLE tbl_a (
+ a INT,
+ b VARCHAR(255),
+ PRIMARY KEY(a)
+) $MASTER_1_ENGINE $MASTER_1_CHARSET
+REMOTE_SERVER="s_2_1" REMOTE_TABLE="tbl_a" READ_ONLY=1;
+show create table tbl_a;
+
+--error 12518
+INSERT INTO tbl_a VALUES (1, "aaa"), (2, "bbb"), (3, "ccc"), (4, "ddd");
+SELECT * FROM tbl_a;
+
+DROP TABLE tbl_a;
+
+# invalid bool
+--error 12528
+eval CREATE TABLE tbl_a (a INT) $MASTER_1_ENGINE $MASTER_1_CHARSET
+READ_ONLY=1k;
+
+--error 12528
+eval CREATE TABLE tbl_a (a INT) $MASTER_1_ENGINE $MASTER_1_CHARSET
+READ_ONLY=k1;
+
+--error 12528
+eval CREATE TABLE tbl_a (a INT) $MASTER_1_ENGINE $MASTER_1_CHARSET
+READ_ONLY=2;
+
+--error 12528
+eval CREATE TABLE tbl_a (a INT) $MASTER_1_ENGINE $MASTER_1_CHARSET
+READ_ONLY=NOPE;
+
+--echo ## bounded_nat
+# test that it has expected effects
+eval CREATE TABLE tbl_a (
+ a INT,
+ b VARCHAR(255),
+ PRIMARY KEY(a)
+) $MASTER_1_ENGINE $MASTER_1_CHARSET
+REMOTE_SERVER=s_2_1 REMOTE_TABLE=tbl_a QUERY_CACHE=2;
+INSERT INTO tbl_a VALUES (1, "aaa"), (2, "bbb"), (3, "ccc"), (4, "ddd");
+--connection child2_1
+SET @old_general_log = @@global.general_log;
+SET @old_log_output = @@global.log_output;
+SET global general_log = 1;
+SET global log_output = "TABLE";
+--connection master_1
+SELECT * FROM tbl_a;
+--connection child2_1
+select argument from mysql.general_log where argument like "select sql_no_cache%" limit 1;
+SET global general_log = @old_general_log;
+SET global log_output = @old_log_output;
+truncate table mysql.general_log;
+--connection master_1
+DELETE FROM tbl_a;
+DROP TABLE tbl_a;
+
+# invalid nat
+--error 12528
+eval CREATE TABLE tbl_a (a INT) $MASTER_1_ENGINE $MASTER_1_CHARSET
+AUTO_INCREMENT_MODE=1k;
+
+--error 12528
+eval CREATE TABLE tbl_a (a INT) $MASTER_1_ENGINE $MASTER_1_CHARSET
+AUTO_INCREMENT_MODE=k1;
+
+# out of bound nat
+--error 12528
+eval CREATE TABLE tbl_a (a INT) $MASTER_1_ENGINE $MASTER_1_CHARSET
+AUTO_INCREMENT_MODE=4;
+
+--error ER_PARSE_ERROR
+eval CREATE TABLE tbl_a (a INT) $MASTER_1_ENGINE $MASTER_1_CHARSET
+AUTO_INCREMENT_MODE=-1;
+
+--error 12528
+eval CREATE TABLE tbl_a (a INT) $MASTER_1_ENGINE $MASTER_1_CHARSET
+AUTO_INCREMENT_MODE="-1";
+
+--echo ## bounded_nat_list
+# test that it has expected effect
+eval CREATE TABLE tbl_a (a INT) $MASTER_1_ENGINE $MASTER_1_CHARSET
+REMOTE_PORT="123 456";
+select db_name, table_name, port from mysql.spider_tables;
+drop table tbl_a;
+
+# invalid nat list
+--error 12528
+eval CREATE TABLE tbl_a (a INT) $MASTER_1_ENGINE $MASTER_1_CHARSET
+REMOTE_PORT="123 999a";
+
+--error 12528
+eval CREATE TABLE tbl_a (a INT) $MASTER_1_ENGINE $MASTER_1_CHARSET
+REMOTE_PORT="123 a999";
+
+# out of bound nat list
+--error 12528
+eval CREATE TABLE tbl_a (a INT) $MASTER_1_ENGINE $MASTER_1_CHARSET
+REMOTE_PORT="123 99999";
+
+--echo ## nat_longlong
+eval CREATE TABLE tbl_a (a INT) $MASTER_1_ENGINE $MASTER_1_CHARSET
+PRIORITY=1234567890123456789;
+select db_name, table_name, priority from mysql.spider_tables;
+drop table tbl_a;
+
+--echo ## hint
+# test that it has expected effects
+eval CREATE TABLE tbl_a (
+ a INT,
+ b VARCHAR(255),
+ PRIMARY KEY(a)
+) $MASTER_1_ENGINE $MASTER_1_CHARSET
+REMOTE_SERVER=s_2_1 REMOTE_TABLE=tbl_a IDX="f PRIMARY";
+INSERT INTO tbl_a VALUES (1, "aaa"), (2, "bbb"), (3, "ccc"), (4, "ddd");
+--connection child2_1
+SET @old_general_log = @@global.general_log;
+SET @old_log_output = @@global.log_output;
+SET global general_log = 1;
+SET global log_output = "TABLE";
+--connection master_1
+SELECT max(a) FROM tbl_a;
+--connection child2_1
+select argument from mysql.general_log
+ where argument like "select `a` %force index (primary)%" limit 1;
+# select argument from mysql.general_log;
+SET global general_log = @old_general_log;
+SET global log_output = @old_log_output;
+truncate table mysql.general_log;
+--connection master_1
+DELETE FROM tbl_a;
+DROP TABLE tbl_a;
+
+# invalid key hint - not a col
+--error 12528
+eval CREATE TABLE tbl_a (a1 INT, a2 INT, UNIQUE KEY (a2)) $MASTER_1_ENGINE $MASTER_1_CHARSET
+IDX="f a1 u c";
+
+# invalid key hint - not a key
+--error 12528
+eval CREATE TABLE tbl_a (a1 INT, a2 INT, UNIQUE KEY (a2)) $MASTER_1_ENGINE $MASTER_1_CHARSET
+IDX="f a2 u a1";
+
+# invalid key hint - wrong format
+--error 12528
+eval CREATE TABLE tbl_a (a INT, b INT, UNIQUE KEY (b)) $MASTER_1_ENGINE $MASTER_1_CHARSET
+IDX="f b f";
+
+# key hint - spaces are fine
+eval CREATE TABLE tbl_a (
+ a INT,
+ b VARCHAR(255),
+ c1 INT,
+ c2 INT,
+ PRIMARY KEY(a), UNIQUE KEY(c1), KEY(c2)
+) $MASTER_1_ENGINE $MASTER_1_CHARSET
+IDX=" f c2 ig c1 u PRIMARY ";
+drop table tbl_a;
+
+--echo # Misc cases
+# comments can be used as comments if options are specified
+set session spider_suppress_comment_ignored_warning=1;
+eval CREATE TABLE tbl_a (a INT) $MASTER_1_ENGINE $MASTER_1_CHARSET
+REMOTE_TABLE=t COMMENT="My favourite spider table";
+drop table tbl_a;
+set session spider_suppress_comment_ignored_warning=0;
+
+# CONNECTION string is ignored if options are specified
+eval CREATE TABLE tbl_a (a INT) $MASTER_1_ENGINE $MASTER_1_CHARSET
+REMOTE_TABLE=t CONNECTION="srv s_2_1";
+drop table tbl_a;
+
+# same option specified twice - last appearance wins
+eval CREATE TABLE tbl_a (
+ a INT,
+ b VARCHAR(255),
+ PRIMARY KEY(a)
+) $MASTER_1_ENGINE $MASTER_1_CHARSET
+REMOTE_SERVER="s_2_1" REMOTE_TABLE="tbl_a" READ_ONLY=0 READ_ONLY=1;
+show create table tbl_a;
+
+--error 12518
+INSERT INTO tbl_a VALUES (1, "aaa"), (2, "bbb"), (3, "ccc"), (4, "ddd");
+SELECT * FROM tbl_a;
+
+DROP TABLE tbl_a;
+
+# update option with alter table
+--connection master_1
+eval CREATE TABLE tbl_a (
+ a INT,
+ b VARCHAR(255),
+ PRIMARY KEY(a)
+) $MASTER_1_ENGINE $MASTER_1_CHARSET
+REMOTE_SERVER="s_2_1" REMOTE_TABLE="tbl_a" READ_ONLY=1;
+show create table tbl_a;
+
+--error 12518
+INSERT INTO tbl_a VALUES (1, "aaa"), (2, "bbb"), (3, "ccc"), (4, "ddd");
+
+ALTER TABLE tbl_a READ_ONLY=0;
+INSERT INTO tbl_a VALUES (1, "aaa"), (2, "bbb"), (3, "ccc"), (4, "ddd");
+show create table tbl_a;
+SELECT * FROM tbl_a;
+
+DELETE FROM tbl_a;
+DROP TABLE tbl_a;
+
--echo # Single data node
--connection master_1
eval CREATE TABLE tbl_a (
@@ -53,7 +313,6 @@ eval CREATE TABLE tbl_a (
PRIMARY KEY(a)
) $MASTER_1_ENGINE $MASTER_1_CHARSET
REMOTE_SERVER="s_2_1 s_2_2" REMOTE_TABLE="tbl_a";
-
INSERT INTO tbl_a VALUES (1, "aaa"), (2, "bbb"), (3, "ccc"), (4, "ddd");
SELECT * FROM tbl_a;
@@ -85,6 +344,16 @@ SELECT * FROM tbl_a;
DELETE FROM tbl_a;
DROP TABLE tbl_a;
+# invalid option value
+--connection master_1
+--error 12528
+eval CREATE TABLE tbl_a (
+ a INT,
+ b VARCHAR(255),
+ PRIMARY KEY(a)
+) $MASTER_1_ENGINE $MASTER_1_CHARSET
+REMOTE_SERVER="s_2_1" REMOTE_TABLE="tbl_a" READ_ONLY=maybe;
+
--echo # Multiple data nodes with table options + partition options
--connection master_1
eval CREATE TABLE tbl_a (
@@ -108,7 +377,10 @@ SELECT * FROM tbl_a;
DELETE FROM tbl_a;
DROP TABLE tbl_a;
---echo # COMMENT + engine-defined option
+--echo # COMMENT + engine-defined option, COMMENT ignored, invalid (missing table name)
+# In this case, the first partition has its comment parsed, because
+# it does not set any options. And the second partition only has the
+# option parsed.
--connection master_1
eval CREATE TABLE tbl_a (
a INT,
@@ -121,80 +393,102 @@ PARTITION BY RANGE (a) (
PARTITION p2 VALUES LESS THAN MAXVALUE REMOTE_SERVER="s_2_2"
);
+--error 12702
INSERT INTO tbl_a VALUES (1, "aaa"), (2, "bbb"), (3, "ccc"), (4, "ddd");
-SELECT * FROM tbl_a;
---connection child2_1
-SELECT * FROM tbl_a;
-
---connection master_1
-DELETE FROM tbl_a;
+# FIXME(MDEV-32097): the following delete statement, if uncommented,
+# causes an assertion failure
+# DELETE FROM tbl_a;
DROP TABLE tbl_a;
---echo # COMMENT + engine-defined option (invalid)
---connection master_1
-
---replace_result error: error
---error ER_CANT_CREATE_TABLE
+# Let us set spider_ignore_comments to true, so that it won't
+# accidentally parse comments when table options are present
+set session spider_ignore_comments=1;
eval CREATE TABLE tbl_a (
a INT,
b VARCHAR(255),
PRIMARY KEY(a)
) $MASTER_1_ENGINE $MASTER_1_CHARSET
-REMOTE_SERVER="s_2_1" REMOTE_TABLE="tbl_a" COMMENT='tbl "tbl_b"';
+COMMENT='tbl "tbl_a"'
+PARTITION BY RANGE (a) (
+ PARTITION p1 VALUES LESS THAN (3) COMMENT='srv "s_2_1"',
+ PARTITION p2 VALUES LESS THAN MAXVALUE REMOTE_SERVER="s_2_2"
+);
+
+--error 1429
+INSERT INTO tbl_a VALUES (1, "aaa"), (2, "bbb"), (3, "ccc"), (4, "ddd");
---replace_result error: error
---error ER_CANT_CREATE_TABLE
+DROP TABLE tbl_a;
+set session spider_ignore_comments=0;
+
+--echo # COMMENT + engine-defined option, COMMENT ignored, ok
+--connection master_1
eval CREATE TABLE tbl_a (
a INT,
b VARCHAR(255),
PRIMARY KEY(a)
) $MASTER_1_ENGINE $MASTER_1_CHARSET
-COMMENT='srv "s_2_1"' REMOTE_TABLE="tbl_a"
+REMOTE_SERVER="s_2_1" REMOTE_TABLE="tbl_a"
PARTITION BY RANGE (a) (
- PARTITION p1 VALUES LESS THAN (3),
+ PARTITION p1 VALUES LESS THAN (3) COMMENT='srv "s_2_2"',
PARTITION p2 VALUES LESS THAN MAXVALUE REMOTE_SERVER="s_2_2"
);
---echo # Various combinations of COMMENTs and options
-eval CREATE TABLE tbl_a (
- a INT,
- b VARCHAR(255),
- PRIMARY KEY(a)
-) $MASTER_1_ENGINE $MASTER_1_CHARSET
-REMOTE_SERVER="s_2_1" REMOTE_DATABASE="auto_test_remote" REMOTE_TABLE="tbl_a";
+# --ps-protocol eats a warning here
+--disable_ps_protocol
+INSERT INTO tbl_a VALUES (1, "aaa"), (2, "bbb"), (3, "ccc"), (4, "ddd");
+--enable_ps_protocol
+
+--connection child2_1
SELECT * FROM tbl_a;
+
+--connection child2_2
+SELECT * FROM tbl_a;
+
+--connection master_1
+DELETE FROM tbl_a;
DROP TABLE tbl_a;
+--echo # COMMENT + engine-defined option, COMMENT ignored, ok
+--connection master_1
eval CREATE TABLE tbl_a (
a INT,
b VARCHAR(255),
PRIMARY KEY(a)
) $MASTER_1_ENGINE $MASTER_1_CHARSET
-REMOTE_TABLE="tbl_a"
+REMOTE_SERVER="s_2_1" REMOTE_TABLE="tbl_a" READ_ONLY=YES
PARTITION BY RANGE (a) (
- PARTITION p1 VALUES LESS THAN (3)
- REMOTE_SERVER="s_2_1" COMMENT='database "auto_test_remote"',
- PARTITION p2 VALUES LESS THAN MAXVALUE
- REMOTE_SERVER="s_2_2" REMOTE_DATABASE="auto_test_remote2"
+ PARTITION p1 VALUES LESS THAN (3) COMMENT='srv "s_2_2" read_only_mode "0"',
+ PARTITION p2 VALUES LESS THAN MAXVALUE REMOTE_SERVER="s_2_2" READ_ONLY=NO
);
+
+--error 12518
+INSERT INTO tbl_a VALUES (1, "aaa"), (2, "bbb");
+INSERT INTO tbl_a VALUES (3, "ccc"), (4, "ddd");
+
+--connection child2_1
SELECT * FROM tbl_a;
+
+--connection child2_2
+SELECT * FROM tbl_a;
+DELETE FROM tbl_a;
+
+--connection master_1
+# FIXME: the following delete statement, if uncommented, causes an
+# assertion failure
+#DELETE FROM tbl_a;
DROP TABLE tbl_a;
+--connection master_1
eval CREATE TABLE tbl_a (
a INT,
b VARCHAR(255),
PRIMARY KEY(a)
) $MASTER_1_ENGINE $MASTER_1_CHARSET
-COMMENT='tbl "tbl_a"'
-PARTITION BY RANGE (a) (
- PARTITION p1 VALUES LESS THAN (3)
- REMOTE_SERVER="s_2_1" REMOTE_DATABASE="auto_test_remote",
- PARTITION p2 VALUES LESS THAN MAXVALUE
- REMOTE_SERVER="s_2_2" REMOTE_DATABASE="auto_test_remote2"
-);
-SELECT * FROM tbl_a;
-DROP TABLE tbl_a;
+REMOTE_SERVER="s_2_1" COMMENT='tbl "tbl_b"' REMOTE_TABLE="tbl_a";
+
+select table_name, server, tgt_table_name from mysql.spider_tables;
+drop table tbl_a;
eval CREATE TABLE tbl_a (
a INT
@@ -206,7 +500,7 @@ DROP TABLE tbl_a;
--echo # MDEV-27860 SIGSEGV in spider_parse_connect_info on CREATE TABLE
--error ER_FOREIGN_SERVER_DOESNT_EXIST
-CREATE TABLE tbl_a ENGINE=SPIDER COMMENT="TABLE 'unknown_table'"
+CREATE TABLE tbl_a (c INT) ENGINE=SPIDER COMMENT="TABLE 'unknown_table'"
PARTITION BY LIST COLUMNS (c) (
PARTITION p DEFAULT COMMENT="srv 'unknown_server'" ENGINE=SPIDER
);
@@ -225,3 +519,7 @@ DROP DATABASE auto_test_local;
--source ../t/test_deinit.inc
--enable_result_log
--enable_query_log
+
+--echo #
+--echo # end of test engine_defined_attributes
+--echo #
diff --git a/storage/spider/mysql-test/spider/feature/t/slave_transaction_retry_errors.cnf b/storage/spider/mysql-test/spider/feature/t/slave_transaction_retry_errors.cnf
index 45019d6c..7c33a8af 100644
--- a/storage/spider/mysql-test/spider/feature/t/slave_transaction_retry_errors.cnf
+++ b/storage/spider/mysql-test/spider/feature/t/slave_transaction_retry_errors.cnf
@@ -1,4 +1,5 @@
!include include/default_mysqld.cnf
+!include include/default_client.cnf
!include ../my_1_1.cnf
!include ../my_2_1.cnf
!include ../my_4_1.cnf
diff --git a/storage/spider/mysql-test/spider/my.cnf b/storage/spider/mysql-test/spider/my.cnf
index db4f7656..2f597ec8 100644
--- a/storage/spider/mysql-test/spider/my.cnf
+++ b/storage/spider/mysql-test/spider/my.cnf
@@ -1,5 +1,6 @@
# Use default setting for mysqld processes
!include include/default_mysqld.cnf
+!include include/default_client.cnf
[mysqld.1.1]
log-bin= master-bin
diff --git a/storage/spider/mysql-test/spider/r/auto_increment.result b/storage/spider/mysql-test/spider/r/auto_increment.result
index c3da4575..b21d66ce 100644
--- a/storage/spider/mysql-test/spider/r/auto_increment.result
+++ b/storage/spider/mysql-test/spider/r/auto_increment.result
@@ -43,6 +43,8 @@ col_b VARCHAR(20) DEFAULT 'defg',
col_c INT NOT NULL DEFAULT 100,
PRIMARY KEY(col_a)
) MASTER_1_ENGINE MASTER_1_AUTO_INCREMENT_2_1 MASTER_1_COMMENT_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
SHOW CREATE TABLE tbl_a;
Table Create Table
tbl_a CREATE TABLE `tbl_a` (
@@ -62,6 +64,8 @@ tbl_a CREATE TABLE `tbl_a` (
PRIMARY KEY (`col_a`)
) ENGINE=SPIDER DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='database "auto_test_remote", table "tbl_a", srv "s_2_1", aim "0"'
ALTER TABLE tbl_a MODIFY col_c MEDIUMINT NOT NULL DEFAULT 100;
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
SHOW CREATE TABLE tbl_a;
Table Create Table
tbl_a CREATE TABLE `tbl_a` (
@@ -99,6 +103,8 @@ tbl_a CREATE TABLE `tbl_a` (
PRIMARY KEY (`col_a`)
) ENGINE=SPIDER AUTO_INCREMENT=3 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='database "auto_test_remote", table "tbl_a", srv "s_2_1", aim "0"'
MASTER_1_AUTO_INCREMENT1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
SHOW CREATE TABLE tbl_a;
Table Create Table
tbl_a CREATE TABLE `tbl_a` (
@@ -118,6 +124,8 @@ tbl_a CREATE TABLE `tbl_a` (
PRIMARY KEY (`col_a`)
) ENGINE=SPIDER AUTO_INCREMENT=5 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='database "auto_test_remote", table "tbl_a", srv "s_2_1", aim "0"'
MASTER_1_AUTO_INCREMENT2
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
SHOW CREATE TABLE tbl_a;
Table Create Table
tbl_a CREATE TABLE `tbl_a` (
diff --git a/storage/spider/mysql-test/spider/r/basic_sql.result b/storage/spider/mysql-test/spider/r/basic_sql.result
index 2443f348..baebbffc 100644
--- a/storage/spider/mysql-test/spider/r/basic_sql.result
+++ b/storage/spider/mysql-test/spider/r/basic_sql.result
@@ -48,6 +48,9 @@ CREATE TABLE ta_l (
PRIMARY KEY(a)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
SELECT a, b, c FROM tb_l
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
@@ -78,6 +81,8 @@ PRIMARY KEY(a)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
IGNORE SELECT a, b, c FROM tb_l
Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
Warning 1062 Duplicate entry '1' for key 'PRIMARY'
Warning 1062 Duplicate entry '2' for key 'PRIMARY'
Warning 1062 Duplicate entry '3' for key 'PRIMARY'
@@ -99,6 +104,9 @@ CREATE TABLE ta_l (
PRIMARY KEY(a)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
REPLACE SELECT a, b, c FROM tb_l
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
@@ -114,6 +122,9 @@ DROP TABLE IF EXISTS ta_l_no_idx;
CREATE TABLE ta_l_no_idx
MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT2_2_1
SELECT a, b, c FROM tb_l
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l_no_idx ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
@@ -720,12 +731,16 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s')
connection master_1;
create table t2345678911234567892123456789312345678941234567895123234234(id int) ENGINE=SPIDER
COMMENT='host "192.168.21.1", user "spider", password "password", database "test32738123123123"';
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
drop table t2345678911234567892123456789312345678941234567895123234234;
#
# MDEV-26139 Spider crashes with segmentation fault (signal 11) on CREATE TABLE when COMMENT does not contain embedded double quotes
#
create table mdev_26139 (id int) ENGINE=SPIDER
COMMENT="host '192.168.21.1', user 'spider', password 'password', database 'test'";
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
drop table mdev_26139;
deinit
diff --git a/storage/spider/mysql-test/spider/r/basic_sql_part.result b/storage/spider/mysql-test/spider/r/basic_sql_part.result
index 0f402940..4507d31b 100644
--- a/storage/spider/mysql-test/spider/r/basic_sql_part.result
+++ b/storage/spider/mysql-test/spider/r/basic_sql_part.result
@@ -48,6 +48,11 @@ CREATE TABLE ta_l2 (
PRIMARY KEY(a)
) MASTER_1_ENGINE MASTER_1_COMMENT_P_2_1
SELECT a, b, c FROM tb_l
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
diff --git a/storage/spider/mysql-test/spider/r/checksum_table_with_quick_mode_3.result b/storage/spider/mysql-test/spider/r/checksum_table_with_quick_mode_3.result
index ff6b968c..706f0233 100644
--- a/storage/spider/mysql-test/spider/r/checksum_table_with_quick_mode_3.result
+++ b/storage/spider/mysql-test/spider/r/checksum_table_with_quick_mode_3.result
@@ -32,6 +32,8 @@ CREATE TABLE tbl_a (
pkey int NOT NULL,
PRIMARY KEY (pkey)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
INSERT INTO tbl_a (pkey) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
INSERT INTO tbl_a (pkey) VALUES (10),(11),(12),(13),(14),(15),(16),(17),(18),(19);
INSERT INTO tbl_a (pkey) VALUES (20),(21),(22),(23),(24),(25),(26),(27),(28),(29);
diff --git a/storage/spider/mysql-test/spider/r/direct_aggregate.result b/storage/spider/mysql-test/spider/r/direct_aggregate.result
index 2455fe18..2e726138 100644
--- a/storage/spider/mysql-test/spider/r/direct_aggregate.result
+++ b/storage/spider/mysql-test/spider/r/direct_aggregate.result
@@ -37,6 +37,9 @@ b CHAR(1),
c DATETIME,
PRIMARY KEY(a)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
INSERT INTO ta_l (a, b, c) VALUES
(1, 'a', '2008-08-01 10:21:39'),
(2, 'b', '2000-01-01 00:00:00'),
diff --git a/storage/spider/mysql-test/spider/r/direct_aggregate_part.result b/storage/spider/mysql-test/spider/r/direct_aggregate_part.result
index 9d65fcc2..35221a63 100644
--- a/storage/spider/mysql-test/spider/r/direct_aggregate_part.result
+++ b/storage/spider/mysql-test/spider/r/direct_aggregate_part.result
@@ -36,6 +36,11 @@ b CHAR(1),
c DATETIME,
PRIMARY KEY(a)
) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
set @old_spider_direct_aggregate=@@session.spider_direct_aggregate;
set spider_direct_aggregate=1;
SHOW STATUS LIKE 'Spider_direct_aggregate';
diff --git a/storage/spider/mysql-test/spider/r/direct_join.result b/storage/spider/mysql-test/spider/r/direct_join.result
index 96f18a54..fcfed12e 100644
--- a/storage/spider/mysql-test/spider/r/direct_join.result
+++ b/storage/spider/mysql-test/spider/r/direct_join.result
@@ -48,11 +48,17 @@ c DATETIME DEFAULT '1999-10-10 10:10:10',
PRIMARY KEY(a),
KEY idx1(b)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
CREATE TABLE tbl_b (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10'
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT5_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
CREATE TABLE tbl_c (
a INT AUTO_INCREMENT,
b INT DEFAULT 10,
@@ -61,6 +67,9 @@ PRIMARY KEY(a),
KEY idx1(b),
KEY idx2(c)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT4_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
insert into tbl_a values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04'),(5,'e','2000/01/05');
insert into tbl_b values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04'),(5,'e','2000/01/05');
insert into tbl_c values (1,10,100),(2,20,200),(3,30,300),(4,40,400),(5,50,500);
@@ -106,6 +115,9 @@ region INT(11) NOT NULL,
PRIMARY KEY (id, region) USING BTREE
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_CONST_TABLE_JOIN
MASTER_1_ROW_FORMAT_CONST_TABLE_JOIN MASTER_1_PART_CONST_TABLE_JOIN
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
SHOW CREATE TABLE tbl_person
Table Create Table
tbl_person CREATE TABLE `tbl_person` (
@@ -125,6 +137,8 @@ region INT(11) NOT NULL,
PRIMARY KEY (id, region) USING BTREE
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_CONST_TABLE2_JOIN
MASTER_1_ROW_FORMAT_CONST_TABLE_JOIN MASTER_1_PART_CONST_TABLE2_JOIN
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
SHOW CREATE TABLE tbl_ncd_cm_person
Table Create Table
tbl_ncd_cm_person CREATE TABLE `tbl_ncd_cm_person` (
diff --git a/storage/spider/mysql-test/spider/r/direct_join_using.result b/storage/spider/mysql-test/spider/r/direct_join_using.result
index facfabfe..ba63baa5 100644
--- a/storage/spider/mysql-test/spider/r/direct_join_using.result
+++ b/storage/spider/mysql-test/spider/r/direct_join_using.result
@@ -48,11 +48,17 @@ c DATETIME DEFAULT '1999-10-10 10:10:10',
PRIMARY KEY(a),
KEY idx1(b)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
CREATE TABLE tbl_b (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10'
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT5_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
CREATE TABLE tbl_c (
a INT AUTO_INCREMENT,
b INT DEFAULT 10,
@@ -61,6 +67,9 @@ PRIMARY KEY(a),
KEY idx1(b),
KEY idx2(c)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT4_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
insert into tbl_a values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04'),(5,'e','2000/01/05');
insert into tbl_b values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04'),(5,'e','2000/01/05');
insert into tbl_c values (1,10,100),(2,20,200),(3,30,300),(4,40,400),(5,50,500);
diff --git a/storage/spider/mysql-test/spider/r/direct_left_join.result b/storage/spider/mysql-test/spider/r/direct_left_join.result
index 1af1a661..6cd89007 100644
--- a/storage/spider/mysql-test/spider/r/direct_left_join.result
+++ b/storage/spider/mysql-test/spider/r/direct_left_join.result
@@ -48,11 +48,17 @@ c DATETIME DEFAULT '1999-10-10 10:10:10',
PRIMARY KEY(a),
KEY idx1(b)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
CREATE TABLE tbl_b (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10'
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT5_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
CREATE TABLE tbl_c (
a INT AUTO_INCREMENT,
b INT DEFAULT 10,
@@ -61,6 +67,9 @@ PRIMARY KEY(a),
KEY idx1(b),
KEY idx2(c)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT4_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
insert into tbl_a values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04'),(5,'e','2000/01/05');
insert into tbl_b values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04'),(5,'e','2000/01/05');
insert into tbl_c values (1,10,100),(2,20,200),(3,30,300),(4,40,400),(5,50,500);
diff --git a/storage/spider/mysql-test/spider/r/direct_left_join_nullable.result b/storage/spider/mysql-test/spider/r/direct_left_join_nullable.result
index 4adfb1bd..b2d173db 100644
--- a/storage/spider/mysql-test/spider/r/direct_left_join_nullable.result
+++ b/storage/spider/mysql-test/spider/r/direct_left_join_nullable.result
@@ -50,11 +50,17 @@ c DATETIME DEFAULT '1999-10-10 10:10:10',
KEY idx0(a),
KEY idx1(b)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
CREATE TABLE tbl_b (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10'
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT5_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
CREATE TABLE tbl_c (
a INT AUTO_INCREMENT,
b CHAR(1) DEFAULT 'c',
@@ -63,11 +69,17 @@ KEY idx0(a),
KEY idx1(b),
KEY idx2(c)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT3_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
CREATE TABLE tbl_d (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10'
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT2_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
insert into tbl_a values (1,'a','2000/01/01'),(2,'b','2000/01/02');
insert into tbl_b values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03');
insert into tbl_c values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04');
@@ -87,7 +99,7 @@ a b c a
connection child2_1;
SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %';
argument
-select t0.`a` `a`,t2.`b` `b`,t2.`c` `c`,t3.`a` `a` from `auto_test_remote`.`ta_r_no_idx` t0 left join `auto_test_remote`.`ta_r_auto_inc` t1 on (t1.`a` = t0.`a`) left join `auto_test_remote`.`ta_r_3` t2 on (t2.`c` = t1.`c`) left join `auto_test_remote`.`ta_r` t3 on (t3.`b` = t2.`b`) where 1 order by t0.`a` desc
+select t0.`a` `a`,t2.`b` `b`,t2.`c` `c`,t3.`a` `a` from `auto_test_remote`.`ta_r_no_idx` t0 left join `auto_test_remote`.`ta_r_auto_inc` t1 on ((t1.`a` = t0.`a`) and (t0.`a` is not null)) left join `auto_test_remote`.`ta_r_3` t2 on (t2.`c` = t1.`c`) left join `auto_test_remote`.`ta_r` t3 on ((t3.`b` = t2.`b`) and (t2.`b` is not null)) where 1 order by t0.`a` desc
SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
diff --git a/storage/spider/mysql-test/spider/r/direct_left_right_join_nullable.result b/storage/spider/mysql-test/spider/r/direct_left_right_join_nullable.result
index 96b00c61..194e9a57 100644
--- a/storage/spider/mysql-test/spider/r/direct_left_right_join_nullable.result
+++ b/storage/spider/mysql-test/spider/r/direct_left_right_join_nullable.result
@@ -50,11 +50,17 @@ c DATETIME DEFAULT '1999-10-10 10:10:10',
KEY idx0(a),
KEY idx1(b)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
CREATE TABLE tbl_b (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10'
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT5_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
CREATE TABLE tbl_c (
a INT AUTO_INCREMENT,
b CHAR(1) DEFAULT 'c',
@@ -63,11 +69,17 @@ KEY idx0(a),
KEY idx1(b),
KEY idx2(c)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT3_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
CREATE TABLE tbl_d (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10'
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT2_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
insert into tbl_a values (1,'a','2000/01/01'),(2,'b','2000/01/02');
insert into tbl_b values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03');
insert into tbl_c values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04');
@@ -87,7 +99,7 @@ NULL NULL NULL 3
connection child2_1;
SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %';
argument
-select t0.`a` `a`,t2.`b` `b`,t2.`c` `c`,t3.`a` `a` from `auto_test_remote`.`ta_r_no_idx` t3 left join (`auto_test_remote`.`ta_r` t0 join `auto_test_remote`.`ta_r_3` t1 join `auto_test_remote`.`ta_r_auto_inc` t2) on ((t2.`b` = t3.`b`) and (t2.`c` = t1.`c`) and (t0.`a` = t1.`a`) and (t1.`a` is not null)) where 1 order by t3.`a` desc
+select t0.`a` `a`,t2.`b` `b`,t2.`c` `c`,t3.`a` `a` from `auto_test_remote`.`ta_r_no_idx` t3 left join (`auto_test_remote`.`ta_r` t0 join `auto_test_remote`.`ta_r_3` t1 join `auto_test_remote`.`ta_r_auto_inc` t2) on ((t2.`b` = t3.`b`) and (t1.`c` = t2.`c`) and (t0.`a` = t1.`a`) and (t3.`b` is not null) and (t1.`a` is not null)) where 1 order by t3.`a` desc
SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
diff --git a/storage/spider/mysql-test/spider/r/direct_left_right_left_join_nullable.result b/storage/spider/mysql-test/spider/r/direct_left_right_left_join_nullable.result
index 7ba1084a..496edd0c 100644
--- a/storage/spider/mysql-test/spider/r/direct_left_right_left_join_nullable.result
+++ b/storage/spider/mysql-test/spider/r/direct_left_right_left_join_nullable.result
@@ -50,11 +50,17 @@ c DATETIME DEFAULT '1999-10-10 10:10:10',
KEY idx0(a),
KEY idx1(b)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
CREATE TABLE tbl_b (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10'
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT5_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
CREATE TABLE tbl_c (
a INT AUTO_INCREMENT,
b CHAR(1) DEFAULT 'c',
@@ -63,11 +69,17 @@ KEY idx0(a),
KEY idx1(b),
KEY idx2(c)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT3_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
CREATE TABLE tbl_d (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10'
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT2_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
insert into tbl_a values (1,'a','2000/01/01'),(2,'b','2000/01/02');
insert into tbl_b values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03');
insert into tbl_c values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04');
diff --git a/storage/spider/mysql-test/spider/r/direct_right_join.result b/storage/spider/mysql-test/spider/r/direct_right_join.result
index ee0940a4..ac5bf0ee 100644
--- a/storage/spider/mysql-test/spider/r/direct_right_join.result
+++ b/storage/spider/mysql-test/spider/r/direct_right_join.result
@@ -48,11 +48,17 @@ c DATETIME DEFAULT '1999-10-10 10:10:10',
PRIMARY KEY(a),
KEY idx1(b)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
CREATE TABLE tbl_b (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10'
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT5_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
CREATE TABLE tbl_c (
a INT AUTO_INCREMENT,
b INT DEFAULT 10,
@@ -61,6 +67,9 @@ PRIMARY KEY(a),
KEY idx1(b),
KEY idx2(c)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT4_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
insert into tbl_a values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04'),(5,'e','2000/01/05');
insert into tbl_b values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04'),(5,'e','2000/01/05');
insert into tbl_c values (1,10,100),(2,20,200),(3,30,300),(4,40,400),(5,50,500);
diff --git a/storage/spider/mysql-test/spider/r/direct_right_join_nullable.result b/storage/spider/mysql-test/spider/r/direct_right_join_nullable.result
index fefb67fa..3f4c244f 100644
--- a/storage/spider/mysql-test/spider/r/direct_right_join_nullable.result
+++ b/storage/spider/mysql-test/spider/r/direct_right_join_nullable.result
@@ -50,11 +50,17 @@ c DATETIME DEFAULT '1999-10-10 10:10:10',
KEY idx0(a),
KEY idx1(b)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
CREATE TABLE tbl_b (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10'
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT5_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
CREATE TABLE tbl_c (
a INT AUTO_INCREMENT,
b CHAR(1) DEFAULT 'c',
@@ -63,11 +69,17 @@ KEY idx0(a),
KEY idx1(b),
KEY idx2(c)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT3_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
CREATE TABLE tbl_d (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10'
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT2_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
insert into tbl_a values (1,'a','2000/01/01'),(2,'b','2000/01/02');
insert into tbl_b values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03');
insert into tbl_c values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04');
@@ -87,7 +99,7 @@ NULL c 2000-01-03 00:00:00 3
connection child2_1;
SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %';
argument
-select t0.`a` `a`,t2.`b` `b`,t2.`c` `c`,t3.`a` `a` from `auto_test_remote`.`ta_r_no_idx` t3 left join (`auto_test_remote`.`ta_r_auto_inc` t2 left join (`auto_test_remote`.`ta_r_3` t1 left join `auto_test_remote`.`ta_r` t0 on ((t0.`a` = t1.`a`) and (t1.`a` is not null))) on (t1.`c` = t2.`c`)) on (t2.`b` = t3.`b`) where 1 order by t3.`a` desc
+select t0.`a` `a`,t2.`b` `b`,t2.`c` `c`,t3.`a` `a` from `auto_test_remote`.`ta_r_no_idx` t3 left join (`auto_test_remote`.`ta_r_auto_inc` t2 left join (`auto_test_remote`.`ta_r_3` t1 left join `auto_test_remote`.`ta_r` t0 on ((t0.`a` = t1.`a`) and (t1.`a` is not null))) on (t1.`c` = t2.`c`)) on ((t2.`b` = t3.`b`) and (t3.`b` is not null)) where 1 order by t3.`a` desc
SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
diff --git a/storage/spider/mysql-test/spider/r/direct_right_left_join_nullable.result b/storage/spider/mysql-test/spider/r/direct_right_left_join_nullable.result
index 64c3b57c..11244416 100644
--- a/storage/spider/mysql-test/spider/r/direct_right_left_join_nullable.result
+++ b/storage/spider/mysql-test/spider/r/direct_right_left_join_nullable.result
@@ -50,11 +50,17 @@ c DATETIME DEFAULT '1999-10-10 10:10:10',
KEY idx0(a),
KEY idx1(b)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
CREATE TABLE tbl_b (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10'
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT5_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
CREATE TABLE tbl_c (
a INT AUTO_INCREMENT,
b CHAR(1) DEFAULT 'c',
@@ -63,11 +69,17 @@ KEY idx0(a),
KEY idx1(b),
KEY idx2(c)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT3_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
CREATE TABLE tbl_d (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10'
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT2_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
insert into tbl_a values (1,'a','2000/01/01'),(2,'b','2000/01/02');
insert into tbl_b values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03');
insert into tbl_c values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04');
diff --git a/storage/spider/mysql-test/spider/r/direct_right_left_right_join_nullable.result b/storage/spider/mysql-test/spider/r/direct_right_left_right_join_nullable.result
index 68d11934..1ac35b2c 100644
--- a/storage/spider/mysql-test/spider/r/direct_right_left_right_join_nullable.result
+++ b/storage/spider/mysql-test/spider/r/direct_right_left_right_join_nullable.result
@@ -50,11 +50,17 @@ c DATETIME DEFAULT '1999-10-10 10:10:10',
KEY idx0(a),
KEY idx1(b)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
CREATE TABLE tbl_b (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10'
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT5_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
CREATE TABLE tbl_c (
a INT AUTO_INCREMENT,
b CHAR(1) DEFAULT 'c',
@@ -63,11 +69,17 @@ KEY idx0(a),
KEY idx1(b),
KEY idx2(c)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT3_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
CREATE TABLE tbl_d (
a INT DEFAULT 10,
b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10'
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT2_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
insert into tbl_a values (1,'a','2000/01/01'),(2,'b','2000/01/02');
insert into tbl_b values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03');
insert into tbl_c values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04');
@@ -87,7 +99,7 @@ NULL c 2000-01-03 00:00:00 3
connection child2_1;
SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %';
argument
-select t0.`a` `a`,t2.`b` `b`,t2.`c` `c`,t3.`a` `a` from `auto_test_remote`.`ta_r_no_idx` t3 left join (`auto_test_remote`.`ta_r_3` t1 left join `auto_test_remote`.`ta_r` t0 on ((t0.`a` = t1.`a`) and (t1.`a` is not null)) join `auto_test_remote`.`ta_r_auto_inc` t2) on ((t2.`b` = t3.`b`) and (t2.`c` = t1.`c`)) where 1 order by t3.`a` desc
+select t0.`a` `a`,t2.`b` `b`,t2.`c` `c`,t3.`a` `a` from `auto_test_remote`.`ta_r_no_idx` t3 left join (`auto_test_remote`.`ta_r_3` t1 left join `auto_test_remote`.`ta_r` t0 on ((t0.`a` = t1.`a`) and (t1.`a` is not null)) join `auto_test_remote`.`ta_r_auto_inc` t2) on ((t2.`b` = t3.`b`) and (t1.`c` = t2.`c`) and (t3.`b` is not null)) where 1 order by t3.`a` desc
SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
diff --git a/storage/spider/mysql-test/spider/r/direct_update.result b/storage/spider/mysql-test/spider/r/direct_update.result
index 0e536d48..587984a5 100644
--- a/storage/spider/mysql-test/spider/r/direct_update.result
+++ b/storage/spider/mysql-test/spider/r/direct_update.result
@@ -37,6 +37,9 @@ b CHAR(1),
c DATETIME,
PRIMARY KEY(a)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
INSERT INTO ta_l (a, b, c) VALUES
(1, 'a', '2008-08-01 10:21:39'),
(2, 'b', '2000-01-01 00:00:00'),
diff --git a/storage/spider/mysql-test/spider/r/direct_update_part.result b/storage/spider/mysql-test/spider/r/direct_update_part.result
index 7069cd72..a92fce72 100644
--- a/storage/spider/mysql-test/spider/r/direct_update_part.result
+++ b/storage/spider/mysql-test/spider/r/direct_update_part.result
@@ -36,6 +36,11 @@ b CHAR(1),
c DATETIME,
PRIMARY KEY(a)
) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
SHOW STATUS LIKE 'Spider_direct_update';
Variable_name Value
Spider_direct_update 0
diff --git a/storage/spider/mysql-test/spider/r/error_row_number.result b/storage/spider/mysql-test/spider/r/error_row_number.result
index cc2b5487..c63bbbe5 100644
--- a/storage/spider/mysql-test/spider/r/error_row_number.result
+++ b/storage/spider/mysql-test/spider/r/error_row_number.result
@@ -16,6 +16,9 @@ use auto_test_remote;
create table ta_r (id int primary key);
connection master_1;
create table spd (id int primary key) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1;
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
insert into spd values (1),(2),(1);
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
get diagnostics condition 1 @n = row_number;
@@ -29,7 +32,7 @@ ERROR 23000: Duplicate entry '13' for key 'PRIMARY'
get diagnostics condition 1 @n = row_number;
select @n;
@n
-0
+1
drop table spd;
connection child2_1;
drop database auto_test_remote;
diff --git a/storage/spider/mysql-test/spider/r/function.result b/storage/spider/mysql-test/spider/r/function.result
index c088a8a9..cd439f5f 100644
--- a/storage/spider/mysql-test/spider/r/function.result
+++ b/storage/spider/mysql-test/spider/r/function.result
@@ -34,6 +34,8 @@ CREATE TABLE t1 (
a VARCHAR(255),
PRIMARY KEY(a)
) MASTER_1_ENGINE MASTER_1_CHARSET3 MASTER_1_COMMENT_TEXT_PK1_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
insert into t1 values ('1');
insert into t1 select a + 1 from t1;
insert into t1 select a + 2 from t1;
@@ -61,6 +63,9 @@ b CHAR(1),
c DATETIME,
PRIMARY KEY(a)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
INSERT INTO ta_l (a, b, c) VALUES
(1, 'a', '2008-08-01 10:21:39'),
(2, 'b', '2000-01-01 00:00:00'),
diff --git a/storage/spider/mysql-test/spider/r/ha.result b/storage/spider/mysql-test/spider/r/ha.result
index 3c37c2d5..2ccff04b 100644
--- a/storage/spider/mysql-test/spider/r/ha.result
+++ b/storage/spider/mysql-test/spider/r/ha.result
@@ -63,8 +63,12 @@ c DATETIME,
PRIMARY KEY(a)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_HA_2_1
Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
Warning 138 The high availability feature of Spider has been deprecated and will be removed in a future release
Warning 138 The high availability feature of Spider has been deprecated and will be removed in a future release
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 1287 'msi' is deprecated and will be removed in a future release
+Warning 1287 'mkd' is deprecated and will be removed in a future release
Warning 138 The high availability feature of Spider has been deprecated and will be removed in a future release
INSERT INTO ta_l (a, b, c) VALUES
(1, 'a', '2008-08-01 10:21:39'),
@@ -122,9 +126,14 @@ CONNECTION='host "localhost", user "root", password "",
msi "5", mkd "2",
database "auto_test_remote auto_test_remote2", lst "0 2"';
Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
Warning 138 The high availability feature of Spider has been deprecated and will be removed in a future release
Warning 138 The high availability feature of Spider has been deprecated and will be removed in a future release
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 1287 'msi' is deprecated and will be removed in a future release
+Warning 1287 'mkd' is deprecated and will be removed in a future release
Warning 138 The high availability feature of Spider has been deprecated and will be removed in a future release
+Warning 1287 'lst' is deprecated and will be removed in a future release
SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables
ORDER BY db_name, table_name, link_id;
db_name table_name link_id link_status
@@ -139,9 +148,14 @@ CONNECTION='host "localhost", user "root", password "",
msi "5", mkd "2",
database "auto_test_remote auto_test_remote2", lst "0 1"';
Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
Warning 138 The high availability feature of Spider has been deprecated and will be removed in a future release
Warning 138 The high availability feature of Spider has been deprecated and will be removed in a future release
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 1287 'msi' is deprecated and will be removed in a future release
+Warning 1287 'mkd' is deprecated and will be removed in a future release
Warning 138 The high availability feature of Spider has been deprecated and will be removed in a future release
+Warning 1287 'lst' is deprecated and will be removed in a future release
SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables
ORDER BY db_name, table_name, link_id;
db_name table_name link_id link_status
@@ -175,8 +189,13 @@ c DATETIME,
PRIMARY KEY(a)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_HA_AS_2_1
Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
Warning 138 The high availability feature of Spider has been deprecated and will be removed in a future release
Warning 138 The high availability feature of Spider has been deprecated and will be removed in a future release
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 1287 'msi' is deprecated and will be removed in a future release
+Warning 1287 'mkd' is deprecated and will be removed in a future release
+Warning 1287 'alc' is deprecated and will be removed in a future release
Warning 138 The high availability feature of Spider has been deprecated and will be removed in a future release
INSERT INTO ta_l (a, b, c) VALUES
(1, 'a', '2008-08-01 10:21:39'),
@@ -230,9 +249,15 @@ CONNECTION='host "localhost", user "root", password "",
msi "5", mkd "2", alc "1",
database "auto_test_remote auto_test_remote2", lst "1 0"';
Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
Warning 138 The high availability feature of Spider has been deprecated and will be removed in a future release
Warning 138 The high availability feature of Spider has been deprecated and will be removed in a future release
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 1287 'msi' is deprecated and will be removed in a future release
+Warning 1287 'mkd' is deprecated and will be removed in a future release
+Warning 1287 'alc' is deprecated and will be removed in a future release
Warning 138 The high availability feature of Spider has been deprecated and will be removed in a future release
+Warning 1287 'lst' is deprecated and will be removed in a future release
SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables
ORDER BY db_name, table_name, link_id;
db_name table_name link_id link_status
diff --git a/storage/spider/mysql-test/spider/r/ha_part.result b/storage/spider/mysql-test/spider/r/ha_part.result
index d191cab3..0ae8431b 100644
--- a/storage/spider/mysql-test/spider/r/ha_part.result
+++ b/storage/spider/mysql-test/spider/r/ha_part.result
@@ -63,10 +63,18 @@ c DATETIME,
PRIMARY KEY(a)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_HA_P_2_1
Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
Warning 138 The high availability feature of Spider has been deprecated and will be removed in a future release
Warning 138 The high availability feature of Spider has been deprecated and will be removed in a future release
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 1287 'msi' is deprecated and will be removed in a future release
+Warning 1287 'mkd' is deprecated and will be removed in a future release
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
Warning 138 The high availability feature of Spider has been deprecated and will be removed in a future release
Warning 138 The high availability feature of Spider has been deprecated and will be removed in a future release
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 1287 'msi' is deprecated and will be removed in a future release
+Warning 1287 'mkd' is deprecated and will be removed in a future release
INSERT INTO ta_l2 (a, b, c) VALUES
(1, 'a', '2008-08-01 10:21:39'),
(2, 'b', '2000-01-01 00:00:00'),
@@ -128,10 +136,19 @@ PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
priority "1000001", lst "0 2"'
);
Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
Warning 138 The high availability feature of Spider has been deprecated and will be removed in a future release
Warning 138 The high availability feature of Spider has been deprecated and will be removed in a future release
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 1287 'msi' is deprecated and will be removed in a future release
+Warning 1287 'mkd' is deprecated and will be removed in a future release
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
Warning 138 The high availability feature of Spider has been deprecated and will be removed in a future release
Warning 138 The high availability feature of Spider has been deprecated and will be removed in a future release
+Warning 1287 'lst' is deprecated and will be removed in a future release
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 1287 'msi' is deprecated and will be removed in a future release
+Warning 1287 'mkd' is deprecated and will be removed in a future release
SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables
ORDER BY db_name, table_name, link_id;
db_name table_name link_id link_status
@@ -151,10 +168,19 @@ PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
priority "1000001", lst "0 1"'
);
Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
Warning 138 The high availability feature of Spider has been deprecated and will be removed in a future release
Warning 138 The high availability feature of Spider has been deprecated and will be removed in a future release
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 1287 'msi' is deprecated and will be removed in a future release
+Warning 1287 'mkd' is deprecated and will be removed in a future release
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
Warning 138 The high availability feature of Spider has been deprecated and will be removed in a future release
Warning 138 The high availability feature of Spider has been deprecated and will be removed in a future release
+Warning 1287 'lst' is deprecated and will be removed in a future release
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 1287 'msi' is deprecated and will be removed in a future release
+Warning 1287 'mkd' is deprecated and will be removed in a future release
SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables
ORDER BY db_name, table_name, link_id;
db_name table_name link_id link_status
@@ -187,10 +213,20 @@ c DATETIME,
PRIMARY KEY(a)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_HA_AS_P_2_1
Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
Warning 138 The high availability feature of Spider has been deprecated and will be removed in a future release
Warning 138 The high availability feature of Spider has been deprecated and will be removed in a future release
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 1287 'msi' is deprecated and will be removed in a future release
+Warning 1287 'mkd' is deprecated and will be removed in a future release
+Warning 1287 'alc' is deprecated and will be removed in a future release
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
Warning 138 The high availability feature of Spider has been deprecated and will be removed in a future release
Warning 138 The high availability feature of Spider has been deprecated and will be removed in a future release
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 1287 'msi' is deprecated and will be removed in a future release
+Warning 1287 'mkd' is deprecated and will be removed in a future release
+Warning 1287 'alc' is deprecated and will be removed in a future release
INSERT INTO ta_l2 (a, b, c) VALUES
(1, 'a', '2008-08-01 10:21:39'),
(2, 'b', '2000-01-01 00:00:00'),
@@ -251,10 +287,21 @@ PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4",
priority "1000001", lst "1 0"'
);
Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
Warning 138 The high availability feature of Spider has been deprecated and will be removed in a future release
Warning 138 The high availability feature of Spider has been deprecated and will be removed in a future release
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 1287 'msi' is deprecated and will be removed in a future release
+Warning 1287 'mkd' is deprecated and will be removed in a future release
+Warning 1287 'alc' is deprecated and will be removed in a future release
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
Warning 138 The high availability feature of Spider has been deprecated and will be removed in a future release
Warning 138 The high availability feature of Spider has been deprecated and will be removed in a future release
+Warning 1287 'lst' is deprecated and will be removed in a future release
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 1287 'msi' is deprecated and will be removed in a future release
+Warning 1287 'mkd' is deprecated and will be removed in a future release
+Warning 1287 'alc' is deprecated and will be removed in a future release
SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables
ORDER BY db_name, table_name, link_id;
db_name table_name link_id link_status
diff --git a/storage/spider/mysql-test/spider/r/partition_cond_push.result b/storage/spider/mysql-test/spider/r/partition_cond_push.result
index dd91e4b7..25b794f2 100644
--- a/storage/spider/mysql-test/spider/r/partition_cond_push.result
+++ b/storage/spider/mysql-test/spider/r/partition_cond_push.result
@@ -51,6 +51,13 @@ DROP TABLE IF EXISTS tbl_b;
CREATE TABLE tbl_a (
value int NOT NULL
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
INSERT INTO tbl_a (value) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
INSERT INTO tbl_a (value) VALUES (10),(11),(12),(13),(14),(15),(16),(17),(18),(19);
INSERT INTO tbl_a (value) VALUES (20),(21),(22),(23),(24),(25),(26),(27),(28),(29);
diff --git a/storage/spider/mysql-test/spider/r/partition_fulltext.result b/storage/spider/mysql-test/spider/r/partition_fulltext.result
index 581c731b..8b65852c 100644
--- a/storage/spider/mysql-test/spider/r/partition_fulltext.result
+++ b/storage/spider/mysql-test/spider/r/partition_fulltext.result
@@ -59,6 +59,16 @@ words text NOT NULL,
PRIMARY KEY (pkey),
FULLTEXT (words)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 1287 'bka_mode' is deprecated and will be removed in a future release
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 1287 'bka_mode' is deprecated and will be removed in a future release
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 1287 'bka_mode' is deprecated and will be removed in a future release
INSERT INTO tbl_a (pkey, words) VALUES (0, 'abc'),(1, 'def'),(2, 'ghi'),(3, 'jkl'),(4, 'mno'),(5, 'pqr'),(6, 'stu'),(7, 'vwx');
select test
diff --git a/storage/spider/mysql-test/spider/r/partition_join_pushdown_for_single_partition.result b/storage/spider/mysql-test/spider/r/partition_join_pushdown_for_single_partition.result
index 3eed8df2..e7e34988 100644
--- a/storage/spider/mysql-test/spider/r/partition_join_pushdown_for_single_partition.result
+++ b/storage/spider/mysql-test/spider/r/partition_join_pushdown_for_single_partition.result
@@ -58,10 +58,24 @@ CREATE TABLE tbl_a (
value int NOT NULL,
PRIMARY KEY(value)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
CREATE TABLE tbl_b (
value2 int NOT NULL,
PRIMARY KEY(value2)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_2
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
insert into tbl_a values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
insert into tbl_b values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
connection master_1;
diff --git a/storage/spider/mysql-test/spider/r/partition_mrr.result b/storage/spider/mysql-test/spider/r/partition_mrr.result
index c1b7d6e6..f211910b 100644
--- a/storage/spider/mysql-test/spider/r/partition_mrr.result
+++ b/storage/spider/mysql-test/spider/r/partition_mrr.result
@@ -61,6 +61,26 @@ CREATE TABLE tbl_b (
pkey int NOT NULL,
PRIMARY KEY (pkey)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_2
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 1287 'bka_mode' is deprecated and will be removed in a future release
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 1287 'bka_mode' is deprecated and will be removed in a future release
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 1287 'bka_mode' is deprecated and will be removed in a future release
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 1287 'bka_mode' is deprecated and will be removed in a future release
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 1287 'bka_mode' is deprecated and will be removed in a future release
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 1287 'bka_mode' is deprecated and will be removed in a future release
INSERT INTO tbl_a (pkey) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
INSERT INTO tbl_a (pkey) VALUES (10),(11),(12),(13),(14),(15),(16),(17),(18),(19);
INSERT INTO tbl_a (pkey) VALUES (20),(21),(22),(23),(24),(25),(26),(27),(28),(29);
@@ -74,36 +94,36 @@ TRUNCATE TABLE mysql.general_log;
connection master_1;
SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey;
pkey
-4
-5
+0
+1
10
11
+12
+13
+14
+15
16
17
+18
+19
+2
+20
+21
22
23
+24
+25
+26
+27
28
29
-0
-1
+3
+4
+5
6
7
-12
-13
-18
-19
-24
-25
-2
-3
8
9
-14
-15
-20
-21
-26
-27
SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey+0 = b.pkey+0 ORDER BY a.pkey;
pkey
0
@@ -140,7 +160,9 @@ connection child2_1;
SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %';
argument
select `pkey` from `auto_test_remote`.`tbl_a` order by `pkey`
-select a.id,b.`pkey` from auto_test_remote.tmp_spider_bka_xxxx a,`auto_test_remote`.`tbl_b` b where a.c0 <=> b.`pkey`
+select `pkey` from `auto_test_remote`.`tbl_b` order by `pkey`
+select `pkey` from `auto_test_remote`.`tbl_b` order by `pkey`
+select `pkey` from `auto_test_remote`.`tbl_b` order by `pkey`
select `pkey` from `auto_test_remote`.`tbl_a` order by `pkey`
select `pkey` from `auto_test_remote`.`tbl_b` order by `pkey`
select `pkey` from `auto_test_remote`.`tbl_b` order by `pkey`
@@ -174,7 +196,9 @@ connection child2_2;
SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %';
argument
select `pkey` from `auto_test_remote2`.`tbl_a` order by `pkey`
-select a.id,b.`pkey` from auto_test_remote2.tmp_spider_bka_xxxx a,`auto_test_remote2`.`tbl_b` b where a.c0 <=> b.`pkey`
+select `pkey` from `auto_test_remote2`.`tbl_b` order by `pkey`
+select `pkey` from `auto_test_remote2`.`tbl_b` order by `pkey`
+select `pkey` from `auto_test_remote2`.`tbl_b` order by `pkey`
select `pkey` from `auto_test_remote2`.`tbl_a` order by `pkey`
select `pkey` from `auto_test_remote2`.`tbl_b` order by `pkey`
select `pkey` from `auto_test_remote2`.`tbl_b` order by `pkey`
@@ -208,7 +232,9 @@ connection child2_3;
SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %';
argument
select `pkey` from `auto_test_remote3`.`tbl_a` order by `pkey`
-select a.id,b.`pkey` from auto_test_remote3.tmp_spider_bka_xxxx a,`auto_test_remote3`.`tbl_b` b where a.c0 <=> b.`pkey`
+select `pkey` from `auto_test_remote3`.`tbl_b` order by `pkey`
+select `pkey` from `auto_test_remote3`.`tbl_b` order by `pkey`
+select `pkey` from `auto_test_remote3`.`tbl_b` order by `pkey`
select `pkey` from `auto_test_remote3`.`tbl_a` order by `pkey`
select `pkey` from `auto_test_remote3`.`tbl_b` order by `pkey`
select `pkey` from `auto_test_remote3`.`tbl_b` order by `pkey`
diff --git a/storage/spider/mysql-test/spider/r/pushdown_not_like.result b/storage/spider/mysql-test/spider/r/pushdown_not_like.result
index 5c802c90..05b25787 100644
--- a/storage/spider/mysql-test/spider/r/pushdown_not_like.result
+++ b/storage/spider/mysql-test/spider/r/pushdown_not_like.result
@@ -27,6 +27,9 @@ b CHAR(1),
c DATETIME,
PRIMARY KEY(a)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
INSERT INTO ta_l (a, b, c) VALUES
(1, 'a', '2018-11-01 10:21:39'),
(2, 'b', '2015-06-30 23:59:59'),
diff --git a/storage/spider/mysql-test/spider/r/quick_mode_0.result b/storage/spider/mysql-test/spider/r/quick_mode_0.result
index 04c8231b..d3738571 100644
--- a/storage/spider/mysql-test/spider/r/quick_mode_0.result
+++ b/storage/spider/mysql-test/spider/r/quick_mode_0.result
@@ -45,6 +45,10 @@ CREATE TABLE tbl_b (
pkey int NOT NULL,
PRIMARY KEY (pkey)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_2
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
INSERT INTO tbl_a (pkey) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
INSERT INTO tbl_a (pkey) VALUES (10),(11),(12),(13),(14),(15),(16),(17),(18),(19);
INSERT INTO tbl_a (pkey) VALUES (20),(21),(22),(23),(24),(25),(26),(27),(28),(29);
diff --git a/storage/spider/mysql-test/spider/r/quick_mode_1.result b/storage/spider/mysql-test/spider/r/quick_mode_1.result
index 820d791d..a0057357 100644
--- a/storage/spider/mysql-test/spider/r/quick_mode_1.result
+++ b/storage/spider/mysql-test/spider/r/quick_mode_1.result
@@ -45,6 +45,10 @@ CREATE TABLE tbl_b (
pkey int NOT NULL,
PRIMARY KEY (pkey)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_2
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
INSERT INTO tbl_a (pkey) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
INSERT INTO tbl_a (pkey) VALUES (10),(11),(12),(13),(14),(15),(16),(17),(18),(19);
INSERT INTO tbl_a (pkey) VALUES (20),(21),(22),(23),(24),(25),(26),(27),(28),(29);
diff --git a/storage/spider/mysql-test/spider/r/quick_mode_2.result b/storage/spider/mysql-test/spider/r/quick_mode_2.result
index 94c5c4cf..54206bda 100644
--- a/storage/spider/mysql-test/spider/r/quick_mode_2.result
+++ b/storage/spider/mysql-test/spider/r/quick_mode_2.result
@@ -45,6 +45,10 @@ CREATE TABLE tbl_b (
pkey int NOT NULL,
PRIMARY KEY (pkey)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_2
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
INSERT INTO tbl_a (pkey) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
INSERT INTO tbl_a (pkey) VALUES (10),(11),(12),(13),(14),(15),(16),(17),(18),(19);
INSERT INTO tbl_a (pkey) VALUES (20),(21),(22),(23),(24),(25),(26),(27),(28),(29);
diff --git a/storage/spider/mysql-test/spider/r/quick_mode_3.result b/storage/spider/mysql-test/spider/r/quick_mode_3.result
index 88a8914c..9f485dda 100644
--- a/storage/spider/mysql-test/spider/r/quick_mode_3.result
+++ b/storage/spider/mysql-test/spider/r/quick_mode_3.result
@@ -45,6 +45,10 @@ CREATE TABLE tbl_b (
pkey int NOT NULL,
PRIMARY KEY (pkey)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_2
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
INSERT INTO tbl_a (pkey) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
INSERT INTO tbl_a (pkey) VALUES (10),(11),(12),(13),(14),(15),(16),(17),(18),(19);
INSERT INTO tbl_a (pkey) VALUES (20),(21),(22),(23),(24),(25),(26),(27),(28),(29);
diff --git a/storage/spider/mysql-test/spider/r/slave_trx_isolation.result b/storage/spider/mysql-test/spider/r/slave_trx_isolation.result
index 2f850b26..c65a62e0 100644
--- a/storage/spider/mysql-test/spider/r/slave_trx_isolation.result
+++ b/storage/spider/mysql-test/spider/r/slave_trx_isolation.result
@@ -44,6 +44,8 @@ CREATE TABLE tbl_a (
pkey int NOT NULL,
PRIMARY KEY (pkey)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
connection master_1;
INSERT INTO tbl_a (pkey) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
connection slave1_1;
@@ -54,6 +56,8 @@ SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argum
argument
set session time_zone = '+00:00';set @`spider_lc_./auto_test_remote/tbl_a` = '-xxxxxxxxxxxx-xxxxx-./auto_test_local/tbl_a-'
SET NAMES utf8mb3
+set @old_lock_wait_timeout=@@session.lock_wait_timeout;set session lock_wait_timeout=1
+set session lock_wait_timeout=@old_lock_wait_timeout
set session transaction isolation level read committed;set session autocommit = 1;set session wait_timeout = 604800;set session sql_mode = 'strict_trans_tables,error_for_division_by_zero,no_auto_create_user,no_engine_substitution';start transaction
SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%set %'
SELECT pkey FROM tbl_a ORDER BY pkey;
diff --git a/storage/spider/mysql-test/spider/r/spider3_fixes.result b/storage/spider/mysql-test/spider/r/spider3_fixes.result
index 614920be..9b0fc311 100644
--- a/storage/spider/mysql-test/spider/r/spider3_fixes.result
+++ b/storage/spider/mysql-test/spider/r/spider3_fixes.result
@@ -50,6 +50,10 @@ PRIMARY KEY (id)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_INCREMENT1_1
MASTER_1_AUTO_INCREMENT_INCREMENT2
MASTER_1_AUTO_INCREMENT_OFFSET2
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
spider_direct_sql('SET SESSION AUTO_INCREMENT_INCREMENT = 4', '',
'srv "s_2_1"')
1
diff --git a/storage/spider/mysql-test/spider/r/spider3_fixes_part.result b/storage/spider/mysql-test/spider/r/spider3_fixes_part.result
index 94390ff7..03bb6437 100644
--- a/storage/spider/mysql-test/spider/r/spider3_fixes_part.result
+++ b/storage/spider/mysql-test/spider/r/spider3_fixes_part.result
@@ -48,6 +48,16 @@ PRIMARY KEY (id)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_INCREMENT1_P_1
MASTER_1_AUTO_INCREMENT_INCREMENT2
MASTER_1_AUTO_INCREMENT_OFFSET2
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
spider_direct_sql('SET SESSION AUTO_INCREMENT_INCREMENT = 4', '',
'srv "s_2_1"')
1
diff --git a/storage/spider/mysql-test/spider/r/spider_fixes.result b/storage/spider/mysql-test/spider/r/spider_fixes.result
index 9083ad70..e4c6826b 100644
--- a/storage/spider/mysql-test/spider/r/spider_fixes.result
+++ b/storage/spider/mysql-test/spider/r/spider_fixes.result
@@ -53,6 +53,9 @@ DROP TABLE IF EXISTS ta_l;
CREATE TABLE ta_l (
PRIMARY KEY(a)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
INSERT INTO ta_l SELECT a, b, c FROM tb_l;
2.13
@@ -98,6 +101,9 @@ b char(1) DEFAULT NULL,
c datetime DEFAULT NULL,
PRIMARY KEY (a, b, c)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT5_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
INSERT INTO ta_l SELECT a, b, c FROM tb_l;
connection master_1;
SELECT a, b, c FROM ta_l FORCE INDEX(PRIMARY) WHERE a = 4 AND b >= 'b'
@@ -169,6 +175,9 @@ b CHAR(1) DEFAULT 'c',
c DATETIME DEFAULT '1999-10-10 10:10:10',
PRIMARY KEY(a)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT3_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
CREATE TABLE tc_l (
a INT,
b CHAR(1),
@@ -206,6 +215,9 @@ PRIMARY KEY(a),
KEY idx1(b),
KEY idx2(c)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT4_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
INSERT INTO ta_l_int (a, b, c) VALUES (1, 2, 3);
INSERT INTO ta_l_int (a, b, c) SELECT a + 1, b + 1, c + 1 FROM ta_l_int;
INSERT INTO ta_l_int (a, b, c) SELECT a + 2, b + 2, c + 2 FROM ta_l_int;
@@ -230,6 +242,9 @@ c INT DEFAULT 11,
KEY idx1(b),
KEY idx2(c)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT4_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
SELECT a, b, c FROM ta_l_int ORDER BY a;
a b c
1 2 3
@@ -299,6 +314,7 @@ id int(11) NOT NULL,
PRIMARY KEY (id)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_LOCK1
Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
Warning 138 The high availability feature of Spider has been deprecated and will be removed in a future release
Warning 138 The high availability feature of Spider has been deprecated and will be removed in a future release
CREATE TABLE t2 (
@@ -306,6 +322,7 @@ id int(11) NOT NULL,
PRIMARY KEY (id)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_LOCK2
Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
Warning 138 The high availability feature of Spider has been deprecated and will be removed in a future release
Warning 138 The high availability feature of Spider has been deprecated and will be removed in a future release
LOCK TABLES t1 READ, t2 READ;
@@ -322,6 +339,8 @@ PRIMARY KEY (id)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_INCREMENT1_1
MASTER_1_AUTO_INCREMENT_INCREMENT2
MASTER_1_AUTO_INCREMENT_OFFSET2
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
spider_direct_sql('SET SESSION AUTO_INCREMENT_INCREMENT = 4', '',
'srv "s_2_1"')
1
@@ -425,6 +444,8 @@ CREATE TABLE t1 (
id int(11) NOT NULL,
PRIMARY KEY (id)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_READONLY1_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
SELECT id FROM t1 ORDER BY id;
id
777
@@ -457,6 +478,10 @@ CREATE TABLE t1 (
id int(11) NOT NULL,
PRIMARY KEY (id)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_ERROR_MODE1_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 1287 'erm' is deprecated and will be removed in a future release
+Warning 1287 'ewm' is deprecated and will be removed in a future release
SELECT id FROM t1 ORDER BY id;
id
Warnings:
@@ -469,7 +494,6 @@ DELETE FROM t1;
Warnings:
Error 12702 Remote table 'auto_test_remote.ter1_1' is not found
Error 12702 Remote table 'auto_test_remote.ter1_1' is not found
-Error 1146 Table 'auto_test_remote.ter1_1' doesn't exist
TRUNCATE t1;
Warnings:
Error 1146 Table 'auto_test_remote.ter1_1' doesn't exist
@@ -486,6 +510,8 @@ KEY idx1(a,b),
KEY idx2(b),
PRIMARY KEY(c)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_TEXT_KEY1_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
insert into t1 values (null, null, '2048');
insert into t1 values ('1', '1', '1');
insert into t1 select a + 1, b + 1, c + 1 from t1;
diff --git a/storage/spider/mysql-test/spider/r/spider_fixes_part.result b/storage/spider/mysql-test/spider/r/spider_fixes_part.result
index a59d2d2b..53e15609 100644
--- a/storage/spider/mysql-test/spider/r/spider_fixes_part.result
+++ b/storage/spider/mysql-test/spider/r/spider_fixes_part.result
@@ -57,6 +57,11 @@ b CHAR(1),
c DATETIME,
PRIMARY KEY(a)
) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
INSERT INTO ta_l2 SELECT a, b, c FROM tb_l;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 WHERE a > 1
ORDER BY a;
@@ -77,6 +82,11 @@ b CHAR(1),
c DATETIME,
PRIMARY KEY(a)
) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
INSERT INTO ta_l2 (a, b, c) VALUES (3, 'B', '2010-09-26 00:00:00');
UPDATE ta_l2 SET a = 4 WHERE a = 3;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2;
@@ -94,6 +104,11 @@ PRIMARY KEY(a),
KEY idx1(b),
KEY idx2(c)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT3_P_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
INSERT INTO ta_l_int (a, b, c) VALUES (1, 2, 3);
INSERT INTO ta_l_int (a, b, c) SELECT a + 1, b + 1, c + 1 FROM ta_l_int;
INSERT INTO ta_l_int (a, b, c) SELECT a + 2, b + 2, c + 2 FROM ta_l_int;
@@ -120,6 +135,11 @@ PRIMARY KEY (id)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_INCREMENT1_P_1
MASTER_1_AUTO_INCREMENT_INCREMENT2
MASTER_1_AUTO_INCREMENT_OFFSET2
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
spider_direct_sql('SET SESSION AUTO_INCREMENT_INCREMENT = 4', '',
'srv "s_2_1"')
1
@@ -229,6 +249,9 @@ PRIMARY KEY (a, e)
) ENGINE=Spider COMMENT='database "auto_test_remote", table "ta_ob"'
PARTITION BY LIST COLUMNS (e) PARTITIONS 1
(PARTITION pt1 values in (510411) COMMENT = 'srv "s_2_1"')
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
INSERT INTO ta_ob VALUES ('0B95CD65DF994BC9A09A6AABE53A2733',
'6CFED89FF6A84C7AA55C3C432663D094',
'51041110620304', '2018-08-02 13:41:13',
@@ -289,6 +312,9 @@ KEY (b,c)
PARTITION BY LIST COLUMNS(`a`) (
PARTITION `pt1` DEFAULT COMMENT = 'srv "s_2_1"'
);
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
connection master_1;
SELECT * FROM t1 WHERE c > 0 AND b >= 1 AND b <= 2;
a b c
@@ -309,6 +335,11 @@ b CHAR(1),
c DATETIME,
PRIMARY KEY(a)
) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
INSERT INTO ta_l2 SELECT a, b, c FROM tb_l;
Query a Spider table only using the second partition
SELECT a,b,c FROM ta_l2 PARTITION (pt2);
diff --git a/storage/spider/mysql-test/spider/r/timestamp.result b/storage/spider/mysql-test/spider/r/timestamp.result
index 4618d920..3eb4d1da 100644
--- a/storage/spider/mysql-test/spider/r/timestamp.result
+++ b/storage/spider/mysql-test/spider/r/timestamp.result
@@ -55,10 +55,14 @@ DEFAULT current_timestamp() ON UPDATE current_timestamp(),
PRIMARY KEY(col_a),
UNIQUE INDEX i_ts (col_ts)
) MASTER_1_ENGINE MASTER_1_AUTO_INCREMENT_2_1 MASTER_1_COMMENT_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
CREATE TABLE tbl_f (
col_d DATE,
col_t TIME
) ENGINE=Spider COMMENT='database "ts_test_remote", table "tbl_f", srv "s_2_1"'
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
SHOW CREATE TABLE tbl_a;
Table Create Table
tbl_a CREATE TABLE `tbl_a` (
@@ -257,7 +261,7 @@ select t0.`col_a` `col_a`,t0.`col_dt` `col_dt`,t0.`col_ts` `col_ts`,(unix_timest
select t0.`col_a` `col_a`,t0.`col_dt` `col_dt`,t0.`col_ts` `col_ts`,(unix_timestamp(t0.`col_ts`)) `unix_timestamp(col_ts)` from `ts_test_remote`.`tbl_a` t0 where (_latin1'2018-10-28 01:30:00' > t0.`col_ts`)
select t0.`col_a` `col_a`,t0.`col_dt` `col_dt`,t0.`col_ts` `col_ts`,(unix_timestamp(t0.`col_ts`)) `unix_timestamp(col_ts)` from `ts_test_remote`.`tbl_a` t0 where (t0.`col_ts` between _latin1'2018-10-28 00:30:00' and _latin1'2018-10-28 01:30:00')
select t0.`col_a` `col_a`,t0.`col_dt` `col_dt`,t0.`col_ts` `col_ts`,(unix_timestamp(t0.`col_ts`)) `unix_timestamp(col_ts)` from `ts_test_remote`.`tbl_a` t0 where ((t0.`col_ts` >= _latin1'2018-10-28 00:30:00') and (t0.`col_ts` <= _latin1'2018-10-28 01:30:00'))
-select t0.`col_a` `col_a`,t0.`col_dt` `col_dt`,t0.`col_ts` `col_ts`,(unix_timestamp(t0.`col_ts`)) `unix_timestamp(col_ts)` from `ts_test_remote`.`tbl_a` t0 where (t0.`col_ts` > '2018-03-25 01:00:00')
+select t0.`col_a` `col_a`,t0.`col_dt` `col_dt`,t0.`col_ts` `col_ts`,(unix_timestamp(t0.`col_ts`)) `unix_timestamp(col_ts)` from `ts_test_remote`.`tbl_a` t0 where (t0.`col_ts` > _latin1'2018-03-25 01:00:00')
select t0.`col_a` `col_a`,t0.`col_dt` `col_dt`,t0.`col_ts` `col_ts`,(unix_timestamp(t0.`col_ts`)) `unix_timestamp(col_ts)` from `ts_test_remote`.`tbl_a` t0 where (t0.`col_ts` > '1970-01-01 00:00:01')
SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'
SELECT col_a, col_dt, col_ts, unix_timestamp(col_ts) FROM tbl_a ORDER BY col_a;
@@ -344,7 +348,7 @@ select t0.`col_a` `col_a`,t0.`col_dt` `col_dt`,t0.`col_ts` `col_ts`,(unix_timest
select t0.`col_a` `col_a`,t0.`col_dt` `col_dt`,t0.`col_ts` `col_ts`,(unix_timestamp(t0.`col_ts`)) `unix_timestamp(col_ts)` from `ts_test_remote`.`tbl_a` t0 where (_latin1'2018-10-28 01:30:00' > t0.`col_ts`)
select t0.`col_a` `col_a`,t0.`col_dt` `col_dt`,t0.`col_ts` `col_ts`,(unix_timestamp(t0.`col_ts`)) `unix_timestamp(col_ts)` from `ts_test_remote`.`tbl_a` t0 where (t0.`col_ts` between _latin1'2018-10-28 00:30:00' and _latin1'2018-10-28 01:30:00')
select t0.`col_a` `col_a`,t0.`col_dt` `col_dt`,t0.`col_ts` `col_ts`,(unix_timestamp(t0.`col_ts`)) `unix_timestamp(col_ts)` from `ts_test_remote`.`tbl_a` t0 where ((t0.`col_ts` >= _latin1'2018-10-28 00:30:00') and (t0.`col_ts` <= _latin1'2018-10-28 01:30:00'))
-select t0.`col_a` `col_a`,t0.`col_dt` `col_dt`,t0.`col_ts` `col_ts`,(unix_timestamp(t0.`col_ts`)) `unix_timestamp(col_ts)` from `ts_test_remote`.`tbl_a` t0 where (t0.`col_ts` > '2018-03-25 01:00:00')
+select t0.`col_a` `col_a`,t0.`col_dt` `col_dt`,t0.`col_ts` `col_ts`,(unix_timestamp(t0.`col_ts`)) `unix_timestamp(col_ts)` from `ts_test_remote`.`tbl_a` t0 where (t0.`col_ts` > _latin1'2018-03-25 01:00:00')
select t0.`col_a` `col_a`,t0.`col_dt` `col_dt`,t0.`col_ts` `col_ts`,(unix_timestamp(t0.`col_ts`)) `unix_timestamp(col_ts)` from `ts_test_remote`.`tbl_a` t0 where (t0.`col_ts` > '1970-01-01 00:00:01')
SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'
SELECT col_a, col_dt, col_ts, unix_timestamp(col_ts) FROM tbl_a ORDER BY col_a;
diff --git a/storage/spider/mysql-test/spider/r/variable_deprecation.result b/storage/spider/mysql-test/spider/r/variable_deprecation.result
index be964ce4..2ef96e93 100644
--- a/storage/spider/mysql-test/spider/r/variable_deprecation.result
+++ b/storage/spider/mysql-test/spider/r/variable_deprecation.result
@@ -22,10 +22,12 @@ Variable_name Value
spider_internal_offset 1
CREATE TABLE tbl_a (a INT) ENGINE=Spider COMMENT='ios "1"';
Warnings:
-Warning 1287 The table parameter 'ios' is deprecated and will be removed in a future release
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 1287 'ios' is deprecated and will be removed in a future release
CREATE TABLE tbl_b (a INT) ENGINE=Spider COMMENT='internal_offset "1"';
Warnings:
-Warning 1287 The table parameter 'internal_offset' is deprecated and will be removed in a future release
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 1287 'internal_offset' is deprecated and will be removed in a future release
DROP TABLE tbl_a;
DROP TABLE tbl_b;
# MDEV-27981 Deprecate spider_internal_limit
@@ -37,10 +39,12 @@ Variable_name Value
spider_internal_limit 1
CREATE TABLE tbl_a (a INT) ENGINE=Spider COMMENT='ilm "1"';
Warnings:
-Warning 1287 The table parameter 'ilm' is deprecated and will be removed in a future release
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 1287 'ilm' is deprecated and will be removed in a future release
CREATE TABLE tbl_b (a INT) ENGINE=Spider COMMENT='internal_limit "1"';
Warnings:
-Warning 1287 The table parameter 'internal_limit' is deprecated and will be removed in a future release
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 1287 'internal_limit' is deprecated and will be removed in a future release
DROP TABLE tbl_a;
DROP TABLE tbl_b;
# MDEV-28244 Deprecate spider_xa_register_mode
@@ -84,10 +88,12 @@ Variable_name Value
spider_crd_mode 1
CREATE TABLE tbl_a (a INT) ENGINE=Spider COMMENT='cmd "3"';
Warnings:
-Warning 1287 The table parameter 'cmd' is deprecated and will be removed in a future release
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 1287 'cmd' is deprecated and will be removed in a future release
CREATE TABLE tbl_b (a INT) ENGINE=Spider COMMENT='crd_mode "3"';
Warnings:
-Warning 1287 The table parameter 'crd_mode' is deprecated and will be removed in a future release
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 1287 'crd_mode' is deprecated and will be removed in a future release
DROP TABLE tbl_a;
DROP TABLE tbl_b;
SET spider_sts_mode = 1;
@@ -98,10 +104,12 @@ Variable_name Value
spider_sts_mode 1
CREATE TABLE tbl_a (a INT) ENGINE=Spider COMMENT='smd "3"';
Warnings:
-Warning 1287 The table parameter 'smd' is deprecated and will be removed in a future release
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 1287 'smd' is deprecated and will be removed in a future release
CREATE TABLE tbl_b (a INT) ENGINE=Spider COMMENT='sts_mode "3"';
Warnings:
-Warning 1287 The table parameter 'sts_mode' is deprecated and will be removed in a future release
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 1287 'sts_mode' is deprecated and will be removed in a future release
DROP TABLE tbl_a;
DROP TABLE tbl_b;
# MDEV-28010 Deprecate spider_crd_type and spider_crd_weight
@@ -113,10 +121,12 @@ Variable_name Value
spider_crd_type 1
CREATE TABLE tbl_a (a INT) ENGINE=Spider COMMENT='ctp "1"';
Warnings:
-Warning 1287 The table parameter 'ctp' is deprecated and will be removed in a future release
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 1287 'ctp' is deprecated and will be removed in a future release
CREATE TABLE tbl_b (a INT) ENGINE=Spider COMMENT='crd_type "1"';
Warnings:
-Warning 1287 The table parameter 'crd_type' is deprecated and will be removed in a future release
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 1287 'crd_type' is deprecated and will be removed in a future release
DROP TABLE tbl_a;
DROP TABLE tbl_b;
SET spider_crd_weight = 1;
@@ -127,10 +137,12 @@ Variable_name Value
spider_crd_weight 1
CREATE TABLE tbl_a (a INT) ENGINE=Spider COMMENT='cwg "1"';
Warnings:
-Warning 1287 The table parameter 'cwg' is deprecated and will be removed in a future release
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 1287 'cwg' is deprecated and will be removed in a future release
CREATE TABLE tbl_b (a INT) ENGINE=Spider COMMENT='crd_weight "1"';
Warnings:
-Warning 1287 The table parameter 'crd_weight' is deprecated and will be removed in a future release
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 1287 'crd_weight' is deprecated and will be removed in a future release
DROP TABLE tbl_a;
DROP TABLE tbl_b;
# MDEV-28560 Deprecate spider_buffer_size
@@ -142,10 +154,12 @@ Variable_name Value
spider_buffer_size 1
CREATE TABLE tbl_a (a INT) ENGINE=Spider COMMENT='bfz "1"';
Warnings:
-Warning 1287 The table parameter 'bfz' is deprecated and will be removed in a future release
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 1287 'bfz' is deprecated and will be removed in a future release
CREATE TABLE tbl_b (a INT) ENGINE=Spider COMMENT='buffer_size "1"';
Warnings:
-Warning 1287 The table parameter 'buffer_size' is deprecated and will be removed in a future release
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 1287 'buffer_size' is deprecated and will be removed in a future release
DROP TABLE tbl_a;
DROP TABLE tbl_b;
# MDEV-27926 Deprecate spider_init_sql_alloc_size
@@ -157,10 +171,12 @@ Variable_name Value
spider_init_sql_alloc_size 1
CREATE TABLE tbl_a (a INT) ENGINE=Spider COMMENT='isa "1"';
Warnings:
-Warning 1287 The table parameter 'isa' is deprecated and will be removed in a future release
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 1287 'isa' is deprecated and will be removed in a future release
CREATE TABLE tbl_b (a INT) ENGINE=Spider COMMENT='init_sql_alloc_size "1"';
Warnings:
-Warning 1287 The table parameter 'init_sql_alloc_size' is deprecated and will be removed in a future release
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 1287 'init_sql_alloc_size' is deprecated and will be removed in a future release
DROP TABLE tbl_a;
DROP TABLE tbl_b;
# MDEV-28829 Deprecate spider_semi_table_lock and spider_semi_table_lock_connection
@@ -172,10 +188,12 @@ Variable_name Value
spider_semi_table_lock 1
CREATE TABLE tbl_a (a INT) ENGINE=Spider COMMENT='stl "1"';
Warnings:
-Warning 1287 The table parameter 'stl' is deprecated and will be removed in a future release
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 1287 'stl' is deprecated and will be removed in a future release
CREATE TABLE tbl_b (a INT) ENGINE=Spider COMMENT='semi_table_lock "1"';
Warnings:
-Warning 1287 The table parameter 'semi_table_lock' is deprecated and will be removed in a future release
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 1287 'semi_table_lock' is deprecated and will be removed in a future release
DROP TABLE tbl_a;
DROP TABLE tbl_b;
SET spider_semi_table_lock_connection = 0;
@@ -186,10 +204,12 @@ Variable_name Value
spider_semi_table_lock_connection 0
CREATE TABLE tbl_a (a INT) ENGINE=Spider COMMENT='stc "0"';
Warnings:
-Warning 1287 The table parameter 'stc' is deprecated and will be removed in a future release
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 1287 'stc' is deprecated and will be removed in a future release
CREATE TABLE tbl_b (a INT) ENGINE=Spider COMMENT='semi_table_lock_connection "0"';
Warnings:
-Warning 1287 The table parameter 'semi_table_lock_connection' is deprecated and will be removed in a future release
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 1287 'semi_table_lock_connection' is deprecated and will be removed in a future release
DROP TABLE tbl_a;
DROP TABLE tbl_b;
# MDEV-28795 Deprecate spider_bka_table_name_type
@@ -201,10 +221,12 @@ Variable_name Value
spider_bka_table_name_type 1
CREATE TABLE tbl_a (a INT) ENGINE=Spider COMMENT='btt "1"';
Warnings:
-Warning 1287 The table parameter 'btt' is deprecated and will be removed in a future release
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 1287 'btt' is deprecated and will be removed in a future release
CREATE TABLE tbl_b (a INT) ENGINE=Spider COMMENT='bka_table_name_type "1"';
Warnings:
-Warning 1287 The table parameter 'bka_table_name_type' is deprecated and will be removed in a future release
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 1287 'bka_table_name_type' is deprecated and will be removed in a future release
DROP TABLE tbl_a;
DROP TABLE tbl_b;
DROP DATABASE auto_test_local;
diff --git a/storage/spider/mysql-test/spider/r/vp_fixes.result b/storage/spider/mysql-test/spider/r/vp_fixes.result
index cc0e4105..0a38e3cd 100644
--- a/storage/spider/mysql-test/spider/r/vp_fixes.result
+++ b/storage/spider/mysql-test/spider/r/vp_fixes.result
@@ -47,6 +47,9 @@ DROP TABLE IF EXISTS ta_l;
CREATE TABLE ta_l (
PRIMARY KEY(a)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
INSERT INTO ta_l SELECT a, b, c FROM tb_l;
0.9
@@ -58,6 +61,9 @@ b INT AUTO_INCREMENT,
c INT DEFAULT 11,
PRIMARY KEY(b)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT4_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
connection master_1;
INSERT INTO ta_l_int (a, b, c) VALUES (2, NULL, 3);
create un-correspond primary key table
@@ -70,6 +76,9 @@ b INT DEFAULT 12,
c INT DEFAULT 11,
PRIMARY KEY(c)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT4_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
connection master_1;
INSERT INTO ta_l_int (a, b, c) VALUES (2, NULL, 3);
diff --git a/storage/spider/mysql-test/spider/regression/e1121/my.cnf b/storage/spider/mysql-test/spider/regression/e1121/my.cnf
index 47558d85..39569f38 100644
--- a/storage/spider/mysql-test/spider/regression/e1121/my.cnf
+++ b/storage/spider/mysql-test/spider/regression/e1121/my.cnf
@@ -1,3 +1,4 @@
!include include/default_mysqld.cnf
+!include include/default_client.cnf
!include my_1_1.cnf
!include my_2_1.cnf
diff --git a/storage/spider/mysql-test/spider/regression/e1121/r/direct_join_by_pkey_key.result b/storage/spider/mysql-test/spider/regression/e1121/r/direct_join_by_pkey_key.result
index 72645f4f..0063adf6 100644
--- a/storage/spider/mysql-test/spider/regression/e1121/r/direct_join_by_pkey_key.result
+++ b/storage/spider/mysql-test/spider/regression/e1121/r/direct_join_by_pkey_key.result
@@ -27,11 +27,15 @@ akey int NOT NULL,
val int NOT NULL,
KEY idx1 (akey)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
CREATE TABLE tbl_b (
bkey int NOT NULL,
akey int NOT NULL,
PRIMARY KEY (bkey)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1_2
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
INSERT INTO tbl_a (akey,val) VALUES (0,0),(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9);
INSERT INTO tbl_b (bkey,akey) VALUES (0,0),(1,1),(2,2),(3,3),(4,4),(5,4),(6,3),(7,2),(8,1),(9,0);
diff --git a/storage/spider/mysql-test/spider/regression/e1121/r/direct_join_by_pkey_pkey.result b/storage/spider/mysql-test/spider/regression/e1121/r/direct_join_by_pkey_pkey.result
index 4ea23c88..b4a1f8e1 100644
--- a/storage/spider/mysql-test/spider/regression/e1121/r/direct_join_by_pkey_pkey.result
+++ b/storage/spider/mysql-test/spider/regression/e1121/r/direct_join_by_pkey_pkey.result
@@ -27,11 +27,15 @@ akey int NOT NULL,
val int NOT NULL,
PRIMARY KEY (akey)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
CREATE TABLE tbl_b (
bkey int NOT NULL,
akey int NOT NULL,
PRIMARY KEY (bkey)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1_2
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
INSERT INTO tbl_a (akey,val) VALUES (0,0),(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9);
INSERT INTO tbl_b (bkey,akey) VALUES (0,0),(1,1),(2,2),(3,3),(4,4),(5,4),(6,3),(7,2),(8,1),(9,0);
diff --git a/storage/spider/mysql-test/spider/regression/e1121/r/load_data_ddi0.result b/storage/spider/mysql-test/spider/regression/e1121/r/load_data_ddi0.result
index 9d30f61a..28dbdf1a 100644
--- a/storage/spider/mysql-test/spider/regression/e1121/r/load_data_ddi0.result
+++ b/storage/spider/mysql-test/spider/regression/e1121/r/load_data_ddi0.result
@@ -30,6 +30,8 @@ pkey int NOT NULL,
val int NOT NULL,
PRIMARY KEY (pkey)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
INSERT INTO tbl_a (pkey,val) VALUES (0,0),(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9);
SELECT pkey,val INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/spider_outfile.tsv' FROM tbl_a ORDER BY pkey;
TRUNCATE tbl_a;
diff --git a/storage/spider/mysql-test/spider/regression/e1121/r/load_data_ddi1.result b/storage/spider/mysql-test/spider/regression/e1121/r/load_data_ddi1.result
index 594016e1..928d3e58 100644
--- a/storage/spider/mysql-test/spider/regression/e1121/r/load_data_ddi1.result
+++ b/storage/spider/mysql-test/spider/regression/e1121/r/load_data_ddi1.result
@@ -30,6 +30,8 @@ pkey int NOT NULL,
val int NOT NULL,
PRIMARY KEY (pkey)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
INSERT INTO tbl_a (pkey,val) VALUES (0,0),(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9);
SELECT pkey,val INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/spider_outfile.tsv' FROM tbl_a ORDER BY pkey;
TRUNCATE tbl_a;
diff --git a/storage/spider/mysql-test/spider/regression/e1121/r/load_data_ignore_ddi0.result b/storage/spider/mysql-test/spider/regression/e1121/r/load_data_ignore_ddi0.result
index e1ba5470..aab82e5a 100644
--- a/storage/spider/mysql-test/spider/regression/e1121/r/load_data_ignore_ddi0.result
+++ b/storage/spider/mysql-test/spider/regression/e1121/r/load_data_ignore_ddi0.result
@@ -30,6 +30,8 @@ pkey int NOT NULL,
val int NOT NULL,
PRIMARY KEY (pkey)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
INSERT INTO tbl_a (pkey,val) VALUES (0,0),(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9);
SELECT pkey,val INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/spider_outfile.tsv' FROM tbl_a ORDER BY pkey;
UPDATE tbl_a SET val = val + 1;
diff --git a/storage/spider/mysql-test/spider/regression/e1121/r/load_data_ignore_ddi1.result b/storage/spider/mysql-test/spider/regression/e1121/r/load_data_ignore_ddi1.result
index af2bcc3d..550851d5 100644
--- a/storage/spider/mysql-test/spider/regression/e1121/r/load_data_ignore_ddi1.result
+++ b/storage/spider/mysql-test/spider/regression/e1121/r/load_data_ignore_ddi1.result
@@ -30,6 +30,8 @@ pkey int NOT NULL,
val int NOT NULL,
PRIMARY KEY (pkey)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
INSERT INTO tbl_a (pkey,val) VALUES (0,0),(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9);
SELECT pkey,val INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/spider_outfile.tsv' FROM tbl_a ORDER BY pkey;
UPDATE tbl_a SET val = val + 1;
diff --git a/storage/spider/mysql-test/spider/regression/e1121/r/load_data_local_ddi0.result b/storage/spider/mysql-test/spider/regression/e1121/r/load_data_local_ddi0.result
index 057d8386..6675a6cb 100644
--- a/storage/spider/mysql-test/spider/regression/e1121/r/load_data_local_ddi0.result
+++ b/storage/spider/mysql-test/spider/regression/e1121/r/load_data_local_ddi0.result
@@ -30,6 +30,8 @@ pkey int NOT NULL,
val int NOT NULL,
PRIMARY KEY (pkey)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
INSERT INTO tbl_a (pkey,val) VALUES (0,0),(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9);
SELECT pkey,val INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/spider_outfile.tsv' FROM tbl_a ORDER BY pkey;
TRUNCATE tbl_a;
diff --git a/storage/spider/mysql-test/spider/regression/e1121/r/load_data_local_ddi1.result b/storage/spider/mysql-test/spider/regression/e1121/r/load_data_local_ddi1.result
index ba643fa6..4695715e 100644
--- a/storage/spider/mysql-test/spider/regression/e1121/r/load_data_local_ddi1.result
+++ b/storage/spider/mysql-test/spider/regression/e1121/r/load_data_local_ddi1.result
@@ -30,6 +30,8 @@ pkey int NOT NULL,
val int NOT NULL,
PRIMARY KEY (pkey)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
INSERT INTO tbl_a (pkey,val) VALUES (0,0),(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9);
SELECT pkey,val INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/spider_outfile.tsv' FROM tbl_a ORDER BY pkey;
TRUNCATE tbl_a;
diff --git a/storage/spider/mysql-test/spider/regression/e1121/r/load_data_local_ignore_ddi0.result b/storage/spider/mysql-test/spider/regression/e1121/r/load_data_local_ignore_ddi0.result
index 50248d5a..aa31c4ce 100644
--- a/storage/spider/mysql-test/spider/regression/e1121/r/load_data_local_ignore_ddi0.result
+++ b/storage/spider/mysql-test/spider/regression/e1121/r/load_data_local_ignore_ddi0.result
@@ -30,6 +30,8 @@ pkey int NOT NULL,
val int NOT NULL,
PRIMARY KEY (pkey)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
INSERT INTO tbl_a (pkey,val) VALUES (0,0),(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9);
SELECT pkey,val INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/spider_outfile.tsv' FROM tbl_a ORDER BY pkey;
UPDATE tbl_a SET val = val + 1;
diff --git a/storage/spider/mysql-test/spider/regression/e1121/r/load_data_local_ignore_ddi1.result b/storage/spider/mysql-test/spider/regression/e1121/r/load_data_local_ignore_ddi1.result
index bb4c6da7..dcf8d60c 100644
--- a/storage/spider/mysql-test/spider/regression/e1121/r/load_data_local_ignore_ddi1.result
+++ b/storage/spider/mysql-test/spider/regression/e1121/r/load_data_local_ignore_ddi1.result
@@ -30,6 +30,8 @@ pkey int NOT NULL,
val int NOT NULL,
PRIMARY KEY (pkey)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
INSERT INTO tbl_a (pkey,val) VALUES (0,0),(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9);
SELECT pkey,val INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/spider_outfile.tsv' FROM tbl_a ORDER BY pkey;
UPDATE tbl_a SET val = val + 1;
diff --git a/storage/spider/mysql-test/spider/regression/e1121/r/load_data_local_replace_ddi0.result b/storage/spider/mysql-test/spider/regression/e1121/r/load_data_local_replace_ddi0.result
index 324cdac2..c2e84706 100644
--- a/storage/spider/mysql-test/spider/regression/e1121/r/load_data_local_replace_ddi0.result
+++ b/storage/spider/mysql-test/spider/regression/e1121/r/load_data_local_replace_ddi0.result
@@ -30,6 +30,8 @@ pkey int NOT NULL,
val int NOT NULL,
PRIMARY KEY (pkey)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
INSERT INTO tbl_a (pkey,val) VALUES (0,0),(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9);
SELECT pkey,val INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/spider_outfile.tsv' FROM tbl_a ORDER BY pkey;
UPDATE tbl_a SET val = val + 1;
diff --git a/storage/spider/mysql-test/spider/regression/e1121/r/load_data_local_replace_ddi1.result b/storage/spider/mysql-test/spider/regression/e1121/r/load_data_local_replace_ddi1.result
index e73b078d..4333544f 100644
--- a/storage/spider/mysql-test/spider/regression/e1121/r/load_data_local_replace_ddi1.result
+++ b/storage/spider/mysql-test/spider/regression/e1121/r/load_data_local_replace_ddi1.result
@@ -30,6 +30,8 @@ pkey int NOT NULL,
val int NOT NULL,
PRIMARY KEY (pkey)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
INSERT INTO tbl_a (pkey,val) VALUES (0,0),(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9);
SELECT pkey,val INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/spider_outfile.tsv' FROM tbl_a ORDER BY pkey;
UPDATE tbl_a SET val = val + 1;
diff --git a/storage/spider/mysql-test/spider/regression/e1121/r/load_data_replace_ddi0.result b/storage/spider/mysql-test/spider/regression/e1121/r/load_data_replace_ddi0.result
index dd91e95d..e1eb4a61 100644
--- a/storage/spider/mysql-test/spider/regression/e1121/r/load_data_replace_ddi0.result
+++ b/storage/spider/mysql-test/spider/regression/e1121/r/load_data_replace_ddi0.result
@@ -30,6 +30,8 @@ pkey int NOT NULL,
val int NOT NULL,
PRIMARY KEY (pkey)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
INSERT INTO tbl_a (pkey,val) VALUES (0,0),(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9);
SELECT pkey,val INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/spider_outfile.tsv' FROM tbl_a ORDER BY pkey;
UPDATE tbl_a SET val = val + 1;
diff --git a/storage/spider/mysql-test/spider/regression/e1121/r/load_data_replace_ddi1.result b/storage/spider/mysql-test/spider/regression/e1121/r/load_data_replace_ddi1.result
index 974287ab..e2bfa102 100644
--- a/storage/spider/mysql-test/spider/regression/e1121/r/load_data_replace_ddi1.result
+++ b/storage/spider/mysql-test/spider/regression/e1121/r/load_data_replace_ddi1.result
@@ -30,6 +30,8 @@ pkey int NOT NULL,
val int NOT NULL,
PRIMARY KEY (pkey)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
INSERT INTO tbl_a (pkey,val) VALUES (0,0),(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9);
SELECT pkey,val INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/spider_outfile.tsv' FROM tbl_a ORDER BY pkey;
UPDATE tbl_a SET val = val + 1;
diff --git a/storage/spider/mysql-test/spider/regression/e1121/t/direct_join_by_pkey_key.test b/storage/spider/mysql-test/spider/regression/e1121/t/direct_join_by_pkey_key.test
index ec4639ed..a9b48319 100644
--- a/storage/spider/mysql-test/spider/regression/e1121/t/direct_join_by_pkey_key.test
+++ b/storage/spider/mysql-test/spider/regression/e1121/t/direct_join_by_pkey_key.test
@@ -51,8 +51,10 @@ eval CREATE TABLE tbl_b (
PRIMARY KEY (bkey)
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1_2;
--enable_query_log
+--disable_ps_protocol
INSERT INTO tbl_a (akey,val) VALUES (0,0),(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9);
INSERT INTO tbl_b (bkey,akey) VALUES (0,0),(1,1),(2,2),(3,3),(4,4),(5,4),(6,3),(7,2),(8,1),(9,0);
+--enable_ps_protocol
--echo
--echo select test 1
diff --git a/storage/spider/mysql-test/spider/regression/e1121/t/direct_join_by_pkey_pkey.test b/storage/spider/mysql-test/spider/regression/e1121/t/direct_join_by_pkey_pkey.test
index 52d9b52d..746ff382 100644
--- a/storage/spider/mysql-test/spider/regression/e1121/t/direct_join_by_pkey_pkey.test
+++ b/storage/spider/mysql-test/spider/regression/e1121/t/direct_join_by_pkey_pkey.test
@@ -51,8 +51,10 @@ eval CREATE TABLE tbl_b (
PRIMARY KEY (bkey)
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1_2;
--enable_query_log
+--disable_ps_protocol
INSERT INTO tbl_a (akey,val) VALUES (0,0),(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9);
INSERT INTO tbl_b (bkey,akey) VALUES (0,0),(1,1),(2,2),(3,3),(4,4),(5,4),(6,3),(7,2),(8,1),(9,0);
+--enable_ps_protocol
--echo
--echo select test 1
diff --git a/storage/spider/mysql-test/spider/regression/e1121/t/load_data.inc b/storage/spider/mysql-test/spider/regression/e1121/t/load_data.inc
index 080ba735..6a6033a6 100644
--- a/storage/spider/mysql-test/spider/regression/e1121/t/load_data.inc
+++ b/storage/spider/mysql-test/spider/regression/e1121/t/load_data.inc
@@ -38,7 +38,9 @@ eval CREATE TABLE tbl_a (
PRIMARY KEY (pkey)
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1;
--enable_query_log
+--disable_ps_protocol
INSERT INTO tbl_a (pkey,val) VALUES (0,0),(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9);
+--enable_ps_protocol
--disable_query_log
--echo SELECT pkey,val INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/spider_outfile.tsv' FROM tbl_a ORDER BY pkey;
--disable_ps2_protocol
diff --git a/storage/spider/mysql-test/spider/regression/e112122/my.cnf b/storage/spider/mysql-test/spider/regression/e112122/my.cnf
index 6610e4cf..47e82b1f 100644
--- a/storage/spider/mysql-test/spider/regression/e112122/my.cnf
+++ b/storage/spider/mysql-test/spider/regression/e112122/my.cnf
@@ -1,4 +1,5 @@
!include include/default_mysqld.cnf
+!include include/default_client.cnf
!include my_1_1.cnf
!include my_2_1.cnf
!include my_2_2.cnf
diff --git a/storage/spider/mysql-test/spider/regression/e112122/r/group_by_order_by_limit_ok.result b/storage/spider/mysql-test/spider/regression/e112122/r/group_by_order_by_limit_ok.result
index 695ddadc..f547367d 100644
--- a/storage/spider/mysql-test/spider/regression/e112122/r/group_by_order_by_limit_ok.result
+++ b/storage/spider/mysql-test/spider/regression/e112122/r/group_by_order_by_limit_ok.result
@@ -36,6 +36,11 @@ skey int NOT NULL,
KEY idx1 (pkey),
KEY idx2 (skey)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
INSERT INTO tbl_a (pkey,skey) VALUES (0,0),(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9);
INSERT INTO tbl_a (pkey,skey) VALUES (10,10),(11,11),(12,12),(13,13),(14,14),(15,15),(16,16),(17,17),(18,18),(19,19);
INSERT INTO tbl_a (pkey,skey) VALUES (20,5),(21,6),(22,7),(23,8),(24,9),(25,10),(26,11),(27,12),(28,13),(29,14);
diff --git a/storage/spider/mysql-test/spider/regression/e112122/r/load_data_part_ddi0.result b/storage/spider/mysql-test/spider/regression/e112122/r/load_data_part_ddi0.result
index c32e8793..7f3ddfea 100644
--- a/storage/spider/mysql-test/spider/regression/e112122/r/load_data_part_ddi0.result
+++ b/storage/spider/mysql-test/spider/regression/e112122/r/load_data_part_ddi0.result
@@ -38,6 +38,11 @@ pkey int NOT NULL,
val int NOT NULL,
PRIMARY KEY (pkey)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
INSERT INTO tbl_a (pkey,val) VALUES (0,0),(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9);
SELECT pkey,val INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/spider_outfile.tsv' FROM tbl_a ORDER BY pkey;
TRUNCATE tbl_a;
diff --git a/storage/spider/mysql-test/spider/regression/e112122/r/load_data_part_ddi1.result b/storage/spider/mysql-test/spider/regression/e112122/r/load_data_part_ddi1.result
index dab51a3e..caa089c1 100644
--- a/storage/spider/mysql-test/spider/regression/e112122/r/load_data_part_ddi1.result
+++ b/storage/spider/mysql-test/spider/regression/e112122/r/load_data_part_ddi1.result
@@ -38,6 +38,11 @@ pkey int NOT NULL,
val int NOT NULL,
PRIMARY KEY (pkey)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
INSERT INTO tbl_a (pkey,val) VALUES (0,0),(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9);
SELECT pkey,val INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/spider_outfile.tsv' FROM tbl_a ORDER BY pkey;
TRUNCATE tbl_a;
diff --git a/storage/spider/mysql-test/spider/regression/e112122/r/load_data_part_ignore_ddi0.result b/storage/spider/mysql-test/spider/regression/e112122/r/load_data_part_ignore_ddi0.result
index 7d99878b..4937be03 100644
--- a/storage/spider/mysql-test/spider/regression/e112122/r/load_data_part_ignore_ddi0.result
+++ b/storage/spider/mysql-test/spider/regression/e112122/r/load_data_part_ignore_ddi0.result
@@ -38,6 +38,11 @@ pkey int NOT NULL,
val int NOT NULL,
PRIMARY KEY (pkey)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
INSERT INTO tbl_a (pkey,val) VALUES (0,0),(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9);
SELECT pkey,val INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/spider_outfile.tsv' FROM tbl_a ORDER BY pkey;
UPDATE tbl_a SET val = val + 1;
diff --git a/storage/spider/mysql-test/spider/regression/e112122/r/load_data_part_ignore_ddi1.result b/storage/spider/mysql-test/spider/regression/e112122/r/load_data_part_ignore_ddi1.result
index 0ae71b49..bd6cc3e4 100644
--- a/storage/spider/mysql-test/spider/regression/e112122/r/load_data_part_ignore_ddi1.result
+++ b/storage/spider/mysql-test/spider/regression/e112122/r/load_data_part_ignore_ddi1.result
@@ -38,6 +38,11 @@ pkey int NOT NULL,
val int NOT NULL,
PRIMARY KEY (pkey)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
INSERT INTO tbl_a (pkey,val) VALUES (0,0),(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9);
SELECT pkey,val INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/spider_outfile.tsv' FROM tbl_a ORDER BY pkey;
UPDATE tbl_a SET val = val + 1;
diff --git a/storage/spider/mysql-test/spider/regression/e112122/r/load_data_part_local_ddi0.result b/storage/spider/mysql-test/spider/regression/e112122/r/load_data_part_local_ddi0.result
index d2362e46..1a9c009b 100644
--- a/storage/spider/mysql-test/spider/regression/e112122/r/load_data_part_local_ddi0.result
+++ b/storage/spider/mysql-test/spider/regression/e112122/r/load_data_part_local_ddi0.result
@@ -38,6 +38,11 @@ pkey int NOT NULL,
val int NOT NULL,
PRIMARY KEY (pkey)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
INSERT INTO tbl_a (pkey,val) VALUES (0,0),(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9);
SELECT pkey,val INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/spider_outfile.tsv' FROM tbl_a ORDER BY pkey;
TRUNCATE tbl_a;
diff --git a/storage/spider/mysql-test/spider/regression/e112122/r/load_data_part_local_ddi1.result b/storage/spider/mysql-test/spider/regression/e112122/r/load_data_part_local_ddi1.result
index c57dc96b..43f216b8 100644
--- a/storage/spider/mysql-test/spider/regression/e112122/r/load_data_part_local_ddi1.result
+++ b/storage/spider/mysql-test/spider/regression/e112122/r/load_data_part_local_ddi1.result
@@ -38,6 +38,11 @@ pkey int NOT NULL,
val int NOT NULL,
PRIMARY KEY (pkey)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
INSERT INTO tbl_a (pkey,val) VALUES (0,0),(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9);
SELECT pkey,val INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/spider_outfile.tsv' FROM tbl_a ORDER BY pkey;
TRUNCATE tbl_a;
diff --git a/storage/spider/mysql-test/spider/regression/e112122/r/load_data_part_local_ignore_ddi0.result b/storage/spider/mysql-test/spider/regression/e112122/r/load_data_part_local_ignore_ddi0.result
index 81005ac8..7bd67e9a 100644
--- a/storage/spider/mysql-test/spider/regression/e112122/r/load_data_part_local_ignore_ddi0.result
+++ b/storage/spider/mysql-test/spider/regression/e112122/r/load_data_part_local_ignore_ddi0.result
@@ -38,6 +38,11 @@ pkey int NOT NULL,
val int NOT NULL,
PRIMARY KEY (pkey)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
INSERT INTO tbl_a (pkey,val) VALUES (0,0),(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9);
SELECT pkey,val INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/spider_outfile.tsv' FROM tbl_a ORDER BY pkey;
UPDATE tbl_a SET val = val + 1;
diff --git a/storage/spider/mysql-test/spider/regression/e112122/r/load_data_part_local_ignore_ddi1.result b/storage/spider/mysql-test/spider/regression/e112122/r/load_data_part_local_ignore_ddi1.result
index d7cea9ed..ea1245d8 100644
--- a/storage/spider/mysql-test/spider/regression/e112122/r/load_data_part_local_ignore_ddi1.result
+++ b/storage/spider/mysql-test/spider/regression/e112122/r/load_data_part_local_ignore_ddi1.result
@@ -38,6 +38,11 @@ pkey int NOT NULL,
val int NOT NULL,
PRIMARY KEY (pkey)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
INSERT INTO tbl_a (pkey,val) VALUES (0,0),(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9);
SELECT pkey,val INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/spider_outfile.tsv' FROM tbl_a ORDER BY pkey;
UPDATE tbl_a SET val = val + 1;
diff --git a/storage/spider/mysql-test/spider/regression/e112122/r/load_data_part_local_replace_ddi0.result b/storage/spider/mysql-test/spider/regression/e112122/r/load_data_part_local_replace_ddi0.result
index d6cd973f..df073bff 100644
--- a/storage/spider/mysql-test/spider/regression/e112122/r/load_data_part_local_replace_ddi0.result
+++ b/storage/spider/mysql-test/spider/regression/e112122/r/load_data_part_local_replace_ddi0.result
@@ -38,6 +38,11 @@ pkey int NOT NULL,
val int NOT NULL,
PRIMARY KEY (pkey)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
INSERT INTO tbl_a (pkey,val) VALUES (0,0),(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9);
SELECT pkey,val INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/spider_outfile.tsv' FROM tbl_a ORDER BY pkey;
UPDATE tbl_a SET val = val + 1;
diff --git a/storage/spider/mysql-test/spider/regression/e112122/r/load_data_part_local_replace_ddi1.result b/storage/spider/mysql-test/spider/regression/e112122/r/load_data_part_local_replace_ddi1.result
index ac233777..f8eef377 100644
--- a/storage/spider/mysql-test/spider/regression/e112122/r/load_data_part_local_replace_ddi1.result
+++ b/storage/spider/mysql-test/spider/regression/e112122/r/load_data_part_local_replace_ddi1.result
@@ -38,6 +38,11 @@ pkey int NOT NULL,
val int NOT NULL,
PRIMARY KEY (pkey)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
INSERT INTO tbl_a (pkey,val) VALUES (0,0),(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9);
SELECT pkey,val INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/spider_outfile.tsv' FROM tbl_a ORDER BY pkey;
UPDATE tbl_a SET val = val + 1;
diff --git a/storage/spider/mysql-test/spider/regression/e112122/r/load_data_part_replace_ddi0.result b/storage/spider/mysql-test/spider/regression/e112122/r/load_data_part_replace_ddi0.result
index cd4bf6d7..aa798dff 100644
--- a/storage/spider/mysql-test/spider/regression/e112122/r/load_data_part_replace_ddi0.result
+++ b/storage/spider/mysql-test/spider/regression/e112122/r/load_data_part_replace_ddi0.result
@@ -38,6 +38,11 @@ pkey int NOT NULL,
val int NOT NULL,
PRIMARY KEY (pkey)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
INSERT INTO tbl_a (pkey,val) VALUES (0,0),(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9);
SELECT pkey,val INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/spider_outfile.tsv' FROM tbl_a ORDER BY pkey;
UPDATE tbl_a SET val = val + 1;
diff --git a/storage/spider/mysql-test/spider/regression/e112122/r/load_data_part_replace_ddi1.result b/storage/spider/mysql-test/spider/regression/e112122/r/load_data_part_replace_ddi1.result
index 98c63603..593a4c44 100644
--- a/storage/spider/mysql-test/spider/regression/e112122/r/load_data_part_replace_ddi1.result
+++ b/storage/spider/mysql-test/spider/regression/e112122/r/load_data_part_replace_ddi1.result
@@ -38,6 +38,11 @@ pkey int NOT NULL,
val int NOT NULL,
PRIMARY KEY (pkey)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
+Warnings:
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
+Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
INSERT INTO tbl_a (pkey,val) VALUES (0,0),(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9);
SELECT pkey,val INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/spider_outfile.tsv' FROM tbl_a ORDER BY pkey;
UPDATE tbl_a SET val = val + 1;
diff --git a/storage/spider/mysql-test/spider/regression/e112122/t/group_by_order_by_limit_ok.test b/storage/spider/mysql-test/spider/regression/e112122/t/group_by_order_by_limit_ok.test
index e4f3f215..d7db0db0 100644
--- a/storage/spider/mysql-test/spider/regression/e112122/t/group_by_order_by_limit_ok.test
+++ b/storage/spider/mysql-test/spider/regression/e112122/t/group_by_order_by_limit_ok.test
@@ -53,7 +53,9 @@ eval CREATE TABLE tbl_a (
KEY idx2 (skey)
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1;
--enable_query_log
+--disable_ps_protocol
INSERT INTO tbl_a (pkey,skey) VALUES (0,0),(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9);
+--enable_ps_protocol
INSERT INTO tbl_a (pkey,skey) VALUES (10,10),(11,11),(12,12),(13,13),(14,14),(15,15),(16,16),(17,17),(18,18),(19,19);
INSERT INTO tbl_a (pkey,skey) VALUES (20,5),(21,6),(22,7),(23,8),(24,9),(25,10),(26,11),(27,12),(28,13),(29,14);
diff --git a/storage/spider/mysql-test/spider/regression/e112122/t/load_data_part.inc b/storage/spider/mysql-test/spider/regression/e112122/t/load_data_part.inc
index fd31047a..a599292b 100644
--- a/storage/spider/mysql-test/spider/regression/e112122/t/load_data_part.inc
+++ b/storage/spider/mysql-test/spider/regression/e112122/t/load_data_part.inc
@@ -51,7 +51,9 @@ eval CREATE TABLE tbl_a (
PRIMARY KEY (pkey)
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1;
--enable_query_log
+--disable_ps_protocol
INSERT INTO tbl_a (pkey,val) VALUES (0,0),(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9);
+--enable_ps_protocol
--disable_query_log
--echo SELECT pkey,val INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/spider_outfile.tsv' FROM tbl_a ORDER BY pkey;
--disable_ps_protocol
diff --git a/storage/spider/mysql-test/spider/t/auto_increment.test b/storage/spider/mysql-test/spider/t/auto_increment.test
index c5f272f5..e278a12a 100644
--- a/storage/spider/mysql-test/spider/t/auto_increment.test
+++ b/storage/spider/mysql-test/spider/t/auto_increment.test
@@ -93,16 +93,24 @@ eval CREATE TABLE tbl_a (
PRIMARY KEY(col_a)
) $MASTER_1_ENGINE $MASTER_1_AUTO_INCREMENT_2_1 $MASTER_1_COMMENT_2_1;
--enable_query_log
+--disable_ps_protocol
SHOW CREATE TABLE tbl_a;
+--enable_ps_protocol
INSERT INTO tbl_a () VALUES ();
INSERT INTO tbl_a () VALUES ();
SHOW CREATE TABLE tbl_a;
ALTER TABLE tbl_a MODIFY col_c MEDIUMINT NOT NULL DEFAULT 100;
+--disable_ps_protocol
SHOW CREATE TABLE tbl_a;
+--enable_ps_protocol
RENAME TABLE tbl_a TO tbl_x;
+--disable_ps_protocol
SHOW CREATE TABLE tbl_x;
+--enable_ps_protocol
RENAME TABLE tbl_x TO tbl_a;
+--disable_ps_protocol
SHOW CREATE TABLE tbl_a;
+--enable_ps_protocol
INSERT INTO tbl_a () VALUES ();
INSERT INTO tbl_a () VALUES ();
SHOW CREATE TABLE tbl_a;
@@ -110,7 +118,9 @@ SHOW CREATE TABLE tbl_a;
echo MASTER_1_AUTO_INCREMENT1;
eval $MASTER_1_AUTO_INCREMENT1;
--enable_query_log
+--disable_ps_protocol
SHOW CREATE TABLE tbl_a;
+--enable_ps_protocol
INSERT INTO tbl_a () VALUES ();
INSERT INTO tbl_a () VALUES ();
SHOW CREATE TABLE tbl_a;
@@ -118,7 +128,9 @@ SHOW CREATE TABLE tbl_a;
echo MASTER_1_AUTO_INCREMENT2;
eval $MASTER_1_AUTO_INCREMENT2;
--enable_query_log
+--disable_ps_protocol
SHOW CREATE TABLE tbl_a;
+--enable_ps_protocol
INSERT INTO tbl_a () VALUES ();
INSERT INTO tbl_a () VALUES ();
SHOW CREATE TABLE tbl_a;
diff --git a/storage/spider/mysql-test/spider/t/checksum_table_with_quick_mode_3.test b/storage/spider/mysql-test/spider/t/checksum_table_with_quick_mode_3.test
index e0fa7a84..c6fecb5c 100644
--- a/storage/spider/mysql-test/spider/t/checksum_table_with_quick_mode_3.test
+++ b/storage/spider/mysql-test/spider/t/checksum_table_with_quick_mode_3.test
@@ -59,7 +59,9 @@ eval CREATE TABLE tbl_a (
PRIMARY KEY (pkey)
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1;
--enable_query_log
+--disable_ps_protocol
INSERT INTO tbl_a (pkey) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+--enable_ps_protocol
INSERT INTO tbl_a (pkey) VALUES (10),(11),(12),(13),(14),(15),(16),(17),(18),(19);
INSERT INTO tbl_a (pkey) VALUES (20),(21),(22),(23),(24),(25),(26),(27),(28),(29);
FLUSH TABLES;
diff --git a/storage/spider/mysql-test/spider/t/direct_aggregate.test b/storage/spider/mysql-test/spider/t/direct_aggregate.test
index 0acff3f6..89997ba7 100644
--- a/storage/spider/mysql-test/spider/t/direct_aggregate.test
+++ b/storage/spider/mysql-test/spider/t/direct_aggregate.test
@@ -98,12 +98,14 @@ eval CREATE TABLE ta_l (
PRIMARY KEY(a)
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1;
--enable_query_log
+--disable_ps_protocol
INSERT INTO ta_l (a, b, c) VALUES
(1, 'a', '2008-08-01 10:21:39'),
(2, 'b', '2000-01-01 00:00:00'),
(3, 'e', '2007-06-04 20:03:11'),
(4, 'd', '2003-11-30 05:01:03'),
(5, 'c', '2001-12-31 23:59:59');
+--enable_ps_protocol
--echo
--echo direct_aggregating test
diff --git a/storage/spider/mysql-test/spider/t/direct_aggregate_part.test b/storage/spider/mysql-test/spider/t/direct_aggregate_part.test
index 8f4c72dc..3e593183 100644
--- a/storage/spider/mysql-test/spider/t/direct_aggregate_part.test
+++ b/storage/spider/mysql-test/spider/t/direct_aggregate_part.test
@@ -125,12 +125,14 @@ if ($HAVE_PARTITION)
c DATETIME,
PRIMARY KEY(a)
) $MASTER_1_ENGINE $MASTER_1_COMMENT2_P_2_1;
+ --disable_ps_protocol
INSERT INTO ta_l2 (a, b, c) VALUES
(1, 'a', '2008-08-01 10:21:39'),
(2, 'b', '2000-01-01 00:00:00'),
(3, 'e', '2007-06-04 20:03:11'),
(4, 'd', '2003-11-30 05:01:03'),
(5, 'c', '2001-12-31 23:59:59');
+ --enable_ps_protocol
--enable_query_log
--disable_ps2_protocol
set @old_spider_direct_aggregate=@@session.spider_direct_aggregate;
diff --git a/storage/spider/mysql-test/spider/t/direct_join.test b/storage/spider/mysql-test/spider/t/direct_join.test
index 634b958f..04f28921 100644
--- a/storage/spider/mysql-test/spider/t/direct_join.test
+++ b/storage/spider/mysql-test/spider/t/direct_join.test
@@ -129,9 +129,11 @@ eval CREATE TABLE tbl_c (
KEY idx2(c)
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT4_2_1;
--enable_query_log
+--disable_ps_protocol
insert into tbl_a values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04'),(5,'e','2000/01/05');
insert into tbl_b values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04'),(5,'e','2000/01/05');
insert into tbl_c values (1,10,100),(2,20,200),(3,30,300),(4,40,400),(5,50,500);
+--enable_ps_protocol
--echo
--echo select test
@@ -242,7 +244,9 @@ eval CREATE TABLE tbl_person (
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_CONST_TABLE_JOIN
$MASTER_1_ROW_FORMAT_CONST_TABLE_JOIN $MASTER_1_PART_CONST_TABLE_JOIN;
echo SHOW CREATE TABLE tbl_person;
+--disable_ps_protocol
SHOW CREATE TABLE tbl_person;
+--enable_ps_protocol
echo CREATE TABLE tbl_ncd_cm_person (
id VARCHAR(50) NOT NULL,
person_id VARCHAR(50) NULL DEFAULT '',
@@ -260,10 +264,12 @@ eval CREATE TABLE tbl_ncd_cm_person (
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_CONST_TABLE2_JOIN
$MASTER_1_ROW_FORMAT_CONST_TABLE_JOIN $MASTER_1_PART_CONST_TABLE2_JOIN;
echo SHOW CREATE TABLE tbl_ncd_cm_person;
+--disable_ps_protocol
SHOW CREATE TABLE tbl_ncd_cm_person;
--enable_query_log
INSERT INTO tbl_person VALUES ('24FC3F0A5119432BAE13DD65AABAA39C',
'1', '123-51041110620301-321', 510411);
+--enable_ps_protocol
INSERT INTO tbl_person VALUES ('123456789012345678901234567890AB',
'1', '123-51041110620301-321', 510411);
INSERT INTO tbl_ncd_cm_person VALUES ('123456789',
diff --git a/storage/spider/mysql-test/spider/t/direct_join_using.test b/storage/spider/mysql-test/spider/t/direct_join_using.test
index 3ecfb292..c16dbc03 100644
--- a/storage/spider/mysql-test/spider/t/direct_join_using.test
+++ b/storage/spider/mysql-test/spider/t/direct_join_using.test
@@ -129,9 +129,11 @@ eval CREATE TABLE tbl_c (
KEY idx2(c)
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT4_2_1;
--enable_query_log
+--disable_ps_protocol
insert into tbl_a values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04'),(5,'e','2000/01/05');
insert into tbl_b values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04'),(5,'e','2000/01/05');
insert into tbl_c values (1,10,100),(2,20,200),(3,30,300),(4,40,400),(5,50,500);
+--enable_ps_protocol
--echo
--echo select test
diff --git a/storage/spider/mysql-test/spider/t/direct_left_join.test b/storage/spider/mysql-test/spider/t/direct_left_join.test
index c9784b04..6db2b53e 100644
--- a/storage/spider/mysql-test/spider/t/direct_left_join.test
+++ b/storage/spider/mysql-test/spider/t/direct_left_join.test
@@ -129,9 +129,11 @@ eval CREATE TABLE tbl_c (
KEY idx2(c)
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT4_2_1;
--enable_query_log
+--disable_ps_protocol
insert into tbl_a values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04'),(5,'e','2000/01/05');
insert into tbl_b values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04'),(5,'e','2000/01/05');
insert into tbl_c values (1,10,100),(2,20,200),(3,30,300),(4,40,400),(5,50,500);
+--enable_ps_protocol
--echo
--echo select test
diff --git a/storage/spider/mysql-test/spider/t/direct_left_join_nullable.test b/storage/spider/mysql-test/spider/t/direct_left_join_nullable.test
index 7c69d73d..1dddf1f8 100644
--- a/storage/spider/mysql-test/spider/t/direct_left_join_nullable.test
+++ b/storage/spider/mysql-test/spider/t/direct_left_join_nullable.test
@@ -143,10 +143,12 @@ eval CREATE TABLE tbl_d (
c DATETIME DEFAULT '1999-10-10 10:10:10'
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT2_2_1;
--enable_query_log
+--disable_ps_protocol
insert into tbl_a values (1,'a','2000/01/01'),(2,'b','2000/01/02');
insert into tbl_b values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03');
insert into tbl_c values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04');
insert into tbl_d values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04'),(5,'e','2000/01/05');
+--enable_ps_protocol
--echo
--echo select test
diff --git a/storage/spider/mysql-test/spider/t/direct_left_right_join_nullable.test b/storage/spider/mysql-test/spider/t/direct_left_right_join_nullable.test
index dd407482..d124504d 100644
--- a/storage/spider/mysql-test/spider/t/direct_left_right_join_nullable.test
+++ b/storage/spider/mysql-test/spider/t/direct_left_right_join_nullable.test
@@ -143,10 +143,12 @@ eval CREATE TABLE tbl_d (
c DATETIME DEFAULT '1999-10-10 10:10:10'
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT2_2_1;
--enable_query_log
+--disable_ps_protocol
insert into tbl_a values (1,'a','2000/01/01'),(2,'b','2000/01/02');
insert into tbl_b values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03');
insert into tbl_c values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04');
insert into tbl_d values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04'),(5,'e','2000/01/05');
+--enable_ps_protocol
--echo
--echo select test
diff --git a/storage/spider/mysql-test/spider/t/direct_left_right_left_join_nullable.test b/storage/spider/mysql-test/spider/t/direct_left_right_left_join_nullable.test
index 3de0c310..ca3fc2cf 100644
--- a/storage/spider/mysql-test/spider/t/direct_left_right_left_join_nullable.test
+++ b/storage/spider/mysql-test/spider/t/direct_left_right_left_join_nullable.test
@@ -143,10 +143,12 @@ eval CREATE TABLE tbl_d (
c DATETIME DEFAULT '1999-10-10 10:10:10'
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT2_2_1;
--enable_query_log
+--disable_ps_protocol
insert into tbl_a values (1,'a','2000/01/01'),(2,'b','2000/01/02');
insert into tbl_b values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03');
insert into tbl_c values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04');
insert into tbl_d values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04'),(5,'e','2000/01/05');
+--enable_ps_protocol
--echo
--echo select test
diff --git a/storage/spider/mysql-test/spider/t/direct_right_join.test b/storage/spider/mysql-test/spider/t/direct_right_join.test
index d124f75a..3431a18a 100644
--- a/storage/spider/mysql-test/spider/t/direct_right_join.test
+++ b/storage/spider/mysql-test/spider/t/direct_right_join.test
@@ -129,9 +129,11 @@ eval CREATE TABLE tbl_c (
KEY idx2(c)
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT4_2_1;
--enable_query_log
+--disable_ps_protocol
insert into tbl_a values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04'),(5,'e','2000/01/05');
insert into tbl_b values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04'),(5,'e','2000/01/05');
insert into tbl_c values (1,10,100),(2,20,200),(3,30,300),(4,40,400),(5,50,500);
+--enable_ps_protocol
--echo
--echo select test
diff --git a/storage/spider/mysql-test/spider/t/direct_right_join_nullable.test b/storage/spider/mysql-test/spider/t/direct_right_join_nullable.test
index cdb2d4e6..4a61f3b7 100644
--- a/storage/spider/mysql-test/spider/t/direct_right_join_nullable.test
+++ b/storage/spider/mysql-test/spider/t/direct_right_join_nullable.test
@@ -143,10 +143,12 @@ eval CREATE TABLE tbl_d (
c DATETIME DEFAULT '1999-10-10 10:10:10'
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT2_2_1;
--enable_query_log
+--disable_ps_protocol
insert into tbl_a values (1,'a','2000/01/01'),(2,'b','2000/01/02');
insert into tbl_b values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03');
insert into tbl_c values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04');
insert into tbl_d values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04'),(5,'e','2000/01/05');
+--enable_ps_protocol
--echo
--echo select test
diff --git a/storage/spider/mysql-test/spider/t/direct_right_left_join_nullable.test b/storage/spider/mysql-test/spider/t/direct_right_left_join_nullable.test
index cff40bfd..c18752cd 100644
--- a/storage/spider/mysql-test/spider/t/direct_right_left_join_nullable.test
+++ b/storage/spider/mysql-test/spider/t/direct_right_left_join_nullable.test
@@ -143,10 +143,12 @@ eval CREATE TABLE tbl_d (
c DATETIME DEFAULT '1999-10-10 10:10:10'
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT2_2_1;
--enable_query_log
+--disable_ps_protocol
insert into tbl_a values (1,'a','2000/01/01'),(2,'b','2000/01/02');
insert into tbl_b values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03');
insert into tbl_c values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04');
insert into tbl_d values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04'),(5,'e','2000/01/05');
+--enable_ps_protocol
--echo
--echo select test
diff --git a/storage/spider/mysql-test/spider/t/direct_right_left_right_join_nullable.test b/storage/spider/mysql-test/spider/t/direct_right_left_right_join_nullable.test
index cd677a4b..1cdf3298 100644
--- a/storage/spider/mysql-test/spider/t/direct_right_left_right_join_nullable.test
+++ b/storage/spider/mysql-test/spider/t/direct_right_left_right_join_nullable.test
@@ -143,10 +143,12 @@ eval CREATE TABLE tbl_d (
c DATETIME DEFAULT '1999-10-10 10:10:10'
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT2_2_1;
--enable_query_log
+--disable_ps_protocol
insert into tbl_a values (1,'a','2000/01/01'),(2,'b','2000/01/02');
insert into tbl_b values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03');
insert into tbl_c values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04');
insert into tbl_d values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04'),(5,'e','2000/01/05');
+--enable_ps_protocol
--echo
--echo select test
diff --git a/storage/spider/mysql-test/spider/t/direct_update.test b/storage/spider/mysql-test/spider/t/direct_update.test
index 94f27e28..8b8bb1e5 100644
--- a/storage/spider/mysql-test/spider/t/direct_update.test
+++ b/storage/spider/mysql-test/spider/t/direct_update.test
@@ -98,12 +98,14 @@ eval CREATE TABLE ta_l (
PRIMARY KEY(a)
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1;
--enable_query_log
+--disable_ps_protocol
INSERT INTO ta_l (a, b, c) VALUES
(1, 'a', '2008-08-01 10:21:39'),
(2, 'b', '2000-01-01 00:00:00'),
(3, 'e', '2007-06-04 20:03:11'),
(4, 'd', '2003-11-30 05:01:03'),
(5, 'c', '2001-12-31 23:59:59');
+--enable_ps_protocol
--echo
--echo direct_updating test
diff --git a/storage/spider/mysql-test/spider/t/direct_update_part.test b/storage/spider/mysql-test/spider/t/direct_update_part.test
index e8f18825..690fa834 100644
--- a/storage/spider/mysql-test/spider/t/direct_update_part.test
+++ b/storage/spider/mysql-test/spider/t/direct_update_part.test
@@ -125,12 +125,14 @@ if ($HAVE_PARTITION)
c DATETIME,
PRIMARY KEY(a)
) $MASTER_1_ENGINE $MASTER_1_COMMENT2_P_2_1;
+ --disable_ps_protocol
INSERT INTO ta_l2 (a, b, c) VALUES
(1, 'a', '2008-08-01 10:21:39'),
(2, 'b', '2000-01-01 00:00:00'),
(3, 'e', '2007-06-04 20:03:11'),
(4, 'd', '2003-11-30 05:01:03'),
(5, 'c', '2001-12-31 23:59:59');
+ --enable_ps_protocol
--enable_query_log
eval $MASTER_1_CHECK_DIRECT_UPDATE_STATUS;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a;
diff --git a/storage/spider/mysql-test/spider/t/function.test b/storage/spider/mysql-test/spider/t/function.test
index 2472e774..2b81a130 100644
--- a/storage/spider/mysql-test/spider/t/function.test
+++ b/storage/spider/mysql-test/spider/t/function.test
@@ -83,7 +83,9 @@ eval CREATE TABLE t1 (
PRIMARY KEY(a)
) $MASTER_1_ENGINE $MASTER_1_CHARSET3 $MASTER_1_COMMENT_TEXT_PK1_1;
--enable_query_log
+--disable_ps_protocol
insert into t1 values ('1');
+--enable_ps_protocol
insert into t1 select a + 1 from t1;
insert into t1 select a + 2 from t1;
insert into t1 select a + 4 from t1;
@@ -114,7 +116,9 @@ if ($USE_CHILD_GROUP2)
}
}
--connection master_1
+--disable_ps_protocol
select a from t1 where a in ('15', '120');
+--enable_ps_protocol
if ($USE_CHILD_GROUP2)
{
if (!$OUTPUT_CHILD_GROUP2)
@@ -187,12 +191,14 @@ eval CREATE TABLE ta_l (
PRIMARY KEY(a)
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1;
--enable_query_log
+--disable_ps_protocol
INSERT INTO ta_l (a, b, c) VALUES
(1, 'a', '2008-08-01 10:21:39'),
(2, 'b', '2000-01-01 00:00:00'),
(3, 'e', '2007-06-04 20:03:11'),
(4, 'd', '2003-11-30 05:01:03'),
(5, 'c', '2001-12-31 23:59:59');
+--enable_ps_protocol
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
UPDATE ta_l SET c = DATE_SUB(c, INTERVAL 1 YEAR);
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
diff --git a/storage/spider/mysql-test/spider/t/ha.test b/storage/spider/mysql-test/spider/t/ha.test
index 1924b908..64ede980 100644
--- a/storage/spider/mysql-test/spider/t/ha.test
+++ b/storage/spider/mysql-test/spider/t/ha.test
@@ -189,12 +189,14 @@ eval CREATE TABLE ta_l (
PRIMARY KEY(a)
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_HA_2_1;
--enable_query_log
+--disable_ps_protocol
INSERT INTO ta_l (a, b, c) VALUES
(1, 'a', '2008-08-01 10:21:39'),
(2, 'b', '2000-01-01 00:00:00'),
(3, 'e', '2007-06-04 20:03:11'),
(4, 'd', '2003-11-30 05:01:03'),
(5, 'c', '2001-12-31 23:59:59');
+--enable_ps_protocol
--echo
--echo select test
@@ -395,7 +397,9 @@ if ($USE_CHILD_GROUP3)
--connection master_1
eval $MASTER_1_SET_RECOVERY_STATUS_2_1;
eval $MASTER_1_CHECK_LINK_STATUS;
+--disable_ps_protocol
eval $MASTER_1_COPY_TABLES_2_1;
+--enable_ps_protocol
if ($USE_CHILD_GROUP3)
{
if (!$OUTPUT_CHILD_GROUP3)
@@ -421,8 +425,10 @@ if ($USE_CHILD_GROUP3)
--connection master_1
eval $MASTER_1_SET_OK_STATUS_2_1;
eval $MASTER_1_CHECK_LINK_STATUS;
+--disable_ps_protocol
INSERT INTO ta_l (a, b, c) VALUES
- (8, 'g', '2011-05-05 21:33:30');
+(8, 'g', '2011-05-05 21:33:30');
+--enable_ps_protocol
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
DROP TABLE ta_l;
if ($USE_CHILD_GROUP2)
@@ -581,12 +587,14 @@ eval CREATE TABLE ta_l (
PRIMARY KEY(a)
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_HA_AS_2_1;
--enable_query_log
+--disable_ps_protocol
INSERT INTO ta_l (a, b, c) VALUES
(1, 'a', '2008-08-01 10:21:39'),
(2, 'b', '2000-01-01 00:00:00'),
(3, 'e', '2007-06-04 20:03:11'),
(4, 'd', '2003-11-30 05:01:03'),
(5, 'c', '2001-12-31 23:59:59');
+--enable_ps_protocol
--echo
--echo select test
@@ -787,8 +795,10 @@ if ($USE_CHILD_GROUP3)
--connection master_1
eval $MASTER_1_SET_OK_STATUS_AS_2_1;
eval $MASTER_1_CHECK_LINK_STATUS;
+--disable_ps_protocol
INSERT INTO ta_l (a, b, c) VALUES
(8, 'g', '2011-05-05 21:33:30');
+--enable_ps_protocol
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
DROP TABLE ta_l;
if ($USE_CHILD_GROUP2)
diff --git a/storage/spider/mysql-test/spider/t/ha_part.test b/storage/spider/mysql-test/spider/t/ha_part.test
index 21b5837c..4966d3d6 100644
--- a/storage/spider/mysql-test/spider/t/ha_part.test
+++ b/storage/spider/mysql-test/spider/t/ha_part.test
@@ -225,12 +225,14 @@ if ($HAVE_PARTITION)
PRIMARY KEY(a)
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_HA_P_2_1;
--enable_query_log
+ --disable_ps_protocol
INSERT INTO ta_l2 (a, b, c) VALUES
(1, 'a', '2008-08-01 10:21:39'),
(2, 'b', '2000-01-01 00:00:00'),
(3, 'e', '2007-06-04 20:03:11'),
(4, 'd', '2003-11-30 05:01:03'),
(5, 'c', '2001-12-31 23:59:59');
+ --enable_ps_protocol
--echo
--echo select test
@@ -460,7 +462,9 @@ if ($HAVE_PARTITION)
--connection master_1
eval $MASTER_1_SET_RECOVERY_STATUS_P_2_1;
eval $MASTER_1_CHECK_LINK_STATUS;
+ --disable_ps_protocol
eval $MASTER_1_COPY_TABLES_P_2_1;
+ --enable_ps_protocol
if ($USE_CHILD_GROUP3)
{
if (!$OUTPUT_CHILD_GROUP3)
@@ -486,9 +490,11 @@ if ($HAVE_PARTITION)
--connection master_1
eval $MASTER_1_SET_OK_STATUS_P_2_1;
eval $MASTER_1_CHECK_LINK_STATUS;
+ --disable_ps_protocol
INSERT INTO ta_l2 (a, b, c) VALUES
(8, 'g', '2011-05-05 21:33:30'),
(9, 'h', '2011-05-05 22:32:10');
+ --enable_ps_protocol
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a;
DROP TABLE ta_l2;
if ($USE_CHILD_GROUP2)
@@ -674,12 +680,14 @@ if ($HAVE_PARTITION)
PRIMARY KEY(a)
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_HA_AS_P_2_1;
--enable_query_log
+ --disable_ps_protocol
INSERT INTO ta_l2 (a, b, c) VALUES
(1, 'a', '2008-08-01 10:21:39'),
(2, 'b', '2000-01-01 00:00:00'),
(3, 'e', '2007-06-04 20:03:11'),
(4, 'd', '2003-11-30 05:01:03'),
(5, 'c', '2001-12-31 23:59:59');
+ --enable_ps_protocol
--echo
--echo select test
@@ -918,9 +926,11 @@ if ($HAVE_PARTITION)
--connection master_1
eval $MASTER_1_SET_OK_STATUS_AS_P_2_1;
eval $MASTER_1_CHECK_LINK_STATUS;
+ --disable_ps_protocol
INSERT INTO ta_l2 (a, b, c) VALUES
(8, 'g', '2011-05-05 21:33:30'),
(9, 'h', '2011-05-05 22:32:10');
+ --enable_ps_protocol
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a;
DROP TABLE ta_l2;
if ($USE_CHILD_GROUP2)
diff --git a/storage/spider/mysql-test/spider/t/partition_cond_push.test b/storage/spider/mysql-test/spider/t/partition_cond_push.test
index e47209ef..317026d7 100644
--- a/storage/spider/mysql-test/spider/t/partition_cond_push.test
+++ b/storage/spider/mysql-test/spider/t/partition_cond_push.test
@@ -129,7 +129,9 @@ eval CREATE TABLE tbl_a (
value int NOT NULL
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1;
--enable_query_log
+--disable_ps_protocol
INSERT INTO tbl_a (value) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+--enable_ps_protocol
INSERT INTO tbl_a (value) VALUES (10),(11),(12),(13),(14),(15),(16),(17),(18),(19);
INSERT INTO tbl_a (value) VALUES (20),(21),(22),(23),(24),(25),(26),(27),(28),(29);
diff --git a/storage/spider/mysql-test/spider/t/partition_fulltext.test b/storage/spider/mysql-test/spider/t/partition_fulltext.test
index 1b31fa05..af42e8ff 100644
--- a/storage/spider/mysql-test/spider/t/partition_fulltext.test
+++ b/storage/spider/mysql-test/spider/t/partition_fulltext.test
@@ -135,7 +135,9 @@ eval CREATE TABLE tbl_a (
FULLTEXT (words)
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1;
--enable_query_log
+--disable_ps_protocol
INSERT INTO tbl_a (pkey, words) VALUES (0, 'abc'),(1, 'def'),(2, 'ghi'),(3, 'jkl'),(4, 'mno'),(5, 'pqr'),(6, 'stu'),(7, 'vwx');
+--enable_ps_protocol
--echo
--echo select test
diff --git a/storage/spider/mysql-test/spider/t/partition_join_pushdown_for_single_partition.test b/storage/spider/mysql-test/spider/t/partition_join_pushdown_for_single_partition.test
index 753014d5..84ee3f2e 100644
--- a/storage/spider/mysql-test/spider/t/partition_join_pushdown_for_single_partition.test
+++ b/storage/spider/mysql-test/spider/t/partition_join_pushdown_for_single_partition.test
@@ -152,8 +152,10 @@ eval CREATE TABLE tbl_b (
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_2;
--enable_query_log
+--disable_ps_protocol
insert into tbl_a values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
insert into tbl_b values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
+--enable_ps_protocol
--connection master_1
--disable_ps2_protocol
diff --git a/storage/spider/mysql-test/spider/t/partition_mrr.test b/storage/spider/mysql-test/spider/t/partition_mrr.test
index 840c19d2..842505fe 100644
--- a/storage/spider/mysql-test/spider/t/partition_mrr.test
+++ b/storage/spider/mysql-test/spider/t/partition_mrr.test
@@ -169,6 +169,7 @@ if ($USE_CHILD_GROUP2)
}
--connection master_1
--disable_ps2_protocol
+--sorted_result
SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey;
SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey+0 = b.pkey+0 ORDER BY a.pkey; # MDEV-29947
if ($USE_CHILD_GROUP2)
diff --git a/storage/spider/mysql-test/spider/t/pushdown_not_like.test b/storage/spider/mysql-test/spider/t/pushdown_not_like.test
index 45b88e52..998ce1cb 100644
--- a/storage/spider/mysql-test/spider/t/pushdown_not_like.test
+++ b/storage/spider/mysql-test/spider/t/pushdown_not_like.test
@@ -77,10 +77,12 @@ eval CREATE TABLE ta_l (
PRIMARY KEY(a)
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1;
--enable_query_log
+--disable_ps_protocol
INSERT INTO ta_l (a, b, c) VALUES
(1, 'a', '2018-11-01 10:21:39'),
(2, 'b', '2015-06-30 23:59:59'),
(3, 'c', '2013-11-01 01:01:01');
+--enable_ps_protocol
--echo
--echo spider not like bug fix test
diff --git a/storage/spider/mysql-test/spider/t/quick_mode_0.test b/storage/spider/mysql-test/spider/t/quick_mode_0.test
index 070d9e40..37c6f939 100644
--- a/storage/spider/mysql-test/spider/t/quick_mode_0.test
+++ b/storage/spider/mysql-test/spider/t/quick_mode_0.test
@@ -90,10 +90,14 @@ eval CREATE TABLE tbl_b (
PRIMARY KEY (pkey)
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_2;
--enable_query_log
+--disable_ps_protocol
INSERT INTO tbl_a (pkey) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+--enable_ps_protocol
INSERT INTO tbl_a (pkey) VALUES (10),(11),(12),(13),(14),(15),(16),(17),(18),(19);
INSERT INTO tbl_a (pkey) VALUES (20),(21),(22),(23),(24),(25),(26),(27),(28),(29);
+--disable_ps_protocol
INSERT INTO tbl_b (pkey) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+--enable_ps_protocol
INSERT INTO tbl_b (pkey) VALUES (10),(11),(12),(13),(14),(15),(16),(17),(18),(19);
INSERT INTO tbl_b (pkey) VALUES (20),(21),(22),(23),(24),(25),(26),(27),(28),(29);
diff --git a/storage/spider/mysql-test/spider/t/quick_mode_1.test b/storage/spider/mysql-test/spider/t/quick_mode_1.test
index a2c2bf87..8d19c8de 100644
--- a/storage/spider/mysql-test/spider/t/quick_mode_1.test
+++ b/storage/spider/mysql-test/spider/t/quick_mode_1.test
@@ -90,10 +90,14 @@ eval CREATE TABLE tbl_b (
PRIMARY KEY (pkey)
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_2;
--enable_query_log
+--disable_ps_protocol
INSERT INTO tbl_a (pkey) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+--enable_ps_protocol
INSERT INTO tbl_a (pkey) VALUES (10),(11),(12),(13),(14),(15),(16),(17),(18),(19);
INSERT INTO tbl_a (pkey) VALUES (20),(21),(22),(23),(24),(25),(26),(27),(28),(29);
+--disable_ps_protocol
INSERT INTO tbl_b (pkey) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+--enable_ps_protocol
INSERT INTO tbl_b (pkey) VALUES (10),(11),(12),(13),(14),(15),(16),(17),(18),(19);
INSERT INTO tbl_b (pkey) VALUES (20),(21),(22),(23),(24),(25),(26),(27),(28),(29);
diff --git a/storage/spider/mysql-test/spider/t/quick_mode_2.test b/storage/spider/mysql-test/spider/t/quick_mode_2.test
index 12a48a90..cb0167d9 100644
--- a/storage/spider/mysql-test/spider/t/quick_mode_2.test
+++ b/storage/spider/mysql-test/spider/t/quick_mode_2.test
@@ -90,10 +90,14 @@ eval CREATE TABLE tbl_b (
PRIMARY KEY (pkey)
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_2;
--enable_query_log
+--disable_ps_protocol
INSERT INTO tbl_a (pkey) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+--enable_ps_protocol
INSERT INTO tbl_a (pkey) VALUES (10),(11),(12),(13),(14),(15),(16),(17),(18),(19);
INSERT INTO tbl_a (pkey) VALUES (20),(21),(22),(23),(24),(25),(26),(27),(28),(29);
+--disable_ps_protocol
INSERT INTO tbl_b (pkey) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+--enable_ps_protocol
INSERT INTO tbl_b (pkey) VALUES (10),(11),(12),(13),(14),(15),(16),(17),(18),(19);
INSERT INTO tbl_b (pkey) VALUES (20),(21),(22),(23),(24),(25),(26),(27),(28),(29);
diff --git a/storage/spider/mysql-test/spider/t/quick_mode_3.test b/storage/spider/mysql-test/spider/t/quick_mode_3.test
index 65851a5b..e65b1cd7 100644
--- a/storage/spider/mysql-test/spider/t/quick_mode_3.test
+++ b/storage/spider/mysql-test/spider/t/quick_mode_3.test
@@ -90,10 +90,14 @@ eval CREATE TABLE tbl_b (
PRIMARY KEY (pkey)
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_2;
--enable_query_log
+--disable_ps_protocol
INSERT INTO tbl_a (pkey) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+--enable_ps_protocol
INSERT INTO tbl_a (pkey) VALUES (10),(11),(12),(13),(14),(15),(16),(17),(18),(19);
INSERT INTO tbl_a (pkey) VALUES (20),(21),(22),(23),(24),(25),(26),(27),(28),(29);
+--disable_ps_protocol
INSERT INTO tbl_b (pkey) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+--enable_ps_protocol
INSERT INTO tbl_b (pkey) VALUES (10),(11),(12),(13),(14),(15),(16),(17),(18),(19);
INSERT INTO tbl_b (pkey) VALUES (20),(21),(22),(23),(24),(25),(26),(27),(28),(29);
diff --git a/storage/spider/mysql-test/spider/t/slave_test_init.inc b/storage/spider/mysql-test/spider/t/slave_test_init.inc
index 84de2c7d..4f7a6bba 100644
--- a/storage/spider/mysql-test/spider/t/slave_test_init.inc
+++ b/storage/spider/mysql-test/spider/t/slave_test_init.inc
@@ -16,7 +16,8 @@ if (!$SLAVE1_1_SLAVE_STATUS)
MASTER_HOST = '127.0.0.1',
MASTER_USER = 'root',
MASTER_PASSWORD = '',
- MASTER_PORT = $MASTER_1_MYPORT
+ MASTER_PORT = $MASTER_1_MYPORT,
+ MASTER_SSL_VERIFY_SERVER_CERT=0
;
}
--source include/start_slave.inc
diff --git a/storage/spider/mysql-test/spider/t/spider3_fixes.test b/storage/spider/mysql-test/spider/t/spider3_fixes.test
index eb48b0c8..0d46802f 100644
--- a/storage/spider/mysql-test/spider/t/spider3_fixes.test
+++ b/storage/spider/mysql-test/spider/t/spider3_fixes.test
@@ -159,10 +159,14 @@ if ($USE_REPLICATION)
--connection master_1
}
--enable_query_log
+--disable_ps_protocol
INSERT INTO t1 () VALUES ();
+--enable_ps_protocol
SELECT LAST_INSERT_ID();
SELECT MAX(id) FROM t1;
+--disable_ps_protocol
INSERT INTO t2 () VALUES ();
+--enable_ps_protocol
SELECT LAST_INSERT_ID();
SELECT MAX(id) FROM t2;
--disable_query_log
diff --git a/storage/spider/mysql-test/spider/t/spider3_fixes_part.test b/storage/spider/mysql-test/spider/t/spider3_fixes_part.test
index bcd85f42..6f43274f 100644
--- a/storage/spider/mysql-test/spider/t/spider3_fixes_part.test
+++ b/storage/spider/mysql-test/spider/t/spider3_fixes_part.test
@@ -193,10 +193,14 @@ if ($HAVE_PARTITION)
--connection master_1
}
--enable_query_log
+ --disable_ps_protocol
INSERT INTO t1 () VALUES ();
+ --enable_ps_protocol
SELECT LAST_INSERT_ID();
SELECT MAX(id) FROM t1;
+ --disable_ps_protocol
INSERT INTO t2 () VALUES ();
+ --enable_ps_protocol
SELECT LAST_INSERT_ID();
SELECT MAX(id) FROM t2;
--disable_query_log
diff --git a/storage/spider/mysql-test/spider/t/spider_fixes.test b/storage/spider/mysql-test/spider/t/spider_fixes.test
index a5a8f228..326e1767 100644
--- a/storage/spider/mysql-test/spider/t/spider_fixes.test
+++ b/storage/spider/mysql-test/spider/t/spider_fixes.test
@@ -128,7 +128,9 @@ eval CREATE TABLE ta_l (
PRIMARY KEY(a)
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1;
--enable_query_log
+--disable_ps_protocol
INSERT INTO ta_l SELECT a, b, c FROM tb_l;
+--enable_ps_protocol
--echo
--echo 2.13
@@ -309,7 +311,9 @@ eval CREATE TABLE ta_l (
PRIMARY KEY (a, b, c)
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT5_2_1;
--enable_query_log
+--disable_ps_protocol
INSERT INTO ta_l SELECT a, b, c FROM tb_l;
+--enable_ps_protocol
if ($USE_CHILD_GROUP2)
{
if (!$OUTPUT_CHILD_GROUP2)
@@ -668,8 +672,10 @@ if ($HAVE_TRIGGER)
}
}
--connection master_1
+ --disable_ps_protocol
INSERT INTO ta_l_auto_inc (a, b, c) VALUES
(NULL, 's', '2008-12-31 20:59:59');
+ --enable_ps_protocol
if ($USE_CHILD_GROUP2)
{
if (!$OUTPUT_CHILD_GROUP2)
@@ -780,7 +786,9 @@ eval CREATE TABLE ta_l_int (
KEY idx2(c)
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT4_2_1;
--enable_query_log
+--disable_ps_protocol
INSERT INTO ta_l_int (a, b, c) VALUES (1, 2, 3);
+--enable_ps_protocol
INSERT INTO ta_l_int (a, b, c) SELECT a + 1, b + 1, c + 1 FROM ta_l_int;
INSERT INTO ta_l_int (a, b, c) SELECT a + 2, b + 2, c + 2 FROM ta_l_int;
INSERT INTO ta_l_int (a, b, c) SELECT a + 4, b + 4, c + 4 FROM ta_l_int;
@@ -870,7 +878,9 @@ if (!$MASTER_1_NEEDPK)
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT4_2_1;
}
--enable_query_log
+--disable_ps_protocol
SELECT a, b, c FROM ta_l_int ORDER BY a;
+--enable_ps_protocol
INSERT INTO ta_l_int (a, b, c) VALUES (0, 2, 3);
INSERT INTO ta_l_int (a, b, c) VALUES (18, 2, 3);
if ($USE_CHILD_GROUP2)
@@ -1101,7 +1111,9 @@ if ($USE_REPLICATION)
--connection master_1
}
--enable_query_log
+--disable_ps_protocol
INSERT INTO t1 () VALUES ();
+--enable_ps_protocol
SELECT LAST_INSERT_ID();
SELECT MAX(id) FROM t1;
INSERT INTO t1 () VALUES ();
@@ -1115,7 +1127,9 @@ SELECT LAST_INSERT_ID();
SELECT MAX(id) FROM t1;
INSERT INTO t1 () VALUES (),(),(),();
SELECT LAST_INSERT_ID();
+--disable_ps_protocol
SELECT id FROM t1 ORDER BY id;
+--enable_ps_protocol
SET INSERT_ID=5000;
INSERT INTO t1 () VALUES ();
SELECT LAST_INSERT_ID();
@@ -1192,7 +1206,9 @@ if ($MASTER_1_ENGINE_IS_SPIDER)
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_READONLY1_1;
--let $MIN_VAL= `SELECT MIN(id) FROM t1`
--enable_query_log
+ --disable_ps_protocol
SELECT id FROM t1 ORDER BY id;
+ --enable_ps_protocol
--error 12518
INSERT INTO t1 (id) VALUES (1);
--error 12518
@@ -1229,7 +1245,9 @@ if ($MASTER_1_ENGINE_IS_SPIDER)
PRIMARY KEY (id)
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_ERROR_MODE1_1;
--enable_query_log
+ --disable_ps_protocol
SELECT id FROM t1 ORDER BY id;
+ --enable_ps_protocol
INSERT INTO t1 (id) VALUES (1);
DELETE FROM t1;
TRUNCATE t1;
@@ -1288,7 +1306,9 @@ eval CREATE TABLE t1 (
PRIMARY KEY(c)
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_TEXT_KEY1_1;
--enable_query_log
+--disable_ps_protocol
insert into t1 values (null, null, '2048');
+--enable_ps_protocol
insert into t1 values ('1', '1', '1');
insert into t1 select a + 1, b + 1, c + 1 from t1;
insert into t1 select a + 2, b + 2, c + 2 from t1;
@@ -1320,7 +1340,9 @@ if ($USE_CHILD_GROUP2)
}
}
--connection master_1
+--disable_ps_protocol
select a from t1 where a is null order by a limit 30;
+--enable_ps_protocol
select b from t1 where b is null order by b limit 30;
if ($USE_CHILD_GROUP2)
{
@@ -1376,7 +1398,9 @@ if ($USE_CHILD_GROUP2)
}
}
--connection master_1
+--disable_ps_protocol
select a, b, c from t1 where a = '10' and b <> '100' order by c desc limit 5;
+--enable_ps_protocol
select a, c from t1 where a = '10' order by b desc limit 5;
if ($USE_CHILD_GROUP2)
{
diff --git a/storage/spider/mysql-test/spider/t/spider_fixes_part.test b/storage/spider/mysql-test/spider/t/spider_fixes_part.test
index 9604f83b..6c0c8a7e 100644
--- a/storage/spider/mysql-test/spider/t/spider_fixes_part.test
+++ b/storage/spider/mysql-test/spider/t/spider_fixes_part.test
@@ -163,7 +163,9 @@ if ($HAVE_PARTITION)
PRIMARY KEY(a)
) $MASTER_1_ENGINE $MASTER_1_COMMENT2_P_2_1;
--enable_query_log
+ --disable_ps_protocol
INSERT INTO ta_l2 SELECT a, b, c FROM tb_l;
+ --enable_ps_protocol
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 WHERE a > 1
ORDER BY a;
if ($USE_CHILD_GROUP2)
@@ -268,7 +270,9 @@ if ($HAVE_PARTITION)
PRIMARY KEY(a)
) $MASTER_1_ENGINE $MASTER_1_COMMENT2_P_2_1;
--enable_query_log
+ --disable_ps_protocol
INSERT INTO ta_l2 (a, b, c) VALUES (3, 'B', '2010-09-26 00:00:00');
+ --enable_ps_protocol
UPDATE ta_l2 SET a = 4 WHERE a = 3;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2;
if ($USE_CHILD_GROUP2)
@@ -363,7 +367,9 @@ if ($HAVE_PARTITION)
KEY idx2(c)
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT3_P_2_1;
--enable_query_log
+ --disable_ps_protocol
INSERT INTO ta_l_int (a, b, c) VALUES (1, 2, 3);
+ --enable_ps_protocol
INSERT INTO ta_l_int (a, b, c) SELECT a + 1, b + 1, c + 1 FROM ta_l_int;
INSERT INTO ta_l_int (a, b, c) SELECT a + 2, b + 2, c + 2 FROM ta_l_int;
INSERT INTO ta_l_int (a, b, c) SELECT a + 4, b + 4, c + 4 FROM ta_l_int;
@@ -547,7 +553,9 @@ if ($HAVE_PARTITION)
--connection master_1
}
--enable_query_log
+ --disable_ps_protocol
INSERT INTO t1 () VALUES ();
+ --enable_ps_protocol
SELECT LAST_INSERT_ID();
SELECT MAX(id) FROM t1;
INSERT INTO t1 () VALUES ();
@@ -694,10 +702,12 @@ if ($HAVE_PARTITION)
PRIMARY KEY (a, e)
) $MASTER_1_ENGINE $MASTER_1_COMMENT6_P_1_1;
--enable_query_log
+ --disable_ps_protocol
INSERT INTO ta_ob VALUES ('0B95CD65DF994BC9A09A6AABE53A2733',
'6CFED89FF6A84C7AA55C3C432663D094',
'51041110620304', '2018-08-02 13:41:13',
510411, 1);
+ --enable_ps_protocol
INSERT INTO ta_ob VALUES ('15E8D55EF099443BAEE639E60A4650BD',
'879DC2A0B6AC46D9A62E8EA47E2970F2',
'51041110620301', NULL,
@@ -776,7 +786,9 @@ eval CREATE TABLE t1 (
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_MDEV_25985;
--connection master_1
+--disable_ps_protocol
SELECT * FROM t1 WHERE c > 0 AND b >= 1 AND b <= 2;
+--enable_ps_protocol
SELECT * FROM t1 WHERE c < 3 AND b <= 2;
--echo
@@ -854,7 +866,9 @@ if ($HAVE_PARTITION)
PRIMARY KEY(a)
) $MASTER_1_ENGINE $MASTER_1_COMMENT2_P_2_1;
--enable_query_log
+ --disable_ps_protocol
INSERT INTO ta_l2 SELECT a, b, c FROM tb_l;
+ --enable_ps_protocol
--echo Query a Spider table only using the second partition
SELECT a,b,c FROM ta_l2 PARTITION (pt2);
--echo Query a Spider table only using the first partition
diff --git a/storage/spider/mysql-test/spider/t/timestamp.test b/storage/spider/mysql-test/spider/t/timestamp.test
index 47d637bb..a76ea2e1 100644
--- a/storage/spider/mysql-test/spider/t/timestamp.test
+++ b/storage/spider/mysql-test/spider/t/timestamp.test
@@ -121,8 +121,10 @@ eval CREATE TABLE tbl_f (
col_t TIME
) $MASTER_1_ENGINE $MASTER_1_COMMENT_2_1_F;
--enable_query_log
+--disable_ps_protocol
SHOW CREATE TABLE tbl_a;
SHOW CREATE TABLE tbl_f;
+--enable_ps_protocol
--echo
--echo Set a different time zone that has DST
@@ -406,7 +408,9 @@ if ($USE_CHILD_GROUP2)
}
--connection master_1
DROP INDEX i_ts ON tbl_a;
+--disable_ps_protocol
SHOW CREATE TABLE tbl_a;
+--enable_ps_protocol
--echo
--echo Retry lookups on unindexed timestamp column
diff --git a/storage/spider/mysql-test/spider/t/vp_fixes.test b/storage/spider/mysql-test/spider/t/vp_fixes.test
index 2c3e1523..2061cf25 100644
--- a/storage/spider/mysql-test/spider/t/vp_fixes.test
+++ b/storage/spider/mysql-test/spider/t/vp_fixes.test
@@ -119,7 +119,9 @@ eval CREATE TABLE ta_l (
PRIMARY KEY(a)
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1;
--enable_query_log
+--disable_ps_protocol
INSERT INTO ta_l SELECT a, b, c FROM tb_l;
+--enable_ps_protocol
--echo
--echo 0.9
@@ -182,6 +184,7 @@ if ($USE_CHILD_GROUP2)
}
--connection master_1
--let $MASTER_1_IS_VP= `SELECT IF('$MASTER_1_ENGINE_TYPE' = 'VP', 1, 0)`
+--disable_ps_protocol
if ($MASTER_1_IS_VP)
{
--error 14514
@@ -215,6 +218,7 @@ if ($USE_CHILD_GROUP2)
--enable_result_log
}
}
+--enable_ps_protocol
--echo create un-correspond primary key table
--connection master_1
@@ -279,6 +283,7 @@ if ($USE_CHILD_GROUP2)
}
}
--connection master_1
+--disable_ps_protocol
if ($MASTER_1_IS_VP)
{
--error 14514
@@ -312,6 +317,7 @@ if ($USE_CHILD_GROUP2)
--enable_result_log
}
}
+--enable_ps_protocol
--echo
--echo deinit
diff --git a/storage/spider/spd_conn.cc b/storage/spider/spd_conn.cc
index 68c5362d..fed6bc27 100644
--- a/storage/spider/spd_conn.cc
+++ b/storage/spider/spd_conn.cc
@@ -108,7 +108,6 @@ uchar *spider_conn_get_key(
) {
DBUG_ENTER("spider_conn_get_key");
*length = conn->conn_key_length;
- DBUG_PRINT("info",("spider conn_kind=%u", conn->conn_kind));
#ifdef DBUG_TRACE
spider_print_keys(conn->conn_key, conn->conn_key_length);
#endif
@@ -382,7 +381,6 @@ SPIDER_CONN *spider_create_conn(
ha_spider *spider,
int link_idx,
int base_link_idx,
- uint conn_kind,
int *error_num
) {
int *need_mon;
@@ -602,7 +600,6 @@ SPIDER_CONN *spider_create_conn(
conn->semi_trx_isolation_chk = FALSE;
conn->semi_trx_chk = FALSE;
conn->link_idx = base_link_idx;
- conn->conn_kind = conn_kind;
conn->conn_need_mon = need_mon;
if (spider)
conn->need_mon = &spider->need_mons[base_link_idx];
@@ -689,13 +686,11 @@ SPIDER_CONN *spider_get_conn(
ha_spider *spider,
bool another,
bool thd_chg,
- uint conn_kind,
int *error_num
) {
SPIDER_CONN *conn = NULL;
int base_link_idx = link_idx;
DBUG_ENTER("spider_get_conn");
- DBUG_PRINT("info",("spider conn_kind=%u", conn_kind));
if (spider)
link_idx = spider->conn_link_idx[base_link_idx];
@@ -734,7 +729,8 @@ SPIDER_CONN *spider_get_conn(
pthread_mutex_unlock(&spider_conn_mutex);
if (spider_param_max_connections())
{ /* enable connection pool */
- conn = spider_get_conn_from_idle_connection(share, link_idx, conn_key, spider, conn_kind, base_link_idx, error_num);
+ conn= spider_get_conn_from_idle_connection(
+ share, link_idx, conn_key, spider, base_link_idx, error_num);
/* failed get conn, goto error */
if (!conn)
goto error;
@@ -743,8 +739,8 @@ SPIDER_CONN *spider_get_conn(
else
{ /* did not enable conncetion pool , create_conn */
DBUG_PRINT("info",("spider create new conn"));
- if (!(conn = spider_create_conn(share, spider, link_idx,
- base_link_idx, conn_kind, error_num)))
+ if (!(conn= spider_create_conn(share, spider, link_idx,
+ base_link_idx, error_num)))
goto error;
*conn->conn_key = *conn_key;
if (spider)
@@ -768,8 +764,8 @@ SPIDER_CONN *spider_get_conn(
} else {
DBUG_PRINT("info",("spider create new conn"));
/* conn_recycle_strict = 0 and conn_recycle_mode = 0 or 2 */
- if (!(conn = spider_create_conn(share, spider, link_idx, base_link_idx,
- conn_kind, error_num)))
+ if (!(conn= spider_create_conn(share, spider, link_idx, base_link_idx,
+ error_num)))
goto error;
*conn->conn_key = *conn_key;
if (spider)
@@ -918,8 +914,7 @@ int spider_check_and_get_casual_read_conn(
'0' + spider->result_list.casual_read[link_idx];
if (!(spider->conns[link_idx]= spider_get_conn(
spider->share, link_idx, spider->conn_keys[link_idx],
- spider->wide_handler->trx, spider, FALSE, TRUE,
- SPIDER_CONN_KIND_MYSQL, &error_num)))
+ spider->wide_handler->trx, spider, FALSE, TRUE, &error_num)))
{
*spider->conn_keys[link_idx] = first_byte_bak;
DBUG_RETURN(error_num);
@@ -3024,12 +3019,6 @@ void *spider_bg_sts_action(
if (spider.search_link_idx < 0)
{
spider_trx_set_link_idx_for_all(&spider);
-/*
- spider.search_link_idx = spider_conn_next_link_idx(
- thd, share->link_statuses, share->access_balances,
- spider.conn_link_idx, spider.search_link_idx, share->link_count,
- SPIDER_LINK_STATUS_OK);
-*/
spider.search_link_idx = spider_conn_first_link_idx(thd,
share->link_statuses, share->access_balances, spider.conn_link_idx,
share->link_count, SPIDER_LINK_STATUS_OK);
@@ -3042,36 +3031,9 @@ void *spider_bg_sts_action(
if (!conns[spider.search_link_idx])
{
spider_get_conn(share, spider.search_link_idx,
- share->conn_keys[spider.search_link_idx],
- trx, &spider, FALSE, FALSE, SPIDER_CONN_KIND_MYSQL,
- &error_num);
+ share->conn_keys[spider.search_link_idx], trx,
+ &spider, FALSE, FALSE, &error_num);
conns[spider.search_link_idx]->error_mode = 0;
-/*
- if (
- error_num &&
- share->monitoring_kind[spider.search_link_idx] &&
- need_mons[spider.search_link_idx]
- ) {
- lex_start(thd);
- error_num = spider_ping_table_mon_from_table(
- trx,
- thd,
- share,
- spider.search_link_idx,
- (uint32) share->monitoring_sid[spider.search_link_idx],
- share->table_name,
- share->table_name_length,
- spider.conn_link_idx[spider.search_link_idx],
- NULL,
- 0,
- share->monitoring_kind[spider.search_link_idx],
- share->monitoring_limit[spider.search_link_idx],
- share->monitoring_flag[spider.search_link_idx],
- TRUE
- );
- lex_end(thd->lex);
- }
-*/
spider.search_link_idx = -1;
}
if (spider.search_link_idx != -1 && conns[spider.search_link_idx])
@@ -3082,31 +3044,6 @@ void *spider_bg_sts_action(
share->bg_sts_sync,
2, HA_STATUS_CONST | HA_STATUS_VARIABLE))
{
-/*
- if (
- share->monitoring_kind[spider.search_link_idx] &&
- need_mons[spider.search_link_idx]
- ) {
- lex_start(thd);
- error_num = spider_ping_table_mon_from_table(
- trx,
- thd,
- share,
- spider.search_link_idx,
- (uint32) share->monitoring_sid[spider.search_link_idx],
- share->table_name,
- share->table_name_length,
- spider.conn_link_idx[spider.search_link_idx],
- NULL,
- 0,
- share->monitoring_kind[spider.search_link_idx],
- share->monitoring_limit[spider.search_link_idx],
- share->monitoring_flag[spider.search_link_idx],
- TRUE
- );
- lex_end(thd->lex);
- }
-*/
spider.search_link_idx = -1;
}
}
@@ -3349,12 +3286,6 @@ void *spider_bg_crd_action(
if (spider.search_link_idx < 0)
{
spider_trx_set_link_idx_for_all(&spider);
-/*
- spider.search_link_idx = spider_conn_next_link_idx(
- thd, share->link_statuses, share->access_balances,
- spider.conn_link_idx, spider.search_link_idx, share->link_count,
- SPIDER_LINK_STATUS_OK);
-*/
spider.search_link_idx = spider_conn_first_link_idx(thd,
share->link_statuses, share->access_balances, spider.conn_link_idx,
share->link_count, SPIDER_LINK_STATUS_OK);
@@ -3367,9 +3298,8 @@ void *spider_bg_crd_action(
if (!conns[spider.search_link_idx])
{
spider_get_conn(share, spider.search_link_idx,
- share->conn_keys[spider.search_link_idx],
- trx, &spider, FALSE, FALSE, SPIDER_CONN_KIND_MYSQL,
- &error_num);
+ share->conn_keys[spider.search_link_idx], trx,
+ &spider, FALSE, FALSE, &error_num);
conns[spider.search_link_idx]->error_mode = 0;
/*
if (
@@ -3781,6 +3711,24 @@ void *spider_bg_mon_action(
}
}
+/**
+ Returns a random (active) server with a maximum required link status
+
+ Calculate the sum of balances of all servers whose link status is at
+ most the specified status ("eligible"), generate a random number
+ less than this balance, then find the first server cumulatively
+ exceeding this balance
+
+ @param thd Connection used for generating a random number
+ @param link_statuses The link statuses of servers
+ @param access_balances The access balances of servers
+ @param conn_link_idx Array of indexes to servers
+ @param link_count Number of servers
+ @param link_status The maximum required link status
+ @retval Index to the found server
+ @retval -1 if no eligible servers
+ @retval -2 if out of memory
+*/
int spider_conn_first_link_idx(
THD *thd,
long *link_statuses,
@@ -3789,35 +3737,35 @@ int spider_conn_first_link_idx(
int link_count,
int link_status
) {
- int roop_count, active_links = 0;
- longlong balance_total = 0, balance_val;
+ int eligible_link_idx, eligible_links = 0;
+ longlong balance_total = 0, balance_threshold;
double rand_val;
- int *link_idxs, link_idx;
- long *balances;
+ int *link_idxs, result;
DBUG_ENTER("spider_conn_first_link_idx");
char *ptr;
- ptr = (char *) my_alloca((sizeof(int) * link_count) + (sizeof(long) * link_count));
+ /* Allocate memory for link_idxs */
+ ptr = (char *) my_alloca((sizeof(int) * link_count));
if (!ptr)
{
DBUG_PRINT("info",("spider out of memory"));
DBUG_RETURN(-2);
}
link_idxs = (int *) ptr;
- ptr += sizeof(int) * link_count;
- balances = (long *) ptr;
- for (roop_count = 0; roop_count < link_count; roop_count++)
+
+ /* Filter for eligible servers, store their indexes and calculate
+ the total balances */
+ for (int link_idx = 0; link_idx < link_count; link_idx++)
{
- DBUG_ASSERT((conn_link_idx[roop_count] - roop_count) % link_count == 0);
- if (link_statuses[conn_link_idx[roop_count]] <= link_status)
+ DBUG_ASSERT((conn_link_idx[link_idx] - link_idx) % link_count == 0);
+ if (link_statuses[conn_link_idx[link_idx]] <= link_status)
{
- link_idxs[active_links] = roop_count;
- balances[active_links] = access_balances[roop_count];
- balance_total += access_balances[roop_count];
- active_links++;
+ link_idxs[eligible_links] = link_idx;
+ balance_total += access_balances[link_idx];
+ eligible_links++;
}
}
- if (active_links == 0)
+ if (eligible_links == 0)
{
DBUG_PRINT("info",("spider all links are failed"));
my_afree(link_idxs);
@@ -3827,21 +3775,25 @@ int spider_conn_first_link_idx(
DBUG_PRINT("info",("spider thread_id=%lu", thd_get_thread_id(thd)));
rand_val = spider_rand(thd->variables.server_id + thd_get_thread_id(thd));
DBUG_PRINT("info",("spider rand_val=%f", rand_val));
- balance_val = (longlong) (rand_val * balance_total);
- DBUG_PRINT("info",("spider balance_val=%lld", balance_val));
- for (roop_count = 0; roop_count < active_links - 1; roop_count++)
- {
+ balance_threshold = (longlong) (rand_val * balance_total);
+ DBUG_PRINT("info",("spider balance_threshold=%lld", balance_threshold));
+ /* Since balance_threshold < total balance, this loop WILL break */
+ for (eligible_link_idx = 0;
+ eligible_link_idx < eligible_links;
+ eligible_link_idx++)
+ {
+ result = link_idxs[eligible_link_idx];
+ const long balance = access_balances[result];
DBUG_PRINT("info",("spider balances[%d]=%ld",
- roop_count, balances[roop_count]));
- if (balance_val < balances[roop_count])
+ link_idxs[eligible_link_idx], balance));
+ if (balance_threshold < balance)
break;
- balance_val -= balances[roop_count];
+ balance_threshold -= balance;
}
- DBUG_PRINT("info",("spider first link_idx=%d", link_idxs[roop_count]));
- link_idx = link_idxs[roop_count];
+ DBUG_PRINT("info",("spider first link_idx=%d", result));
my_afree(link_idxs);
- DBUG_RETURN(link_idx);
+ DBUG_RETURN(result);
}
int spider_conn_next_link_idx(
@@ -3876,6 +3828,17 @@ int spider_conn_next_link_idx(
DBUG_RETURN(tmp_link_idx);
}
+/**
+ Finds the next active server with a maximum required link status
+
+ @param link_statuses The statuses of servers
+ @param conn_link_idx The array of active servers
+ @param link_idx The index of the current active server
+ @param link_count The number of active servers
+ @param link_status The required maximum link status
+ @return The next active server whose link status is
+ at most the required one.
+*/
int spider_conn_link_idx_next(
long *link_statuses,
uint *conn_link_idx,
@@ -3888,6 +3851,8 @@ int spider_conn_link_idx_next(
link_idx++;
if (link_idx >= link_count)
break;
+ /* Asserts that the `link_idx`th active server is in the correct
+ "group" */
DBUG_ASSERT((conn_link_idx[link_idx] - link_idx) % link_count == 0);
} while (link_statuses[conn_link_idx[link_idx]] > link_status);
DBUG_PRINT("info",("spider link_idx=%d", link_idx));
@@ -3936,7 +3901,6 @@ SPIDER_CONN* spider_get_conn_from_idle_connection(
int link_idx,
char *conn_key,
ha_spider *spider,
- uint conn_kind,
int base_link_idx,
int *error_num
)
@@ -4024,7 +3988,8 @@ SPIDER_CONN* spider_get_conn_from_idle_connection(
if (ip_port_conn)
pthread_mutex_unlock(&ip_port_conn->mutex);
DBUG_PRINT("info",("spider create new conn"));
- if (!(conn = spider_create_conn(share, spider, link_idx, base_link_idx, conn_kind, error_num)))
+ if (!(conn= spider_create_conn(share, spider, link_idx, base_link_idx,
+ error_num)))
DBUG_RETURN(conn);
*conn->conn_key = *conn_key;
if (spider)
diff --git a/storage/spider/spd_conn.h b/storage/spider/spd_conn.h
index 807e1474..1759f06b 100644
--- a/storage/spider/spd_conn.h
+++ b/storage/spider/spd_conn.h
@@ -84,7 +84,6 @@ SPIDER_CONN *spider_create_conn(
ha_spider *spider,
int link_id,
int base_link_id,
- uint conn_kind,
int *error_num
);
@@ -96,7 +95,6 @@ SPIDER_CONN *spider_get_conn(
ha_spider *spider,
bool another,
bool thd_chg,
- uint conn_kind,
int *error_num
);
@@ -397,7 +395,6 @@ SPIDER_CONN* spider_get_conn_from_idle_connection
int link_idx,
char *conn_key,
ha_spider *spider,
- uint conn_kind,
int base_link_idx,
int *error_num
);
diff --git a/storage/spider/spd_copy_tables.cc b/storage/spider/spd_copy_tables.cc
index 4b608721..1a6bd861 100644
--- a/storage/spider/spd_copy_tables.cc
+++ b/storage/spider/spd_copy_tables.cc
@@ -257,7 +257,7 @@ int spider_udf_get_copy_tgt_tables(
!(table_tables = spider_open_sys_table(
thd, SPIDER_SYS_TABLES_TABLE_NAME_STR,
SPIDER_SYS_TABLES_TABLE_NAME_LEN, FALSE, &open_tables_backup,
- need_lock, &error_num))
+ &error_num))
) {
my_error(error_num, MYF(0));
goto error;
@@ -300,7 +300,7 @@ int spider_udf_get_copy_tgt_tables(
(error_num = spider_get_sys_tables_connect_info(
table_tables, tmp_share, mem_root)) ||
(error_num = spider_get_sys_tables_link_status(
- table_tables, tmp_share, 0, mem_root)) ||
+ table_tables, tmp_share->link_statuses, mem_root)) ||
(error_num = spider_get_sys_tables_link_idx(
table_tables, &table_conn->link_idx, mem_root))
) {
@@ -445,8 +445,7 @@ int spider_udf_get_copy_tgt_tables(
error_num = spider_sys_index_next_same(table_tables, table_key);
} while (error_num == 0);
spider_sys_index_end(table_tables);
- spider_close_sys_table(thd, table_tables,
- &open_tables_backup, need_lock);
+ spider_sys_close_table(thd, &open_tables_backup);
table_tables = NULL;
if (!copy_tables->table_conn[0])
@@ -468,8 +467,7 @@ int spider_udf_get_copy_tgt_tables(
error:
if (table_tables)
- spider_close_sys_table(thd, table_tables,
- &open_tables_backup, need_lock);
+ spider_sys_close_table(thd, &open_tables_backup);
if (table_conn)
{
spider_free_tmp_dbton_share(tmp_share);
@@ -495,11 +493,10 @@ int spider_udf_get_copy_tgt_conns(
while (table_conn)
{
share = table_conn->share;
- if (
- !(table_conn->conn = spider_get_conn(
- share, 0, share->conn_keys[0], trx, NULL, FALSE, FALSE,
- SPIDER_CONN_KIND_MYSQL, &error_num))
- ) {
+ if (!(table_conn->conn=
+ spider_get_conn(share, 0, share->conn_keys[0], trx, NULL,
+ FALSE, FALSE, &error_num)))
+ {
my_error(ER_CONNECT_TO_FOREIGN_DATA_SOURCE, MYF(0), share->server_names[0]);
DBUG_RETURN(ER_CONNECT_TO_FOREIGN_DATA_SOURCE);
}
diff --git a/storage/spider/spd_db_conn.cc b/storage/spider/spd_db_conn.cc
index 7c56ede2..5f816d47 100644
--- a/storage/spider/spd_db_conn.cc
+++ b/storage/spider/spd_db_conn.cc
@@ -74,7 +74,7 @@ int spider_db_connect(
THD* thd = current_thd;
longlong connect_retry_interval;
DBUG_ENTER("spider_db_connect");
- DBUG_ASSERT(conn->conn_kind != SPIDER_CONN_KIND_MYSQL || conn->need_mon);
+ DBUG_ASSERT(conn->need_mon);
DBUG_PRINT("info",("spider link_idx=%d", link_idx));
DBUG_PRINT("info",("spider conn=%p", conn));
@@ -234,7 +234,6 @@ void spider_db_disconnect(
) {
DBUG_ENTER("spider_db_disconnect");
DBUG_PRINT("info",("spider conn=%p", conn));
- DBUG_PRINT("info",("spider conn->conn_kind=%u", conn->conn_kind));
if (conn->db_conn->is_connected())
{
conn->db_conn->disconnect();
@@ -3432,18 +3431,12 @@ int spider_db_store_result(
DBUG_PRINT("info",("spider store result to temporary table"));
DBUG_ASSERT(!current->result_tmp_tbl);
-#ifdef SPIDER_use_LEX_CSTRING_for_Field_blob_constructor
LEX_CSTRING field_name1 = {STRING_WITH_LEN("a")};
LEX_CSTRING field_name2 = {STRING_WITH_LEN("b")};
LEX_CSTRING field_name3 = {STRING_WITH_LEN("c")};
if (!(current->result_tmp_tbl = spider_mk_sys_tmp_table_for_result(
thd, table, &current->result_tmp_tbl_prm, &field_name1, &field_name2,
&field_name3, &my_charset_bin)))
-#else
- if (!(current->result_tmp_tbl = spider_mk_sys_tmp_table_for_result(
- thd, table, &current->result_tmp_tbl_prm, "a", "b", "c",
- &my_charset_bin)))
-#endif
{
DBUG_RETURN(HA_ERR_OUT_OF_MEM);
}
@@ -3793,21 +3786,13 @@ int spider_db_store_result_for_reuse_cursor(
DBUG_PRINT("info",("spider store result to temporary table"));
DBUG_ASSERT(!current->result_tmp_tbl);
-#ifdef SPIDER_use_LEX_CSTRING_for_Field_blob_constructor
LEX_CSTRING field_name1 = {STRING_WITH_LEN("a")};
LEX_CSTRING field_name2 = {STRING_WITH_LEN("b")};
LEX_CSTRING field_name3 = {STRING_WITH_LEN("c")};
if (!(current->result_tmp_tbl = spider_mk_sys_tmp_table_for_result(
thd, table, &current->result_tmp_tbl_prm, &field_name1, &field_name2,
&field_name3, &my_charset_bin)))
-#else
- if (!(current->result_tmp_tbl = spider_mk_sys_tmp_table_for_result(
- thd, table, &current->result_tmp_tbl_prm, "a", "b", "c",
- &my_charset_bin)))
-#endif
- {
DBUG_RETURN(HA_ERR_OUT_OF_MEM);
- }
current->result_tmp_tbl_thd = thd;
TABLE *tmp_tbl = current->result_tmp_tbl;
tmp_tbl->file->extra(HA_EXTRA_WRITE_CACHE);
diff --git a/storage/spider/spd_db_include.h b/storage/spider/spd_db_include.h
index 4e9d6b1a..87985584 100644
--- a/storage/spider/spd_db_include.h
+++ b/storage/spider/spd_db_include.h
@@ -19,12 +19,19 @@
#define SPD_INIT_ALLOC_ROOT(A, B, C, D) \
init_alloc_root(PSI_INSTRUMENT_ME, A, B, C, D)
+/** Maximum possible number of `SPIDER_DBTON`s available to use */
#define SPIDER_DBTON_SIZE 15
#ifndef SIZEOF_STORED_DOUBLE
#define SIZEOF_STORED_DOUBLE 8
#endif
+/**
+ Possible wrapper values, e.g. for `SPIDER_DBTON::wrapper` and
+ `SPIDER_SHARE::tgt_wrappers`.
+
+ fixme: change this to enum
+*/
#define SPIDER_DB_WRAPPER_MYSQL "mysql"
#define SPIDER_DB_WRAPPER_MARIADB "mariadb"
@@ -166,8 +173,6 @@ typedef st_spider_result SPIDER_RESULT;
#define SPIDER_SQL_LOP_CHK_PRM_PRF_STR "spider_lc_"
#define SPIDER_SQL_LOP_CHK_PRM_PRF_LEN (sizeof(SPIDER_SQL_LOP_CHK_PRM_PRF_STR) - 1)
-#define SPIDER_CONN_KIND_MYSQL (1 << 0)
-
#define SPIDER_SQL_TYPE_SELECT_SQL (1 << 0)
#define SPIDER_SQL_TYPE_INSERT_SQL (1 << 1)
#define SPIDER_SQL_TYPE_UPDATE_SQL (1 << 2)
@@ -176,11 +181,6 @@ typedef st_spider_result SPIDER_RESULT;
#define SPIDER_SQL_TYPE_TMP_SQL (1 << 5)
#define SPIDER_SQL_TYPE_DROP_TMP_TABLE_SQL (1 << 6)
#define SPIDER_SQL_TYPE_OTHER_SQL (1 << 7)
-#define SPIDER_SQL_TYPE_SELECT_HS (1 << 9)
-#define SPIDER_SQL_TYPE_INSERT_HS (1 << 10)
-#define SPIDER_SQL_TYPE_UPDATE_HS (1 << 11)
-#define SPIDER_SQL_TYPE_DELETE_HS (1 << 12)
-#define SPIDER_SQL_TYPE_OTHER_HS (1 << 13)
enum spider_bulk_upd_start {
SPD_BU_NOT_START,
@@ -650,6 +650,8 @@ struct st_spider_db_request_key
class spider_db_util
{
public:
+ /** Same as the `SPIDER_DBTON::dbton_id` of the `SPIDER_DBTON`
+ containing this `spider_db_util` */
uint dbton_id;
spider_db_util() = default;
virtual ~spider_db_util() = default;
@@ -1640,7 +1642,10 @@ static const LEX_CSTRING maturity_name[] =
*/
typedef struct st_spider_dbton
{
+ /** The index of this dbton in `spider_dbton` */
uint dbton_id;
+ /** The wrapper of this dbton, same possible values as each element
+ of `SPIDER_SHARE::tgt_wrappers` */
const char *wrapper;
enum spider_db_access_type db_access_type;
int (*init)();
diff --git a/storage/spider/spd_db_mysql.cc b/storage/spider/spd_db_mysql.cc
index 450e1a02..8ff45022 100644
--- a/storage/spider/spd_db_mysql.cc
+++ b/storage/spider/spd_db_mysql.cc
@@ -307,6 +307,7 @@ bool spider_mariadb_support_direct_join(
DBUG_RETURN(TRUE);
}
+/** Available `SPIDER_DBTON`s */
SPIDER_DBTON spider_dbton_mysql = {
0,
SPIDER_DB_WRAPPER_MYSQL,
@@ -806,6 +807,7 @@ SPIDER_DB_ROW *spider_db_mbase_result::fetch_row_from_tmp_table(
DBUG_RETURN((SPIDER_DB_ROW *) &row);
}
+/* Fetches table status into `stat` */
int spider_db_mbase_result::fetch_table_status(
int mode,
ha_statistics &stat
@@ -1907,12 +1909,10 @@ int spider_db_mbase::connect(
mysql_options(db_conn, MYSQL_OPT_SSL_CA, conn->tgt_ssl_ca);
mysql_options(db_conn, MYSQL_OPT_SSL_CAPATH, conn->tgt_ssl_capath);
mysql_options(db_conn, MYSQL_OPT_SSL_CIPHER, conn->tgt_ssl_cipher);
- if (conn->tgt_ssl_vsc)
- {
- my_bool verify_flg = TRUE;
- mysql_options(db_conn, MYSQL_OPT_SSL_VERIFY_SERVER_CERT,
- &verify_flg);
- }
+ }
+ {
+ my_bool verify_flg = conn->tgt_ssl_vsc != 0;
+ mysql_options(db_conn, MYSQL_OPT_SSL_VERIFY_SERVER_CERT, &verify_flg);
}
if (conn->tgt_default_file)
@@ -5204,6 +5204,7 @@ int spider_db_mbase_util::append_sql_mode(
DBUG_RETURN(0);
}
+/** Append `set session time_zone = ...` to a query string */
int spider_db_mbase_util::append_time_zone(
spider_string *str,
Time_zone *time_zone
@@ -5222,6 +5223,14 @@ int spider_db_mbase_util::append_time_zone(
DBUG_RETURN(0);
}
+/**
+ Append a query for self-referencing check
+
+ The query is setting a user variable `@spider_lc$target_table_path`
+ to the value of `"$spider_unique_id$spider_table_path-"`, where
+ $target_table_path is the path to the data node table ("to"), and
+ $spider_table_path the path to the spider table ("from")
+*/
int spider_db_mbase_util::append_loop_check(
spider_string *str,
SPIDER_CONN *conn
@@ -7955,10 +7964,10 @@ int spider_mbase_share::discover_table_structure(
SPIDER_CONN *conn;
int need_mon;
- if (!(conn = spider_get_conn(
- spider_share, 0, spider_share->conn_keys[roop_count], trx, NULL, FALSE,
- FALSE, SPIDER_CONN_KIND_MYSQL, &error_num))
- ) {
+ if (!(conn= spider_get_conn(spider_share, 0,
+ spider_share->conn_keys[roop_count], trx, NULL,
+ FALSE, FALSE, &error_num)))
+ {
DBUG_RETURN(error_num);
}
pthread_mutex_assert_not_owner(&conn->mta_conn_mutex);
@@ -12012,23 +12021,14 @@ int spider_mbase_handler::append_from(
DBUG_RETURN(0);
}
-int spider_mbase_handler::append_flush_tables_part(
- ulong sql_type,
- int link_idx,
- bool lock
-) {
+int spider_mbase_handler::append_flush_tables_part(int link_idx, bool lock)
+{
int error_num;
spider_string *str;
DBUG_ENTER("spider_mbase_handler::append_flush_tables_part");
DBUG_PRINT("info",("spider this=%p", this));
- switch (sql_type)
- {
- case SPIDER_SQL_TYPE_OTHER_SQL:
- str = &spider->result_list.sqls[link_idx];
- break;
- default:
- DBUG_RETURN(0);
- }
+
+ str= &spider->result_list.sqls[link_idx];
error_num = append_flush_tables(str, link_idx, lock);
DBUG_RETURN(error_num);
}
@@ -12056,22 +12056,14 @@ int spider_mbase_handler::append_flush_tables(
DBUG_RETURN(0);
}
-int spider_mbase_handler::append_optimize_table_part(
- ulong sql_type,
- int link_idx
-) {
+int spider_mbase_handler::append_optimize_table_part(int link_idx)
+{
int error_num;
spider_string *str;
DBUG_ENTER("spider_mbase_handler::append_optimize_table_part");
DBUG_PRINT("info",("spider this=%p", this));
- switch (sql_type)
- {
- case SPIDER_SQL_TYPE_OTHER_SQL:
- str = &spider->result_list.sqls[link_idx];
- break;
- default:
- DBUG_RETURN(0);
- }
+
+ str= &spider->result_list.sqls[link_idx];
error_num = append_optimize_table(str, link_idx);
DBUG_RETURN(error_num);
}
@@ -12102,22 +12094,14 @@ int spider_mbase_handler::append_optimize_table(
DBUG_RETURN(0);
}
-int spider_mbase_handler::append_analyze_table_part(
- ulong sql_type,
- int link_idx
-) {
+int spider_mbase_handler::append_analyze_table_part(int link_idx)
+{
int error_num;
spider_string *str;
DBUG_ENTER("spider_mbase_handler::append_analyze_table_part");
DBUG_PRINT("info",("spider this=%p", this));
- switch (sql_type)
- {
- case SPIDER_SQL_TYPE_OTHER_SQL:
- str = &spider->result_list.sqls[link_idx];
- break;
- default:
- DBUG_RETURN(0);
- }
+
+ str= &spider->result_list.sqls[link_idx];
error_num = append_analyze_table(str, link_idx);
DBUG_RETURN(error_num);
}
@@ -12148,23 +12132,15 @@ int spider_mbase_handler::append_analyze_table(
DBUG_RETURN(0);
}
-int spider_mbase_handler::append_repair_table_part(
- ulong sql_type,
- int link_idx,
- HA_CHECK_OPT* check_opt
-) {
+int spider_mbase_handler::append_repair_table_part(int link_idx,
+ HA_CHECK_OPT *check_opt)
+{
int error_num;
spider_string *str;
DBUG_ENTER("spider_mbase_handler::append_repair_table_part");
DBUG_PRINT("info",("spider this=%p", this));
- switch (sql_type)
- {
- case SPIDER_SQL_TYPE_OTHER_SQL:
- str = &spider->result_list.sqls[link_idx];
- break;
- default:
- DBUG_RETURN(0);
- }
+
+ str= &spider->result_list.sqls[link_idx];
error_num = append_repair_table(str, link_idx, check_opt);
DBUG_RETURN(error_num);
}
@@ -12214,23 +12190,15 @@ int spider_mbase_handler::append_repair_table(
DBUG_RETURN(0);
}
-int spider_mbase_handler::append_check_table_part(
- ulong sql_type,
- int link_idx,
- HA_CHECK_OPT* check_opt
-) {
+int spider_mbase_handler::append_check_table_part(int link_idx,
+ HA_CHECK_OPT *check_opt)
+{
int error_num;
spider_string *str;
DBUG_ENTER("spider_mbase_handler::append_check_table_part");
DBUG_PRINT("info",("spider this=%p", this));
- switch (sql_type)
- {
- case SPIDER_SQL_TYPE_OTHER_SQL:
- str = &spider->result_list.sqls[link_idx];
- break;
- default:
- DBUG_RETURN(0);
- }
+
+ str= &spider->result_list.sqls[link_idx];
error_num = append_check_table(str, link_idx, check_opt);
DBUG_RETURN(error_num);
}
@@ -12279,22 +12247,14 @@ int spider_mbase_handler::append_check_table(
DBUG_RETURN(0);
}
-int spider_mbase_handler::append_enable_keys_part(
- ulong sql_type,
- int link_idx
-) {
+int spider_mbase_handler::append_enable_keys_part(int link_idx)
+{
int error_num;
spider_string *str;
DBUG_ENTER("spider_mbase_handler::append_enable_keys_part");
DBUG_PRINT("info",("spider this=%p", this));
- switch (sql_type)
- {
- case SPIDER_SQL_TYPE_OTHER_SQL:
- str = &spider->result_list.sqls[link_idx];
- break;
- default:
- DBUG_RETURN(0);
- }
+
+ str= &spider->result_list.sqls[link_idx];
error_num = append_enable_keys(str, link_idx);
DBUG_RETURN(error_num);
}
@@ -12320,22 +12280,14 @@ int spider_mbase_handler::append_enable_keys(
DBUG_RETURN(0);
}
-int spider_mbase_handler::append_disable_keys_part(
- ulong sql_type,
- int link_idx
-) {
+int spider_mbase_handler::append_disable_keys_part(int link_idx)
+{
int error_num;
spider_string *str;
DBUG_ENTER("spider_mbase_handler::append_disable_keys_part");
DBUG_PRINT("info",("spider this=%p", this));
- switch (sql_type)
- {
- case SPIDER_SQL_TYPE_OTHER_SQL:
- str = &spider->result_list.sqls[link_idx];
- break;
- default:
- DBUG_RETURN(0);
- }
+
+ str= &spider->result_list.sqls[link_idx];
error_num = append_disable_keys(str, link_idx);
DBUG_RETURN(error_num);
}
@@ -12692,14 +12644,9 @@ int spider_mbase_handler::mk_bulk_tmp_table_and_bulk_start()
DBUG_PRINT("info",("spider this=%p", this));
if (!upd_tmp_tbl)
{
-#ifdef SPIDER_use_LEX_CSTRING_for_Field_blob_constructor
LEX_CSTRING field_name = {STRING_WITH_LEN("a")};
if (!(upd_tmp_tbl = spider_mk_sys_tmp_table(
thd, table, &upd_tmp_tbl_prm, &field_name, update_sql.charset())))
-#else
- if (!(upd_tmp_tbl = spider_mk_sys_tmp_table(
- thd, table, &upd_tmp_tbl_prm, "a", update_sql.charset())))
-#endif
{
DBUG_RETURN(HA_ERR_OUT_OF_MEM);
}
@@ -13176,6 +13123,90 @@ int spider_mbase_handler::sts_mode_exchange(
DBUG_RETURN(sts_mode);
}
+/** Set the session lock wait time out */
+static int spider_set_lock_wait_timeout(uint seconds, SPIDER_CONN *conn,
+ int *need_mon)
+{
+ char query[512];
+ int error_num;
+ DBUG_ENTER("spider_db_set_lock_wait_timeout");
+ size_t query_len =
+ my_snprintf(query, sizeof(query),
+ "set @old_lock_wait_timeout=@@session.lock_wait_timeout;"
+ "set session lock_wait_timeout=%d;",
+ seconds);
+ DEBUG_SYNC(conn->thd, "spider_set_lock_wait_timeout_before_query");
+ if (spider_db_query(conn, query, query_len, -1, need_mon))
+ DBUG_RETURN(spider_db_errorno(conn));
+ spider_db_result *result;
+ do {
+ st_spider_db_request_key request_key= {1, 1, NULL, 1, NULL};
+ if ((result = conn->db_conn->store_result(NULL, &request_key,
+ &error_num)))
+ {
+ result->free_result();
+ delete result;
+ } else if ((error_num = conn->db_conn->get_errno()))
+ break;
+ } while (!(error_num = conn->db_conn->next_result()));
+ DBUG_RETURN(0);
+}
+
+/** Reset the session lock wait time out */
+int spider_db_mbase::reset_lock_wait_timeout()
+{
+ const LEX_CSTRING query = {STRING_WITH_LEN(
+ "set session lock_wait_timeout=@old_lock_wait_timeout;")};
+ int error_num;
+ DBUG_ENTER("spider_db_set_lock_wait_timeout");
+ if ((error_num = exec_query(query.str, query.length, -1)))
+ DBUG_RETURN(error_num);
+ spider_db_result *result;
+ do {
+ st_spider_db_request_key request_key= {1, 1, NULL, 1, NULL};
+ if ((result = conn->db_conn->store_result(NULL, &request_key,
+ &error_num)))
+ {
+ result->free_result();
+ delete result;
+ } else if ((error_num = conn->db_conn->get_errno()))
+ break;
+ } while (!(error_num= conn->db_conn->next_result()));
+ DBUG_RETURN(0);
+}
+
+/** FIXME: refactor more functions to use spider_setup_for_query() and
+spider_teardown_after_query(). */
+void spider_setup_for_query(ha_spider *spider, SPIDER_CONN *conn, int link_idx)
+{
+ pthread_mutex_assert_not_owner(&conn->mta_conn_mutex);
+ pthread_mutex_lock(&conn->mta_conn_mutex);
+ SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
+ conn->need_mon= &spider->need_mons[link_idx];
+ DBUG_ASSERT(!conn->mta_conn_mutex_lock_already);
+ DBUG_ASSERT(!conn->mta_conn_mutex_unlock_later);
+ conn->mta_conn_mutex_lock_already= TRUE;
+ conn->mta_conn_mutex_unlock_later= TRUE;
+ conn->disable_connect_retry= TRUE;
+}
+
+int spider_teardown_after_query(SPIDER_CONN *conn, int error_num, bool clear)
+{
+ conn->disable_connect_retry= FALSE;
+ DBUG_ASSERT(conn->mta_conn_mutex_lock_already);
+ DBUG_ASSERT(conn->mta_conn_mutex_unlock_later);
+ conn->mta_conn_mutex_lock_already= FALSE;
+ conn->mta_conn_mutex_unlock_later= FALSE;
+ if (clear)
+ {
+ SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos);
+ pthread_mutex_unlock(&conn->mta_conn_mutex);
+ }
+ return error_num;
+}
+/**
+ Executes show table status query and stores results in share->stat
+*/
int spider_mbase_handler::show_table_status(
int link_idx,
int sts_mode,
@@ -13185,329 +13216,137 @@ int spider_mbase_handler::show_table_status(
SPIDER_CONN *conn = spider->conns[link_idx];
SPIDER_DB_RESULT *res;
SPIDER_SHARE *share = spider->share;
- uint pos = (2 * spider->conn_link_idx[link_idx]);
+ const uint pos = 2 * spider->conn_link_idx[link_idx] +
+ (sts_mode == 1 ? 0 : 1);
ulonglong auto_increment_value = 0;
DBUG_ENTER("spider_mbase_handler::show_table_status");
DBUG_PRINT("info",("spider sts_mode=%d", sts_mode));
- if (sts_mode == 1)
+ spider_setup_for_query(spider, conn, link_idx);
+ spider_conn_set_timeout_from_share(
+ conn, link_idx, spider->wide_handler->trx->thd, share);
+
+ if ((error_num = spider_db_set_names(spider, conn, link_idx)) ||
+ (error_num = spider_set_lock_wait_timeout(
+ 1, conn, &spider->need_mons[link_idx])) ||
+ /* Executes the `show table status` query */
+ (spider_db_query(
+ conn,
+ mysql_share->show_table_status[pos].ptr(),
+ mysql_share->show_table_status[pos].length(),
+ -1,
+ &spider->need_mons[link_idx]) &&
+ (error_num = spider_db_errorno(conn))))
{
- pthread_mutex_assert_not_owner(&conn->mta_conn_mutex);
- pthread_mutex_lock(&conn->mta_conn_mutex);
- SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
- conn->need_mon = &spider->need_mons[link_idx];
- DBUG_ASSERT(!conn->mta_conn_mutex_lock_already);
- DBUG_ASSERT(!conn->mta_conn_mutex_unlock_later);
- conn->mta_conn_mutex_lock_already = TRUE;
- conn->mta_conn_mutex_unlock_later = TRUE;
- conn->disable_connect_retry = TRUE;
- spider_conn_set_timeout_from_share(conn, link_idx,
- spider->wide_handler->trx->thd,
- share);
- if (
- (error_num = spider_db_set_names(spider, conn, link_idx)) ||
- (
- spider_db_query(
- conn,
- mysql_share->show_table_status[0 + pos].ptr(),
- mysql_share->show_table_status[0 + pos].length(),
- -1,
- &spider->need_mons[link_idx]) &&
- (error_num = spider_db_errorno(conn))
- )
- ) {
- if (
- error_num == ER_SPIDER_REMOTE_SERVER_GONE_AWAY_NUM &&
- !conn->disable_reconnect
+ if (error_num == ER_SPIDER_REMOTE_SERVER_GONE_AWAY_NUM &&
+ !conn->disable_reconnect)
+ {
+ /* retry */
+ if ((error_num = spider_db_ping(spider, conn, link_idx)))
+ DBUG_RETURN(spider_teardown_after_query(conn, error_num, true));
+ if ((error_num = spider_db_set_names(spider, conn, link_idx)))
+ DBUG_RETURN(spider_teardown_after_query(conn, error_num, true));
+ spider_conn_set_timeout_from_share(conn, link_idx,
+ spider->wide_handler->trx->thd,
+ share);
+ if ((error_num =
+ spider_set_lock_wait_timeout(1, conn, &spider->need_mons[link_idx])))
+ DBUG_RETURN(spider_teardown_after_query(conn, error_num, true));
+ if (spider_db_query(
+ conn,
+ mysql_share->show_table_status[pos].ptr(),
+ mysql_share->show_table_status[pos].length(),
+ -1,
+ &spider->need_mons[link_idx])
) {
- /* retry */
- if ((error_num = spider_db_ping(spider, conn, link_idx)))
- {
- conn->disable_connect_retry = FALSE;
- DBUG_ASSERT(conn->mta_conn_mutex_lock_already);
- DBUG_ASSERT(conn->mta_conn_mutex_unlock_later);
- conn->mta_conn_mutex_lock_already = FALSE;
- conn->mta_conn_mutex_unlock_later = FALSE;
- SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos);
- pthread_mutex_unlock(&conn->mta_conn_mutex);
- DBUG_RETURN(error_num);
- }
- if ((error_num = spider_db_set_names(spider, conn, link_idx)))
- {
- conn->disable_connect_retry = FALSE;
- DBUG_ASSERT(conn->mta_conn_mutex_lock_already);
- DBUG_ASSERT(conn->mta_conn_mutex_unlock_later);
- conn->mta_conn_mutex_lock_already = FALSE;
- conn->mta_conn_mutex_unlock_later = FALSE;
- SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos);
- pthread_mutex_unlock(&conn->mta_conn_mutex);
- DBUG_RETURN(error_num);
- }
- spider_conn_set_timeout_from_share(conn, link_idx,
- spider->wide_handler->trx->thd,
- share);
- if (spider_db_query(
- conn,
- mysql_share->show_table_status[0 + pos].ptr(),
- mysql_share->show_table_status[0 + pos].length(),
- -1,
- &spider->need_mons[link_idx])
- ) {
- conn->disable_connect_retry = FALSE;
- DBUG_ASSERT(conn->mta_conn_mutex_lock_already);
- DBUG_ASSERT(conn->mta_conn_mutex_unlock_later);
- conn->mta_conn_mutex_lock_already = FALSE;
- conn->mta_conn_mutex_unlock_later = FALSE;
- DBUG_RETURN(spider_db_errorno(conn));
- }
- } else {
- conn->disable_connect_retry = FALSE;
- DBUG_ASSERT(conn->mta_conn_mutex_lock_already);
- DBUG_ASSERT(conn->mta_conn_mutex_unlock_later);
- conn->mta_conn_mutex_lock_already = FALSE;
- conn->mta_conn_mutex_unlock_later = FALSE;
- SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos);
- pthread_mutex_unlock(&conn->mta_conn_mutex);
- DBUG_RETURN(error_num);
+ spider_teardown_after_query(conn, 0, false);
+ DBUG_RETURN(spider_db_errorno(conn));
}
- }
- st_spider_db_request_key request_key;
- request_key.spider_thread_id = spider->wide_handler->trx->spider_thread_id;
- request_key.query_id = spider->wide_handler->trx->thd->query_id;
- request_key.handler = spider;
- request_key.request_id = 1;
- request_key.next = NULL;
- if (spider_param_dry_access())
- {
- conn->disable_connect_retry = FALSE;
- DBUG_ASSERT(conn->mta_conn_mutex_lock_already);
- DBUG_ASSERT(conn->mta_conn_mutex_unlock_later);
- conn->mta_conn_mutex_lock_already = FALSE;
- conn->mta_conn_mutex_unlock_later = FALSE;
- SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos);
- pthread_mutex_unlock(&conn->mta_conn_mutex);
- DBUG_RETURN(0);
- }
- if (!(res = conn->db_conn->store_result(NULL, &request_key, &error_num)))
+ } else
+ DBUG_RETURN(spider_teardown_after_query(conn, error_num, true));
+ }
+ st_spider_db_request_key request_key = {
+ spider->wide_handler->trx->spider_thread_id,
+ spider->wide_handler->trx->thd->query_id, spider, 1, NULL};
+ if (spider_param_dry_access())
+ DBUG_RETURN(spider_teardown_after_query(conn, 0, true));
+ if (!(res = conn->db_conn->store_result(NULL, &request_key, &error_num)))
+ {
+ if (sts_mode == 1) /* get from status table */
{
- conn->disable_connect_retry = FALSE;
- DBUG_ASSERT(conn->mta_conn_mutex_lock_already);
- DBUG_ASSERT(conn->mta_conn_mutex_unlock_later);
- conn->mta_conn_mutex_lock_already = FALSE;
- conn->mta_conn_mutex_unlock_later = FALSE;
if (error_num)
- {
- SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos);
- pthread_mutex_unlock(&conn->mta_conn_mutex);
- DBUG_RETURN(error_num);
- }
- else if ((error_num = spider_db_errorno(conn)))
+ DBUG_RETURN(spider_teardown_after_query(conn, error_num, true));
+ spider_teardown_after_query(conn, 0, false);
+ if ((error_num = spider_db_errorno(conn)))
DBUG_RETURN(error_num);
- else {
- my_printf_error(ER_SPIDER_REMOTE_TABLE_NOT_FOUND_NUM,
+ else
+ {
+ my_printf_error(
+ ER_SPIDER_REMOTE_TABLE_NOT_FOUND_NUM,
ER_SPIDER_REMOTE_TABLE_NOT_FOUND_STR, MYF(0),
mysql_share->db_names_str[spider->conn_link_idx[link_idx]].ptr(),
- mysql_share->table_names_str[spider->conn_link_idx[
- link_idx]].ptr());
+ mysql_share->table_names_str[spider->conn_link_idx[link_idx]].ptr());
DBUG_RETURN(ER_SPIDER_REMOTE_TABLE_NOT_FOUND_NUM);
}
- }
- conn->disable_connect_retry = FALSE;
- DBUG_ASSERT(conn->mta_conn_mutex_lock_already);
- DBUG_ASSERT(conn->mta_conn_mutex_unlock_later);
- conn->mta_conn_mutex_lock_already = FALSE;
- conn->mta_conn_mutex_unlock_later = FALSE;
- SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos);
- pthread_mutex_unlock(&conn->mta_conn_mutex);
- error_num = res->fetch_table_status(
- sts_mode,
- share->stat
- );
- auto_increment_value = share->stat.auto_increment_value;
- res->free_result();
- delete res;
- if (error_num)
- {
- switch (error_num)
- {
- case ER_SPIDER_REMOTE_TABLE_NOT_FOUND_NUM:
- my_printf_error(ER_SPIDER_REMOTE_TABLE_NOT_FOUND_NUM,
- ER_SPIDER_REMOTE_TABLE_NOT_FOUND_STR, MYF(0),
- mysql_share->db_names_str[spider->conn_link_idx[link_idx]].ptr(),
- mysql_share->table_names_str[spider->conn_link_idx[
- link_idx]].ptr());
- break;
- case ER_SPIDER_INVALID_REMOTE_TABLE_INFO_NUM:
- my_printf_error(ER_SPIDER_INVALID_REMOTE_TABLE_INFO_NUM,
- ER_SPIDER_INVALID_REMOTE_TABLE_INFO_STR, MYF(0),
- mysql_share->db_names_str[spider->conn_link_idx[link_idx]].ptr(),
- mysql_share->table_names_str[spider->conn_link_idx[
- link_idx]].ptr());
- break;
- default:
- break;
- }
- DBUG_RETURN(error_num);
- }
- } else {
- pthread_mutex_assert_not_owner(&conn->mta_conn_mutex);
- pthread_mutex_lock(&conn->mta_conn_mutex);
- SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
- conn->need_mon = &spider->need_mons[link_idx];
- DBUG_ASSERT(!conn->mta_conn_mutex_lock_already);
- DBUG_ASSERT(!conn->mta_conn_mutex_unlock_later);
- conn->mta_conn_mutex_lock_already = TRUE;
- conn->mta_conn_mutex_unlock_later = TRUE;
- conn->disable_connect_retry = TRUE;
- spider_conn_set_timeout_from_share(conn, link_idx,
- spider->wide_handler->trx->thd,
- share);
- if (
- (error_num = spider_db_set_names(spider, conn, link_idx)) ||
- (
- spider_db_query(
- conn,
- mysql_share->show_table_status[1 + pos].ptr(),
- mysql_share->show_table_status[1 + pos].length(),
- -1,
- &spider->need_mons[link_idx]) &&
- (error_num = spider_db_errorno(conn))
- )
- ) {
- if (
- error_num == ER_SPIDER_REMOTE_SERVER_GONE_AWAY_NUM &&
- !conn->disable_reconnect
- ) {
- /* retry */
- if ((error_num = spider_db_ping(spider, conn, link_idx)))
- {
- conn->disable_connect_retry = FALSE;
- DBUG_ASSERT(conn->mta_conn_mutex_lock_already);
- DBUG_ASSERT(conn->mta_conn_mutex_unlock_later);
- conn->mta_conn_mutex_lock_already = FALSE;
- conn->mta_conn_mutex_unlock_later = FALSE;
- SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos);
- pthread_mutex_unlock(&conn->mta_conn_mutex);
- DBUG_RETURN(error_num);
- }
- if ((error_num = spider_db_set_names(spider, conn, link_idx)))
- {
- conn->disable_connect_retry = FALSE;
- DBUG_ASSERT(conn->mta_conn_mutex_lock_already);
- DBUG_ASSERT(conn->mta_conn_mutex_unlock_later);
- conn->mta_conn_mutex_lock_already = FALSE;
- conn->mta_conn_mutex_unlock_later = FALSE;
- SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos);
- pthread_mutex_unlock(&conn->mta_conn_mutex);
- DBUG_RETURN(error_num);
- }
- spider_conn_set_timeout_from_share(conn, link_idx,
- spider->wide_handler->trx->thd,
- share);
- if (spider_db_query(
- conn,
- mysql_share->show_table_status[1 + pos].ptr(),
- mysql_share->show_table_status[1 + pos].length(),
- -1,
- &spider->need_mons[link_idx])
- ) {
- conn->disable_connect_retry = FALSE;
- DBUG_ASSERT(conn->mta_conn_mutex_lock_already);
- DBUG_ASSERT(conn->mta_conn_mutex_unlock_later);
- conn->mta_conn_mutex_lock_already = FALSE;
- conn->mta_conn_mutex_unlock_later = FALSE;
- DBUG_RETURN(spider_db_errorno(conn));
- }
- } else {
- conn->disable_connect_retry = FALSE;
- DBUG_ASSERT(conn->mta_conn_mutex_lock_already);
- DBUG_ASSERT(conn->mta_conn_mutex_unlock_later);
- conn->mta_conn_mutex_lock_already = FALSE;
- conn->mta_conn_mutex_unlock_later = FALSE;
- SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos);
- pthread_mutex_unlock(&conn->mta_conn_mutex);
- DBUG_RETURN(error_num);
- }
- }
- st_spider_db_request_key request_key;
- request_key.spider_thread_id = spider->wide_handler->trx->spider_thread_id;
- request_key.query_id = spider->wide_handler->trx->thd->query_id;
- request_key.handler = spider;
- request_key.request_id = 1;
- request_key.next = NULL;
- if (spider_param_dry_access())
- {
- conn->disable_connect_retry = FALSE;
- DBUG_ASSERT(conn->mta_conn_mutex_lock_already);
- DBUG_ASSERT(conn->mta_conn_mutex_unlock_later);
- conn->mta_conn_mutex_lock_already = FALSE;
- conn->mta_conn_mutex_unlock_later = FALSE;
- SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos);
- pthread_mutex_unlock(&conn->mta_conn_mutex);
- DBUG_RETURN(0);
- }
- if (!(res = conn->db_conn->store_result(NULL, &request_key, &error_num)))
+ } else /* get from information schema */
{
- conn->disable_connect_retry = FALSE;
- DBUG_ASSERT(conn->mta_conn_mutex_lock_already);
- DBUG_ASSERT(conn->mta_conn_mutex_unlock_later);
- conn->mta_conn_mutex_lock_already = FALSE;
- conn->mta_conn_mutex_unlock_later = FALSE;
- if (error_num || (error_num = spider_db_errorno(conn)))
+ spider_teardown_after_query(conn, error_num, false);
+ if (error_num || (error_num= spider_db_errorno(conn)))
DBUG_RETURN(error_num);
else
DBUG_RETURN(ER_QUERY_ON_FOREIGN_DATA_SOURCE);
}
- conn->disable_connect_retry = FALSE;
- DBUG_ASSERT(conn->mta_conn_mutex_lock_already);
- DBUG_ASSERT(conn->mta_conn_mutex_unlock_later);
- conn->mta_conn_mutex_lock_already = FALSE;
- conn->mta_conn_mutex_unlock_later = FALSE;
- SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos);
- pthread_mutex_unlock(&conn->mta_conn_mutex);
- error_num = res->fetch_table_status(
- sts_mode,
- share->stat
- );
- auto_increment_value = share->stat.auto_increment_value;
- res->free_result();
- delete res;
- if (error_num)
+ }
+ spider_teardown_after_query(conn, 0, true);
+ /* Fetches query results into share->stat. */
+ error_num = res->fetch_table_status(sts_mode, share->stat);
+ auto_increment_value = share->stat.auto_increment_value;
+ res->free_result();
+ delete res;
+ if (error_num)
+ {
+ switch (error_num)
{
- switch (error_num)
- {
- case ER_SPIDER_REMOTE_TABLE_NOT_FOUND_NUM:
- my_printf_error(ER_SPIDER_REMOTE_TABLE_NOT_FOUND_NUM,
- ER_SPIDER_REMOTE_TABLE_NOT_FOUND_STR, MYF(0),
- mysql_share->db_names_str[spider->conn_link_idx[link_idx]].ptr(),
- mysql_share->table_names_str[spider->conn_link_idx[
- link_idx]].ptr());
- break;
- case ER_SPIDER_INVALID_REMOTE_TABLE_INFO_NUM:
- my_printf_error(ER_SPIDER_INVALID_REMOTE_TABLE_INFO_NUM,
- ER_SPIDER_INVALID_REMOTE_TABLE_INFO_STR, MYF(0),
- mysql_share->db_names_str[spider->conn_link_idx[link_idx]].ptr(),
- mysql_share->table_names_str[spider->conn_link_idx[
- link_idx]].ptr());
- break;
- default:
- break;
- }
- DBUG_RETURN(error_num);
+ case ER_SPIDER_REMOTE_TABLE_NOT_FOUND_NUM:
+ my_printf_error(
+ ER_SPIDER_REMOTE_TABLE_NOT_FOUND_NUM,
+ ER_SPIDER_REMOTE_TABLE_NOT_FOUND_STR, MYF(0),
+ mysql_share->db_names_str[spider->conn_link_idx[link_idx]].ptr(),
+ mysql_share->table_names_str[spider->conn_link_idx[link_idx]].ptr());
+ break;
+ case ER_SPIDER_INVALID_REMOTE_TABLE_INFO_NUM:
+ my_printf_error(
+ ER_SPIDER_INVALID_REMOTE_TABLE_INFO_NUM,
+ ER_SPIDER_INVALID_REMOTE_TABLE_INFO_STR, MYF(0),
+ mysql_share->db_names_str[spider->conn_link_idx[link_idx]].ptr(),
+ mysql_share->table_names_str[spider->conn_link_idx[link_idx]].ptr());
+ break;
+ default:
+ break;
}
+ DBUG_RETURN(error_num);
}
if ((error_num = ((spider_db_mbase *) conn->db_conn)->fetch_and_print_warnings(NULL)))
{
+ ((spider_db_mbase *) conn->db_conn)->reset_lock_wait_timeout();
+ if (error_num == ER_LOCK_WAIT_TIMEOUT)
+ {
+ error_num = ER_SPIDER_TABLE_OPEN_LOCK_WAIT_TIMEOUT_NUM;
+ my_printf_error(
+ ER_SPIDER_TABLE_OPEN_LOCK_WAIT_TIMEOUT_NUM,
+ ER_SPIDER_TABLE_OPEN_LOCK_WAIT_TIMEOUT_STR, MYF(0),
+ mysql_share->db_names_str[spider->conn_link_idx[link_idx]].ptr(),
+ mysql_share->table_names_str[spider->conn_link_idx[link_idx]].ptr());
+ }
DBUG_RETURN(error_num);
}
+ if ((error_num =
+ ((spider_db_mbase *) conn->db_conn)->reset_lock_wait_timeout()))
+ DBUG_RETURN(error_num);
if (share->static_records_for_status != -1)
- {
share->stat.records = (ha_rows) share->static_records_for_status;
- }
if (share->static_mean_rec_length != -1)
- {
share->stat.mean_rec_length = (ulong) share->static_mean_rec_length;
- }
if (auto_increment_value > share->lgtm_tblhnd_share->auto_increment_value)
{
share->lgtm_tblhnd_share->auto_increment_value = auto_increment_value;
@@ -13534,314 +13373,105 @@ int spider_mbase_handler::show_index(
SPIDER_SHARE *share = spider->share;
TABLE *table = spider->get_table();
SPIDER_DB_RESULT *res;
- int roop_count;
- longlong *tmp_cardinality;
- uint pos = (2 * spider->conn_link_idx[link_idx]);
+ int field;
+ longlong *tmp_crd;
+ const uint pos = 2 * spider->conn_link_idx[link_idx] +
+ (crd_mode == 1 ? 0 : 1);
DBUG_ENTER("spider_mbase_handler::show_index");
DBUG_PRINT("info",("spider crd_mode=%d", crd_mode));
- if (crd_mode == 1)
+ spider_setup_for_query(spider, conn, link_idx);
+ spider_conn_set_timeout_from_share(conn, link_idx,
+ spider->wide_handler->trx->thd, share);
+ if ((error_num = spider_db_set_names(spider, conn, link_idx)) ||
+ (error_num =
+ spider_set_lock_wait_timeout(1, conn, &spider->need_mons[link_idx])) ||
+ (spider_db_query(
+ conn,
+ mysql_share->show_index[pos].ptr(),
+ mysql_share->show_index[pos].length(),
+ -1,
+ &spider->need_mons[link_idx]) &&
+ (error_num = spider_db_errorno(conn))))
{
- pthread_mutex_assert_not_owner(&conn->mta_conn_mutex);
- pthread_mutex_lock(&conn->mta_conn_mutex);
- SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
- conn->need_mon = &spider->need_mons[link_idx];
- DBUG_ASSERT(!conn->mta_conn_mutex_lock_already);
- DBUG_ASSERT(!conn->mta_conn_mutex_unlock_later);
- conn->mta_conn_mutex_lock_already = TRUE;
- conn->mta_conn_mutex_unlock_later = TRUE;
- spider_conn_set_timeout_from_share(conn, link_idx,
- spider->wide_handler->trx->thd,
- share);
- if (
- (error_num = spider_db_set_names(spider, conn, link_idx)) ||
- (
- spider_db_query(
- conn,
- mysql_share->show_index[0 + pos].ptr(),
- mysql_share->show_index[0 + pos].length(),
- -1,
- &spider->need_mons[link_idx]) &&
- (error_num = spider_db_errorno(conn))
- )
- ) {
- if (
- error_num == ER_SPIDER_REMOTE_SERVER_GONE_AWAY_NUM &&
- !conn->disable_reconnect
- ) {
- /* retry */
- if ((error_num = spider_db_ping(spider, conn, link_idx)))
- {
- DBUG_ASSERT(conn->mta_conn_mutex_lock_already);
- DBUG_ASSERT(conn->mta_conn_mutex_unlock_later);
- conn->mta_conn_mutex_lock_already = FALSE;
- conn->mta_conn_mutex_unlock_later = FALSE;
- SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos);
- pthread_mutex_unlock(&conn->mta_conn_mutex);
- DBUG_RETURN(error_num);
- }
- if ((error_num = spider_db_set_names(spider, conn, link_idx)))
- {
- DBUG_ASSERT(conn->mta_conn_mutex_lock_already);
- DBUG_ASSERT(conn->mta_conn_mutex_unlock_later);
- conn->mta_conn_mutex_lock_already = FALSE;
- conn->mta_conn_mutex_unlock_later = FALSE;
- SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos);
- pthread_mutex_unlock(&conn->mta_conn_mutex);
- DBUG_RETURN(error_num);
- }
- spider_conn_set_timeout_from_share(conn, link_idx,
- spider->wide_handler->trx->thd,
- share);
- if (spider_db_query(
- conn,
- mysql_share->show_index[0 + pos].ptr(),
- mysql_share->show_index[0 + pos].length(),
- -1,
- &spider->need_mons[link_idx])
- ) {
- DBUG_ASSERT(conn->mta_conn_mutex_lock_already);
- DBUG_ASSERT(conn->mta_conn_mutex_unlock_later);
- conn->mta_conn_mutex_lock_already = FALSE;
- conn->mta_conn_mutex_unlock_later = FALSE;
- DBUG_RETURN(spider_db_errorno(conn));
- }
- } else {
- DBUG_ASSERT(conn->mta_conn_mutex_lock_already);
- DBUG_ASSERT(conn->mta_conn_mutex_unlock_later);
- conn->mta_conn_mutex_lock_already = FALSE;
- conn->mta_conn_mutex_unlock_later = FALSE;
- SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos);
- pthread_mutex_unlock(&conn->mta_conn_mutex);
- DBUG_RETURN(error_num);
- }
- }
- st_spider_db_request_key request_key;
- request_key.spider_thread_id = spider->wide_handler->trx->spider_thread_id;
- request_key.query_id = spider->wide_handler->trx->thd->query_id;
- request_key.handler = spider;
- request_key.request_id = 1;
- request_key.next = NULL;
- if (!(res = conn->db_conn->store_result(NULL, &request_key, &error_num)))
- {
- if (error_num || (error_num = spider_db_errorno(conn)))
- {
- DBUG_ASSERT(conn->mta_conn_mutex_lock_already);
- DBUG_ASSERT(conn->mta_conn_mutex_unlock_later);
- conn->mta_conn_mutex_lock_already = FALSE;
- conn->mta_conn_mutex_unlock_later = FALSE;
- SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos);
- pthread_mutex_unlock(&conn->mta_conn_mutex);
- DBUG_RETURN(error_num);
- }
- /* no record is ok */
- }
- DBUG_ASSERT(conn->mta_conn_mutex_lock_already);
- DBUG_ASSERT(conn->mta_conn_mutex_unlock_later);
- conn->mta_conn_mutex_lock_already = FALSE;
- conn->mta_conn_mutex_unlock_later = FALSE;
- SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos);
- pthread_mutex_unlock(&conn->mta_conn_mutex);
- if (res)
- {
- error_num = res->fetch_table_cardinality(
- crd_mode,
- table,
- share->cardinality,
- share->cardinality_upd,
- share->bitmap_size
- );
- }
- for (roop_count = 0, tmp_cardinality = share->cardinality;
- roop_count < (int) table->s->fields;
- roop_count++, tmp_cardinality++)
+ if (error_num == ER_SPIDER_REMOTE_SERVER_GONE_AWAY_NUM &&
+ !conn->disable_reconnect)
{
- if (!spider_bit_is_set(share->cardinality_upd, roop_count))
- {
- DBUG_PRINT("info",
- ("spider uninitialized column cardinality id=%d", roop_count));
- *tmp_cardinality = -1;
- }
- }
- if (res)
- {
- res->free_result();
- delete res;
- }
- if (error_num)
- {
- switch (error_num)
- {
- case ER_SPIDER_REMOTE_TABLE_NOT_FOUND_NUM:
- my_printf_error(ER_SPIDER_REMOTE_TABLE_NOT_FOUND_NUM,
- ER_SPIDER_REMOTE_TABLE_NOT_FOUND_STR, MYF(0),
- mysql_share->db_names_str[spider->conn_link_idx[link_idx]].ptr(),
- mysql_share->table_names_str[spider->conn_link_idx[
- link_idx]].ptr());
- break;
- case ER_SPIDER_INVALID_REMOTE_TABLE_INFO_NUM:
- my_printf_error(ER_SPIDER_INVALID_REMOTE_TABLE_INFO_NUM,
- ER_SPIDER_INVALID_REMOTE_TABLE_INFO_STR, MYF(0),
- mysql_share->db_names_str[spider->conn_link_idx[link_idx]].ptr(),
- mysql_share->table_names_str[spider->conn_link_idx[
- link_idx]].ptr());
- break;
- default:
- break;
- }
- DBUG_RETURN(error_num);
- }
- } else {
- pthread_mutex_assert_not_owner(&conn->mta_conn_mutex);
- pthread_mutex_lock(&conn->mta_conn_mutex);
- SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
- conn->need_mon = &spider->need_mons[link_idx];
- DBUG_ASSERT(!conn->mta_conn_mutex_lock_already);
- DBUG_ASSERT(!conn->mta_conn_mutex_unlock_later);
- conn->mta_conn_mutex_lock_already = TRUE;
- conn->mta_conn_mutex_unlock_later = TRUE;
- spider_conn_set_timeout_from_share(conn, link_idx,
- spider->wide_handler->trx->thd,
- share);
- if (
- (error_num = spider_db_set_names(spider, conn, link_idx)) ||
- (
- spider_db_query(
- conn,
- mysql_share->show_index[1 + pos].ptr(),
- mysql_share->show_index[1 + pos].length(),
- -1,
- &spider->need_mons[link_idx]) &&
- (error_num = spider_db_errorno(conn))
- )
- ) {
- if (
- error_num == ER_SPIDER_REMOTE_SERVER_GONE_AWAY_NUM &&
- !conn->disable_reconnect
- ) {
- /* retry */
- if ((error_num = spider_db_ping(spider, conn, link_idx)))
- {
- DBUG_ASSERT(conn->mta_conn_mutex_lock_already);
- DBUG_ASSERT(conn->mta_conn_mutex_unlock_later);
- conn->mta_conn_mutex_lock_already = FALSE;
- conn->mta_conn_mutex_unlock_later = FALSE;
- SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos);
- pthread_mutex_unlock(&conn->mta_conn_mutex);
- DBUG_RETURN(error_num);
- }
- if ((error_num = spider_db_set_names(spider, conn, link_idx)))
- {
- DBUG_ASSERT(conn->mta_conn_mutex_lock_already);
- DBUG_ASSERT(conn->mta_conn_mutex_unlock_later);
- conn->mta_conn_mutex_lock_already = FALSE;
- conn->mta_conn_mutex_unlock_later = FALSE;
- SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos);
- pthread_mutex_unlock(&conn->mta_conn_mutex);
- DBUG_RETURN(error_num);
- }
- spider_conn_set_timeout_from_share(conn, link_idx,
- spider->wide_handler->trx->thd,
- share);
- if (spider_db_query(
- conn,
- mysql_share->show_index[1 + pos].ptr(),
- mysql_share->show_index[1 + pos].length(),
- -1,
- &spider->need_mons[link_idx])
- ) {
- DBUG_ASSERT(conn->mta_conn_mutex_lock_already);
- DBUG_ASSERT(conn->mta_conn_mutex_unlock_later);
- conn->mta_conn_mutex_lock_already = FALSE;
- conn->mta_conn_mutex_unlock_later = FALSE;
- DBUG_RETURN(spider_db_errorno(conn));
- }
- } else {
- DBUG_ASSERT(conn->mta_conn_mutex_lock_already);
- DBUG_ASSERT(conn->mta_conn_mutex_unlock_later);
- conn->mta_conn_mutex_lock_already = FALSE;
- conn->mta_conn_mutex_unlock_later = FALSE;
- SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos);
- pthread_mutex_unlock(&conn->mta_conn_mutex);
- DBUG_RETURN(error_num);
- }
- }
- st_spider_db_request_key request_key;
- request_key.spider_thread_id = spider->wide_handler->trx->spider_thread_id;
- request_key.query_id = spider->wide_handler->trx->thd->query_id;
- request_key.handler = spider;
- request_key.request_id = 1;
- request_key.next = NULL;
- if (!(res = conn->db_conn->store_result(NULL, &request_key, &error_num)))
- {
- if (error_num || (error_num = spider_db_errorno(conn)))
- {
- DBUG_ASSERT(conn->mta_conn_mutex_lock_already);
- DBUG_ASSERT(conn->mta_conn_mutex_unlock_later);
- conn->mta_conn_mutex_lock_already = FALSE;
- conn->mta_conn_mutex_unlock_later = FALSE;
- SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos);
- pthread_mutex_unlock(&conn->mta_conn_mutex);
- DBUG_RETURN(error_num);
- }
- /* no record is ok */
- }
- DBUG_ASSERT(conn->mta_conn_mutex_lock_already);
- DBUG_ASSERT(conn->mta_conn_mutex_unlock_later);
- conn->mta_conn_mutex_lock_already = FALSE;
- conn->mta_conn_mutex_unlock_later = FALSE;
- SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos);
- pthread_mutex_unlock(&conn->mta_conn_mutex);
- if (res)
- {
- error_num = res->fetch_table_cardinality(
- crd_mode,
- table,
- share->cardinality,
- share->cardinality_upd,
- share->bitmap_size
- );
- }
- for (roop_count = 0, tmp_cardinality = share->cardinality;
- roop_count < (int) table->s->fields;
- roop_count++, tmp_cardinality++)
- {
- if (!spider_bit_is_set(share->cardinality_upd, roop_count))
+ /* retry */
+ if ((error_num = spider_db_ping(spider, conn, link_idx)))
+ DBUG_RETURN(spider_teardown_after_query(conn, error_num, true));
+ if ((error_num = spider_db_set_names(spider, conn, link_idx)))
+ DBUG_RETURN(spider_teardown_after_query(conn, error_num, true));
+ spider_conn_set_timeout_from_share(conn, link_idx,
+ spider->wide_handler->trx->thd,
+ share);
+ if ((error_num =
+ spider_set_lock_wait_timeout(1, conn, &spider->need_mons[link_idx])))
+ DBUG_RETURN(spider_teardown_after_query(conn, error_num, true));
+ if (spider_db_query(
+ conn,
+ mysql_share->show_index[pos].ptr(),
+ mysql_share->show_index[pos].length(),
+ -1,
+ &spider->need_mons[link_idx]))
{
- DBUG_PRINT("info",
- ("spider uninitialized column cardinality id=%d", roop_count));
- *tmp_cardinality = -1;
+ spider_teardown_after_query(conn, 0, false);
+ DBUG_RETURN(spider_db_errorno(conn));
}
- }
- if (res)
- {
- res->free_result();
- delete res;
- }
- if (error_num)
+ } else
+ DBUG_RETURN(spider_teardown_after_query(conn, error_num, true));
+ }
+ st_spider_db_request_key request_key = {
+ spider->wide_handler->trx->spider_thread_id,
+ spider->wide_handler->trx->thd->query_id, spider, 1, NULL};
+ /* no record is ok */
+ if (!(res = conn->db_conn->store_result(NULL, &request_key, &error_num)) &&
+ (error_num || (error_num = spider_db_errorno(conn))))
+ DBUG_RETURN(spider_teardown_after_query(conn, error_num, true));
+ spider_teardown_after_query(conn, 0, true);
+ if (res)
+ error_num = res->fetch_table_cardinality(
+ crd_mode, table, share->cardinality, share->cardinality_upd,
+ share->bitmap_size);
+ for (field = 0, tmp_crd = share->cardinality;
+ field < (int) table->s->fields;
+ field++, tmp_crd++)
+ {
+ if (!spider_bit_is_set(share->cardinality_upd, field))
{
- switch (error_num)
- {
- case ER_SPIDER_REMOTE_TABLE_NOT_FOUND_NUM:
- my_printf_error(ER_SPIDER_REMOTE_TABLE_NOT_FOUND_NUM,
- ER_SPIDER_REMOTE_TABLE_NOT_FOUND_STR, MYF(0),
- mysql_share->db_names_str[spider->conn_link_idx[link_idx]].ptr(),
- mysql_share->table_names_str[spider->conn_link_idx[
- link_idx]].ptr());
- break;
- case ER_SPIDER_INVALID_REMOTE_TABLE_INFO_NUM:
- my_printf_error(ER_SPIDER_INVALID_REMOTE_TABLE_INFO_NUM,
- ER_SPIDER_INVALID_REMOTE_TABLE_INFO_STR, MYF(0),
- mysql_share->db_names_str[spider->conn_link_idx[link_idx]].ptr(),
- mysql_share->table_names_str[spider->conn_link_idx[
- link_idx]].ptr());
- break;
- default:
- break;
- }
- DBUG_RETURN(error_num);
+ DBUG_PRINT("info",
+ ("spider uninitialized column cardinality id=%d", field));
+ *tmp_crd = -1;
}
}
- DBUG_RETURN(0);
+ if (res)
+ {
+ res->free_result();
+ delete res;
+ }
+ switch (error_num)
+ {
+ case ER_SPIDER_REMOTE_TABLE_NOT_FOUND_NUM:
+ my_printf_error(
+ ER_SPIDER_REMOTE_TABLE_NOT_FOUND_NUM,
+ ER_SPIDER_REMOTE_TABLE_NOT_FOUND_STR, MYF(0),
+ mysql_share->db_names_str[spider->conn_link_idx[link_idx]].ptr(),
+ mysql_share->table_names_str[spider->conn_link_idx[link_idx]].ptr());
+ break;
+ case ER_SPIDER_INVALID_REMOTE_TABLE_INFO_NUM:
+ my_printf_error(
+ ER_SPIDER_INVALID_REMOTE_TABLE_INFO_NUM,
+ ER_SPIDER_INVALID_REMOTE_TABLE_INFO_STR, MYF(0),
+ mysql_share->db_names_str[spider->conn_link_idx[link_idx]].ptr(),
+ mysql_share->table_names_str[spider->conn_link_idx[link_idx]].ptr());
+ break;
+ default:
+ break;
+ }
+ if (!error_num)
+ error_num = ((spider_db_mbase *) conn->db_conn)->reset_lock_wait_timeout();
+ else
+ ((spider_db_mbase *) conn->db_conn)->reset_lock_wait_timeout();
+ DBUG_RETURN(error_num);
}
int spider_mbase_handler::simple_action(
@@ -14345,8 +13975,7 @@ int spider_mbase_handler::disable_keys(
DBUG_ENTER("spider_mbase_handler::disable_keys");
DBUG_PRINT("info",("spider this=%p", this));
str->length(0);
- if ((error_num = append_disable_keys_part(SPIDER_SQL_TYPE_OTHER_HS,
- link_idx)))
+ if ((error_num= append_disable_keys_part(link_idx)))
{
DBUG_RETURN(error_num);
}
@@ -14404,8 +14033,7 @@ int spider_mbase_handler::enable_keys(
DBUG_ENTER("spider_mbase_handler::enable_keys");
DBUG_PRINT("info",("spider this=%p", this));
str->length(0);
- if ((error_num = append_enable_keys_part(SPIDER_SQL_TYPE_OTHER_HS,
- link_idx)))
+ if ((error_num= append_enable_keys_part(link_idx)))
{
DBUG_RETURN(error_num);
}
@@ -14464,8 +14092,7 @@ int spider_mbase_handler::check_table(
DBUG_ENTER("spider_mbase_handler::check_table");
DBUG_PRINT("info",("spider this=%p", this));
str->length(0);
- if ((error_num = append_check_table_part(SPIDER_SQL_TYPE_OTHER_HS,
- link_idx, check_opt)))
+ if ((error_num= append_check_table_part(link_idx, check_opt)))
{
DBUG_RETURN(error_num);
}
@@ -14524,8 +14151,7 @@ int spider_mbase_handler::repair_table(
DBUG_ENTER("spider_mbase_handler::repair_table");
DBUG_PRINT("info",("spider this=%p", this));
str->length(0);
- if ((error_num = append_repair_table_part(SPIDER_SQL_TYPE_OTHER_HS,
- link_idx, check_opt)))
+ if ((error_num= append_repair_table_part(link_idx, check_opt)))
{
DBUG_RETURN(error_num);
}
@@ -14583,8 +14209,7 @@ int spider_mbase_handler::analyze_table(
DBUG_ENTER("spider_mbase_handler::analyze_table");
DBUG_PRINT("info",("spider this=%p", this));
str->length(0);
- if ((error_num = append_analyze_table_part(SPIDER_SQL_TYPE_OTHER_HS,
- link_idx)))
+ if ((error_num= append_analyze_table_part(link_idx)))
{
DBUG_RETURN(error_num);
}
@@ -14642,8 +14267,7 @@ int spider_mbase_handler::optimize_table(
DBUG_ENTER("spider_mbase_handler::optimize_table");
DBUG_PRINT("info",("spider this=%p", this));
str->length(0);
- if ((error_num = append_optimize_table_part(SPIDER_SQL_TYPE_OTHER_HS,
- link_idx)))
+ if ((error_num= append_optimize_table_part(link_idx)))
{
DBUG_RETURN(error_num);
}
@@ -14702,8 +14326,7 @@ int spider_mbase_handler::flush_tables(
DBUG_ENTER("spider_mbase_handler::flush_tables");
DBUG_PRINT("info",("spider this=%p", this));
str->length(0);
- if ((error_num = append_flush_tables_part(SPIDER_SQL_TYPE_OTHER_HS,
- link_idx, lock)))
+ if ((error_num= append_flush_tables_part(link_idx, lock)))
{
DBUG_RETURN(error_num);
}
diff --git a/storage/spider/spd_db_mysql.h b/storage/spider/spd_db_mysql.h
index 50b21117..a8fa3312 100644
--- a/storage/spider/spd_db_mysql.h
+++ b/storage/spider/spd_db_mysql.h
@@ -509,6 +509,10 @@ public:
int wait_timeout,
int *need_mon
);
+
+ /** Reset the global lock wait time out */
+ int reset_lock_wait_timeout();
+
bool set_sql_mode_in_bulk_sql();
int set_sql_mode(
sql_mode_t sql_mode,
@@ -1206,64 +1210,40 @@ public:
ulong sql_type,
int link_idx
);
- int append_flush_tables_part(
- ulong sql_type,
- int link_idx,
- bool lock
- );
+ int append_flush_tables_part(int link_idx, bool lock);
int append_flush_tables(
spider_string *str,
int link_idx,
bool lock
);
- int append_optimize_table_part(
- ulong sql_type,
- int link_idx
- );
+ int append_optimize_table_part(int link_idx);
int append_optimize_table(
spider_string *str,
int link_idx
);
- int append_analyze_table_part(
- ulong sql_type,
- int link_idx
- );
+ int append_analyze_table_part(int link_idx);
int append_analyze_table(
spider_string *str,
int link_idx
);
- int append_repair_table_part(
- ulong sql_type,
- int link_idx,
- HA_CHECK_OPT* check_opt
- );
+ int append_repair_table_part(int link_idx, HA_CHECK_OPT *check_opt);
int append_repair_table(
spider_string *str,
int link_idx,
HA_CHECK_OPT* check_opt
);
- int append_check_table_part(
- ulong sql_type,
- int link_idx,
- HA_CHECK_OPT* check_opt
- );
+ int append_check_table_part(int link_idx, HA_CHECK_OPT *check_opt);
int append_check_table(
spider_string *str,
int link_idx,
HA_CHECK_OPT* check_opt
);
- int append_enable_keys_part(
- ulong sql_type,
- int link_idx
- );
+ int append_enable_keys_part(int link_idx);
int append_enable_keys(
spider_string *str,
int link_idx
);
- int append_disable_keys_part(
- ulong sql_type,
- int link_idx
- );
+ int append_disable_keys_part(int link_idx);
int append_disable_keys(
spider_string *str,
int link_idx
diff --git a/storage/spider/spd_direct_sql.cc b/storage/spider/spd_direct_sql.cc
index 89c872ee..6d0af8cc 100644
--- a/storage/spider/spd_direct_sql.cc
+++ b/storage/spider/spd_direct_sql.cc
@@ -512,7 +512,6 @@ SPIDER_CONN *spider_udf_direct_sql_create_conn(
conn->semi_trx_isolation = -2;
conn->semi_trx_isolation_chk = FALSE;
conn->semi_trx_chk = FALSE;
- conn->conn_kind = SPIDER_CONN_KIND_MYSQL;
if (mysql_mutex_init(spd_key_mutex_mta_conn, &conn->mta_conn_mutex,
MY_MUTEX_INIT_FAST))
@@ -658,7 +657,6 @@ SPIDER_CONN *spider_udf_direct_sql_get_conn(
conn->queued_ping = FALSE;
DBUG_PRINT("info",("spider conn=%p", conn));
- DBUG_PRINT("info",("spider conn->conn_kind=%u", conn->conn_kind));
DBUG_RETURN(conn);
error:
diff --git a/storage/spider/spd_err.h b/storage/spider/spd_err.h
index e9a4a419..823a367b 100644
--- a/storage/spider/spd_err.h
+++ b/storage/spider/spd_err.h
@@ -70,6 +70,10 @@
#define ER_SPIDER_INVALID_CONNECT_INFO_START_WITH_NUM_STR "The connect info '%-.64s' for %s cannot start with number"
#define ER_SPIDER_INVALID_CONNECT_INFO_SAME_NUM 12527
#define ER_SPIDER_INVALID_CONNECT_INFO_SAME_STR "The connect info '%-.64s' for %s cannot use same name in same table"
+#define ER_SPIDER_INVALID_TABLE_OPTION_NUM 12528
+#define ER_SPIDER_INVALID_TABLE_OPTION_STR "The table option %s=%s is invalid"
+#define ER_SPIDER_COMMENT_CONNECTION_IGNORED_BY_TABLE_OPTIONS_NUM 12529
+#define ER_SPIDER_COMMENT_CONNECTION_IGNORED_BY_TABLE_OPTIONS_STR "The table or partition COMMENT or CONNECTION string '%s' is not used as connection info because spider_ignore_comment is 1 or at least one table option has been specified"
#define ER_SPIDER_CANT_USE_BOTH_INNER_XA_AND_SNAPSHOT_NUM 12601
#define ER_SPIDER_CANT_USE_BOTH_INNER_XA_AND_SNAPSHOT_STR "Can't use both spider_use_consistent_snapshot = 1 and spider_internal_xa = 1"
@@ -134,6 +138,8 @@
#define ER_SPIDER_SAME_SERVER_LINK_STR2 "Host:%s and Port:%ld aim self server. Please change spider_same_server_link parameter if this link is required."
#define ER_SPIDER_CANT_NUM 12721
#define ER_SPIDER_CANT_STR1 "Can't %s%d"
+#define ER_SPIDER_TABLE_OPEN_LOCK_WAIT_TIMEOUT_NUM 12722
+#define ER_SPIDER_TABLE_OPEN_LOCK_WAIT_TIMEOUT_STR "Table %s.%s open lock wait timeout. Please check for self-reference."
#define ER_SPIDER_COND_SKIP_NUM 12801
#define ER_SPIDER_UNKNOWN_NUM 12500
diff --git a/storage/spider/spd_include.h b/storage/spider/spd_include.h
index 3828f19b..33fd26af 100644
--- a/storage/spider/spd_include.h
+++ b/storage/spider/spd_include.h
@@ -85,7 +85,6 @@
#define SPIDER_TEST(A) MY_TEST(A)
-#define SPIDER_FIELD_FIELDPTR_REQUIRES_THDPTR
#define SPIDER_ENGINE_CONDITION_PUSHDOWN_IS_ALWAYS_ON
#define SPIDER_Item_args_arg_count_IS_PROTECTED
@@ -108,7 +107,6 @@
#define SPIDER_read_record_read_record(A) read_record()
#define SPIDER_has_Item_with_subquery
-#define SPIDER_use_LEX_CSTRING_for_Field_blob_constructor
#define SPIDER_use_LEX_CSTRING_for_database_tablename_alias
#define SPIDER_THD_db_str(A) (A)->db.str
#define SPIDER_THD_db_length(A) (A)->db.length
@@ -150,9 +148,14 @@ typedef start_new_trans *SPIDER_Open_tables_backup;
#define spider_bit_is_set(BITMAP, BIT) \
(uint) ((BITMAP)[(BIT) / 8] & (1 << ((BIT) & 7)))
+/* Change status of the remote backend server link. */
+/* 0 Doesn't change status. */
#define SPIDER_LINK_STATUS_NO_CHANGE 0
+/* 1 Changes status to OK. */
#define SPIDER_LINK_STATUS_OK 1
+/* 2 Changes status to RECOVERY. */
#define SPIDER_LINK_STATUS_RECOVERY 2
+/* 3 Changes status to no more in group communication. */
#define SPIDER_LINK_STATUS_NG 3
#define SPIDER_LINK_MON_OK 0
@@ -599,7 +602,6 @@ typedef struct st_spider_conn_loop_check SPIDER_CONN_LOOP_CHECK;
/* database connection */
typedef struct st_spider_conn
{
- uint conn_kind;
char *conn_key;
uint conn_key_length;
my_hash_value_type conn_key_hash_value;
@@ -981,22 +983,30 @@ typedef struct st_spider_share
char *table_name;
uint table_name_length;
uint use_count;
+ /**
+ Probably equals `active_link_count`. See also commit ddff602 of
+ https://github.com/nayuta-yanagisawa/spider-history
+
+ FIXME: consider removing it and using `active_link_count` instead.
+ */
uint link_count;
+ /* Number of all links, i.e. all remote servers for the spider
+ table. */
uint all_link_count;
uint link_bitmap_size;
pthread_mutex_t mutex;
pthread_mutex_t sts_mutex;
pthread_mutex_t crd_mutex;
-/*
- pthread_mutex_t auto_increment_mutex;
-*/
TABLE_SHARE *table_share;
SPIDER_LGTM_TBLHND_SHARE *lgtm_tblhnd_share;
my_hash_value_type table_name_hash_value;
my_hash_value_type table_path_hash_value;
+ /* Whether the share has been initialised */
volatile bool init;
+ /* Whether an error occurred in initialisation of this share */
volatile bool init_error;
+ /* The time of the initialisation error */
volatile time_t init_error_time;
volatile bool link_status_init;
uchar *table_mon_mutex_bitmap;
@@ -1052,10 +1062,6 @@ typedef struct st_spider_share
MEM_ROOT mem_root;
-/*
- volatile bool auto_increment_init;
- volatile ulonglong auto_increment_lclval;
-*/
ha_statistics stat;
longlong static_records_for_status;
@@ -1070,17 +1076,27 @@ typedef struct st_spider_share
longlong additional_table_flags;
bool have_recovery_link;
+ /** See `mysql_sysvar_sts_bg_mode` */
int sts_bg_mode;
+ /** See `mysql_sysvar_sts_interval` */
double sts_interval;
+ /** See `mysql_sysvar_sts_mode` */
int sts_mode;
+ /** See `mysql_sysvar_sts_sync` */
int sts_sync;
int store_last_sts;
+ /** See `mysql_sysvar_load_sts_at_startup` */
int load_sts_at_startup;
+ /** See `mysql_sysvar_crd_bg_mode` */
int crd_bg_mode;
+ /** See `mysql_sysvar_crd_interval` */
double crd_interval;
+ /** See `mysql_sysvar_crd_mode` */
int crd_mode;
+ /** See `mysql_sysvar_crd_sync` */
int crd_sync;
int store_last_crd;
+ /** See `mysql_sysvar_load_crd_at_startup` */
int load_crd_at_startup;
int crd_type;
double crd_weight;
@@ -1118,6 +1134,7 @@ typedef struct st_spider_share
longlong bgs_second_read;
longlong first_read;
longlong second_read;
+ /** See `mysql_sysvar_auto_increment_mode` */
int auto_increment_mode;
int use_table_charset;
int use_pushdown_udf;
@@ -1128,6 +1145,8 @@ typedef struct st_spider_share
int read_only_mode;
int error_read_mode;
int error_write_mode;
+ /* Number of active remote servers, for use in load balancing read
+ connections */
int active_link_count;
#ifdef HA_CAN_FORCE_BULK_UPDATE
int force_bulk_update;
@@ -1150,6 +1169,8 @@ typedef struct st_spider_share
char **tgt_usernames;
char **tgt_passwords;
char **tgt_sockets;
+ /** The wrapper of target servers, each element has the same
+ possible values as `SPIDER_DBTON::wrapper` */
char **tgt_wrappers;
char **tgt_ssl_cas;
char **tgt_ssl_capaths;
@@ -1167,6 +1188,7 @@ typedef struct st_spider_share
char **conn_keys;
long *tgt_ports;
long *tgt_ssl_vscs;
+ /* See SPIDER_LINK_STATUS_* in spd_include.h */
long *link_statuses;
long *monitoring_bg_flag;
long *monitoring_bg_kind;
@@ -1179,6 +1201,7 @@ typedef struct st_spider_share
long *connect_timeouts;
long *net_read_timeouts;
long *net_write_timeouts;
+ /* Connection load balancing integer weight */
long *access_balances;
long *bka_table_name_types;
long *strict_group_bys;
@@ -1271,10 +1294,16 @@ typedef struct st_spider_share
uint bka_table_name_types_length;
uint strict_group_bys_length;
- /* for dbton */
+ /*
+ For dbton. A `SPIDER_SHARE` uses all `SPIDER_DBTON`s with the same
+ wrappers as any its `tgt_wrappers`
+ */
+ /* Specifies which dbtons of the `spider_dbton` to use */
uchar dbton_bitmap[spider_bitmap_size(SPIDER_DBTON_SIZE)];
spider_db_share *dbton_share[SPIDER_DBTON_SIZE];
+ /* Number of `SPIDER_DBTON`s used */
uint use_dbton_count;
+ /* Index of each `SPIDER_DBTON` in `spider_dbton` to use */
/* Actual size is `use_dbton_count'. Values are the indices of item
in `spider_dbton'. */
uint use_dbton_ids[SPIDER_DBTON_SIZE];
@@ -1297,14 +1326,23 @@ typedef struct st_spider_link_pack
int link_idx;
} SPIDER_LINK_PACK;
+/** A struct storing the initialisation error of a table. All
+instances are in `spider_init_error_tables` */
typedef struct st_spider_init_error_table
{
+ /* The associated table name */
char *table_name;
+ /* Length of the associated table name */
uint table_name_length;
+ /* Hash value of the associated table name for lookup */
my_hash_value_type table_name_hash_value;
+ /* Whether the error has a message */
bool init_error_with_message;
+ /* The error message */
char init_error_msg[MYSQL_ERRMSG_SIZE];
+ /* The error code */
volatile int init_error;
+ /* The error time */
volatile time_t init_error_time;
} SPIDER_INIT_ERROR_TABLE;
diff --git a/storage/spider/spd_malloc.cc b/storage/spider/spd_malloc.cc
index 5a7ef404..245ecd6c 100644
--- a/storage/spider/spd_malloc.cc
+++ b/storage/spider/spd_malloc.cc
@@ -861,7 +861,7 @@ bool spider_string::append(
DBUG_ASSERT(mem_calc_inited);
DBUG_ASSERT((!current_alloc_mem && !str.is_alloced()) ||
current_alloc_mem == str.alloced_length());
- bool res = str.append(ls);
+ bool res = str.append(*ls);
SPIDER_STRING_CALC_MEM;
DBUG_RETURN(res);
}
diff --git a/storage/spider/spd_param.cc b/storage/spider/spd_param.cc
index d86e8532..f05c08de 100644
--- a/storage/spider/spd_param.cc
+++ b/storage/spider/spd_param.cc
@@ -1450,7 +1450,7 @@ SPIDER_THDVAR_OVERRIDE_VALUE_FUNC(int, sts_mode)
/*
-1 :fallback to default
0 :No synchronization.
- 1 :Table state is synchronized when opening a table.
+ 1 :Table stat is synchronized when opening a table.
Then no synchronization.
2 :Synchronization.
*/
@@ -1565,7 +1565,7 @@ SPIDER_THDVAR_VALUE_FUNC(bool, local_lock_table)
static MYSQL_THDVAR_INT(
use_pushdown_udf, /* name */
PLUGIN_VAR_RQCMDARG, /* opt */
- "Remote server transmission existence when UDF is used at condition and \"engine_condition_pushdown=1\"", /* comment */
+ "Remote server transmission existence when UDF is used at condition", /* comment */
NULL, /* check */
NULL, /* update */
0, /* def */
@@ -2380,6 +2380,30 @@ static MYSQL_THDVAR_BOOL(
SPIDER_THDVAR_VALUE_FUNC(bool, disable_group_by_handler)
+static MYSQL_THDVAR_BOOL(
+ suppress_comment_ignored_warning,
+ PLUGIN_VAR_RQCMDARG,
+ "Whether to suppress warnings that table COMMENT or CONNECTION strings "
+ "are ignored due to specified table options",
+ NULL,
+ NULL,
+ FALSE
+);
+
+SPIDER_THDVAR_VALUE_FUNC(bool, suppress_comment_ignored_warning)
+
+static MYSQL_THDVAR_BOOL(
+ ignore_comments,
+ PLUGIN_VAR_RQCMDARG,
+ "Whether to unconditionally ignore COMMENT and CONNECTION strings "
+ "without checking whether table options are specified",
+ NULL,
+ NULL,
+ FALSE
+);
+
+SPIDER_THDVAR_VALUE_FUNC(bool, ignore_comments)
+
static struct st_mysql_storage_engine spider_storage_engine =
{ MYSQL_HANDLERTON_INTERFACE_VERSION };
@@ -2496,6 +2520,8 @@ static struct st_mysql_sys_var* spider_system_variables[] = {
MYSQL_SYSVAR(strict_group_by),
MYSQL_SYSVAR(direct_aggregate),
MYSQL_SYSVAR(disable_group_by_handler),
+ MYSQL_SYSVAR(suppress_comment_ignored_warning),
+ MYSQL_SYSVAR(ignore_comments),
NULL
};
diff --git a/storage/spider/spd_param.h b/storage/spider/spd_param.h
index 4c26e66c..84f0f118 100644
--- a/storage/spider/spd_param.h
+++ b/storage/spider/spd_param.h
@@ -316,7 +316,6 @@ my_bool spider_param_index_hint_pushdown(
);
uint spider_param_max_connections();
uint spider_param_conn_wait_timeout();
-uint spider_param_internal_lock_wait_timeout();
uint spider_param_log_result_errors();
uint spider_param_log_result_error_with_sql();
uint spider_param_internal_xa_id_type(
@@ -368,3 +367,5 @@ int spider_param_strict_group_by(
);
bool spider_param_direct_aggregate(THD *thd);
bool spider_param_disable_group_by_handler(THD *thd);
+bool spider_param_suppress_comment_ignored_warning(THD *thd);
+bool spider_param_ignore_comments(THD *thd);
diff --git a/storage/spider/spd_ping_table.cc b/storage/spider/spd_ping_table.cc
index 80b40c62..2597150d 100644
--- a/storage/spider/spd_ping_table.cc
+++ b/storage/spider/spd_ping_table.cc
@@ -304,7 +304,7 @@ int spider_get_ping_table_mon(
!(table_link_mon = spider_open_sys_table(
thd, SPIDER_SYS_LINK_MON_TABLE_NAME_STR,
SPIDER_SYS_LINK_MON_TABLE_NAME_LEN, FALSE, &open_tables_backup,
- need_lock, &error_num))
+ &error_num))
) {
my_error(error_num, MYF(0));
goto error;
@@ -428,8 +428,7 @@ create_table_mon:
error_num = spider_sys_index_next_same(table_link_mon, table_key);
} while (error_num == 0);
spider_sys_index_end(table_link_mon);
- spider_close_sys_table(thd, table_link_mon,
- &open_tables_backup, need_lock);
+ spider_sys_close_table(thd, &open_tables_backup);
table_link_mon = NULL;
table_mon_list->list_size = list_size;
@@ -445,8 +444,7 @@ create_table_mon:
error:
if (table_link_mon)
- spider_close_sys_table(thd, table_link_mon,
- &open_tables_backup, need_lock);
+ spider_sys_close_table(thd, &open_tables_backup);
table_mon = table_mon_list->first;
table_mon_list->first = NULL;
table_mon_list->current = NULL;
@@ -523,7 +521,7 @@ SPIDER_TABLE_MON_LIST *spider_get_ping_table_tgt(
if (
!(table_tables = spider_open_sys_table(
thd, SPIDER_SYS_TABLES_TABLE_NAME_STR,
- SPIDER_SYS_TABLES_TABLE_NAME_LEN, FALSE, &open_tables_backup, need_lock,
+ SPIDER_SYS_TABLES_TABLE_NAME_LEN, FALSE, &open_tables_backup,
error_num))
) {
my_error(*error_num, MYF(0));
@@ -559,13 +557,12 @@ SPIDER_TABLE_MON_LIST *spider_get_ping_table_tgt(
(*error_num = spider_get_sys_tables_connect_info(
table_tables, tmp_share, &mem_root)) ||
(*error_num = spider_get_sys_tables_link_status(
- table_tables, tmp_share, 0, &mem_root))
+ table_tables, tmp_share->link_statuses, &mem_root))
) {
table_tables->file->print_error(*error_num, MYF(0));
goto error;
}
- spider_close_sys_table(thd, table_tables,
- &open_tables_backup, need_lock);
+ spider_sys_close_table(thd, &open_tables_backup);
table_tables = NULL;
if (
@@ -627,8 +624,7 @@ error_receptor_mutex_init:
error_caller_mutex_init:
error:
if (table_tables)
- spider_close_sys_table(thd, table_tables,
- &open_tables_backup, need_lock);
+ spider_sys_close_table(thd, &open_tables_backup);
free_root(&mem_root, MYF(0));
if (table_mon_list)
{
@@ -645,11 +641,9 @@ SPIDER_CONN *spider_get_ping_table_tgt_conn(
) {
SPIDER_CONN *conn;
DBUG_ENTER("spider_get_ping_table_tgt_conn");
- if (
- !(conn = spider_get_conn(
- share, 0, share->conn_keys[0], trx, NULL, FALSE, FALSE,
- SPIDER_CONN_KIND_MYSQL, error_num))
- ) {
+ if (!(conn= spider_get_conn(share, 0, share->conn_keys[0], trx, NULL, FALSE,
+ FALSE, error_num)))
+ {
my_error(ER_CONNECT_TO_FOREIGN_DATA_SOURCE, MYF(0),
share->server_names[0]);
*error_num = ER_CONNECT_TO_FOREIGN_DATA_SOURCE;
@@ -844,11 +838,10 @@ int spider_get_ping_table_gtid_pos(
goto error_sys_index_end;
}
#ifdef SPIDER_REQUIRE_DEFINE_FOR_SECONDARY_OPEN_TABLES_BACKUP
- spider_close_sys_table(thd, table_gtid_pos,
+ spider_sys_close_table(thd, table_gtid_pos,
&open_tables_backup_gtid_pos, need_lock);
#endif
- spider_close_sys_table(thd, table_tables, &open_tables_backup_tables,
- need_lock);
+ spider_sys_close_table(thd, &open_tables_backup_tables);
DBUG_RETURN(0);
@@ -859,13 +852,12 @@ error_get_sys_tables_link_status:
error_sys_index_end:
error_get_sys_table_by_idx:
#ifdef SPIDER_REQUIRE_DEFINE_FOR_SECONDARY_OPEN_TABLES_BACKUP
- spider_close_sys_table(thd, table_gtid_pos,
+ spider_sys_close_table(thd, table_gtid_pos,
&open_tables_backup_gtid_pos,
need_lock);
error_open_table_gtid_pos:
#endif
- spider_close_sys_table(thd, table_tables, &open_tables_backup_tables,
- need_lock);
+ spider_sys_close_table(thd, &open_tables_backup_tables);
error_open_table_tables:
DBUG_RETURN(error_num);
}
@@ -891,7 +883,7 @@ int spider_init_ping_table_mon_cache(
!(table_link_mon = spider_open_sys_table(
thd, SPIDER_SYS_LINK_MON_TABLE_NAME_STR,
SPIDER_SYS_LINK_MON_TABLE_NAME_LEN, FALSE, &open_tables_backup,
- need_lock, &error_num))
+ &error_num))
) {
my_error(error_num, MYF(0));
goto error_open_sys_table;
@@ -986,7 +978,7 @@ int spider_init_ping_table_mon_cache(
spider_mon_table_cache_version = spider_mon_table_cache_version_req;
}
pthread_mutex_unlock(&spider_mon_table_cache_mutex);
- spider_close_sys_table(thd, table_link_mon, &open_tables_backup, need_lock);
+ spider_sys_close_table(thd, &open_tables_backup);
DBUG_RETURN(0);
error_push_dynamic:
@@ -995,7 +987,7 @@ error_sys_index_next:
spider_sys_index_end(table_link_mon);
error_sys_index_first:
pthread_mutex_unlock(&spider_mon_table_cache_mutex);
- spider_close_sys_table(thd, table_link_mon, &open_tables_backup, need_lock);
+ spider_sys_close_table(thd, &open_tables_backup);
error_open_sys_table:
DBUG_RETURN(error_num);
}
@@ -1292,9 +1284,9 @@ long long spider_ping_table_body(
conv_name_length, link_idx, SPIDER_LINK_STATUS_NG);
spider_sys_update_tables_link_status(trx->thd,
conv_name.c_ptr(), conv_name_length, link_idx,
- SPIDER_LINK_STATUS_NG, TRUE);
+ SPIDER_LINK_STATUS_NG);
spider_sys_log_tables_link_failed(trx->thd,
- conv_name.c_ptr(), conv_name_length, link_idx, TRUE);
+ conv_name.c_ptr(), conv_name_length, link_idx);
status_changed_to_ng = TRUE;
}
pthread_mutex_unlock(&spider_udf_table_mon_mutexes[table_mon_list->mutex_hash]);
@@ -1359,9 +1351,9 @@ long long spider_ping_table_body(
conv_name_length, link_idx, SPIDER_LINK_STATUS_NG);
spider_sys_update_tables_link_status(trx->thd,
conv_name.c_ptr(), conv_name_length, link_idx,
- SPIDER_LINK_STATUS_NG, TRUE);
+ SPIDER_LINK_STATUS_NG);
spider_sys_log_tables_link_failed(trx->thd,
- conv_name.c_ptr(), conv_name_length, link_idx, TRUE);
+ conv_name.c_ptr(), conv_name_length, link_idx);
status_changed_to_ng = TRUE;
}
pthread_mutex_unlock(&spider_udf_table_mon_mutexes[table_mon_list->mutex_hash]);
@@ -1416,9 +1408,9 @@ long long spider_ping_table_body(
conv_name_length, link_idx, SPIDER_LINK_STATUS_NG);
spider_sys_update_tables_link_status(trx->thd,
conv_name.c_ptr(), conv_name_length, link_idx,
- SPIDER_LINK_STATUS_NG, TRUE);
+ SPIDER_LINK_STATUS_NG);
spider_sys_log_tables_link_failed(trx->thd,
- conv_name.c_ptr(), conv_name_length, link_idx, TRUE);
+ conv_name.c_ptr(), conv_name_length, link_idx);
status_changed_to_ng = TRUE;
}
pthread_mutex_unlock(&spider_udf_table_mon_mutexes[table_mon_list->mutex_hash]);
@@ -1766,9 +1758,9 @@ int spider_ping_table_mon_from_table(
link_idx));
share->link_statuses[link_idx] = SPIDER_LINK_STATUS_NG;
spider_sys_update_tables_link_status(thd, conv_name,
- conv_name_length, link_idx, SPIDER_LINK_STATUS_NG, need_lock);
+ conv_name_length, link_idx, SPIDER_LINK_STATUS_NG);
spider_sys_log_tables_link_failed(thd, conv_name,
- conv_name_length, link_idx, need_lock);
+ conv_name_length, link_idx);
}
pthread_mutex_unlock(&spider_udf_table_mon_mutexes[table_mon_list->mutex_hash]);
}
diff --git a/storage/spider/spd_sys_table.cc b/storage/spider/spd_sys_table.cc
index bd3e7a6f..5cbae605 100644
--- a/storage/spider/spd_sys_table.cc
+++ b/storage/spider/spd_sys_table.cc
@@ -235,7 +235,6 @@ TABLE *spider_open_sys_table(
int table_name_length,
bool write,
SPIDER_Open_tables_backup *open_tables_backup,
- bool need_lock,
int *error_num
) {
TABLE *table;
@@ -277,7 +276,7 @@ TABLE *spider_open_sys_table(
DBUG_PRINT("info",("spider checking for SYS_XA"));
if (table->s->fields != SPIDER_SYS_XA_COL_CNT)
{
- spider_close_sys_table(thd, table, open_tables_backup, need_lock);
+ spider_sys_close_table(thd, open_tables_backup);
table = NULL;
my_printf_error(ER_SPIDER_SYS_TABLE_VERSION_NUM,
ER_SPIDER_SYS_TABLE_VERSION_STR, MYF(0),
@@ -296,7 +295,7 @@ TABLE *spider_open_sys_table(
DBUG_PRINT("info",("spider checking for SYS_TABLES"));
if (table->s->fields != SPIDER_SYS_TABLES_COL_CNT)
{
- spider_close_sys_table(thd, table, open_tables_backup, need_lock);
+ spider_sys_close_table(thd, open_tables_backup);
table = NULL;
my_printf_error(ER_SPIDER_SYS_TABLE_VERSION_NUM,
ER_SPIDER_SYS_TABLE_VERSION_STR, MYF(0),
@@ -315,7 +314,7 @@ TABLE *spider_open_sys_table(
DBUG_PRINT("info",("spider checking for SYS_XA_MEMBER"));
if (table->s->fields != SPIDER_SYS_XA_MEMBER_COL_CNT)
{
- spider_close_sys_table(thd, table, open_tables_backup, need_lock);
+ spider_sys_close_table(thd, open_tables_backup);
table = NULL;
my_printf_error(ER_SPIDER_SYS_TABLE_VERSION_NUM,
ER_SPIDER_SYS_TABLE_VERSION_STR, MYF(0),
@@ -334,7 +333,7 @@ TABLE *spider_open_sys_table(
DBUG_PRINT("info",("spider checking for SYS_XA_FAILED"));
if (table->s->fields != SPIDER_SYS_XA_FAILED_TABLE_COL_CNT)
{
- spider_close_sys_table(thd, table, open_tables_backup, need_lock);
+ spider_sys_close_table(thd, open_tables_backup);
table = NULL;
my_printf_error(ER_SPIDER_SYS_TABLE_VERSION_NUM,
ER_SPIDER_SYS_TABLE_VERSION_STR, MYF(0),
@@ -353,7 +352,7 @@ TABLE *spider_open_sys_table(
DBUG_PRINT("info",("spider checking for SYS_LINK_FAILED"));
if (table->s->fields != SPIDER_SYS_LINK_FAILED_TABLE_COL_CNT)
{
- spider_close_sys_table(thd, table, open_tables_backup, need_lock);
+ spider_sys_close_table(thd, open_tables_backup);
table = NULL;
my_printf_error(ER_SPIDER_SYS_TABLE_VERSION_NUM,
ER_SPIDER_SYS_TABLE_VERSION_STR, MYF(0),
@@ -372,7 +371,7 @@ TABLE *spider_open_sys_table(
DBUG_PRINT("info",("spider checking for SYS_LINK_MON"));
if (table->s->fields != SPIDER_SYS_LINK_MON_TABLE_COL_CNT)
{
- spider_close_sys_table(thd, table, open_tables_backup, need_lock);
+ spider_sys_close_table(thd, open_tables_backup);
table = NULL;
my_printf_error(ER_SPIDER_SYS_TABLE_VERSION_NUM,
ER_SPIDER_SYS_TABLE_VERSION_STR, MYF(0),
@@ -391,7 +390,7 @@ TABLE *spider_open_sys_table(
DBUG_PRINT("info",("spider checking for SYS_POS_FOR_RECOVERY"));
if (table->s->fields != SPIDER_SYS_POS_FOR_RECOVERY_TABLE_COL_CNT)
{
- spider_close_sys_table(thd, table, open_tables_backup, need_lock);
+ spider_sys_close_table(thd, open_tables_backup);
table = NULL;
my_printf_error(ER_SPIDER_SYS_TABLE_VERSION_NUM,
ER_SPIDER_SYS_TABLE_VERSION_STR, MYF(0),
@@ -412,17 +411,6 @@ error_col_num_chk:
DBUG_RETURN(NULL);
}
-void spider_close_sys_table(
- THD *thd,
- TABLE *table,
- SPIDER_Open_tables_backup *open_tables_backup,
- bool need_lock
-) {
- DBUG_ENTER("spider_close_sys_table");
- spider_sys_close_table(thd, open_tables_backup);
- DBUG_VOID_RETURN;
-}
-
bool spider_sys_open_and_lock_tables(
THD *thd,
TABLE_LIST **tables,
@@ -876,9 +864,15 @@ void spider_store_xa_member_info(
DBUG_VOID_RETURN;
}
-/*
- Store db and table names from `name' to `table's corresponding
- fields
+/**
+ Stores the DB and table names in a table
+
+ If `name` starts with "./", separates out db and table names from
+ `name`. Otherwise stores empty strings as names
+
+ @param table The table to store the info
+ @param name The name of the table
+ @param name_length The length of the name
*/
void spider_store_tables_name(
TABLE *table,
@@ -2442,36 +2436,22 @@ int spider_get_sys_tables_monitoring_binlog_pos_at_failing(
DBUG_RETURN(error_num);
}
-/*
- Read the link status from mysql.spider_tables into a `SPIDER_SHARE'
- with default value 1 (`SPIDER_LINK_STATUS_OK')
+/**
+ Reads a table field and updates a link_status of a spider share
+
+ @param table The system table (`spider_tables` table) to read the
+ field from
+ @param share The share to update its link status with
+ @param link_idx Which link status to update
+ @param mem_root MEM_ROOT for allocating
+ @reval 0 for success, or error num
*/
int spider_get_sys_tables_link_status(
- TABLE *table, /* The mysql.spider_tables table */
- SPIDER_SHARE *share, /* The share to read link
- status into */
- int link_idx,
- MEM_ROOT *mem_root
-) {
- char *ptr;
- int error_num = 0;
- DBUG_ENTER("spider_get_sys_tables_link_status");
- if ((ptr = get_field(mem_root, table->field[SPIDER_TABLES_LINK_STATUS_POS])))
- {
- share->link_statuses[link_idx] =
- (long) my_strtoll10(ptr, (char**) NULL, &error_num);
- } else
- share->link_statuses[link_idx] = 1;
- DBUG_PRINT("info",("spider link_statuses[%d]=%ld",
- link_idx, share->link_statuses[link_idx]));
- DBUG_RETURN(error_num);
-}
-
-int spider_get_sys_tables_link_status(
TABLE *table,
long *link_status,
MEM_ROOT *mem_root
-) {
+)
+{
char *ptr;
int error_num = 0;
DBUG_ENTER("spider_get_sys_tables_link_status");
@@ -2479,7 +2459,6 @@ int spider_get_sys_tables_link_status(
*link_status = (long) my_strtoll10(ptr, (char**) NULL, &error_num);
else
*link_status = 1;
- DBUG_PRINT("info",("spider link_statuses=%ld", *link_status));
DBUG_RETURN(error_num);
}
@@ -2526,8 +2505,7 @@ int spider_sys_update_tables_link_status(
char *name,
uint name_length,
int link_idx,
- long link_status,
- bool need_lock
+ long link_status
) {
int error_num;
TABLE *table_tables = NULL;
@@ -2536,7 +2514,7 @@ int spider_sys_update_tables_link_status(
if (
!(table_tables = spider_open_sys_table(
thd, SPIDER_SYS_TABLES_TABLE_NAME_STR,
- SPIDER_SYS_TABLES_TABLE_NAME_LEN, TRUE, &open_tables_backup, need_lock,
+ SPIDER_SYS_TABLES_TABLE_NAME_LEN, TRUE, &open_tables_backup,
&error_num))
) {
goto error;
@@ -2544,15 +2522,13 @@ int spider_sys_update_tables_link_status(
if ((error_num = spider_update_tables_link_status(table_tables,
name, name_length, link_idx, link_status)))
goto error;
- spider_close_sys_table(thd, table_tables,
- &open_tables_backup, need_lock);
+ spider_sys_close_table(thd, &open_tables_backup);
table_tables = NULL;
DBUG_RETURN(0);
error:
if (table_tables)
- spider_close_sys_table(thd, table_tables,
- &open_tables_backup, need_lock);
+ spider_sys_close_table(thd, &open_tables_backup);
DBUG_RETURN(error_num);
}
@@ -2560,8 +2536,7 @@ int spider_sys_log_tables_link_failed(
THD *thd,
char *name,
uint name_length,
- int link_idx,
- bool need_lock
+ int link_idx
) {
int error_num;
TABLE *table_tables = NULL;
@@ -2571,7 +2546,7 @@ int spider_sys_log_tables_link_failed(
!(table_tables = spider_open_sys_table(
thd, SPIDER_SYS_LINK_FAILED_TABLE_NAME_STR,
SPIDER_SYS_LINK_FAILED_TABLE_NAME_LEN, TRUE, &open_tables_backup,
- need_lock, &error_num))
+ &error_num))
) {
goto error;
}
@@ -2579,15 +2554,13 @@ int spider_sys_log_tables_link_failed(
if ((error_num = spider_log_tables_link_failed(table_tables,
name, name_length, link_idx)))
goto error;
- spider_close_sys_table(thd, table_tables,
- &open_tables_backup, need_lock);
+ spider_sys_close_table(thd, &open_tables_backup);
table_tables = NULL;
DBUG_RETURN(0);
error:
if (table_tables)
- spider_close_sys_table(thd, table_tables,
- &open_tables_backup, need_lock);
+ spider_sys_close_table(thd, &open_tables_backup);
DBUG_RETURN(error_num);
}
@@ -2595,8 +2568,7 @@ int spider_sys_log_xa_failed(
THD *thd,
XID *xid,
SPIDER_CONN *conn,
- const char *status,
- bool need_lock
+ const char *status
) {
int error_num;
TABLE *table_tables = NULL;
@@ -2606,20 +2578,20 @@ int spider_sys_log_xa_failed(
!(table_tables = spider_open_sys_table(
thd, SPIDER_SYS_XA_FAILED_TABLE_NAME_STR,
SPIDER_SYS_XA_FAILED_TABLE_NAME_LEN, TRUE, &open_tables_backup,
- need_lock, &error_num))
+ &error_num))
) {
goto error;
}
empty_record(table_tables);
if ((error_num = spider_log_xa_failed(thd, table_tables, xid, conn, status)))
goto error;
- spider_close_sys_table(thd, table_tables, &open_tables_backup, need_lock);
+ spider_sys_close_table(thd, &open_tables_backup);
table_tables = NULL;
DBUG_RETURN(0);
error:
if (table_tables)
- spider_close_sys_table(thd, table_tables, &open_tables_backup, need_lock);
+ spider_sys_close_table(thd, &open_tables_backup);
DBUG_RETURN(error_num);
}
@@ -2940,6 +2912,15 @@ int spider_get_sys_link_mon_connect_info(
DBUG_RETURN(error_num);
}
+/**
+ Reads link statuses from the spider_tables system table into a
+ spider share
+
+ @param table The table to read from
+ @param share The spider share
+ @param mem_root MEM_ROOT for allocating
+ @reval 0 for success, or error code
+*/
int spider_get_link_statuses(
TABLE *table,
SPIDER_SHARE *share,
@@ -2958,11 +2939,10 @@ int spider_get_link_statuses(
{
if (
(error_num == HA_ERR_KEY_NOT_FOUND || error_num == HA_ERR_END_OF_FILE)
- ) {
+ )
DBUG_RETURN(error_num);
- }
- } else if ((error_num =
- spider_get_sys_tables_link_status(table, share, roop_count, mem_root)))
+ } else if ((error_num = spider_get_sys_tables_link_status(
+ table, &share->link_statuses[roop_count], mem_root)))
{
table->file->print_error(error_num, MYF(0));
DBUG_RETURN(error_num);
@@ -3039,7 +3019,6 @@ error:
DBUG_RETURN(error_num);
}
-#ifdef SPIDER_use_LEX_CSTRING_for_Field_blob_constructor
TABLE *spider_mk_sys_tmp_table(
THD *thd,
TABLE *table,
@@ -3047,15 +3026,6 @@ TABLE *spider_mk_sys_tmp_table(
const LEX_CSTRING *field_name,
CHARSET_INFO *cs
)
-#else
-TABLE *spider_mk_sys_tmp_table(
- THD *thd,
- TABLE *table,
- TMP_TABLE_PARAM *tmp_tbl_prm,
- const char *field_name,
- CHARSET_INFO *cs
-)
-#endif
{
Field_blob *field;
Item_field *i_field;
@@ -3063,24 +3033,13 @@ TABLE *spider_mk_sys_tmp_table(
TABLE *tmp_table;
DBUG_ENTER("spider_mk_sys_tmp_table");
-#ifdef SPIDER_FIELD_FIELDPTR_REQUIRES_THDPTR
if (!(field = new (thd->mem_root) Field_blob(
4294967295U, FALSE, field_name, cs, TRUE)))
goto error_alloc_field;
-#else
- if (!(field = new Field_blob(
- 4294967295U, FALSE, field_name, cs, TRUE)))
- goto error_alloc_field;
-#endif
field->init(table);
-#ifdef SPIDER_FIELD_FIELDPTR_REQUIRES_THDPTR
if (!(i_field = new (thd->mem_root) Item_field(thd, (Field *) field)))
goto error_alloc_item_field;
-#else
- if (!(i_field = new Item_field((Field *) field)))
- goto error_alloc_item_field;
-#endif
if (i_list.push_back(i_field))
goto error_push_item;
@@ -3113,7 +3072,6 @@ void spider_rm_sys_tmp_table(
DBUG_VOID_RETURN;
}
-#ifdef SPIDER_use_LEX_CSTRING_for_Field_blob_constructor
TABLE *spider_mk_sys_tmp_table_for_result(
THD *thd,
TABLE *table,
@@ -3123,17 +3081,6 @@ TABLE *spider_mk_sys_tmp_table_for_result(
const LEX_CSTRING *field_name3,
CHARSET_INFO *cs
)
-#else
-TABLE *spider_mk_sys_tmp_table_for_result(
- THD *thd,
- TABLE *table,
- TMP_TABLE_PARAM *tmp_tbl_prm,
- const char *field_name1,
- const char *field_name2,
- const char *field_name3,
- CHARSET_INFO *cs
-)
-#endif
{
Field_blob *field1, *field2, *field3;
Item_field *i_field1, *i_field2, *i_field3;
@@ -3141,68 +3088,35 @@ TABLE *spider_mk_sys_tmp_table_for_result(
TABLE *tmp_table;
DBUG_ENTER("spider_mk_sys_tmp_table_for_result");
-#ifdef SPIDER_FIELD_FIELDPTR_REQUIRES_THDPTR
if (!(field1 = new (thd->mem_root) Field_blob(
4294967295U, FALSE, field_name1, cs, TRUE)))
goto error_alloc_field1;
-#else
- if (!(field1 = new Field_blob(
- 4294967295U, FALSE, field_name1, cs, TRUE)))
- goto error_alloc_field1;
-#endif
field1->init(table);
-#ifdef SPIDER_FIELD_FIELDPTR_REQUIRES_THDPTR
if (!(i_field1 = new (thd->mem_root) Item_field(thd, (Field *) field1)))
goto error_alloc_item_field1;
-#else
- if (!(i_field1 = new Item_field((Field *) field1)))
- goto error_alloc_item_field1;
-#endif
if (i_list.push_back(i_field1))
goto error_push_item1;
-#ifdef SPIDER_FIELD_FIELDPTR_REQUIRES_THDPTR
if (!(field2 = new (thd->mem_root) Field_blob(
4294967295U, FALSE, field_name2, cs, TRUE)))
goto error_alloc_field2;
-#else
- if (!(field2 = new Field_blob(
- 4294967295U, FALSE, field_name2, cs, TRUE)))
- goto error_alloc_field2;
-#endif
field2->init(table);
-#ifdef SPIDER_FIELD_FIELDPTR_REQUIRES_THDPTR
if (!(i_field2 = new (thd->mem_root) Item_field(thd, (Field *) field2)))
goto error_alloc_item_field2;
-#else
- if (!(i_field2 = new Item_field((Field *) field2)))
- goto error_alloc_item_field2;
-#endif
if (i_list.push_back(i_field2))
goto error_push_item2;
-#ifdef SPIDER_FIELD_FIELDPTR_REQUIRES_THDPTR
if (!(field3 = new (thd->mem_root) Field_blob(
4294967295U, FALSE, field_name3, cs, TRUE)))
goto error_alloc_field3;
-#else
- if (!(field3 = new Field_blob(
- 4294967295U, FALSE, field_name3, cs, TRUE)))
- goto error_alloc_field3;
-#endif
field3->init(table);
-#ifdef SPIDER_FIELD_FIELDPTR_REQUIRES_THDPTR
if (!(i_field3 = new (thd->mem_root) Item_field(thd, (Field *) field3)))
goto error_alloc_item_field3;
-#else
- if (!(i_field3 = new Item_field((Field *) field3)))
- goto error_alloc_item_field3;
-#endif
if (i_list.push_back(i_field3))
goto error_push_item3;
diff --git a/storage/spider/spd_sys_table.h b/storage/spider/spd_sys_table.h
index ce3897c7..cef44df9 100644
--- a/storage/spider/spd_sys_table.h
+++ b/storage/spider/spd_sys_table.h
@@ -74,17 +74,9 @@ TABLE *spider_open_sys_table(
int table_name_length,
bool write,
SPIDER_Open_tables_backup *open_tables_backup,
- bool need_lock,
int *error_num
);
-void spider_close_sys_table(
- THD *thd,
- TABLE *table,
- SPIDER_Open_tables_backup *open_tables_backup,
- bool need_lock
-);
-
bool spider_sys_open_and_lock_tables(
THD *thd,
TABLE_LIST **tables,
@@ -413,13 +405,6 @@ int spider_get_sys_tables_monitoring_binlog_pos_at_failing(
int spider_get_sys_tables_link_status(
TABLE *table,
- SPIDER_SHARE *share,
- int link_idx,
- MEM_ROOT *mem_root
-);
-
-int spider_get_sys_tables_link_status(
- TABLE *table,
long *link_status,
MEM_ROOT *mem_root
);
@@ -442,24 +427,21 @@ int spider_sys_update_tables_link_status(
char *name,
uint name_length,
int link_idx,
- long link_status,
- bool need_lock
+ long link_status
);
int spider_sys_log_tables_link_failed(
THD *thd,
char *name,
uint name_length,
- int link_idx,
- bool need_lock
+ int link_idx
);
int spider_sys_log_xa_failed(
THD *thd,
XID *xid,
SPIDER_CONN *conn,
- const char *status,
- bool need_lock
+ const char *status
);
int spider_get_sys_link_mon_key(
@@ -492,7 +474,6 @@ int spider_sys_replace(
bool *modified_non_trans_table
);
-#ifdef SPIDER_use_LEX_CSTRING_for_Field_blob_constructor
TABLE *spider_mk_sys_tmp_table(
THD *thd,
TABLE *table,
@@ -500,15 +481,6 @@ TABLE *spider_mk_sys_tmp_table(
const LEX_CSTRING *field_name,
CHARSET_INFO *cs
);
-#else
-TABLE *spider_mk_sys_tmp_table(
- THD *thd,
- TABLE *table,
- TMP_TABLE_PARAM *tmp_tbl_prm,
- const char *field_name,
- CHARSET_INFO *cs
-);
-#endif
void spider_rm_sys_tmp_table(
THD *thd,
@@ -516,7 +488,6 @@ void spider_rm_sys_tmp_table(
TMP_TABLE_PARAM *tmp_tbl_prm
);
-#ifdef SPIDER_use_LEX_CSTRING_for_Field_blob_constructor
TABLE *spider_mk_sys_tmp_table_for_result(
THD *thd,
TABLE *table,
@@ -526,17 +497,6 @@ TABLE *spider_mk_sys_tmp_table_for_result(
const LEX_CSTRING *field_name3,
CHARSET_INFO *cs
);
-#else
-TABLE *spider_mk_sys_tmp_table_for_result(
- THD *thd,
- TABLE *table,
- TMP_TABLE_PARAM *tmp_tbl_prm,
- const char *field_name1,
- const char *field_name2,
- const char *field_name3,
- CHARSET_INFO *cs
-);
-#endif
void spider_rm_sys_tmp_table_for_result(
THD *thd,
diff --git a/storage/spider/spd_table.cc b/storage/spider/spd_table.cc
index 4b0690be..bdc3a33a 100644
--- a/storage/spider/spd_table.cc
+++ b/storage/spider/spd_table.cc
@@ -119,6 +119,7 @@ bool volatile *spd_abort_loop;
Time_zone *spd_tz_system;
extern long spider_conn_mutex_id;
handlerton *spider_hton_ptr;
+/** All `SPIDER_DBTON`s */
SPIDER_DBTON spider_dbton[SPIDER_DBTON_SIZE];
extern SPIDER_DBTON spider_dbton_mysql;
extern SPIDER_DBTON spider_dbton_mariadb;
@@ -257,17 +258,112 @@ static PSI_thread_info all_spider_threads[] = {
};
#endif
+/*
+ The spider table options. All fields are strings, with NULLness
+ indicating unspecified by the user.
+*/
struct ha_table_option_struct
{
- char *remote_server;
- char *remote_database;
- char *remote_table;
+ char *auto_increment_mode;
+ char *bgs_mode;
+ char *bulk_size;
+ char *bulk_update_size;
+ char *connect_timeout;
+ char *database;
+ char *default_file;
+ char *default_group;
+ char *delete_all_rows_type;
+ char *driver;
+ char *dsn;
+ char *filedsn;
+ char *force_bulk_delete;
+ char *force_bulk_update;
+ char *host;
+ char *idx;
+ char *multi_split_read;
+ char *net_read_timeout;
+ char *net_write_timeout;
+ char *password;
+ char *port;
+ char *priority;
+ char *query_cache;
+ char *query_cache_sync;
+ char *read_only;
+ char *server;
+ char *skip_parallel_search;
+ char *socket;
+ char *ssl_capath;
+ char *ssl_ca;
+ char *ssl_cert;
+ char *ssl_cipher;
+ char *ssl_key;
+ char *ssl_vsc;
+ char *table;
+ char *table_count_mode;
+ char *username;
+ char *use_pushdown_udf;
+ char *wrapper;
};
+/*
+ The spider table options with the names used in statements.
+*/
ha_create_table_option spider_table_option_list[]= {
- HA_TOPTION_STRING("REMOTE_SERVER", remote_server),
- HA_TOPTION_STRING("REMOTE_DATABASE", remote_database),
- HA_TOPTION_STRING("REMOTE_TABLE", remote_table), HA_TOPTION_END};
+ HA_TOPTION_STRING("AUTO_INCREMENT_MODE", auto_increment_mode),
+ HA_TOPTION_STRING("BGS_MODE", bgs_mode),
+ HA_TOPTION_STRING("BULK_SIZE", bulk_size),
+ HA_TOPTION_STRING("BULK_UPDATE_SIZE", bulk_update_size),
+ HA_TOPTION_STRING("CONNECT_TIMEOUT", connect_timeout),
+ HA_TOPTION_STRING("REMOTE_DATABASE", database),
+ HA_TOPTION_STRING("DEFAULT_FILE", default_file),
+ HA_TOPTION_STRING("DEFAULT_GROUP", default_group),
+ HA_TOPTION_STRING("DELETE_ALL_ROWS_TYPE", delete_all_rows_type),
+ HA_TOPTION_STRING("DRIVER", driver),
+ HA_TOPTION_STRING("DSN", dsn),
+ HA_TOPTION_STRING("FILEDSN", filedsn),
+ HA_TOPTION_STRING("FORCE_BULK_DELETE", force_bulk_delete),
+ HA_TOPTION_STRING("FORCE_BULK_UPDATE", force_bulk_update),
+ HA_TOPTION_STRING("REMOTE_HOST", host),
+ HA_TOPTION_STRING("IDX", idx),
+ HA_TOPTION_STRING("MULTI_SPLIT_READ", multi_split_read),
+ HA_TOPTION_STRING("NET_READ_TIMEOUT", net_read_timeout),
+ HA_TOPTION_STRING("NET_WRITE_TIMEOUT", net_write_timeout),
+ HA_TOPTION_STRING("REMOTE_PASSWORD", password),
+ HA_TOPTION_STRING("REMOTE_PORT", port),
+ HA_TOPTION_STRING("PRIORITY", priority),
+ HA_TOPTION_STRING("QUERY_CACHE", query_cache),
+ HA_TOPTION_STRING("QUERY_CACHE_SYNC", query_cache_sync),
+ HA_TOPTION_STRING("READ_ONLY", read_only),
+ HA_TOPTION_STRING("REMOTE_SERVER", server),
+ HA_TOPTION_STRING("SKIP_PARALLEL_SEARCH", skip_parallel_search),
+ HA_TOPTION_STRING("REMOTE_SOCKET", socket),
+ HA_TOPTION_STRING("SSL_CAPATH", ssl_capath),
+ HA_TOPTION_STRING("SSL_CA", ssl_ca),
+ HA_TOPTION_STRING("SSL_CERT", ssl_cert),
+ HA_TOPTION_STRING("SSL_CIPHER", ssl_cipher),
+ HA_TOPTION_STRING("SSL_KEY", ssl_key),
+ HA_TOPTION_STRING("SSL_VSC", ssl_vsc),
+ HA_TOPTION_STRING("REMOTE_TABLE", table),
+ HA_TOPTION_STRING("TABLE_COUNT_MODE", table_count_mode),
+ HA_TOPTION_STRING("REMOTE_USERNAME", username),
+ HA_TOPTION_STRING("USE_PUSHDOWN_UDF", use_pushdown_udf),
+ HA_TOPTION_STRING("WRAPPER", wrapper),
+ HA_TOPTION_END
+};
+
+/**
+ Determines how to populate sts (stat) / crd (cardinality) of a
+ spider share
+*/
+enum ha_sts_crd_get_type
+{
+ HA_GET_COPY = 0, /* Get by copying from wide_share */
+ HA_GET_FETCH = 1, /* Get by executing a sql query */
+ HA_GET_AFTER_LOCK = 2, /* Get by executing a sql query after
+ locking wide_share->sts_mutex. */
+ HA_GET_AFTER_TRYLOCK = 3 /* Get by executing a sql query after
+ trylocking wide_share->sts_mutex. */
+};
extern HASH spider_open_connections;
extern HASH spider_ipport_conns;
@@ -297,6 +393,7 @@ const char *spider_open_tables_func_name;
const char *spider_open_tables_file_name;
ulong spider_open_tables_line_no;
pthread_mutex_t spider_tbl_mutex;
+/** All the `SPIDER_INIT_ERROR_TABLE`s */
HASH spider_init_error_tables;
uint spider_init_error_tables_id;
const char *spider_init_error_tables_func_name;
@@ -344,6 +441,11 @@ extern ulonglong spider_free_mem_count[SPIDER_MEM_CALC_LIST_NUM];
static char spider_wild_many = '%', spider_wild_one = '_',
spider_wild_prefix='\\';
+/**
+ `spider_unique_id` is used for identifying a spider table. It is set
+ to be a concatenation of the MAC address and the PID, give or take
+ some separators
+*/
static char spider_unique_id_buf[1 + 12 + 1 + (16 * 2) + 1 + 1];
LEX_CSTRING spider_unique_id;
@@ -1268,6 +1370,75 @@ int spider_create_long_list(
DBUG_RETURN(0);
}
+/*
+ Parse a list of nonnegative longs with maximum value max_val.
+
+ max_val <= INT_MAX, and the list is space separated and could have
+ leading or trailing spaces.
+*/
+int spider_create_bounded_nat_list(
+ long **long_list,
+ uint *list_length,
+ char *str,
+ uint length,
+ long max_val
+) {
+ int i, error_num;
+ char *cur, *tail;
+ DBUG_ENTER("spider_create_bounded_nat_list");
+
+ *list_length = 0;
+ if (!str)
+ {
+ *long_list = NULL;
+ DBUG_RETURN(0);
+ }
+
+ cur = str;
+ while (*cur == ' ')
+ cur++;
+ if (*cur)
+ *list_length = 1;
+ else {
+ *long_list = NULL;
+ DBUG_RETURN(0);
+ }
+
+ while ((cur = strchr(cur, ' ')))
+ {
+ do {
+ cur++;
+ } while (*cur == ' ');
+ if (*cur)
+ (*list_length)++;
+ }
+
+ if (!(*long_list = (long*)
+ spider_bulk_malloc(spider_current_trx, 44, MYF(MY_WME | MY_ZEROFILL),
+ long_list, (uint) (sizeof(long) * (*list_length)),
+ NullS))
+ ) {
+ my_error(ER_OUT_OF_RESOURCES, MYF(0), HA_ERR_OUT_OF_MEM);
+ DBUG_RETURN(HA_ERR_OUT_OF_MEM);
+ }
+
+ cur = str;
+ for (i = 0; i < (int) *list_length; i++)
+ {
+ while (*cur == ' ')
+ cur++;
+ tail= str + strlen(str);
+ longlong converted= my_strtoll10(cur, &tail, &error_num);
+ cur= tail;
+ if (error_num || (*cur && *cur != ' ') || converted < 0 ||
+ converted > max_val || converted > INT_MAX)
+ DBUG_RETURN(1);
+ (*long_list)[i]= (long) converted;
+ }
+
+ DBUG_RETURN(0);
+}
+
int spider_create_longlong_list(
longlong **longlong_list,
uint *list_length,
@@ -1576,6 +1747,94 @@ static int spider_set_ll_value(
DBUG_RETURN(error_num);
}
+/*
+ Find the index of a given key name in a table.
+
+ Return the index if found, or -1 otherwise.
+*/
+static int spider_find_key_index(char *key_begin, uint key_len,
+ TABLE_SHARE *share)
+{
+ for (uint i= 0; i < share->keys; i++)
+ if (share->key_info[i].name.length == key_len &&
+ !strncmp(share->key_info[i].name.str, key_begin, key_len))
+ return i;
+ return -1;
+}
+
+/* Convert a short key hint verb and append it to a string */
+static int spider_convert_and_append_hint_verb(char *short_verb_begin,
+ int short_verb_len,
+ spider_string *key_hint)
+{
+ switch (short_verb_len)
+ {
+ case 1:
+ if (!strncasecmp("f", short_verb_begin, 1))
+ {
+ key_hint->append(SPIDER_SQL_INDEX_FORCE_STR);
+ return 0;
+ }
+ if (!strncasecmp("u", short_verb_begin, 1))
+ {
+ key_hint->append(SPIDER_SQL_INDEX_USE_STR);
+ return 0;
+ }
+ break;
+ case 2:
+ if (!strncasecmp("ig", short_verb_begin, 2))
+ {
+ key_hint->append(SPIDER_SQL_INDEX_IGNORE_STR);
+ return 0;
+ }
+ break;
+ default:
+ return 1;
+ }
+ return 1;
+}
+
+/* Parse the IDX spider option */
+static int spider_parse_option_hint(char *hint, SPIDER_SHARE *share,
+ TABLE_SHARE *table_share)
+{
+ char *short_verb_begin= hint, *short_verb_end, *key_begin, *key_end;
+ int key_index;
+ spider_string *key_hint;
+ while (*short_verb_begin)
+ {
+ while (*short_verb_begin == ' ' || *short_verb_begin == '\t')
+ short_verb_begin++;
+ if (!*short_verb_begin)
+ break;
+ short_verb_end= short_verb_begin;
+ while (*short_verb_end && *short_verb_end != ' ' && *short_verb_end != '\t')
+ short_verb_end++;
+ key_begin= short_verb_end;
+ while (*key_begin == ' ' || *key_begin == '\t')
+ key_begin++;
+ key_end= key_begin;
+ while (*key_end && *key_end != ' ' && *key_end != '\t')
+ key_end++;
+ if ((key_index=
+ spider_find_key_index(key_begin, (uint) (key_end - key_begin),
+ table_share))
+ == -1)
+ return 1;
+ key_hint= &share->key_hint[key_index];
+ if (spider_convert_and_append_hint_verb(
+ short_verb_begin, (int) (short_verb_end - short_verb_begin),
+ key_hint))
+ return 1;
+ key_hint->append(SPIDER_SQL_OPEN_PAREN_STR);
+ key_hint->append(table_share->key_info[key_index].name.str,
+ table_share->key_info[key_index].name.length);
+ key_hint->append(SPIDER_SQL_CLOSE_PAREN_STR);
+ short_verb_begin= key_end;
+ }
+ return 0;
+}
+
#define SPIDER_PARAM_LEN(name) name ## _length
#define SPIDER_PARAM_LENS(name) name ## _lengths
#define SPIDER_PARAM_CHARLEN(name) name ## _charlen
@@ -1596,17 +1855,10 @@ static int spider_set_ll_value(
} \
break; \
}
-#define SPIDER_PARAM_STR_LIST(title_name, param_name) \
- SPIDER_PARAM_STR_LIST_CHECK(title_name, param_name, FALSE)
-#define SPIDER_PARAM_STR_LIST_CHECK(title_name, param_name, already_set) \
+#define SPIDER_PARAM_STR_LIST(title_name, param_name) \
if (!strncasecmp(parse.start_title, title_name, title_length)) \
{ \
DBUG_PRINT("info", ("spider " title_name " start")); \
- if (already_set) \
- { \
- error_num= ER_SPIDER_INVALID_CONNECT_INFO_NUM; \
- goto error; \
- } \
if (!share->param_name) \
{ \
share->SPIDER_PARAM_CHARLEN(param_name)= value_length; \
@@ -1773,34 +2025,156 @@ static int spider_set_ll_value(
} \
break; \
}
-#define SPIDER_PARAM_DEPRECATED_WARNING(title_name) \
+#define SPIDER_PARAM_DEPRECATED_WARNING(title_name, VER) \
if (!strncasecmp(parse.start_title, title_name, title_length) && create_table) \
- { \
- THD *thd= current_thd; \
- push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, \
- ER_WARN_DEPRECATED_SYNTAX, \
- "The table parameter '%s' is deprecated and will be " \
- "removed in a future release", \
- title_name); \
+ warn_deprecated<VER>(current_thd, title_name)
+
+/**
+ Parse an option string into a string list and assign it to a
+ `SPIDER_SHARE' field
+*/
+#define SPIDER_OPTION_STR_LIST(option_name, param_name) \
+ if (options && options->option_name) \
+ { \
+ option_specified= TRUE; \
+ share->SPIDER_PARAM_CHARLEN(param_name)= \
+ strlen(options->option_name); \
+ if ((error_num= spider_create_string_list( \
+ &share->param_name, &share->SPIDER_PARAM_LENS(param_name), \
+ &share->SPIDER_PARAM_LEN(param_name), \
+ options->option_name, \
+ share->SPIDER_PARAM_CHARLEN(param_name)))) \
+ { \
+ goto error; \
+ } \
+ if (share->SPIDER_PARAM_LEN(param_name) > 1 && create_table) \
+ { \
+ push_warning_printf(current_thd, Sql_condition::WARN_LEVEL_WARN, \
+ HA_ERR_UNSUPPORTED, \
+ "The high availability feature of Spider " \
+ "has been deprecated " \
+ "and will be removed in a future release"); \
+ } \
}
-/*
- Set a given engine-defined option, which holds a string list, to the
- corresponding attribute of SPIDER_SHARE.
- */
-#define SPIDER_OPTION_STR_LIST(title_name, option_name, param_name) \
- if (option_struct && option_struct->option_name) \
+/**
+ Parse an option string into a non-negative int with an upper
+ bound, and assign it to a `SPIDER_SHARE' field
+*/
+#define SPIDER_OPTION_BOUNDED_NAT(option_title, option_name, \
+ param_name, max_val) \
+ if (options && options->option_name) \
+ { \
+ option_specified= TRUE; \
+ char *tail= options->option_name + strlen(options->option_name); \
+ longlong converted= my_strtoll10(options->option_name, &tail, \
+ &error_num); \
+ if (error_num || *tail || converted < 0 || \
+ converted > max_val || converted > INT_MAX) \
+ { \
+ error_num= ER_SPIDER_INVALID_TABLE_OPTION_NUM; \
+ my_printf_error(error_num, ER_SPIDER_INVALID_TABLE_OPTION_STR, \
+ MYF(0), option_title, options->option_name); \
+ goto error; \
+ } \
+ share->param_name= (int) converted; \
+ } \
+
+/**
+ Parse an option string into a non-negative long array with an upper
+ bound, and assign it to a `SPIDER_SHARE' field
+*/
+#define SPIDER_OPTION_BOUNDED_NAT_LIST(option_title, option_name, \
+ param_name, max_val) \
+ if (options && options->option_name) \
+ { \
+ option_specified= TRUE; \
+ if ((error_num = spider_create_bounded_nat_list( \
+ &share->param_name, \
+ &share->SPIDER_PARAM_LEN(param_name), \
+ options->option_name, \
+ strlen(options->option_name), \
+ max_val))) \
+ { \
+ if (error_num != HA_ERR_OUT_OF_MEM) \
+ { \
+ error_num= ER_SPIDER_INVALID_TABLE_OPTION_NUM; \
+ my_printf_error(error_num, ER_SPIDER_INVALID_TABLE_OPTION_STR, \
+ MYF(0), option_title, options->option_name); \
+ } \
+ goto error; \
+ } \
+ if (share->SPIDER_PARAM_LEN(param_name) > 1 && create_table) \
+ { \
+ push_warning_printf(current_thd, Sql_condition::WARN_LEVEL_WARN, \
+ HA_ERR_UNSUPPORTED, \
+ "The high availability feature of Spider " \
+ "has been deprecated " \
+ "and will be removed in a future release"); \
+ } \
+ } \
+
+/**
+ Parse an option string into a non-negative `longlong', and assign it
+ to a `SPIDER_SHARE' field
+*/
+#define SPIDER_OPTION_NAT_LONGLONG(option_title, option_name, param_name) \
+ if (options && options->option_name) \
+ { \
+ option_specified= TRUE; \
+ char *tail= options->option_name + strlen(options->option_name); \
+ longlong converted = my_strtoll10(options->option_name, &tail, \
+ &error_num); \
+ if (error_num || *tail != '\0' || converted < 0) \
+ { \
+ error_num= ER_SPIDER_INVALID_TABLE_OPTION_NUM; \
+ my_printf_error(error_num, ER_SPIDER_INVALID_TABLE_OPTION_STR, \
+ MYF(0), option_title, options->option_name); \
+ goto error; \
+ } \
+ share->param_name = converted; \
+ } \
+
+/**
+ Parse an option string into a boolean, and assign it to a
+ `SPIDER_SHARE' field.
+*/
+#define SPIDER_OPTION_BOOL(option_title, option_name, param_name) \
+ if (options && options->option_name) \
{ \
- DBUG_PRINT("info", ("spider " title_name " start overwrite")); \
- share->SPIDER_PARAM_CHARLEN(param_name)= \
- strlen(option_struct->option_name); \
- if ((error_num= spider_create_string_list( \
- &share->param_name, &share->SPIDER_PARAM_LENS(param_name), \
- &share->SPIDER_PARAM_LEN(param_name), \
- option_struct->option_name, \
- share->SPIDER_PARAM_CHARLEN(param_name)))) \
+ option_specified= TRUE; \
+ if (!strcmp("YES", options->option_name) || \
+ !strcmp("1", options->option_name)) \
+ share->param_name= TRUE; \
+ else if (!strcmp("NO", options->option_name) || \
+ !strcmp("0", options->option_name)) \
+ share->param_name= FALSE; \
+ else \
+ { \
+ error_num= ER_SPIDER_INVALID_TABLE_OPTION_NUM; \
+ my_printf_error(error_num, ER_SPIDER_INVALID_TABLE_OPTION_STR, \
+ MYF(0), option_title, options->option_name); \
goto error; \
- }
+ } \
+ } \
+
+/**
+ Parse an option string into index hints, and assign them to
+ `SPIDER_SHARE::key_hint'
+*/
+#define SPIDER_OPTION_HINT(option_title, option_name) \
+ if (options && options->option_name) \
+ { \
+ option_specified= TRUE; \
+ if ((error_num= spider_parse_option_hint(options->option_name, \
+ share, table_share))) \
+ { \
+ error_num= ER_SPIDER_INVALID_TABLE_OPTION_NUM; \
+ my_printf_error(error_num, ER_SPIDER_INVALID_TABLE_OPTION_STR, \
+ MYF(0), option_title, options->option_name); \
+ goto error; \
+ } \
+ } \
/**
Assign -1 to some `SPIDER_SHARE' numeric fields, to indicate they
@@ -2130,9 +2504,10 @@ int spider_parse_connect_info(
int title_length, value_length;
SPIDER_PARAM_STRING_PARSE parse;
SPIDER_ALTER_TABLE *share_alter;
- ha_table_option_struct *option_struct;
+ ha_table_option_struct *options;
partition_element *part_elem;
partition_element *sub_elem;
+ bool option_specified= FALSE;
DBUG_ENTER("spider_parse_connect_info");
DBUG_PRINT("info",("spider partition_info=%s",
table_share->partition_info_str));
@@ -2148,13 +2523,69 @@ int spider_parse_connect_info(
table, a partition, or a sub-partition. */
if (part_info)
if (part_info->is_sub_partitioned())
- option_struct= sub_elem->option_struct;
+ options= sub_elem->option_struct;
else
- option_struct= part_elem->option_struct;
+ options= part_elem->option_struct;
else
- option_struct= table_share->option_struct;
-
+ options= table_share->option_struct;
spider_minus_1(share, table_share);
+
+ /* Parse through all option fields, and flip option_specified if
+ any option field is not null. */
+ SPIDER_OPTION_BOUNDED_NAT("AUTO_INCREMENT_MODE", auto_increment_mode,
+ auto_increment_mode, 3);
+ SPIDER_OPTION_BOUNDED_NAT("BGS_MODE", bgs_mode, bgs_mode, 3);
+ SPIDER_OPTION_BOUNDED_NAT("BULK_SIZE", bulk_size, bulk_size, 2147483647);
+ SPIDER_OPTION_BOUNDED_NAT("BULK_UPDATE_SIZE", bulk_update_size,
+ bulk_update_size, 2147483647);
+ SPIDER_OPTION_BOUNDED_NAT_LIST("CONNECT_TIMEOUT", connect_timeout,
+ connect_timeouts, 2147483647);
+ SPIDER_OPTION_STR_LIST(database, tgt_dbs);
+ SPIDER_OPTION_STR_LIST(default_file, tgt_default_files);
+ SPIDER_OPTION_STR_LIST(default_group, tgt_default_groups);
+ SPIDER_OPTION_BOUNDED_NAT("DELETE_ALL_ROWS_TYPE", delete_all_rows_type,
+ delete_all_rows_type, 1);
+ SPIDER_OPTION_STR_LIST(driver, tgt_drivers);
+ SPIDER_OPTION_STR_LIST(dsn, tgt_dsns);
+ SPIDER_OPTION_STR_LIST(filedsn, tgt_filedsns);
+ SPIDER_OPTION_BOOL("FORCE_BULK_DELETE", force_bulk_delete,
+ force_bulk_delete);
+ SPIDER_OPTION_BOOL("FORCE_BULK_UPDATE", force_bulk_update,
+ force_bulk_update);
+ SPIDER_OPTION_STR_LIST(host, tgt_hosts);
+ SPIDER_OPTION_HINT("IDX", idx);
+ SPIDER_OPTION_BOUNDED_NAT("MULTI_SPLIT_READ", multi_split_read,
+ multi_split_read, 2147483647);
+ SPIDER_OPTION_BOUNDED_NAT_LIST("NET_READ_TIMEOUT", net_read_timeout,
+ net_read_timeouts, 2147483647);
+ SPIDER_OPTION_BOUNDED_NAT_LIST("NET_WRITE_TIMEOUT", net_write_timeout,
+ net_write_timeouts, 2147483647);
+ SPIDER_OPTION_STR_LIST(password, tgt_passwords);
+ SPIDER_OPTION_BOUNDED_NAT_LIST("REMOTE_PORT", port, tgt_ports, 65535);
+ SPIDER_OPTION_NAT_LONGLONG("PRIORITY", priority, priority);
+ SPIDER_OPTION_BOUNDED_NAT("QUERY_CACHE", query_cache, query_cache, 2);
+ SPIDER_OPTION_BOUNDED_NAT("QUERY_CACHE_SYNC", query_cache_sync,
+ query_cache_sync, 3);
+ SPIDER_OPTION_BOOL("READ_ONLY", read_only, read_only_mode);
+ SPIDER_OPTION_STR_LIST(server, server_names);
+ SPIDER_OPTION_BOUNDED_NAT("SKIP_PARALLEL_SEARCH", skip_parallel_search,
+ skip_parallel_search, 3);
+ SPIDER_OPTION_STR_LIST(socket, tgt_sockets);
+ SPIDER_OPTION_STR_LIST(ssl_capath, tgt_ssl_capaths);
+ SPIDER_OPTION_STR_LIST(ssl_ca, tgt_ssl_cas);
+ SPIDER_OPTION_STR_LIST(ssl_cert, tgt_ssl_certs);
+ SPIDER_OPTION_STR_LIST(ssl_cipher, tgt_ssl_ciphers);
+ SPIDER_OPTION_STR_LIST(ssl_key, tgt_ssl_keys);
+ SPIDER_OPTION_BOUNDED_NAT_LIST("SSL_VSC", ssl_vsc, tgt_ssl_vscs, 1);
+ SPIDER_OPTION_STR_LIST(table, tgt_table_names);
+ SPIDER_OPTION_BOUNDED_NAT("TABLE_COUNT_MODE", table_count_mode,
+ table_count_mode, 3);
+ SPIDER_OPTION_STR_LIST(username, tgt_usernames);
+ SPIDER_OPTION_BOOL("USE_PUSHDOWN_UDF", use_pushdown_udf, use_pushdown_udf);
+ SPIDER_OPTION_STR_LIST(wrapper, tgt_wrappers);
+
+ /* Parse the connect strings, from the most specific level
+ (sub-partition, i=4) to the least (CONNECTION string, i=1). */
for (int i = 4; i > 0; i--)
{
if (connect_string)
@@ -2174,7 +2605,26 @@ int spider_parse_connect_info(
goto error_alloc_conn_string;
}
DBUG_ASSERT(error_num_1 == 0);
+ /* If the connect string is explicitly ignored for parsing, or if
+ any option is specified, skip the parsing. */
+ if (spider_param_ignore_comments(current_thd) || option_specified)
+ {
+ if (!spider_param_suppress_comment_ignored_warning(current_thd))
+ push_warning_printf(
+ current_thd, Sql_condition::WARN_LEVEL_WARN,
+ ER_SPIDER_COMMENT_CONNECTION_IGNORED_BY_TABLE_OPTIONS_NUM,
+ ER_SPIDER_COMMENT_CONNECTION_IGNORED_BY_TABLE_OPTIONS_STR,
+ connect_string);
+ continue;
+ }
+ if (create_table)
+ push_warning_printf(current_thd, Sql_condition::WARN_LEVEL_WARN,
+ HA_ERR_UNSUPPORTED,
+ "Spider table params in COMMENT or CONNECTION "
+ "strings have been deprecated "
+ "and will be removed in a future release. "
+ "Please use table options instead.");
start_param = connect_string;
parse.error_num = ER_SPIDER_INVALID_CONNECT_INFO_NUM;
while (*start_param != '\0')
@@ -2193,43 +2643,58 @@ int spider_parse_connect_info(
error_num= parse.fail(true);
goto error;
case 3:
+ SPIDER_PARAM_DEPRECATED_WARNING("abl", 1104);
SPIDER_PARAM_LONG_LIST_WITH_MAX("abl", access_balances, 0,
2147483647);
SPIDER_PARAM_INT_WITH_MAX("aim", auto_increment_mode, 0, 3);
+ SPIDER_PARAM_DEPRECATED_WARNING("alc", 1104);
SPIDER_PARAM_INT("alc", active_link_count, 1);
- SPIDER_PARAM_DEPRECATED_WARNING("bfz");
+ SPIDER_PARAM_DEPRECATED_WARNING("bfz", 1007);
SPIDER_PARAM_INT("bfz", buffer_size, 0);
+ SPIDER_PARAM_DEPRECATED_WARNING("bfr", 1104);
SPIDER_PARAM_LONGLONG("bfr", bgs_first_read, 0);
SPIDER_PARAM_INT("bmd", bgs_mode, 0);
+ SPIDER_PARAM_DEPRECATED_WARNING("bsr", 1104);
SPIDER_PARAM_LONGLONG("bsr", bgs_second_read, 0);
+ SPIDER_PARAM_DEPRECATED_WARNING("bke", 1104);
SPIDER_PARAM_STR("bke", bka_engine);
+ SPIDER_PARAM_DEPRECATED_WARNING("bkm", 1104);
SPIDER_PARAM_INT_WITH_MAX("bkm", bka_mode, 0, 2);
SPIDER_PARAM_INT("bsz", bulk_size, 0);
- SPIDER_PARAM_DEPRECATED_WARNING("btt");
+ SPIDER_PARAM_DEPRECATED_WARNING("btt", 1007);
SPIDER_PARAM_LONG_LIST_WITH_MAX("btt", bka_table_name_types,
0, 1);
+ SPIDER_PARAM_DEPRECATED_WARNING("bum", 1104);
SPIDER_PARAM_INT_WITH_MAX("bum", bulk_update_mode, 0, 2);
SPIDER_PARAM_INT("bus", bulk_update_size, 0);
+ SPIDER_PARAM_DEPRECATED_WARNING("cbm", 1104);
SPIDER_PARAM_INT_WITH_MAX("cbm", crd_bg_mode, 0, 2);
+ SPIDER_PARAM_DEPRECATED_WARNING("civ", 1104);
SPIDER_PARAM_DOUBLE("civ", crd_interval, 0);
- SPIDER_PARAM_DEPRECATED_WARNING("cmd");
+ SPIDER_PARAM_DEPRECATED_WARNING("cmd", 1007);
SPIDER_PARAM_INT_WITH_MAX("cmd", crd_mode, 0, 3);
+ SPIDER_PARAM_DEPRECATED_WARNING("csr", 1104);
SPIDER_PARAM_INT_WITH_MAX("csr", casual_read, 0, 63);
+ SPIDER_PARAM_DEPRECATED_WARNING("csy", 1104);
SPIDER_PARAM_INT_WITH_MAX("csy", crd_sync, 0, 2);
SPIDER_PARAM_LONG_LIST_WITH_MAX("cto", connect_timeouts, 0,
2147483647);
- SPIDER_PARAM_DEPRECATED_WARNING("ctp");
+ SPIDER_PARAM_DEPRECATED_WARNING("ctp", 1007);
SPIDER_PARAM_INT_WITH_MAX("ctp", crd_type, 0, 2);
- SPIDER_PARAM_DEPRECATED_WARNING("cwg");
+ SPIDER_PARAM_DEPRECATED_WARNING("cwg", 1007);
SPIDER_PARAM_DOUBLE("cwg", crd_weight, 1);
SPIDER_PARAM_INT_WITH_MAX("dat", delete_all_rows_type, 0, 1);
+ SPIDER_PARAM_DEPRECATED_WARNING("ddi", 1104);
SPIDER_PARAM_INT_WITH_MAX("ddi", direct_dup_insert, 0, 1);
SPIDER_PARAM_STR_LIST("dff", tgt_default_files);
SPIDER_PARAM_STR_LIST("dfg", tgt_default_groups);
+ SPIDER_PARAM_DEPRECATED_WARNING("dol", 1104);
SPIDER_PARAM_LONGLONG("dol", direct_order_limit, 0);
SPIDER_PARAM_STR_LIST("drv", tgt_drivers);
SPIDER_PARAM_STR_LIST("dsn", tgt_dsns);
+ SPIDER_PARAM_DEPRECATED_WARNING("erm", 1104);
SPIDER_PARAM_INT_WITH_MAX("erm", error_read_mode, 0, 1);
+ SPIDER_PARAM_DEPRECATED_WARNING("ewm", 1104);
SPIDER_PARAM_INT_WITH_MAX("ewm", error_write_mode, 0, 1);
#ifdef HA_CAN_FORCE_BULK_DELETE
SPIDER_PARAM_INT_WITH_MAX("fbd", force_bulk_delete, 0, 1);
@@ -2237,243 +2702,317 @@ int spider_parse_connect_info(
#ifdef HA_CAN_FORCE_BULK_UPDATE
SPIDER_PARAM_INT_WITH_MAX("fbu", force_bulk_update, 0, 1);
#endif
- SPIDER_PARAM_STR_LIST("fds", tgt_filedsns);
- SPIDER_PARAM_LONGLONG("frd", first_read, 0);
- SPIDER_PARAM_DEPRECATED_WARNING("isa");
- SPIDER_PARAM_INT("isa", init_sql_alloc_size, 0);
- SPIDER_PARAM_DEPRECATED_WARNING("ilm");
- SPIDER_PARAM_LONGLONG("ilm", internal_limit, 0);
- SPIDER_PARAM_DEPRECATED_WARNING("ios");
- SPIDER_PARAM_LONGLONG("ios", internal_offset, 0);
- SPIDER_PARAM_INT_WITH_MAX("iom", internal_optimize, 0, 1);
- SPIDER_PARAM_INT_WITH_MAX("iol", internal_optimize_local, 0, 1);
- SPIDER_PARAM_INT_WITH_MAX("lmr", low_mem_read, 0, 1);
- SPIDER_PARAM_INT_WITH_MAX("lcs", load_crd_at_startup, 0, 1);
- SPIDER_PARAM_INT_WITH_MAX("lss", load_sts_at_startup, 0, 1);
- SPIDER_PARAM_LONG_LIST_WITH_MAX("lst", link_statuses, 0, 3);
- SPIDER_PARAM_LONG_LIST_WITH_MAX("mbf", monitoring_bg_flag, 0, 1);
- SPIDER_PARAM_LONGLONG_LIST_WITH_MAX(
- "mbi", monitoring_bg_interval, 0, 4294967295LL);
- SPIDER_PARAM_LONG_LIST_WITH_MAX("mbk", monitoring_bg_kind, 0, 3);
- SPIDER_PARAM_LONG_LIST_WITH_MAX("mbp", monitoring_binlog_pos_at_failing, 0, 2);
- SPIDER_PARAM_LONG_LIST_WITH_MAX("mfg", monitoring_flag, 0, 1);
- SPIDER_PARAM_LONG_LIST_WITH_MAX("mkd", monitoring_kind, 0, 3);
- SPIDER_PARAM_LONGLONG_LIST_WITH_MAX(
- "mlt", monitoring_limit, 0, 9223372036854775807LL);
- SPIDER_PARAM_INT("mod", max_order, 0);
- SPIDER_PARAM_LONGLONG_LIST_WITH_MAX(
- "msi", monitoring_sid, 0, 4294967295LL);
- SPIDER_PARAM_INT_WITH_MAX("msr", multi_split_read, 0, 2147483647);
- SPIDER_PARAM_LONG_LIST_WITH_MAX("nrt", net_read_timeouts, 0,
- 2147483647);
- SPIDER_PARAM_LONG_LIST_WITH_MAX("nwt", net_write_timeouts, 0,
- 2147483647);
- SPIDER_PARAM_STR_LIST("pkn", tgt_pk_names);
- SPIDER_PARAM_LONGLONG("prt", priority, 0);
- SPIDER_PARAM_INT_WITH_MAX("qch", query_cache, 0, 2);
- SPIDER_PARAM_INT_WITH_MAX("qcs", query_cache_sync, 0, 3);
- SPIDER_PARAM_INT_WITH_MAX("qmd", quick_mode, 0, 3);
- SPIDER_PARAM_LONGLONG("qpb", quick_page_byte, 0);
- SPIDER_PARAM_LONGLONG("qps", quick_page_size, 0);
- SPIDER_PARAM_INT_WITH_MAX("rom", read_only_mode, 0, 1);
- SPIDER_PARAM_DOUBLE("rrt", read_rate, 0);
- SPIDER_PARAM_INT_WITH_MAX("rsa", reset_sql_alloc, 0, 1);
- SPIDER_PARAM_INT_WITH_MAX("sbm", sts_bg_mode, 0, 2);
- SPIDER_PARAM_STR_LIST("sca", tgt_ssl_cas);
- SPIDER_PARAM_STR_LIST("sch", tgt_ssl_ciphers);
- SPIDER_PARAM_INT_WITH_MAX("scm", select_column_mode, 0, 1);
- SPIDER_PARAM_STR_LIST("scp", tgt_ssl_capaths);
- SPIDER_PARAM_STR_LIST("scr", tgt_ssl_certs);
- SPIDER_PARAM_INT_WITH_MAX("sdc", skip_default_condition, 0, 1);
- SPIDER_PARAM_LONG_LIST_WITH_MAX("sgb", strict_group_bys, 0, 1);
- SPIDER_PARAM_DOUBLE("siv", sts_interval, 0);
- SPIDER_PARAM_STR_LIST("sky", tgt_ssl_keys);
- SPIDER_PARAM_STR_LIST("sli", static_link_ids);
- SPIDER_PARAM_INT_WITH_MAX("slc", store_last_crd, 0, 1);
- SPIDER_PARAM_INT_WITH_MAX("slm", selupd_lock_mode, 0, 2);
- SPIDER_PARAM_INT_WITH_MAX("sls", store_last_sts, 0, 1);
- SPIDER_PARAM_DEPRECATED_WARNING("smd");
- SPIDER_PARAM_INT_WITH_MAX("smd", sts_mode, 1, 2);
- SPIDER_PARAM_LONGLONG("smr", static_mean_rec_length, 0);
- SPIDER_PARAM_LONGLONG("spr", split_read, 0);
- SPIDER_PARAM_INT_WITH_MAX("sps", skip_parallel_search, 0, 3);
- SPIDER_PARAM_STR_LIST("sqn", tgt_sequence_names);
- SPIDER_PARAM_LONGLONG("srd", second_read, 0);
- SPIDER_PARAM_DOUBLE("srt", scan_rate, 0);
- SPIDER_PARAM_STR_LIST_CHECK("srv", server_names,
- option_struct &&
- option_struct->remote_server);
- SPIDER_PARAM_DOUBLE("ssr", semi_split_read, 0);
- SPIDER_PARAM_LONGLONG("ssl", semi_split_read_limit, 0);
- SPIDER_PARAM_INT_WITH_MAX("ssy", sts_sync, 0, 2);
- SPIDER_PARAM_DEPRECATED_WARNING("stc");
- SPIDER_PARAM_INT_WITH_MAX("stc", semi_table_lock_conn, 0, 1);
- SPIDER_PARAM_DEPRECATED_WARNING("stl");
- SPIDER_PARAM_INT_WITH_MAX("stl", semi_table_lock, 0, 1);
- SPIDER_PARAM_LONGLONG("srs", static_records_for_status, 0);
- SPIDER_PARAM_LONG_LIST_WITH_MAX("svc", tgt_ssl_vscs, 0, 1);
- SPIDER_PARAM_STR_LIST_CHECK("tbl", tgt_table_names,
- option_struct &&
- option_struct->remote_table);
- SPIDER_PARAM_INT_WITH_MAX("tcm", table_count_mode, 0, 3);
- SPIDER_PARAM_INT_WITH_MAX("upu", use_pushdown_udf, 0, 1);
- SPIDER_PARAM_INT_WITH_MAX("utc", use_table_charset, 0, 1);
- error_num = parse.fail(true);
- goto error;
- case 4:
- SPIDER_PARAM_STR_LIST("host", tgt_hosts);
- SPIDER_PARAM_STR_LIST("user", tgt_usernames);
- SPIDER_PARAM_LONG_LIST_WITH_MAX("port", tgt_ports, 0, 65535);
- error_num = parse.fail(true);
- goto error;
- case 5:
- SPIDER_PARAM_STR_LIST_CHECK("table", tgt_table_names,
- option_struct &&
- option_struct->remote_table);
- error_num = parse.fail(true);
- goto error;
- case 6:
- SPIDER_PARAM_STR_LIST("driver", tgt_drivers);
- SPIDER_PARAM_STR_LIST_CHECK("server", server_names,
- option_struct &&
- option_struct->remote_server);
- SPIDER_PARAM_STR_LIST("socket", tgt_sockets);
- SPIDER_PARAM_HINT("idx", key_hint, 3, (int) table_share->keys,
- spider_db_append_key_hint);
- SPIDER_PARAM_STR_LIST("ssl_ca", tgt_ssl_cas);
- SPIDER_PARAM_NUMHINT("skc", static_key_cardinality, 3,
- (int) table_share->keys, spider_set_ll_value);
- error_num = parse.fail(true);
- goto error;
- case 7:
- SPIDER_PARAM_STR_LIST("filedsn", tgt_filedsns);
- SPIDER_PARAM_STR_LIST("wrapper", tgt_wrappers);
- SPIDER_PARAM_STR_LIST("ssl_key", tgt_ssl_keys);
- SPIDER_PARAM_STR_LIST("pk_name", tgt_pk_names);
- error_num = parse.fail(true);
- goto error;
- case 8:
- SPIDER_PARAM_STR_LIST_CHECK("database", tgt_dbs,
- option_struct &&
- option_struct->remote_database);
- SPIDER_PARAM_STR_LIST("password", tgt_passwords);
- SPIDER_PARAM_DEPRECATED_WARNING("sts_mode");
- SPIDER_PARAM_INT_WITH_MAX("sts_mode", sts_mode, 1, 2);
- SPIDER_PARAM_INT_WITH_MAX("sts_sync", sts_sync, 0, 2);
- SPIDER_PARAM_DEPRECATED_WARNING("crd_mode");
- SPIDER_PARAM_INT_WITH_MAX("crd_mode", crd_mode, 0, 3);
- SPIDER_PARAM_INT_WITH_MAX("crd_sync", crd_sync, 0, 2);
- SPIDER_PARAM_DEPRECATED_WARNING("crd_type");
- SPIDER_PARAM_INT_WITH_MAX("crd_type", crd_type, 0, 2);
- SPIDER_PARAM_LONGLONG("priority", priority, 0);
- SPIDER_PARAM_INT("bgs_mode", bgs_mode, 0);
- SPIDER_PARAM_STR_LIST("ssl_cert", tgt_ssl_certs);
- SPIDER_PARAM_INT_WITH_MAX("bka_mode", bka_mode, 0, 2);
- error_num = parse.fail(true);
- goto error;
- case 9:
- SPIDER_PARAM_INT("max_order", max_order, 0);
- SPIDER_PARAM_INT("bulk_size", bulk_size, 0);
- SPIDER_PARAM_DOUBLE("scan_rate", scan_rate, 0);
- SPIDER_PARAM_DOUBLE("read_rate", read_rate, 0);
- error_num = parse.fail(true);
- goto error;
- case 10:
- SPIDER_PARAM_DEPRECATED_WARNING("crd_weight");
- SPIDER_PARAM_DOUBLE("crd_weight", crd_weight, 1);
- SPIDER_PARAM_LONGLONG("split_read", split_read, 0);
- SPIDER_PARAM_INT_WITH_MAX("quick_mode", quick_mode, 0, 3);
- SPIDER_PARAM_STR_LIST("ssl_cipher", tgt_ssl_ciphers);
- SPIDER_PARAM_STR_LIST("ssl_capath", tgt_ssl_capaths);
- SPIDER_PARAM_STR("bka_engine", bka_engine);
- SPIDER_PARAM_LONGLONG("first_read", first_read, 0);
- error_num = parse.fail(true);
- goto error;
- case 11:
- SPIDER_PARAM_INT_WITH_MAX("query_cache", query_cache, 0, 2);
- SPIDER_PARAM_INT_WITH_MAX("crd_bg_mode", crd_bg_mode, 0, 2);
- SPIDER_PARAM_INT_WITH_MAX("sts_bg_mode", sts_bg_mode, 0, 2);
- SPIDER_PARAM_LONG_LIST_WITH_MAX("link_status", link_statuses, 0, 3);
- SPIDER_PARAM_INT_WITH_MAX("casual_read", casual_read, 0, 63);
- SPIDER_PARAM_DEPRECATED_WARNING("buffer_size");
- SPIDER_PARAM_INT("buffer_size", buffer_size, 0);
- error_num = parse.fail(true);
- goto error;
- case 12:
- SPIDER_PARAM_DOUBLE("sts_interval", sts_interval, 0);
- SPIDER_PARAM_DOUBLE("crd_interval", crd_interval, 0);
- SPIDER_PARAM_INT_WITH_MAX("low_mem_read", low_mem_read, 0, 1);
- SPIDER_PARAM_STR_LIST("default_file", tgt_default_files);
- error_num = parse.fail(true);
- goto error;
- case 13:
- SPIDER_PARAM_STR_LIST("default_group", tgt_default_groups);
- SPIDER_PARAM_STR_LIST("sequence_name", tgt_sequence_names);
- error_num = parse.fail(true);
- goto error;
- case 14:
- SPIDER_PARAM_DEPRECATED_WARNING("internal_limit");
- SPIDER_PARAM_LONGLONG("internal_limit", internal_limit, 0);
- SPIDER_PARAM_LONGLONG("bgs_first_read", bgs_first_read, 0);
- SPIDER_PARAM_INT_WITH_MAX("read_only_mode", read_only_mode, 0, 1);
- SPIDER_PARAM_LONG_LIST_WITH_MAX("access_balance", access_balances, 0,
- 2147483647);
- SPIDER_PARAM_STR_LIST("static_link_id", static_link_ids);
- SPIDER_PARAM_INT_WITH_MAX("store_last_crd", store_last_crd, 0, 1);
- SPIDER_PARAM_INT_WITH_MAX("store_last_sts", store_last_sts, 0, 1);
- error_num = parse.fail(true);
- goto error;
- case 15:
- SPIDER_PARAM_DEPRECATED_WARNING("internal_offset");
- SPIDER_PARAM_LONGLONG("internal_offset", internal_offset, 0);
- SPIDER_PARAM_INT_WITH_MAX("reset_sql_alloc", reset_sql_alloc, 0, 1);
- SPIDER_PARAM_DEPRECATED_WARNING("semi_table_lock");
- SPIDER_PARAM_INT_WITH_MAX("semi_table_lock", semi_table_lock, 0, 1);
- SPIDER_PARAM_LONGLONG("quick_page_byte", quick_page_byte, 0);
- SPIDER_PARAM_LONGLONG("quick_page_size", quick_page_size, 0);
- SPIDER_PARAM_LONGLONG("bgs_second_read", bgs_second_read, 0);
- SPIDER_PARAM_LONG_LIST_WITH_MAX("monitoring_flag", monitoring_flag, 0, 1);
- SPIDER_PARAM_LONG_LIST_WITH_MAX("monitoring_kind", monitoring_kind, 0, 3);
- SPIDER_PARAM_DOUBLE("semi_split_read", semi_split_read, 0);
- SPIDER_PARAM_LONG_LIST_WITH_MAX("connect_timeout", connect_timeouts,
- 0, 2147483647);
- SPIDER_PARAM_LONG_LIST_WITH_MAX("strict_group_by",
- strict_group_bys, 0, 1);
- SPIDER_PARAM_INT_WITH_MAX("error_read_mode", error_read_mode, 0, 1);
- error_num = parse.fail(true);
- goto error;
- case 16:
- SPIDER_PARAM_INT_WITH_MAX(
- "multi_split_read", multi_split_read, 0, 2147483647);
- SPIDER_PARAM_INT_WITH_MAX(
- "selupd_lock_mode", selupd_lock_mode, 0, 2);
- SPIDER_PARAM_INT_WITH_MAX(
- "table_count_mode", table_count_mode, 0, 3);
- SPIDER_PARAM_INT_WITH_MAX(
- "use_pushdown_udf", use_pushdown_udf, 0, 1);
- SPIDER_PARAM_LONGLONG_LIST_WITH_MAX(
- "monitoring_limit", monitoring_limit, 0, 9223372036854775807LL);
- SPIDER_PARAM_INT_WITH_MAX(
- "bulk_update_mode", bulk_update_mode, 0, 2);
- SPIDER_PARAM_INT("bulk_update_size", bulk_update_size, 0);
- SPIDER_PARAM_LONG_LIST_WITH_MAX("net_read_timeout",
- net_read_timeouts, 0, 2147483647);
- SPIDER_PARAM_INT_WITH_MAX(
- "error_write_mode", error_write_mode, 0, 1);
- SPIDER_PARAM_INT_WITH_MAX(
- "query_cache_sync", query_cache_sync, 0, 3);
- error_num = parse.fail(true);
- goto error;
- case 17:
- SPIDER_PARAM_INT_WITH_MAX(
- "internal_optimize", internal_optimize, 0, 1);
- SPIDER_PARAM_INT_WITH_MAX(
- "use_table_charset", use_table_charset, 0, 1);
- SPIDER_PARAM_INT_WITH_MAX(
- "direct_dup_insert", direct_dup_insert, 0, 1);
- SPIDER_PARAM_INT("active_link_count", active_link_count, 1);
- SPIDER_PARAM_LONG_LIST_WITH_MAX("net_write_timeout",
- net_write_timeouts, 0, 2147483647);
+ SPIDER_PARAM_STR_LIST("fds", tgt_filedsns);
+ SPIDER_PARAM_DEPRECATED_WARNING("frd", 1104);
+ SPIDER_PARAM_LONGLONG("frd", first_read, 0);
+ SPIDER_PARAM_DEPRECATED_WARNING("isa", 1007);
+ SPIDER_PARAM_INT("isa", init_sql_alloc_size, 0);
+ SPIDER_PARAM_DEPRECATED_WARNING("ilm", 1007);
+ SPIDER_PARAM_LONGLONG("ilm", internal_limit, 0);
+ SPIDER_PARAM_DEPRECATED_WARNING("ios", 1007);
+ SPIDER_PARAM_LONGLONG("ios", internal_offset, 0);
+ SPIDER_PARAM_DEPRECATED_WARNING("iom", 1104);
+ SPIDER_PARAM_INT_WITH_MAX("iom", internal_optimize, 0, 1);
+ SPIDER_PARAM_DEPRECATED_WARNING("iol", 1104);
+ SPIDER_PARAM_INT_WITH_MAX("iol", internal_optimize_local, 0, 1);
+ SPIDER_PARAM_DEPRECATED_WARNING("lmr", 1104);
+ SPIDER_PARAM_INT_WITH_MAX("lmr", low_mem_read, 0, 1);
+ SPIDER_PARAM_DEPRECATED_WARNING("lcs", 1104);
+ SPIDER_PARAM_INT_WITH_MAX("lcs", load_crd_at_startup, 0, 1);
+ SPIDER_PARAM_DEPRECATED_WARNING("lss", 1104);
+ SPIDER_PARAM_INT_WITH_MAX("lss", load_sts_at_startup, 0, 1);
+ SPIDER_PARAM_DEPRECATED_WARNING("lst", 1104);
+ SPIDER_PARAM_LONG_LIST_WITH_MAX("lst", link_statuses, 0, 3);
+ SPIDER_PARAM_DEPRECATED_WARNING("mbf", 1104);
+ SPIDER_PARAM_LONG_LIST_WITH_MAX("mbf", monitoring_bg_flag, 0, 1);
+ SPIDER_PARAM_DEPRECATED_WARNING("mbi", 1104);
+ SPIDER_PARAM_LONGLONG_LIST_WITH_MAX(
+ "mbi", monitoring_bg_interval, 0, 4294967295LL);
+ SPIDER_PARAM_DEPRECATED_WARNING("mbk", 1104);
+ SPIDER_PARAM_LONG_LIST_WITH_MAX("mbk", monitoring_bg_kind, 0, 3);
+ SPIDER_PARAM_DEPRECATED_WARNING("mbp", 1104);
+ SPIDER_PARAM_LONG_LIST_WITH_MAX("mbp", monitoring_binlog_pos_at_failing, 0, 2);
+ SPIDER_PARAM_DEPRECATED_WARNING("mfg", 1104);
+ SPIDER_PARAM_LONG_LIST_WITH_MAX("mfg", monitoring_flag, 0, 1);
+ SPIDER_PARAM_DEPRECATED_WARNING("mkd", 1104);
+ SPIDER_PARAM_LONG_LIST_WITH_MAX("mkd", monitoring_kind, 0, 3);
+ SPIDER_PARAM_DEPRECATED_WARNING("mlt", 1104);
+ SPIDER_PARAM_LONGLONG_LIST_WITH_MAX(
+ "mlt", monitoring_limit, 0, 9223372036854775807LL);
+ SPIDER_PARAM_DEPRECATED_WARNING("mod", 1104);
+ SPIDER_PARAM_INT("mod", max_order, 0);
+ SPIDER_PARAM_DEPRECATED_WARNING("msi", 1104);
+ SPIDER_PARAM_LONGLONG_LIST_WITH_MAX(
+ "msi", monitoring_sid, 0, 4294967295LL);
+ SPIDER_PARAM_INT_WITH_MAX("msr", multi_split_read, 0, 2147483647);
+ SPIDER_PARAM_LONG_LIST_WITH_MAX("nrt", net_read_timeouts, 0,
+ 2147483647);
+ SPIDER_PARAM_LONG_LIST_WITH_MAX("nwt", net_write_timeouts, 0,
+ 2147483647);
+ SPIDER_PARAM_STR_LIST("pkn", tgt_pk_names);
+ SPIDER_PARAM_LONGLONG("prt", priority, 0);
+ SPIDER_PARAM_INT_WITH_MAX("qch", query_cache, 0, 2);
+ SPIDER_PARAM_INT_WITH_MAX("qcs", query_cache_sync, 0, 3);
+ SPIDER_PARAM_DEPRECATED_WARNING("qmd", 1104);
+ SPIDER_PARAM_INT_WITH_MAX("qmd", quick_mode, 0, 3);
+ SPIDER_PARAM_DEPRECATED_WARNING("qpb", 1104);
+ SPIDER_PARAM_LONGLONG("qpb", quick_page_byte, 0);
+ SPIDER_PARAM_DEPRECATED_WARNING("qps", 1104);
+ SPIDER_PARAM_LONGLONG("qps", quick_page_size, 0);
+ SPIDER_PARAM_INT_WITH_MAX("rom", read_only_mode, 0, 1);
+ SPIDER_PARAM_DEPRECATED_WARNING("rrt", 1104);
+ SPIDER_PARAM_DOUBLE("rrt", read_rate, 0);
+ SPIDER_PARAM_DEPRECATED_WARNING("rsa", 1104);
+ SPIDER_PARAM_INT_WITH_MAX("rsa", reset_sql_alloc, 0, 1);
+ SPIDER_PARAM_DEPRECATED_WARNING("sbm", 1104);
+ SPIDER_PARAM_INT_WITH_MAX("sbm", sts_bg_mode, 0, 2);
+ SPIDER_PARAM_STR_LIST("sca", tgt_ssl_cas);
+ SPIDER_PARAM_STR_LIST("sch", tgt_ssl_ciphers);
+ SPIDER_PARAM_DEPRECATED_WARNING("scm", 1104);
+ SPIDER_PARAM_INT_WITH_MAX("scm", select_column_mode, 0, 1);
+ SPIDER_PARAM_STR_LIST("scp", tgt_ssl_capaths);
+ SPIDER_PARAM_STR_LIST("scr", tgt_ssl_certs);
+ SPIDER_PARAM_DEPRECATED_WARNING("sdc", 1104);
+ SPIDER_PARAM_INT_WITH_MAX("sdc", skip_default_condition, 0, 1);
+ SPIDER_PARAM_DEPRECATED_WARNING("sgb", 1104);
+ SPIDER_PARAM_LONG_LIST_WITH_MAX("sgb", strict_group_bys, 0, 1);
+ SPIDER_PARAM_DEPRECATED_WARNING("siv", 1104);
+ SPIDER_PARAM_DOUBLE("siv", sts_interval, 0);
+ SPIDER_PARAM_STR_LIST("sky", tgt_ssl_keys);
+ SPIDER_PARAM_DEPRECATED_WARNING("sli", 1104);
+ SPIDER_PARAM_STR_LIST("sli", static_link_ids);
+ SPIDER_PARAM_DEPRECATED_WARNING("slc", 1104);
+ SPIDER_PARAM_INT_WITH_MAX("slc", store_last_crd, 0, 1);
+ SPIDER_PARAM_DEPRECATED_WARNING("slm", 1104);
+ SPIDER_PARAM_INT_WITH_MAX("slm", selupd_lock_mode, 0, 2);
+ SPIDER_PARAM_DEPRECATED_WARNING("sls", 1104);
+ SPIDER_PARAM_INT_WITH_MAX("sls", store_last_sts, 0, 1);
+ SPIDER_PARAM_DEPRECATED_WARNING("smd", 1007);
+ SPIDER_PARAM_INT_WITH_MAX("smd", sts_mode, 1, 2);
+ SPIDER_PARAM_DEPRECATED_WARNING("smr", 1104);
+ SPIDER_PARAM_LONGLONG("smr", static_mean_rec_length, 0);
+ SPIDER_PARAM_DEPRECATED_WARNING("spr", 1104);
+ SPIDER_PARAM_LONGLONG("spr", split_read, 0);
+ SPIDER_PARAM_INT_WITH_MAX("sps", skip_parallel_search, 0, 3);
+ SPIDER_PARAM_DEPRECATED_WARNING("sqn", 1104);
+ SPIDER_PARAM_STR_LIST("sqn", tgt_sequence_names);
+ SPIDER_PARAM_DEPRECATED_WARNING("srd", 1104);
+ SPIDER_PARAM_LONGLONG("srd", second_read, 0);
+ SPIDER_PARAM_DEPRECATED_WARNING("srt", 1104);
+ SPIDER_PARAM_DOUBLE("srt", scan_rate, 0);
+ SPIDER_PARAM_STR_LIST("srv", server_names);
+ SPIDER_PARAM_DEPRECATED_WARNING("ssr", 1104);
+ SPIDER_PARAM_DOUBLE("ssr", semi_split_read, 0);
+ SPIDER_PARAM_DEPRECATED_WARNING("ssl", 1104);
+ SPIDER_PARAM_LONGLONG("ssl", semi_split_read_limit, 0);
+ SPIDER_PARAM_DEPRECATED_WARNING("ssy", 1104);
+ SPIDER_PARAM_INT_WITH_MAX("ssy", sts_sync, 0, 2);
+ SPIDER_PARAM_DEPRECATED_WARNING("stc", 1007);
+ SPIDER_PARAM_INT_WITH_MAX("stc", semi_table_lock_conn, 0, 1);
+ SPIDER_PARAM_DEPRECATED_WARNING("stl", 1007);
+ SPIDER_PARAM_INT_WITH_MAX("stl", semi_table_lock, 0, 1);
+ SPIDER_PARAM_DEPRECATED_WARNING("srs", 1104);
+ SPIDER_PARAM_LONGLONG("srs", static_records_for_status, 0);
+ SPIDER_PARAM_LONG_LIST_WITH_MAX("svc", tgt_ssl_vscs, 0, 1);
+ SPIDER_PARAM_STR_LIST("tbl", tgt_table_names);
+ SPIDER_PARAM_INT_WITH_MAX("tcm", table_count_mode, 0, 3);
+ SPIDER_PARAM_INT_WITH_MAX("upu", use_pushdown_udf, 0, 1);
+ SPIDER_PARAM_DEPRECATED_WARNING("utc", 1104);
+ SPIDER_PARAM_INT_WITH_MAX("utc", use_table_charset, 0, 1);
+ error_num= parse.fail(true);
+ goto error;
+ case 4:
+ SPIDER_PARAM_STR_LIST("host", tgt_hosts);
+ SPIDER_PARAM_STR_LIST("user", tgt_usernames);
+ SPIDER_PARAM_LONG_LIST_WITH_MAX("port", tgt_ports, 0, 65535);
+ error_num= parse.fail(true);
+ goto error;
+ case 5:
+ SPIDER_PARAM_STR_LIST("table", tgt_table_names);
+ error_num= parse.fail(true);
+ goto error;
+ case 6:
+ SPIDER_PARAM_STR_LIST("driver", tgt_drivers);
+ SPIDER_PARAM_STR_LIST("server", server_names);
+ SPIDER_PARAM_STR_LIST("socket", tgt_sockets);
+ SPIDER_PARAM_HINT("idx", key_hint, 3, (int) table_share->keys,
+ spider_db_append_key_hint);
+ SPIDER_PARAM_STR_LIST("ssl_ca", tgt_ssl_cas);
+ SPIDER_PARAM_DEPRECATED_WARNING("skc", 1104);
+ SPIDER_PARAM_NUMHINT("skc", static_key_cardinality, 3,
+ (int) table_share->keys, spider_set_ll_value);
+ error_num= parse.fail(true);
+ goto error;
+ case 7:
+ SPIDER_PARAM_STR_LIST("filedsn", tgt_filedsns);
+ SPIDER_PARAM_STR_LIST("wrapper", tgt_wrappers);
+ SPIDER_PARAM_STR_LIST("ssl_key", tgt_ssl_keys);
+ SPIDER_PARAM_DEPRECATED_WARNING("pk_name", 1104);
+ SPIDER_PARAM_STR_LIST("pk_name", tgt_pk_names);
+ error_num= parse.fail(true);
+ goto error;
+ case 8:
+ SPIDER_PARAM_STR_LIST("database", tgt_dbs);
+ SPIDER_PARAM_STR_LIST("password", tgt_passwords);
+ SPIDER_PARAM_DEPRECATED_WARNING("sts_mode", 1007);
+ SPIDER_PARAM_INT_WITH_MAX("sts_mode", sts_mode, 1, 2);
+ SPIDER_PARAM_DEPRECATED_WARNING("sts_sync", 1104);
+ SPIDER_PARAM_INT_WITH_MAX("sts_sync", sts_sync, 0, 2);
+ SPIDER_PARAM_DEPRECATED_WARNING("crd_mode", 1007);
+ SPIDER_PARAM_INT_WITH_MAX("crd_mode", crd_mode, 0, 3);
+ SPIDER_PARAM_DEPRECATED_WARNING("crd_sync", 1104);
+ SPIDER_PARAM_INT_WITH_MAX("crd_sync", crd_sync, 0, 2);
+ SPIDER_PARAM_DEPRECATED_WARNING("crd_type", 1007);
+ SPIDER_PARAM_INT_WITH_MAX("crd_type", crd_type, 0, 2);
+ SPIDER_PARAM_LONGLONG("priority", priority, 0);
+ SPIDER_PARAM_INT("bgs_mode", bgs_mode, 0);
+ SPIDER_PARAM_STR_LIST("ssl_cert", tgt_ssl_certs);
+ SPIDER_PARAM_DEPRECATED_WARNING("bka_mode", 1104);
+ SPIDER_PARAM_INT_WITH_MAX("bka_mode", bka_mode, 0, 2);
+ error_num= parse.fail(true);
+ goto error;
+ case 9:
+ SPIDER_PARAM_DEPRECATED_WARNING("max_order", 1104);
+ SPIDER_PARAM_INT("max_order", max_order, 0);
+ SPIDER_PARAM_DEPRECATED_WARNING("bulk_size", 1104);
+ SPIDER_PARAM_INT("bulk_size", bulk_size, 0);
+ SPIDER_PARAM_DEPRECATED_WARNING("scan_rate", 1104);
+ SPIDER_PARAM_DOUBLE("scan_rate", scan_rate, 0);
+ SPIDER_PARAM_DEPRECATED_WARNING("read_rate", 1104);
+ SPIDER_PARAM_DOUBLE("read_rate", read_rate, 0);
+ error_num= parse.fail(true);
+ goto error;
+ case 10:
+ SPIDER_PARAM_DEPRECATED_WARNING("crd_weight", 1007);
+ SPIDER_PARAM_DOUBLE("crd_weight", crd_weight, 1);
+ SPIDER_PARAM_DEPRECATED_WARNING("split_read", 1104);
+ SPIDER_PARAM_LONGLONG("split_read", split_read, 0);
+ SPIDER_PARAM_DEPRECATED_WARNING("quick_mode", 1104);
+ SPIDER_PARAM_INT_WITH_MAX("quick_mode", quick_mode, 0, 3);
+ SPIDER_PARAM_STR_LIST("ssl_cipher", tgt_ssl_ciphers);
+ SPIDER_PARAM_STR_LIST("ssl_capath", tgt_ssl_capaths);
+ SPIDER_PARAM_DEPRECATED_WARNING("bka_engine", 1104);
+ SPIDER_PARAM_STR("bka_engine", bka_engine);
+ SPIDER_PARAM_DEPRECATED_WARNING("first_read", 1104);
+ SPIDER_PARAM_LONGLONG("first_read", first_read, 0);
+ error_num= parse.fail(true);
+ goto error;
+ case 11:
+ SPIDER_PARAM_DEPRECATED_WARNING("query_cache", 1104);
+ SPIDER_PARAM_INT_WITH_MAX("query_cache", query_cache, 0, 2);
+ SPIDER_PARAM_DEPRECATED_WARNING("crd_bg_mode", 1104);
+ SPIDER_PARAM_INT_WITH_MAX("crd_bg_mode", crd_bg_mode, 0, 2);
+ SPIDER_PARAM_DEPRECATED_WARNING("sts_bg_mode", 1104);
+ SPIDER_PARAM_INT_WITH_MAX("sts_bg_mode", sts_bg_mode, 0, 2);
+ SPIDER_PARAM_DEPRECATED_WARNING("link_status", 1104);
+ SPIDER_PARAM_LONG_LIST_WITH_MAX("link_status", link_statuses, 0, 3);
+ SPIDER_PARAM_DEPRECATED_WARNING("casual_read", 1104);
+ SPIDER_PARAM_INT_WITH_MAX("casual_read", casual_read, 0, 63);
+ SPIDER_PARAM_DEPRECATED_WARNING("buffer_size", 1007);
+ SPIDER_PARAM_INT("buffer_size", buffer_size, 0);
+ error_num= parse.fail(true);
+ goto error;
+ case 12:
+ SPIDER_PARAM_DEPRECATED_WARNING("sts_interval", 1104);
+ SPIDER_PARAM_DOUBLE("sts_interval", sts_interval, 0);
+ SPIDER_PARAM_DEPRECATED_WARNING("crd_interval", 1104);
+ SPIDER_PARAM_DOUBLE("crd_interval", crd_interval, 0);
+ SPIDER_PARAM_DEPRECATED_WARNING("low_mem_read", 1104);
+ SPIDER_PARAM_INT_WITH_MAX("low_mem_read", low_mem_read, 0, 1);
+ SPIDER_PARAM_STR_LIST("default_file", tgt_default_files);
+ error_num= parse.fail(true);
+ goto error;
+ case 13:
+ SPIDER_PARAM_STR_LIST("default_group", tgt_default_groups);
+ SPIDER_PARAM_DEPRECATED_WARNING("sequence_name", 1104);
+ SPIDER_PARAM_STR_LIST("sequence_name", tgt_sequence_names);
+ error_num= parse.fail(true);
+ goto error;
+ case 14:
+ SPIDER_PARAM_DEPRECATED_WARNING("internal_limit", 1007);
+ SPIDER_PARAM_LONGLONG("internal_limit", internal_limit, 0);
+ SPIDER_PARAM_DEPRECATED_WARNING("bgs_first_read", 1104);
+ SPIDER_PARAM_LONGLONG("bgs_first_read", bgs_first_read, 0);
+ SPIDER_PARAM_INT_WITH_MAX("read_only_mode", read_only_mode, 0, 1);
+ SPIDER_PARAM_DEPRECATED_WARNING("access_balance", 1104);
+ SPIDER_PARAM_LONG_LIST_WITH_MAX("access_balance", access_balances, 0,
+ 2147483647);
+ SPIDER_PARAM_DEPRECATED_WARNING("static_link_id", 1104);
+ SPIDER_PARAM_STR_LIST("static_link_id", static_link_ids);
+ SPIDER_PARAM_DEPRECATED_WARNING("store_last_crd", 1104);
+ SPIDER_PARAM_INT_WITH_MAX("store_last_crd", store_last_crd, 0, 1);
+ SPIDER_PARAM_DEPRECATED_WARNING("store_last_sts", 1104);
+ SPIDER_PARAM_INT_WITH_MAX("store_last_sts", store_last_sts, 0, 1);
+ error_num= parse.fail(true);
+ goto error;
+ case 15:
+ SPIDER_PARAM_DEPRECATED_WARNING("internal_offset", 1007);
+ SPIDER_PARAM_LONGLONG("internal_offset", internal_offset, 0);
+ SPIDER_PARAM_DEPRECATED_WARNING("reset_sql_alloc", 1104);
+ SPIDER_PARAM_INT_WITH_MAX("reset_sql_alloc", reset_sql_alloc, 0, 1);
+ SPIDER_PARAM_DEPRECATED_WARNING("semi_table_lock", 1007);
+ SPIDER_PARAM_INT_WITH_MAX("semi_table_lock", semi_table_lock, 0, 1);
+ SPIDER_PARAM_DEPRECATED_WARNING("quick_page_byte", 1104);
+ SPIDER_PARAM_LONGLONG("quick_page_byte", quick_page_byte, 0);
+ SPIDER_PARAM_DEPRECATED_WARNING("quick_page_size", 1104);
+ SPIDER_PARAM_LONGLONG("quick_page_size", quick_page_size, 0);
+ SPIDER_PARAM_DEPRECATED_WARNING("bgs_second_read", 1104);
+ SPIDER_PARAM_LONGLONG("bgs_second_read", bgs_second_read, 0);
+ SPIDER_PARAM_DEPRECATED_WARNING("monitoring_flag", 1104);
+ SPIDER_PARAM_LONG_LIST_WITH_MAX("monitoring_flag", monitoring_flag, 0, 1);
+ SPIDER_PARAM_DEPRECATED_WARNING("monitoring_kind", 1104);
+ SPIDER_PARAM_LONG_LIST_WITH_MAX("monitoring_kind", monitoring_kind, 0, 3);
+ SPIDER_PARAM_DEPRECATED_WARNING("semi_split_read", 1104);
+ SPIDER_PARAM_DOUBLE("semi_split_read", semi_split_read, 0);
+ SPIDER_PARAM_LONG_LIST_WITH_MAX("connect_timeout", connect_timeouts,
+ 0, 2147483647);
+ SPIDER_PARAM_DEPRECATED_WARNING("strict_group_by", 1104);
+ SPIDER_PARAM_LONG_LIST_WITH_MAX("strict_group_by",
+ strict_group_bys, 0, 1);
+ SPIDER_PARAM_DEPRECATED_WARNING("error_read_mode", 1104);
+ SPIDER_PARAM_INT_WITH_MAX("error_read_mode", error_read_mode, 0, 1);
+ error_num= parse.fail(true);
+ goto error;
+ case 16:
+ SPIDER_PARAM_INT_WITH_MAX(
+ "multi_split_read", multi_split_read, 0, 2147483647);
+ SPIDER_PARAM_DEPRECATED_WARNING("selupd_lock_mode", 1104);
+ SPIDER_PARAM_INT_WITH_MAX(
+ "selupd_lock_mode", selupd_lock_mode, 0, 2);
+ SPIDER_PARAM_INT_WITH_MAX(
+ "table_count_mode", table_count_mode, 0, 3);
+ SPIDER_PARAM_INT_WITH_MAX(
+ "use_pushdown_udf", use_pushdown_udf, 0, 1);
+ SPIDER_PARAM_DEPRECATED_WARNING("monitoring_limit", 1104);
+ SPIDER_PARAM_LONGLONG_LIST_WITH_MAX(
+ "monitoring_limit", monitoring_limit, 0, 9223372036854775807LL);
+ SPIDER_PARAM_DEPRECATED_WARNING("bulk_update_mode", 1104);
+ SPIDER_PARAM_INT_WITH_MAX(
+ "bulk_update_mode", bulk_update_mode, 0, 2);
+ SPIDER_PARAM_INT("bulk_update_size", bulk_update_size, 0);
+ SPIDER_PARAM_LONG_LIST_WITH_MAX("net_read_timeout",
+ net_read_timeouts, 0, 2147483647);
+ SPIDER_PARAM_DEPRECATED_WARNING("error_write_mode", 1104);
+ SPIDER_PARAM_INT_WITH_MAX(
+ "error_write_mode", error_write_mode, 0, 1);
+ SPIDER_PARAM_INT_WITH_MAX(
+ "query_cache_sync", query_cache_sync, 0, 3);
+ error_num= parse.fail(true);
+ goto error;
+ case 17:
+ SPIDER_PARAM_DEPRECATED_WARNING("internal_optimize", 1104);
+ SPIDER_PARAM_INT_WITH_MAX(
+ "internal_optimize", internal_optimize, 0, 1);
+ SPIDER_PARAM_DEPRECATED_WARNING("use_table_charset", 1104);
+ SPIDER_PARAM_INT_WITH_MAX(
+ "use_table_charset", use_table_charset, 0, 1);
+ SPIDER_PARAM_DEPRECATED_WARNING("direct_dup_insert", 1104);
+ SPIDER_PARAM_INT_WITH_MAX(
+ "direct_dup_insert", direct_dup_insert, 0, 1);
+ SPIDER_PARAM_DEPRECATED_WARNING("active_link_count", 1104);
+ SPIDER_PARAM_INT("active_link_count", active_link_count, 1);
+ SPIDER_PARAM_LONG_LIST_WITH_MAX("net_write_timeout",
+ net_write_timeouts, 0, 2147483647);
#ifdef HA_CAN_FORCE_BULK_DELETE
SPIDER_PARAM_INT_WITH_MAX(
"force_bulk_delete", force_bulk_delete, 0, 1);
@@ -2485,31 +3024,38 @@ int spider_parse_connect_info(
error_num = parse.fail(true);
goto error;
case 18:
+ SPIDER_PARAM_DEPRECATED_WARNING("select_column_mode", 1104);
SPIDER_PARAM_INT_WITH_MAX(
"select_column_mode", select_column_mode, 0, 1);
+ SPIDER_PARAM_DEPRECATED_WARNING("monitoring_bg_flag", 1104);
SPIDER_PARAM_LONG_LIST_WITH_MAX(
"monitoring_bg_flag", monitoring_bg_flag, 0, 1);
+ SPIDER_PARAM_DEPRECATED_WARNING("monitoring_bg_kind", 1104);
SPIDER_PARAM_LONG_LIST_WITH_MAX(
"monitoring_bg_kind", monitoring_bg_kind, 0, 3);
+ SPIDER_PARAM_DEPRECATED_WARNING("direct_order_limit", 1104);
SPIDER_PARAM_LONGLONG(
"direct_order_limit", direct_order_limit, 0);
error_num = parse.fail(true);
goto error;
case 19:
- SPIDER_PARAM_DEPRECATED_WARNING("init_sql_alloc_size");
+ SPIDER_PARAM_DEPRECATED_WARNING("init_sql_alloc_size", 1007);
SPIDER_PARAM_INT("init_sql_alloc_size", init_sql_alloc_size, 0);
SPIDER_PARAM_INT_WITH_MAX(
"auto_increment_mode", auto_increment_mode, 0, 3);
- SPIDER_PARAM_DEPRECATED_WARNING("bka_table_name_type");
+ SPIDER_PARAM_DEPRECATED_WARNING("bka_table_name_type", 1007);
SPIDER_PARAM_LONG_LIST_WITH_MAX("bka_table_name_type",
bka_table_name_types, 0, 1);
+ SPIDER_PARAM_DEPRECATED_WARNING("load_crd_at_startup", 1104);
SPIDER_PARAM_INT_WITH_MAX(
"load_crd_at_startup", load_crd_at_startup, 0, 1);
+ SPIDER_PARAM_DEPRECATED_WARNING("load_sts_at_startup", 1104);
SPIDER_PARAM_INT_WITH_MAX(
"load_sts_at_startup", load_sts_at_startup, 0, 1);
error_num = parse.fail(true);
goto error;
case 20:
+ SPIDER_PARAM_DEPRECATED_WARNING("monitoring_server_id", 1104);
SPIDER_PARAM_LONGLONG_LIST_WITH_MAX(
"monitoring_server_id", monitoring_sid, 0, 4294967295LL);
SPIDER_PARAM_INT_WITH_MAX(
@@ -2519,6 +3065,7 @@ int spider_parse_connect_info(
error_num = parse.fail(true);
goto error;
case 21:
+ SPIDER_PARAM_DEPRECATED_WARNING("semi_split_read_limit", 1104);
SPIDER_PARAM_LONGLONG(
"semi_split_read_limit", semi_split_read_limit, 0);
error_num = parse.fail(true);
@@ -2526,33 +3073,40 @@ int spider_parse_connect_info(
case 22:
SPIDER_PARAM_LONG_LIST_WITH_MAX(
"ssl_verify_server_cert", tgt_ssl_vscs, 0, 1);
+ SPIDER_PARAM_DEPRECATED_WARNING("monitoring_bg_interval", 1104);
SPIDER_PARAM_LONGLONG_LIST_WITH_MAX(
"monitoring_bg_interval", monitoring_bg_interval, 0, 4294967295LL);
+ SPIDER_PARAM_DEPRECATED_WARNING("skip_default_condition", 1104);
SPIDER_PARAM_INT_WITH_MAX(
"skip_default_condition", skip_default_condition, 0, 1);
+ SPIDER_PARAM_DEPRECATED_WARNING("static_mean_rec_length", 1104);
SPIDER_PARAM_LONGLONG(
"static_mean_rec_length", static_mean_rec_length, 0);
error_num = parse.fail(true);
goto error;
case 23:
+ SPIDER_PARAM_DEPRECATED_WARNING("internal_optimize_local", 1104);
SPIDER_PARAM_INT_WITH_MAX(
"internal_optimize_local", internal_optimize_local, 0, 1);
error_num = parse.fail(true);
goto error;
case 25:
+ SPIDER_PARAM_DEPRECATED_WARNING("static_records_for_status", 1104);
SPIDER_PARAM_LONGLONG("static_records_for_status",
static_records_for_status, 0);
+ SPIDER_PARAM_DEPRECATED_WARNING("static_key_cardinality", 1104);
SPIDER_PARAM_NUMHINT("static_key_cardinality", static_key_cardinality,
3, (int) table_share->keys, spider_set_ll_value);
error_num = parse.fail(true);
goto error;
case 26:
- SPIDER_PARAM_DEPRECATED_WARNING("semi_table_lock_connection");
+ SPIDER_PARAM_DEPRECATED_WARNING("semi_table_lock_connection", 1007);
SPIDER_PARAM_INT_WITH_MAX(
"semi_table_lock_connection", semi_table_lock_conn, 0, 1);
error_num = parse.fail(true);
goto error;
case 32:
+ SPIDER_PARAM_DEPRECATED_WARNING("monitoring_binlog_pos_at_failing", 1104);
SPIDER_PARAM_LONG_LIST_WITH_MAX("monitoring_binlog_pos_at_failing",
monitoring_binlog_pos_at_failing, 0, 2);
error_num = parse.fail(true);
@@ -2566,9 +3120,6 @@ int spider_parse_connect_info(
}
}
- SPIDER_OPTION_STR_LIST("server", remote_server, server_names);
- SPIDER_OPTION_STR_LIST("database", remote_database, tgt_dbs);
- SPIDER_OPTION_STR_LIST("table", remote_table, tgt_table_names);
/* check all_link_count */
share->all_link_count = 1;
@@ -3945,7 +4496,7 @@ void spider_print_keys(
int spider_create_conn_keys(
SPIDER_SHARE *share
) {
- int roop_count, roop_count2;
+ int roop_count;
char *tmp_name, port_str[6];
uint length_base = sizeof(uint) * share->all_link_count;
uint *conn_keys_lengths;
@@ -3963,70 +4514,80 @@ int spider_create_conn_keys(
sql_dbton_ids = (uint *) ptr;
share->conn_keys_charlen = 0;
- for (roop_count = 0; roop_count < (int) share->all_link_count; roop_count++)
+ for (int all_link_idx = 0; all_link_idx < (int) share->all_link_count; all_link_idx++)
{
bool get_sql_id = FALSE;
- for (roop_count2 = 0; roop_count2 < SPIDER_DBTON_SIZE; roop_count2++)
- {
- DBUG_PRINT("info",("spider share->tgt_wrappers[%d]=%s", roop_count,
- share->tgt_wrappers[roop_count]));
- DBUG_PRINT("info",("spider spider_dbton[%d].wrapper=%s", roop_count2,
- spider_dbton[roop_count2].wrapper ?
- spider_dbton[roop_count2].wrapper : "NULL"));
+ /**
+ Find all `SPIDER_DBTON`s with the same wrapper as the target
+ server and set the bitmap. Stop at the first `SPIDER_DBTON` whose
+ db_access_type is sql
+
+ fixme: the logic may be more complicated than the intended
+ one. For one thing, ALL `SPIDER_DBTON`s have sql access
+ type. Consider removing everything to do with the db access
+ type.
+ */
+ for (int dbton_idx = 0; dbton_idx < SPIDER_DBTON_SIZE; dbton_idx++)
+ {
+ DBUG_PRINT("info",("spider share->tgt_wrappers[%d]=%s", all_link_idx,
+ share->tgt_wrappers[all_link_idx]));
+ DBUG_PRINT("info",("spider spider_dbton[%d].wrapper=%s", dbton_idx,
+ spider_dbton[dbton_idx].wrapper ?
+ spider_dbton[dbton_idx].wrapper : "NULL"));
if (
- spider_dbton[roop_count2].wrapper &&
- !strcasecmp(share->tgt_wrappers[roop_count],
- spider_dbton[roop_count2].wrapper)
+ spider_dbton[dbton_idx].wrapper &&
+ !strcasecmp(share->tgt_wrappers[all_link_idx],
+ spider_dbton[dbton_idx].wrapper)
) {
- spider_set_bit(share->dbton_bitmap, roop_count2);
+ spider_set_bit(share->dbton_bitmap, dbton_idx);
if (
!get_sql_id &&
- spider_dbton[roop_count2].db_access_type == SPIDER_DB_ACCESS_TYPE_SQL
+ spider_dbton[dbton_idx].db_access_type == SPIDER_DB_ACCESS_TYPE_SQL
) {
- sql_dbton_ids[roop_count] = roop_count2;
+ sql_dbton_ids[all_link_idx] = dbton_idx;
get_sql_id = TRUE;
break;
}
}
}
if (!get_sql_id)
- sql_dbton_ids[roop_count] = SPIDER_DBTON_SIZE;
+ sql_dbton_ids[all_link_idx] = SPIDER_DBTON_SIZE;
bool tables_on_different_db_are_joinable;
if (get_sql_id)
{
tables_on_different_db_are_joinable =
- spider_dbton[sql_dbton_ids[roop_count]].db_util->
+ spider_dbton[sql_dbton_ids[all_link_idx]].db_util->
tables_on_different_db_are_joinable();
} else {
tables_on_different_db_are_joinable = TRUE;
}
- conn_keys_lengths[roop_count]
+ conn_keys_lengths[all_link_idx]
= 1
- + share->tgt_wrappers_lengths[roop_count] + 1
- + share->tgt_hosts_lengths[roop_count] + 1
+ + share->tgt_wrappers_lengths[all_link_idx] + 1
+ + share->tgt_hosts_lengths[all_link_idx] + 1
+ 5 + 1
- + share->tgt_sockets_lengths[roop_count] + 1
+ + share->tgt_sockets_lengths[all_link_idx] + 1
+ (tables_on_different_db_are_joinable ?
- 0 : share->tgt_dbs_lengths[roop_count] + 1)
- + share->tgt_usernames_lengths[roop_count] + 1
- + share->tgt_passwords_lengths[roop_count] + 1
- + share->tgt_ssl_cas_lengths[roop_count] + 1
- + share->tgt_ssl_capaths_lengths[roop_count] + 1
- + share->tgt_ssl_certs_lengths[roop_count] + 1
- + share->tgt_ssl_ciphers_lengths[roop_count] + 1
- + share->tgt_ssl_keys_lengths[roop_count] + 1
+ 0 : share->tgt_dbs_lengths[all_link_idx] + 1)
+ + share->tgt_usernames_lengths[all_link_idx] + 1
+ + share->tgt_passwords_lengths[all_link_idx] + 1
+ + share->tgt_ssl_cas_lengths[all_link_idx] + 1
+ + share->tgt_ssl_capaths_lengths[all_link_idx] + 1
+ + share->tgt_ssl_certs_lengths[all_link_idx] + 1
+ + share->tgt_ssl_ciphers_lengths[all_link_idx] + 1
+ + share->tgt_ssl_keys_lengths[all_link_idx] + 1
+ 1 + 1
- + share->tgt_default_files_lengths[roop_count] + 1
- + share->tgt_default_groups_lengths[roop_count] + 1
- + share->tgt_dsns_lengths[roop_count] + 1
- + share->tgt_filedsns_lengths[roop_count] + 1
- + share->tgt_drivers_lengths[roop_count];
- share->conn_keys_charlen += conn_keys_lengths[roop_count] + 2;
+ + share->tgt_default_files_lengths[all_link_idx] + 1
+ + share->tgt_default_groups_lengths[all_link_idx] + 1
+ + share->tgt_dsns_lengths[all_link_idx] + 1
+ + share->tgt_filedsns_lengths[all_link_idx] + 1
+ + share->tgt_drivers_lengths[all_link_idx];
+ share->conn_keys_charlen += conn_keys_lengths[all_link_idx] + 2;
}
if (!(share->conn_keys = (char **)
- spider_bulk_alloc_mem(spider_current_trx, SPD_MID_CREATE_CONN_KEYS_1,
- __func__, __FILE__, __LINE__, MYF(MY_WME | MY_ZEROFILL),
+ spider_bulk_malloc(spider_current_trx, SPD_MID_CREATE_CONN_KEYS_1,
+ MYF(MY_WME | MY_ZEROFILL),
&share->conn_keys, sizeof(char *) * share->all_link_count,
&share->conn_keys_lengths, length_base,
&share->conn_keys_hash_value,
@@ -4182,15 +4743,15 @@ int spider_create_conn_keys(
&spider_open_connections, (uchar*) share->conn_keys[roop_count],
share->conn_keys_lengths[roop_count]);
}
- for (roop_count2 = 0; roop_count2 < SPIDER_DBTON_SIZE; roop_count2++)
+ for (int dbton_idx = 0; dbton_idx < SPIDER_DBTON_SIZE; dbton_idx++)
{
- if (spider_bit_is_set(share->dbton_bitmap, roop_count2))
+ if (spider_bit_is_set(share->dbton_bitmap, dbton_idx))
{
- share->use_sql_dbton_ids[share->use_dbton_count] = roop_count2;
- share->sql_dbton_id_to_seq[roop_count2] = share->use_dbton_count;
- share->use_sql_dbton_count++;
- share->use_dbton_ids[share->use_dbton_count] = roop_count2;
- share->dbton_id_to_seq[roop_count2] = share->use_dbton_count;
+ share->use_sql_dbton_ids[share->use_dbton_count] = dbton_idx;
+ share->sql_dbton_id_to_seq[dbton_idx] = share->use_dbton_count;
+ share->use_sql_dbton_count++;
+ share->use_dbton_ids[share->use_dbton_count] = dbton_idx;
+ share->dbton_id_to_seq[dbton_idx] = share->use_dbton_count;
share->use_dbton_count++;
}
}
@@ -4390,1012 +4951,619 @@ error_alloc_share:
DBUG_RETURN(NULL);
}
-SPIDER_SHARE *spider_get_share(
- const char *table_name,
- TABLE *table,
+/**
+ Checks for spider table self-reference
+
+ Get the user variable value (source) and compare it with the user
+ variable name (target). If the target is a substring of the source,
+ then there is a self-reference
+
+ @param thd Connection
+ @param share The table share
+ @retval 0 for success, or else the error number
+*/
+int spider_check_for_self_reference(THD *thd, const TABLE_SHARE *share)
+{
+ String target(0);
+ LEX_CSTRING key;
+ DBUG_ENTER("spider_check_for_self_reference");
+
+ target.append(STRING_WITH_LEN(SPIDER_SQL_LOP_CHK_PRM_PRF_STR));
+ target.append(share->path);
+ DBUG_PRINT("info",("spider loop check param name=%s", target.c_ptr()));
+ key = target.to_lex_cstring();
+ const user_var_entry *loop_check= get_variable(&thd->user_vars, &key, FALSE);
+ if (loop_check && loop_check->type_handler()->result_type() == STRING_RESULT)
+ {
+ String expected(0);
+ expected.append(spider_unique_id);
+ expected.append(share->path);
+ expected.append(STRING_WITH_LEN("-"));
+ DBUG_PRINT("info",("spider loop check expected=%s", expected.c_ptr()));
+ DBUG_PRINT("info",("spider loop check param value=%s",
+ loop_check->value));
+ if (unlikely(strstr(loop_check->value, expected.c_ptr())))
+ {
+ const int error_num = ER_SPIDER_INFINITE_LOOP_NUM;
+ my_printf_error(error_num, ER_SPIDER_INFINITE_LOOP_STR, MYF(0),
+ share->db.str, share->table_name.str);
+ DBUG_RETURN(error_num);
+ }
+ }
+ DBUG_RETURN(0);
+}
+
+/** Populate the init_errors and init of share and/or free it */
+void spider_share_init_error_free(
+ SPIDER_SHARE *share,
+ const bool init,
+ const bool free_share
+)
+{
+ share->init_error= TRUE;
+ share->init_error_time= (time_t) time((time_t *) 0);
+ share->init= TRUE;
+ if (free_share)
+ spider_free_share(share);
+}
+
+void spider_lock_udf_table_mon_mutexes(SPIDER_SHARE *share)
+{
+ pthread_mutex_lock(&share->mutex);
+ for (int roop_count = 0;
+ roop_count < (int) spider_udf_table_mon_mutex_count;
+ roop_count++)
+ {
+ if (spider_bit_is_set(share->table_mon_mutex_bitmap, roop_count))
+ pthread_mutex_lock(&spider_udf_table_mon_mutexes[roop_count]);
+ }
+}
+
+void spider_unlock_udf_table_mon_mutexes(SPIDER_SHARE *share)
+{
+ for (int roop_count = 0;
+ roop_count < (int) spider_udf_table_mon_mutex_count;
+ roop_count++)
+ {
+ if (spider_bit_is_set(share->table_mon_mutex_bitmap, roop_count))
+ pthread_mutex_unlock(&spider_udf_table_mon_mutexes[roop_count]);
+ }
+ pthread_mutex_unlock(&share->mutex);
+}
+
+/**
+ Initialises the link_statuses of a spider share
+
+ Open the spider_tables system table, read the link_statuses and
+ update the spider share, and close the table. Frees share if
+ failure
+
+ @param thd Connection
+ @param share The spider share to populate the link_statuses of
+ @param table_share fixme
+ @param sql_command The sql command of the thread
+ @param error_num The error number
+ @retval true Failure
+ false Success
+*/
+bool spider_share_init_link_statuses(
THD *thd,
- ha_spider *spider,
+ SPIDER_SHARE *share,
+ TABLE_SHARE *table_share,
+ const int sql_command,
+ const bool init_share,
int *error_num
-) {
- SPIDER_SHARE *share;
- TABLE_SHARE *table_share = table->s;
- SPIDER_RESULT_LIST *result_list = &spider->result_list;
- uint length, tmp_conn_link_idx = 0, buf_sz;
- char *tmp_name;
- int roop_count;
- double sts_interval;
- int sts_mode;
- int sts_sync;
- int auto_increment_mode;
- double crd_interval;
- int crd_mode;
- int crd_sync;
- char first_byte;
- int semi_table_lock_conn;
- int search_link_idx;
- uint sql_command = thd_sql_command(thd);
- SPIDER_Open_tables_backup open_tables_backup;
+)
+{
MEM_ROOT mem_root;
- TABLE *table_tables = NULL;
- bool init_mem_root = FALSE;
- bool same_server_link;
- int load_sts_at_startup;
- int load_crd_at_startup;
- user_var_entry *loop_check;
- char *loop_check_buf;
- TABLE_SHARE *top_share;
- LEX_CSTRING lex_str;
- DBUG_ENTER("spider_get_share");
- top_share = spider->wide_handler->top_share;
- length = (uint) strlen(table_name);
- my_hash_value_type hash_value = my_calc_hash(&spider_open_tables,
- (uchar*) table_name, length);
- if (top_share)
+ bool init_mem_root= FALSE;
+ TABLE *table_tables;
+ SPIDER_Open_tables_backup open_tables_backup;
+ DBUG_ENTER("spider_share_init_link_statuses");
+ /*
+ The link statuses need to be refreshed from the spider_tables table
+ if the operation:
+ - Is not a DROP TABLE on a permanent table; or
+ - Is an ALTER TABLE.
+
+ Note that SHOW CREATE TABLE is not excluded, because the commands
+ that follow it require up-to-date link statuses.
+ */
+ if ((table_share->tmp_table == NO_TMP_TABLE &&
+ sql_command != SQLCOM_DROP_TABLE) ||
+ /* for alter change link status */
+ sql_command == SQLCOM_ALTER_TABLE)
{
- lex_str.length = top_share->path.length + SPIDER_SQL_LOP_CHK_PRM_PRF_LEN;
- buf_sz = spider_unique_id.length > SPIDER_SQL_LOP_CHK_PRM_PRF_LEN ?
- top_share->path.length + spider_unique_id.length + 2 :
- lex_str.length + 2;
- loop_check_buf = (char *) my_alloca(buf_sz);
- if (unlikely(!loop_check_buf))
+ SPD_INIT_ALLOC_ROOT(&mem_root, 4096, 0, MYF(MY_WME));
+ init_mem_root = TRUE;
+
+ if (!(table_tables =
+ spider_open_sys_table(thd, SPIDER_SYS_TABLES_TABLE_NAME_STR,
+ SPIDER_SYS_TABLES_TABLE_NAME_LEN, FALSE,
+ &open_tables_backup, error_num)))
{
- *error_num = HA_ERR_OUT_OF_MEM;
- DBUG_RETURN(NULL);
+ spider_unlock_udf_table_mon_mutexes(share);
+ spider_share_init_error_free(share, true, true);
+ free_root(&mem_root, MYF(0));
+ DBUG_RETURN(TRUE);
}
- lex_str.str = loop_check_buf + buf_sz - lex_str.length - 2;
- memcpy((void *) lex_str.str,
- SPIDER_SQL_LOP_CHK_PRM_PRF_STR, SPIDER_SQL_LOP_CHK_PRM_PRF_LEN);
- memcpy((void *) (lex_str.str + SPIDER_SQL_LOP_CHK_PRM_PRF_LEN),
- top_share->path.str, top_share->path.length);
- ((char *) lex_str.str)[lex_str.length] = '\0';
- DBUG_PRINT("info",("spider loop check param name=%s", lex_str.str));
- loop_check = get_variable(&thd->user_vars, &lex_str, FALSE);
- if (loop_check && loop_check->type_handler()->result_type() == STRING_RESULT)
- {
- lex_str.length = top_share->path.length + spider_unique_id.length + 1;
- lex_str.str = loop_check_buf + buf_sz - top_share->path.length -
- spider_unique_id.length - 2;
- memcpy((void *) lex_str.str, spider_unique_id.str,
- spider_unique_id.length);
- ((char *) lex_str.str)[lex_str.length - 1] = '-';
- ((char *) lex_str.str)[lex_str.length] = '\0';
- DBUG_PRINT("info",("spider loop check key=%s", lex_str.str));
- DBUG_PRINT("info",("spider loop check param value=%s",
- loop_check->value));
- if (unlikely(strstr(loop_check->value, lex_str.str)))
+ if ((*error_num= spider_get_link_statuses(table_tables, share,
+ &mem_root)))
+ {
+ if (*error_num != HA_ERR_KEY_NOT_FOUND &&
+ *error_num != HA_ERR_END_OF_FILE)
{
- *error_num = ER_SPIDER_INFINITE_LOOP_NUM;
- my_printf_error(*error_num, ER_SPIDER_INFINITE_LOOP_STR, MYF(0),
- top_share->db.str, top_share->table_name.str);
- my_afree(loop_check_buf);
- DBUG_RETURN(NULL);
+ spider_unlock_udf_table_mon_mutexes(share);
+ spider_share_init_error_free(share, init_share, true);
+ spider_sys_close_table(thd, &open_tables_backup);
+ free_root(&mem_root, MYF(0));
+ DBUG_RETURN(TRUE);
}
+ } else
+ {
+ memcpy(share->alter_table.tmp_link_statuses, share->link_statuses,
+ sizeof(long) * share->all_link_count);
+ share->link_status_init = TRUE;
}
- my_afree(loop_check_buf);
+ spider_sys_close_table(thd, &open_tables_backup);
}
- pthread_mutex_lock(&spider_tbl_mutex);
- if (!(share = (SPIDER_SHARE*) my_hash_search_using_hash_value(
- &spider_open_tables, hash_value, (uchar*) table_name, length)))
- {
- if (!(share = spider_create_share(
- table_name, table_share,
- table->part_info,
- hash_value,
- error_num
- ))) {
- goto error_alloc_share;
- }
+ share->have_recovery_link = spider_conn_check_recovery_link(share);
- uint old_elements = spider_open_tables.array.max_element;
- if (my_hash_insert(&spider_open_tables, (uchar*) share))
- {
- *error_num = HA_ERR_OUT_OF_MEM;
- goto error_hash_insert;
- }
- if (spider_open_tables.array.max_element > old_elements)
+ if (init_mem_root)
+ free_root(&mem_root, MYF(0));
+ DBUG_RETURN(FALSE);
+}
+
+/** Creates an `ha_spider` for the sts thread of the spider share. */
+int spider_share_init_sts(
+ const char* table_name,
+ ha_spider *spider,
+ SPIDER_SHARE *share,
+ const bool init_share
+)
+{
+ DBUG_ENTER("spider_share_init_sts");
+ if (int error_num = spider_create_spider_object_for_share(
+ spider->wide_handler->trx, share, &share->sts_spider))
{
- spider_alloc_calc_mem(spider_current_trx,
- spider_open_tables,
- (spider_open_tables.array.max_element - old_elements) *
- spider_open_tables.array.size_of_element);
+ pthread_mutex_unlock(&share->mutex);
+ spider_share_init_error_free(share, init_share, true);
+ DBUG_RETURN(error_num);
}
+ share->sts_thread =
+ &spider_table_sts_threads[my_calc_hash(&spider_open_tables,
+ (uchar *) table_name,
+ (uint) strlen(table_name)) %
+ spider_param_table_sts_thread_count()];
+ share->sts_spider_init = TRUE;
+ DBUG_RETURN(0);
+}
- spider->share = share;
- spider->conn_link_idx = &tmp_conn_link_idx;
-
- share->use_count++;
- pthread_mutex_unlock(&spider_tbl_mutex);
-
- if (!share->link_status_init)
+/** Creates an `ha_spider` for the crd thread of the spider share */
+int spider_share_init_crd(
+ const char* table_name,
+ ha_spider *spider,
+ SPIDER_SHARE *share,
+ const bool init_share
+)
+{
+ DBUG_ENTER("spider_share_init_crd");
+ if (int error_num = spider_create_spider_object_for_share(
+ spider->wide_handler->trx, share, &share->crd_spider))
{
- pthread_mutex_lock(&share->mutex);
- for (roop_count = 0;
- roop_count < (int) spider_udf_table_mon_mutex_count;
- roop_count++
- ) {
- if (spider_bit_is_set(share->table_mon_mutex_bitmap, roop_count))
- pthread_mutex_lock(&spider_udf_table_mon_mutexes[roop_count]);
- }
- if (!share->link_status_init)
- {
- /*
- The link statuses need to be refreshed from the spider_tables table
- if the operation:
- - Is not a DROP TABLE on a permanent table; or
- - Is an ALTER TABLE.
-
- Note that SHOW CREATE TABLE is not excluded, because the commands
- that follow it require up-to-date link statuses.
- */
- if ((table_share->tmp_table == NO_TMP_TABLE &&
- sql_command != SQLCOM_DROP_TABLE) ||
- /* for alter change link status */
- sql_command == SQLCOM_ALTER_TABLE)
- {
- SPD_INIT_ALLOC_ROOT(&mem_root, 4096, 0, MYF(MY_WME));
- init_mem_root = TRUE;
-
- if (
- !(table_tables = spider_open_sys_table(
- thd, SPIDER_SYS_TABLES_TABLE_NAME_STR,
- SPIDER_SYS_TABLES_TABLE_NAME_LEN, FALSE, &open_tables_backup,
- FALSE, error_num))
- ) {
- for (roop_count = 0;
- roop_count < (int) spider_udf_table_mon_mutex_count;
- roop_count++
- ) {
- if (spider_bit_is_set(share->table_mon_mutex_bitmap, roop_count))
- pthread_mutex_unlock(&spider_udf_table_mon_mutexes[roop_count]);
- }
- pthread_mutex_unlock(&share->mutex);
- share->init_error = TRUE;
- share->init_error_time = (time_t) time((time_t*) 0);
- share->init = TRUE;
- spider_free_share(share);
- goto error_open_sys_table;
- }
- *error_num = spider_get_link_statuses(table_tables, share,
- &mem_root);
- if (*error_num)
- {
- if (
- *error_num != HA_ERR_KEY_NOT_FOUND &&
- *error_num != HA_ERR_END_OF_FILE
- ) {
- for (roop_count = 0;
- roop_count < (int) spider_udf_table_mon_mutex_count;
- roop_count++
- ) {
- if (spider_bit_is_set(share->table_mon_mutex_bitmap, roop_count))
- pthread_mutex_unlock(&spider_udf_table_mon_mutexes[roop_count]);
- }
- pthread_mutex_unlock(&share->mutex);
- share->init_error = TRUE;
- share->init_error_time = (time_t) time((time_t*) 0);
- share->init = TRUE;
- spider_free_share(share);
- spider_close_sys_table(thd, table_tables,
- &open_tables_backup, FALSE);
- table_tables = NULL;
- goto error_open_sys_table;
- }
- } else {
- memcpy(share->alter_table.tmp_link_statuses, share->link_statuses,
- sizeof(long) * share->all_link_count);
- share->link_status_init = TRUE;
- }
- spider_close_sys_table(thd, table_tables,
- &open_tables_backup, FALSE);
- table_tables = NULL;
- }
- share->have_recovery_link = spider_conn_check_recovery_link(share);
- if (init_mem_root)
- {
- free_root(&mem_root, MYF(0));
- init_mem_root = FALSE;
- }
- }
- for (roop_count = 0;
- roop_count < (int) spider_udf_table_mon_mutex_count;
- roop_count++
- ) {
- if (spider_bit_is_set(share->table_mon_mutex_bitmap, roop_count))
- pthread_mutex_unlock(&spider_udf_table_mon_mutexes[roop_count]);
- }
pthread_mutex_unlock(&share->mutex);
+ spider_share_init_error_free(share, init_share, true);
+ DBUG_RETURN(error_num);
}
+ share->crd_thread =
+ &spider_table_crd_threads[my_calc_hash(&spider_open_tables,
+ (uchar *) table_name,
+ (uint) strlen(table_name)) %
+ spider_param_table_crd_thread_count()];
+ share->crd_spider_init = TRUE;
+ DBUG_RETURN(0);
+}
- semi_table_lock_conn = spider_param_semi_table_lock_connection(thd,
- share->semi_table_lock_conn);
- if (semi_table_lock_conn)
- first_byte = '0' +
- spider_param_semi_table_lock(thd, share->semi_table_lock);
- else
- first_byte = '0';
+void *spider_share_malloc_for_spider(
+ ha_spider *spider,
+ SPIDER_SHARE *share,
+ const uint id,
+ char** tmp_name,
+ SPIDER_RESULT_LIST* result_list
+)
+{
+ return spider_bulk_malloc(
+ spider_current_trx, id, MYF(MY_WME | MY_ZEROFILL),
+ &spider->conn_keys, sizeof(char *) * share->link_count,
+ tmp_name, sizeof(char) * share->conn_keys_charlen,
+ &spider->conns, sizeof(SPIDER_CONN *) * share->link_count,
+ &spider->conn_link_idx, sizeof(uint) * share->link_count,
+ &spider->conn_can_fo, sizeof(uchar) * share->link_bitmap_size,
+ &spider->connection_ids, sizeof(ulonglong) * share->link_count,
+ &spider->db_request_id, sizeof(ulonglong) * share->link_count,
+ &spider->db_request_phase, sizeof(uchar) * share->link_bitmap_size,
+ &spider->need_mons, sizeof(int) * share->link_count,
+ &spider->quick_targets, sizeof(void *) * share->link_count,
+ &result_list->upd_tmp_tbls, sizeof(TABLE *) * share->link_count,
+ &result_list->upd_tmp_tbl_prms,
+ sizeof(TMP_TABLE_PARAM) * share->link_count,
+ &result_list->tmp_table_join_first,
+ sizeof(uchar) * share->link_bitmap_size,
+ &result_list->tmp_table_created,
+ sizeof(uchar) * share->link_bitmap_size,
+ &result_list->casual_read, sizeof(int) * share->link_count,
+ &spider->dbton_handler,
+ sizeof(spider_db_handler *) * SPIDER_DBTON_SIZE,
+ NullS);
+}
- if (!(spider->wide_handler->trx = spider_get_trx(thd, TRUE, error_num)))
+/**
+ Initialise dbton_handlers of a spider.
+*/
+int spider_share_init_spider_dbton_handlers(ha_spider *spider, SPIDER_SHARE *share)
+{
+ int roop_count, error_num= 0;
+ for (roop_count = 0; roop_count < (int) share->use_dbton_count;
+ roop_count++)
+ {
+ uint dbton_id = share->use_dbton_ids[roop_count];
+ if (!(spider->dbton_handler[dbton_id]=
+ spider_dbton[dbton_id].create_db_handler(spider,
+ share->dbton_share[dbton_id])))
{
- share->init_error = TRUE;
- share->init_error_time = (time_t) time((time_t*) 0);
- share->init = TRUE;
- spider_free_share(share);
- goto error_but_no_delete;
+ error_num = HA_ERR_OUT_OF_MEM;
+ break;
}
- spider->set_error_mode();
-
- if (!share->sts_spider_init)
+ if ((error_num = spider->dbton_handler[dbton_id]->init()))
+ break;
+ }
+ /* Failure: rollback */
+ if (roop_count < (int) share->use_dbton_count)
+ {
+ for (; roop_count >= 0; roop_count--)
{
- pthread_mutex_lock(&share->mutex);
- if (!share->sts_spider_init)
+ uint dbton_id = share->use_dbton_ids[roop_count];
+ if (spider->dbton_handler[dbton_id])
{
- if ((*error_num = spider_create_spider_object_for_share(
- spider->wide_handler->trx, share, &share->sts_spider)))
- {
- pthread_mutex_unlock(&share->mutex);
- share->init_error = TRUE;
- share->init_error_time = (time_t) time((time_t*) 0);
- share->init = TRUE;
- spider_free_share(share);
- goto error_sts_spider_init;
- }
- share->sts_thread = &spider_table_sts_threads[
- my_calc_hash(&spider_open_tables, (uchar*) table_name, length) %
- spider_param_table_sts_thread_count()];
- share->sts_spider_init = TRUE;
+ delete spider->dbton_handler[dbton_id];
+ spider->dbton_handler[dbton_id]= NULL;
}
- pthread_mutex_unlock(&share->mutex);
}
+ }
+ return error_num;
+}
- if (!share->crd_spider_init)
- {
- pthread_mutex_lock(&share->mutex);
- if (!share->crd_spider_init)
+/** Gets or creates connections to all active servers */
+bool spider_share_get_conns(ha_spider *spider, SPIDER_SHARE *share,
+ int *error_num)
+{
+ DBUG_ENTER("spider_share_get_conns");
+ for (int roop_count = spider_conn_link_idx_next(
+ share->link_statuses, spider->conn_link_idx, -1,
+ share->link_count, SPIDER_LINK_STATUS_RECOVERY);
+ roop_count < (int) share->link_count;
+ roop_count = spider_conn_link_idx_next(
+ share->link_statuses, spider->conn_link_idx, roop_count,
+ share->link_count, SPIDER_LINK_STATUS_RECOVERY))
+ {
+ if (!(spider->conns[roop_count] =
+ spider_get_conn(share, roop_count, spider->conn_keys[roop_count],
+ spider->wide_handler->trx, spider, FALSE, TRUE,
+ error_num)))
+ {
+ if (share->monitoring_kind[roop_count] && spider->need_mons[roop_count])
{
- if ((*error_num = spider_create_spider_object_for_share(
- spider->wide_handler->trx, share, &share->crd_spider)))
- {
- pthread_mutex_unlock(&share->mutex);
- share->init_error = TRUE;
- share->init_error_time = (time_t) time((time_t*) 0);
- share->init = TRUE;
- spider_free_share(share);
- goto error_crd_spider_init;
- }
- share->crd_thread = &spider_table_crd_threads[
- my_calc_hash(&spider_open_tables, (uchar*) table_name, length) %
- spider_param_table_crd_thread_count()];
- share->crd_spider_init = TRUE;
+ *error_num = spider_ping_table_mon_from_table(
+ spider->wide_handler->trx,
+ spider->wide_handler->trx->thd,
+ share,
+ roop_count,
+ (uint32) share->monitoring_sid[roop_count],
+ share->table_name,
+ share->table_name_length,
+ spider->conn_link_idx[roop_count],
+ NULL,
+ 0,
+ share->monitoring_kind[roop_count],
+ share->monitoring_limit[roop_count],
+ share->monitoring_flag[roop_count],
+ FALSE
+ );
}
- pthread_mutex_unlock(&share->mutex);
+ DBUG_RETURN(TRUE);
}
+ spider->conns[roop_count]->error_mode &= spider->error_mode;
+ }
+ DBUG_RETURN(FALSE);
+}
- if (
- sql_command != SQLCOM_DROP_TABLE &&
- sql_command != SQLCOM_ALTER_TABLE &&
- sql_command != SQLCOM_SHOW_CREATE &&
- (*error_num = spider_create_mon_threads(spider->wide_handler->trx,
- share))
- ) {
- share->init_error = TRUE;
- share->init_error_time = (time_t) time((time_t*) 0);
- share->init = TRUE;
- spider_free_share(share);
- goto error_but_no_delete;
- }
-
- if (!(spider->conn_keys = (char **)
- spider_bulk_alloc_mem(spider_current_trx, SPD_MID_GET_SHARE_1,
- __func__, __FILE__, __LINE__, MYF(MY_WME | MY_ZEROFILL),
- &spider->conn_keys, sizeof(char *) * share->link_count,
- &tmp_name, sizeof(char) * share->conn_keys_charlen,
- &spider->conns, sizeof(SPIDER_CONN *) * share->link_count,
- &spider->conn_link_idx, sizeof(uint) * share->link_count,
- &spider->conn_can_fo, sizeof(uchar) * share->link_bitmap_size,
- &spider->connection_ids, sizeof(ulonglong) * share->link_count,
- &spider->conn_kind, sizeof(uint) * share->link_count,
- &spider->db_request_id, sizeof(ulonglong) * share->link_count,
- &spider->db_request_phase, sizeof(uchar) * share->link_bitmap_size,
- &spider->need_mons, sizeof(int) * share->link_count,
- &spider->quick_targets, sizeof(void *) * share->link_count,
- &result_list->upd_tmp_tbls, sizeof(TABLE *) * share->link_count,
- &result_list->upd_tmp_tbl_prms,
- sizeof(TMP_TABLE_PARAM) * share->link_count,
- &result_list->tmp_table_join_first,
- sizeof(uchar) * share->link_bitmap_size,
- &result_list->tmp_table_created,
- sizeof(uchar) * share->link_bitmap_size,
- &result_list->casual_read, sizeof(int) * share->link_count,
- &spider->dbton_handler,
- sizeof(spider_db_handler *) * SPIDER_DBTON_SIZE,
- NullS))
- ) {
- share->init_error = TRUE;
- share->init_error_time = (time_t) time((time_t*) 0);
- share->init = TRUE;
- spider_free_share(share);
- goto error_but_no_delete;
- }
- memcpy(tmp_name, share->conn_keys[0], share->conn_keys_charlen);
+/**
+ Handles a failed search for usable servers
- spider->conn_keys_first_ptr = tmp_name;
- for (roop_count = 0; roop_count < (int) share->link_count; roop_count++)
+ @param share The spider share to update its init error
+ @param table_share The table share
+ @param search_result The search result, either -1 (no usable server) or
+ -2 (out of memory)
+ @return Error code associated with the failure
+*/
+int spider_share_handle_search_link_failure(
+ SPIDER_SHARE* share,
+ TABLE_SHARE* table_share,
+ const int search_result,
+ const bool init_share
+)
+{
+ DBUG_ENTER("spider_share_handle_search_link_failure");
+ if (likely(search_result == -1)) /* No available servers. */
+ {
+ char *db = (char *) my_alloca(
+ table_share->db.length + 1 + table_share->table_name.length + 1);
+ if (unlikely(!db))
{
- spider->conn_keys[roop_count] = tmp_name;
- *tmp_name = first_byte;
- tmp_name += share->conn_keys_lengths[roop_count] + 1;
- result_list->upd_tmp_tbl_prms[roop_count].init();
- result_list->upd_tmp_tbl_prms[roop_count].field_count = 1;
- spider->conn_kind[roop_count] = SPIDER_CONN_KIND_MYSQL;
+ spider_share_init_error_free(share, init_share, false);
+ DBUG_RETURN(HA_ERR_OUT_OF_MEM);
}
- spider_trx_set_link_idx_for_all(spider);
+ char *table_name = db + table_share->db.length + 1;
+ memcpy(db, table_share->db.str, table_share->db.length);
+ db[table_share->db.length] = '\0';
+ memcpy(table_name, table_share->table_name.str,
+ table_share->table_name.length);
+ table_name[table_share->table_name.length] = '\0';
+ my_printf_error(ER_SPIDER_ALL_LINKS_FAILED_NUM,
+ ER_SPIDER_ALL_LINKS_FAILED_STR, MYF(0), db, table_name);
+ my_afree(db);
+ spider_share_init_error_free(share, init_share, false);
+ DBUG_RETURN(ER_SPIDER_ALL_LINKS_FAILED_NUM);
+ }
+ spider_share_init_error_free(share, init_share, false);
+ DBUG_RETURN(HA_ERR_OUT_OF_MEM);
+}
- for (roop_count = 0; roop_count < (int) share->use_dbton_count;
- roop_count++)
+/** Gets sts and crd for spider_init_share() */
+bool spider_share_get_sts_crd(
+ THD *thd,
+ ha_spider *spider,
+ SPIDER_SHARE *share,
+ TABLE *table,
+ const bool init_share,
+ /* fixme: do we need this? */
+ const bool has_lock,
+ int *error_num
+)
+{
+ const bool same_server_link = spider_param_same_server_link(thd);
+ const int load_sts_at_startup =
+ spider_param_load_sts_at_startup(share->load_sts_at_startup);
+ const int load_crd_at_startup =
+ spider_param_load_crd_at_startup(share->load_crd_at_startup);
+ DBUG_ENTER("spider_share_get_sts_crd");
+ if (!spider->error_mode &&
+ (!same_server_link || load_sts_at_startup || load_crd_at_startup))
+ {
+ const double sts_interval = spider_param_sts_interval(thd, share->sts_interval);
+ const int sts_mode = spider_param_sts_mode(thd, share->sts_mode);
+ const int auto_increment_mode = spider_param_auto_increment_mode(
+ thd, share->auto_increment_mode);
+ const int sts_sync = auto_increment_mode == 1 ? 0 :
+ spider_param_sts_sync(thd, share->sts_sync);
+ const double crd_interval = spider_param_crd_interval(thd, share->crd_interval);
+ int crd_mode = spider_param_crd_mode(thd, share->crd_mode);
+ /* TODO(MDEV-27996): Delete spider_crd_mode and spider_sts_mode */
+ if (crd_mode == 3)
+ crd_mode = 1;
+ const int crd_sync = spider_param_crd_sync(thd, share->crd_sync);
+
+ const time_t tmp_time = (time_t) time((time_t*) 0);
+ if (!has_lock)
{
- uint dbton_id = share->use_dbton_ids[roop_count];
- if (!(spider->dbton_handler[dbton_id] =
- spider_dbton[dbton_id].create_db_handler(spider,
- share->dbton_share[dbton_id])))
- {
- *error_num = HA_ERR_OUT_OF_MEM;
- break;
- }
- if ((*error_num = spider->dbton_handler[dbton_id]->init()))
- {
- break;
- }
+ pthread_mutex_lock(&share->sts_mutex);
+ pthread_mutex_lock(&share->crd_mutex);
}
- if (roop_count < (int) share->use_dbton_count)
+ /* If not enough time has passed since the last init error, abort */
+ if (const SPIDER_INIT_ERROR_TABLE *spider_init_error_table =
+ spider_get_init_error_table(spider->wide_handler->trx, share, FALSE))
{
- for (; roop_count >= 0; roop_count--)
+ DBUG_PRINT("info",("spider diff1=%f",
+ difftime(tmp_time, spider_init_error_table->init_error_time)));
+ if (difftime(tmp_time,
+ spider_init_error_table->init_error_time) <
+ spider_param_table_init_error_interval())
{
- uint dbton_id = share->use_dbton_ids[roop_count];
- if (spider->dbton_handler[dbton_id])
- {
- delete spider->dbton_handler[dbton_id];
- spider->dbton_handler[dbton_id] = NULL;
- }
+ *error_num = spider_init_error_table->init_error;
+ if (spider_init_error_table->init_error_with_message)
+ my_message(spider_init_error_table->init_error,
+ spider_init_error_table->init_error_msg, MYF(0));
+ spider_share_init_error_free(share, init_share, false);
+ pthread_mutex_unlock(&share->crd_mutex);
+ pthread_mutex_unlock(&share->sts_mutex);
+ DBUG_RETURN(TRUE);
}
- share->init_error = TRUE;
- share->init_error_time = (time_t) time((time_t*) 0);
- share->init = TRUE;
- goto error_after_alloc_conn_keys;
}
- if (
- sql_command != SQLCOM_DROP_TABLE &&
- sql_command != SQLCOM_ALTER_TABLE &&
- sql_command != SQLCOM_SHOW_CREATE
- ) {
- for (
- roop_count = spider_conn_link_idx_next(share->link_statuses,
- spider->conn_link_idx, -1, share->link_count,
- SPIDER_LINK_STATUS_RECOVERY);
- roop_count < (int) share->link_count;
- roop_count = spider_conn_link_idx_next(share->link_statuses,
- spider->conn_link_idx, roop_count, share->link_count,
- SPIDER_LINK_STATUS_RECOVERY)
- ) {
- if (
- !(spider->conns[roop_count] =
- spider_get_conn(share, roop_count, spider->conn_keys[roop_count],
- spider->wide_handler->trx, spider, FALSE, TRUE,
- SPIDER_CONN_KIND_MYSQL,
- error_num))
- ) {
- if (
- share->monitoring_kind[roop_count] &&
- spider->need_mons[roop_count]
- ) {
- *error_num = spider_ping_table_mon_from_table(
- spider->wide_handler->trx,
- spider->wide_handler->trx->thd,
- share,
- roop_count,
- (uint32) share->monitoring_sid[roop_count],
- share->table_name,
- share->table_name_length,
- spider->conn_link_idx[roop_count],
- NULL,
- 0,
- share->monitoring_kind[roop_count],
- share->monitoring_limit[roop_count],
- share->monitoring_flag[roop_count],
- FALSE
- );
- }
- share->init_error = TRUE;
- share->init_error_time = (time_t) time((time_t*) 0);
- share->init = TRUE;
- goto error_after_alloc_dbton_handler;
- }
- spider->conns[roop_count]->error_mode &= spider->error_mode;
- }
- }
- search_link_idx = spider_conn_first_link_idx(thd,
- share->link_statuses, share->access_balances, spider->conn_link_idx,
- share->link_count, SPIDER_LINK_STATUS_OK);
- if (search_link_idx == -1)
+ if ((!same_server_link || load_sts_at_startup) &&
+ (*error_num = spider_get_sts(share, spider->search_link_idx, tmp_time,
+ spider, sts_interval, sts_mode, sts_sync,
+ 1, HA_STATUS_VARIABLE | HA_STATUS_CONST | HA_STATUS_AUTO))
+ )
{
- char *db = (char *) my_alloca(
- table_share->db.length + 1 + table_share->table_name.length + 1);
- if (!db)
+ if (*error_num != ER_SPIDER_SYS_TABLE_VERSION_NUM &&
+ *error_num != ER_SPIDER_TABLE_OPEN_LOCK_WAIT_TIMEOUT_NUM)
+ thd->clear_error();
+ else
{
- *error_num = HA_ERR_OUT_OF_MEM;
- share->init_error = TRUE;
- share->init_error_time = (time_t) time((time_t*) 0);
- share->init = TRUE;
- goto error_after_alloc_dbton_handler;
- }
- char *table_name = db + table_share->db.length + 1;
- memcpy(db, table_share->db.str, table_share->db.length);
- db[table_share->db.length] = '\0';
- memcpy(table_name, table_share->table_name.str,
- table_share->table_name.length);
- table_name[table_share->table_name.length] = '\0';
- my_printf_error(ER_SPIDER_ALL_LINKS_FAILED_NUM,
- ER_SPIDER_ALL_LINKS_FAILED_STR, MYF(0), db, table_name);
- my_afree(db);
- *error_num = ER_SPIDER_ALL_LINKS_FAILED_NUM;
- share->init_error = TRUE;
- share->init_error_time = (time_t) time((time_t*) 0);
- share->init = TRUE;
- goto error_after_alloc_dbton_handler;
- } else if (search_link_idx == -2)
- {
- *error_num = HA_ERR_OUT_OF_MEM;
- share->init_error = TRUE;
- share->init_error_time = (time_t) time((time_t*) 0);
- share->init = TRUE;
- goto error_after_alloc_dbton_handler;
- }
- spider->search_link_idx = search_link_idx;
-
- same_server_link = spider_param_same_server_link(thd);
- load_sts_at_startup =
- spider_param_load_sts_at_startup(share->load_sts_at_startup);
- load_crd_at_startup =
- spider_param_load_crd_at_startup(share->load_crd_at_startup);
- if (
- sql_command != SQLCOM_DROP_TABLE &&
- sql_command != SQLCOM_ALTER_TABLE &&
- sql_command != SQLCOM_SHOW_CREATE &&
- !spider->error_mode &&
- (
- !same_server_link ||
- load_sts_at_startup ||
- load_crd_at_startup
- )
- ) {
- SPIDER_INIT_ERROR_TABLE *spider_init_error_table;
- sts_interval = spider_param_sts_interval(thd, share->sts_interval);
- sts_mode = spider_param_sts_mode(thd, share->sts_mode);
- sts_sync = spider_param_sts_sync(thd, share->sts_sync);
- auto_increment_mode = spider_param_auto_increment_mode(thd,
- share->auto_increment_mode);
- if (auto_increment_mode == 1)
- sts_sync = 0;
- crd_interval = spider_param_crd_interval(thd, share->crd_interval);
- crd_mode = spider_param_crd_mode(thd, share->crd_mode);
- if (crd_mode == 3)
- crd_mode = 1;
- crd_sync = spider_param_crd_sync(thd, share->crd_sync);
- time_t tmp_time = (time_t) time((time_t*) 0);
- pthread_mutex_lock(&share->sts_mutex);
- pthread_mutex_lock(&share->crd_mutex);
- if ((spider_init_error_table =
- spider_get_init_error_table(spider->wide_handler->trx, share, FALSE)))
- {
- DBUG_PRINT("info",("spider diff1=%f",
- difftime(tmp_time, spider_init_error_table->init_error_time)));
- if (difftime(tmp_time,
- spider_init_error_table->init_error_time) <
- spider_param_table_init_error_interval())
- {
- *error_num = spider_init_error_table->init_error;
- if (spider_init_error_table->init_error_with_message)
- my_message(spider_init_error_table->init_error,
- spider_init_error_table->init_error_msg, MYF(0));
- share->init_error = TRUE;
- share->init = TRUE;
- pthread_mutex_unlock(&share->crd_mutex);
- pthread_mutex_unlock(&share->sts_mutex);
- goto error_after_alloc_dbton_handler;
- }
+ pthread_mutex_unlock(&share->crd_mutex);
+ pthread_mutex_unlock(&share->sts_mutex);
+ spider_share_init_error_free(share, init_share, false);
+ DBUG_RETURN(TRUE);
}
+ }
- if (
- (
- !same_server_link ||
- load_sts_at_startup
- ) &&
- (*error_num = spider_get_sts(share, spider->search_link_idx, tmp_time,
- spider, sts_interval, sts_mode,
- sts_sync,
- 1, HA_STATUS_VARIABLE | HA_STATUS_CONST | HA_STATUS_AUTO))
- ) {
- if (*error_num != ER_SPIDER_SYS_TABLE_VERSION_NUM)
- {
- thd->clear_error();
- } else {
- pthread_mutex_unlock(&share->crd_mutex);
- pthread_mutex_unlock(&share->sts_mutex);
- share->init_error = TRUE;
- share->init_error_time = (time_t) time((time_t*) 0);
- share->init = TRUE;
- goto error_after_alloc_dbton_handler;
- }
- }
- if (
- (
- !same_server_link ||
- load_crd_at_startup
- ) &&
+ if ((!same_server_link || load_crd_at_startup) &&
(*error_num = spider_get_crd(share, spider->search_link_idx, tmp_time,
- spider, table, crd_interval, crd_mode,
- crd_sync,
- 1))
- ) {
- if (*error_num != ER_SPIDER_SYS_TABLE_VERSION_NUM)
- {
- thd->clear_error();
- } else {
- pthread_mutex_unlock(&share->crd_mutex);
- pthread_mutex_unlock(&share->sts_mutex);
- share->init_error = TRUE;
- share->init_error_time = (time_t) time((time_t*) 0);
- share->init = TRUE;
- goto error_after_alloc_dbton_handler;
- }
+ spider, table, crd_interval, crd_mode,
+ crd_sync,
+ 1)))
+ {
+ if (*error_num != ER_SPIDER_SYS_TABLE_VERSION_NUM &&
+ *error_num != ER_SPIDER_TABLE_OPEN_LOCK_WAIT_TIMEOUT_NUM)
+ thd->clear_error();
+ else
+ {
+ pthread_mutex_unlock(&share->crd_mutex);
+ pthread_mutex_unlock(&share->sts_mutex);
+ spider_share_init_error_free(share, init_share, false);
+ DBUG_RETURN(TRUE);
}
+ }
+ if (!has_lock)
+ {
pthread_mutex_unlock(&share->crd_mutex);
pthread_mutex_unlock(&share->sts_mutex);
}
+ }
+ DBUG_RETURN(FALSE);
+}
- share->init = TRUE;
- } else {
- share->use_count++;
- pthread_mutex_unlock(&spider_tbl_mutex);
+/** Initialises a `SPIDER_SHARE` */
+bool spider_init_share(
+ const char *table_name,
+ TABLE *table,
+ THD *thd,
+ ha_spider *spider,
+ int *error_num,
+ SPIDER_SHARE *share,
+ TABLE_SHARE *table_share,
+ const bool new_share
+)
+{
+ char first_byte;
+ char *tmp_name;
+ SPIDER_RESULT_LIST *result_list = &spider->result_list;
+ int search_link_idx;
+ const uint sql_command = thd_sql_command(thd);
+ const bool continue_with_sql_command =
+ sql_command != SQLCOM_DROP_TABLE &&
+ sql_command != SQLCOM_ALTER_TABLE &&
+ sql_command != SQLCOM_SHOW_CREATE;
+ DBUG_ENTER("spider_init_share");
+ if (!share->link_status_init)
+ {
+ spider_lock_udf_table_mon_mutexes(share);
+ if (!share->link_status_init &&
+ spider_share_init_link_statuses(thd, share, table_share,
+ sql_command, new_share, error_num))
+ DBUG_RETURN(TRUE);
+ spider_unlock_udf_table_mon_mutexes(share);
+ }
- int sleep_cnt = 0;
- while (!share->init)
- {
- // avoid for dead loop
- if (sleep_cnt++ > 1000)
- {
- fprintf(stderr, " [WARN SPIDER RESULT] "
- "Wait share->init too long, table_name %s %s %ld\n",
- share->table_name, share->tgt_hosts[0], share->tgt_ports[0]);
- *error_num = ER_SPIDER_TABLE_OPEN_TIMEOUT_NUM;
- my_printf_error(ER_SPIDER_TABLE_OPEN_TIMEOUT_NUM,
- ER_SPIDER_TABLE_OPEN_TIMEOUT_STR, MYF(0),
- table_share->db.str, table_share->table_name.str);
- spider_free_share(share);
- goto error_but_no_delete;
- }
- my_sleep(10000); // wait 10 ms
- }
+ const int semi_table_lock_conn =
+ spider_param_semi_table_lock_connection(thd, share->semi_table_lock_conn);
+ if (semi_table_lock_conn)
+ first_byte = '0' +
+ spider_param_semi_table_lock(thd, share->semi_table_lock);
+ else
+ first_byte = '0';
- if (!share->link_status_init)
- {
- pthread_mutex_lock(&share->mutex);
- for (roop_count = 0;
- roop_count < (int) spider_udf_table_mon_mutex_count;
- roop_count++
- ) {
- if (spider_bit_is_set(share->table_mon_mutex_bitmap, roop_count))
- pthread_mutex_lock(&spider_udf_table_mon_mutexes[roop_count]);
- }
- if (!share->link_status_init)
- {
- DBUG_ASSERT(!table_tables);
- /*
- The link statuses need to be refreshed from the spider_tables table
- if the operation:
- - Is not a DROP TABLE on a permanent table; or
- - Is an ALTER TABLE.
-
- Note that SHOW CREATE TABLE is not excluded, because the commands
- that follow it require up-to-date link statuses.
- */
- if ((table_share->tmp_table == NO_TMP_TABLE &&
- sql_command != SQLCOM_DROP_TABLE) ||
- /* for alter change link status */
- sql_command == SQLCOM_ALTER_TABLE)
- {
- SPD_INIT_ALLOC_ROOT(&mem_root, 4096, 0, MYF(MY_WME));
- init_mem_root = TRUE;
+ if (!(spider->wide_handler->trx = spider_get_trx(thd, TRUE, error_num)))
+ {
+ spider_share_init_error_free(share, new_share, true);
+ DBUG_RETURN(TRUE);
+ }
+ spider->set_error_mode();
- if (
- !(table_tables = spider_open_sys_table(
- thd, SPIDER_SYS_TABLES_TABLE_NAME_STR,
- SPIDER_SYS_TABLES_TABLE_NAME_LEN, FALSE, &open_tables_backup,
- FALSE, error_num))
- ) {
- for (roop_count = 0;
- roop_count < (int) spider_udf_table_mon_mutex_count;
- roop_count++
- ) {
- if (spider_bit_is_set(share->table_mon_mutex_bitmap, roop_count))
- pthread_mutex_unlock(&spider_udf_table_mon_mutexes[roop_count]);
- }
- pthread_mutex_unlock(&share->mutex);
- spider_free_share(share);
- goto error_open_sys_table;
- }
- *error_num = spider_get_link_statuses(table_tables, share,
- &mem_root);
- if (*error_num)
- {
- if (
- *error_num != HA_ERR_KEY_NOT_FOUND &&
- *error_num != HA_ERR_END_OF_FILE
- ) {
- for (roop_count = 0;
- roop_count < (int) spider_udf_table_mon_mutex_count;
- roop_count++
- ) {
- if (spider_bit_is_set(share->table_mon_mutex_bitmap, roop_count))
- pthread_mutex_unlock(&spider_udf_table_mon_mutexes[roop_count]);
- }
- pthread_mutex_unlock(&share->mutex);
- spider_free_share(share);
- spider_close_sys_table(thd, table_tables,
- &open_tables_backup, FALSE);
- table_tables = NULL;
- goto error_open_sys_table;
- }
- } else {
- memcpy(share->alter_table.tmp_link_statuses, share->link_statuses,
- sizeof(long) * share->all_link_count);
- share->link_status_init = TRUE;
- }
- spider_close_sys_table(thd, table_tables,
- &open_tables_backup, FALSE);
- table_tables = NULL;
- }
- share->have_recovery_link = spider_conn_check_recovery_link(share);
- if (init_mem_root)
- {
- free_root(&mem_root, MYF(0));
- init_mem_root = FALSE;
- }
- }
- for (roop_count = 0;
- roop_count < (int) spider_udf_table_mon_mutex_count;
- roop_count++
- ) {
- if (spider_bit_is_set(share->table_mon_mutex_bitmap, roop_count))
- pthread_mutex_unlock(&spider_udf_table_mon_mutexes[roop_count]);
- }
- pthread_mutex_unlock(&share->mutex);
- }
+ /* There's no other place doing anything that
+ `spider_share_init_sts()` does or updating
+ `st_spider_share::sts_spider_init`, therefore there's no need to
+ lock/unlock. Same goes for crd */
+ if (!share->sts_spider_init &&
+ (*error_num= spider_share_init_sts(table_name, spider, share, new_share)))
+ DBUG_RETURN(TRUE);
- semi_table_lock_conn = spider_param_semi_table_lock_connection(thd,
- share->semi_table_lock_conn);
- if (semi_table_lock_conn)
- first_byte = '0' +
- spider_param_semi_table_lock(thd, share->semi_table_lock);
- else
- first_byte = '0';
+ if (!share->crd_spider_init &&
+ (*error_num= spider_share_init_crd(table_name, spider, share, new_share)))
+ DBUG_RETURN(TRUE);
- spider->share = share;
- if (!(spider->wide_handler->trx = spider_get_trx(thd, TRUE, error_num)))
- {
- spider_free_share(share);
- goto error_but_no_delete;
- }
- spider->set_error_mode();
+ if (continue_with_sql_command &&
+ (*error_num = spider_create_mon_threads(spider->wide_handler->trx,
+ share)))
+ {
+ spider_share_init_error_free(share, new_share, true);
+ DBUG_RETURN(TRUE);
+ }
- if (!share->sts_spider_init)
- {
- pthread_mutex_lock(&share->mutex);
- if (!share->sts_spider_init)
- {
- if ((*error_num = spider_create_spider_object_for_share(
- spider->wide_handler->trx, share, &share->sts_spider)))
- {
- pthread_mutex_unlock(&share->mutex);
- spider_free_share(share);
- goto error_sts_spider_init;
- }
- share->sts_thread = &spider_table_sts_threads[
- my_calc_hash(&spider_open_tables, (uchar*) table_name, length) %
- spider_param_table_sts_thread_count()];
- share->sts_spider_init = TRUE;
- }
- pthread_mutex_unlock(&share->mutex);
- }
+ if (!(spider_share_malloc_for_spider(spider, share, SPD_MID_GET_SHARE_1,
+ &tmp_name, result_list)))
+ {
+ spider_share_init_error_free(share, new_share, true);
+ DBUG_RETURN(TRUE);
+ }
+ memcpy(tmp_name, share->conn_keys[0], share->conn_keys_charlen);
- if (!share->crd_spider_init)
- {
- pthread_mutex_lock(&share->mutex);
- if (!share->crd_spider_init)
- {
- if ((*error_num = spider_create_spider_object_for_share(
- spider->wide_handler->trx, share, &share->crd_spider)))
- {
- pthread_mutex_unlock(&share->mutex);
- spider_free_share(share);
- goto error_crd_spider_init;
- }
- share->crd_thread = &spider_table_crd_threads[
- my_calc_hash(&spider_open_tables, (uchar*) table_name, length) %
- spider_param_table_crd_thread_count()];
- share->crd_spider_init = TRUE;
- }
- pthread_mutex_unlock(&share->mutex);
- }
+ spider->conn_keys_first_ptr = tmp_name;
+ for (int link_idx = 0; link_idx < (int) share->link_count; link_idx++)
+ {
+ spider->conn_keys[link_idx] = tmp_name;
+ *tmp_name = first_byte;
+ tmp_name += share->conn_keys_lengths[link_idx] + 1;
+ result_list->upd_tmp_tbl_prms[link_idx].init();
+ result_list->upd_tmp_tbl_prms[link_idx].field_count = 1;
+ }
+ spider_trx_set_link_idx_for_all(spider);
- if (
- sql_command != SQLCOM_DROP_TABLE &&
- sql_command != SQLCOM_ALTER_TABLE &&
- sql_command != SQLCOM_SHOW_CREATE &&
- (*error_num = spider_create_mon_threads(spider->wide_handler->trx,
- share))
- ) {
- spider_free_share(share);
- goto error_but_no_delete;
- }
-
- if (!(spider->conn_keys = (char **)
- spider_bulk_alloc_mem(spider_current_trx, SPD_MID_GET_SHARE_2,
- __func__, __FILE__, __LINE__, MYF(MY_WME | MY_ZEROFILL),
- &spider->conn_keys, sizeof(char *) * share->link_count,
- &tmp_name, sizeof(char) * share->conn_keys_charlen,
- &spider->conns, sizeof(SPIDER_CONN *) * share->link_count,
- &spider->conn_link_idx, sizeof(uint) * share->link_count,
- &spider->conn_can_fo, sizeof(uchar) * share->link_bitmap_size,
- &spider->connection_ids, sizeof(ulonglong) * share->link_count,
- &spider->conn_kind, sizeof(uint) * share->link_count,
- &spider->db_request_id, sizeof(ulonglong) * share->link_count,
- &spider->db_request_phase, sizeof(uchar) * share->link_bitmap_size,
- &spider->need_mons, sizeof(int) * share->link_count,
- &spider->quick_targets, sizeof(void *) * share->link_count,
- &result_list->upd_tmp_tbls, sizeof(TABLE *) * share->link_count,
- &result_list->upd_tmp_tbl_prms,
- sizeof(TMP_TABLE_PARAM) * share->link_count,
- &result_list->tmp_table_join_first,
- sizeof(uchar) * share->link_bitmap_size,
- &result_list->tmp_table_created,
- sizeof(uchar) * share->link_bitmap_size,
- &result_list->casual_read, sizeof(int) * share->link_count,
- &spider->dbton_handler,
- sizeof(spider_db_handler *) * SPIDER_DBTON_SIZE,
- NullS))
- ) {
- spider_free_share(share);
- goto error_but_no_delete;
- }
- memcpy(tmp_name, share->conn_keys[0], share->conn_keys_charlen);
+ if ((*error_num= spider_share_init_spider_dbton_handlers(spider, share)))
+ {
+ spider_share_init_error_free(share, new_share, false);
+ goto error_after_alloc_conn_keys;
+ }
- spider->conn_keys_first_ptr = tmp_name;
- for (roop_count = 0; roop_count < (int) share->link_count; roop_count++)
- {
- spider->conn_keys[roop_count] = tmp_name;
- *tmp_name = first_byte;
- tmp_name += share->conn_keys_lengths[roop_count] + 1;
- result_list->upd_tmp_tbl_prms[roop_count].init();
- result_list->upd_tmp_tbl_prms[roop_count].field_count = 1;
- spider->conn_kind[roop_count] = SPIDER_CONN_KIND_MYSQL;
- }
- spider_trx_set_link_idx_for_all(spider);
+ if (continue_with_sql_command &&
+ spider_share_get_conns(spider, share, error_num))
+ {
+ spider_share_init_error_free(share, new_share, false);
+ goto error_after_alloc_dbton_handler;
+ }
- for (roop_count = 0; roop_count < (int) share->use_dbton_count;
- roop_count++)
- {
- uint dbton_id = share->use_dbton_ids[roop_count];
- if (!(spider->dbton_handler[dbton_id] =
- spider_dbton[dbton_id].create_db_handler(spider,
- share->dbton_share[dbton_id])))
- {
- *error_num = HA_ERR_OUT_OF_MEM;
- break;
- }
- if ((*error_num = spider->dbton_handler[dbton_id]->init()))
- {
- break;
- }
- }
- if (roop_count < (int) share->use_dbton_count)
- {
- for (; roop_count >= 0; roop_count--)
- {
- uint dbton_id = share->use_dbton_ids[roop_count];
- if (spider->dbton_handler[dbton_id])
- {
- delete spider->dbton_handler[dbton_id];
- spider->dbton_handler[dbton_id] = NULL;
- }
- }
- goto error_after_alloc_conn_keys;
- }
+ search_link_idx =
+ spider_conn_first_link_idx(thd, share->link_statuses,
+ share->access_balances,
+ spider->conn_link_idx, share->link_count,
+ SPIDER_LINK_STATUS_OK);
+ if (search_link_idx < 0)
+ {
+ *error_num= spider_share_handle_search_link_failure(
+ share, table_share, search_link_idx, new_share);
+ goto error_after_alloc_dbton_handler;
+ }
+ spider->search_link_idx= search_link_idx;
- if (
- sql_command != SQLCOM_DROP_TABLE &&
- sql_command != SQLCOM_ALTER_TABLE &&
- sql_command != SQLCOM_SHOW_CREATE
- ) {
- for (
- roop_count = spider_conn_link_idx_next(share->link_statuses,
- spider->conn_link_idx, -1, share->link_count,
- SPIDER_LINK_STATUS_RECOVERY);
- roop_count < (int) share->link_count;
- roop_count = spider_conn_link_idx_next(share->link_statuses,
- spider->conn_link_idx, roop_count, share->link_count,
- SPIDER_LINK_STATUS_RECOVERY)
- ) {
- if (
- !(spider->conns[roop_count] =
- spider_get_conn(share, roop_count, spider->conn_keys[roop_count],
- spider->wide_handler->trx, spider, FALSE, TRUE,
- SPIDER_CONN_KIND_MYSQL,
- error_num))
- ) {
- if (
- share->monitoring_kind[roop_count] &&
- spider->need_mons[roop_count]
- ) {
- *error_num = spider_ping_table_mon_from_table(
- spider->wide_handler->trx,
- spider->wide_handler->trx->thd,
- share,
- roop_count,
- (uint32) share->monitoring_sid[roop_count],
- share->table_name,
- share->table_name_length,
- spider->conn_link_idx[roop_count],
- NULL,
- 0,
- share->monitoring_kind[roop_count],
- share->monitoring_limit[roop_count],
- share->monitoring_flag[roop_count],
- FALSE
- );
- }
- goto error_after_alloc_dbton_handler;
- }
- spider->conns[roop_count]->error_mode &= spider->error_mode;
- }
- }
- search_link_idx = spider_conn_first_link_idx(thd,
- share->link_statuses, share->access_balances, spider->conn_link_idx,
- share->link_count, SPIDER_LINK_STATUS_OK);
- if (search_link_idx == -1)
+ if (continue_with_sql_command)
+ {
+ if (new_share)
{
- char *db = (char *) my_alloca(
- table_share->db.length + 1 + table_share->table_name.length + 1);
- if (!db)
- {
- *error_num = HA_ERR_OUT_OF_MEM;
+ if (spider_share_get_sts_crd(thd, spider, share, table, true, false,
+ error_num))
goto error_after_alloc_dbton_handler;
- }
- char *table_name = db + table_share->db.length + 1;
- memcpy(db, table_share->db.str, table_share->db.length);
- db[table_share->db.length] = '\0';
- memcpy(table_name, table_share->table_name.str,
- table_share->table_name.length);
- table_name[table_share->table_name.length] = '\0';
- my_printf_error(ER_SPIDER_ALL_LINKS_FAILED_NUM,
- ER_SPIDER_ALL_LINKS_FAILED_STR, MYF(0), db, table_name);
- my_afree(db);
- *error_num = ER_SPIDER_ALL_LINKS_FAILED_NUM;
- goto error_after_alloc_dbton_handler;
- } else if (search_link_idx == -2)
- {
- *error_num = HA_ERR_OUT_OF_MEM;
- goto error_after_alloc_dbton_handler;
- }
- spider->search_link_idx = search_link_idx;
-
- if (share->init_error)
+ } else if (share->init_error)
{
+ /* fixme: can we move the locking and unlocking into
+ spider_share_get_sts_crd()? */
pthread_mutex_lock(&share->sts_mutex);
pthread_mutex_lock(&share->crd_mutex);
if (share->init_error)
{
- same_server_link = spider_param_same_server_link(thd);
- load_sts_at_startup =
- spider_param_load_sts_at_startup(share->load_sts_at_startup);
- load_crd_at_startup =
- spider_param_load_crd_at_startup(share->load_crd_at_startup);
- if (
- sql_command != SQLCOM_DROP_TABLE &&
- sql_command != SQLCOM_ALTER_TABLE &&
- sql_command != SQLCOM_SHOW_CREATE &&
- !spider->error_mode &&
- (
- !same_server_link ||
- load_sts_at_startup ||
- load_crd_at_startup
- )
- ) {
- SPIDER_INIT_ERROR_TABLE *spider_init_error_table;
- sts_interval = spider_param_sts_interval(thd, share->sts_interval);
- sts_mode = spider_param_sts_mode(thd, share->sts_mode);
- sts_sync = spider_param_sts_sync(thd, share->sts_sync);
- auto_increment_mode = spider_param_auto_increment_mode(thd,
- share->auto_increment_mode);
- if (auto_increment_mode == 1)
- sts_sync = 0;
- crd_interval = spider_param_crd_interval(thd, share->crd_interval);
- crd_mode = spider_param_crd_mode(thd, share->crd_mode);
- if (crd_mode == 3)
- crd_mode = 1;
- crd_sync = spider_param_crd_sync(thd, share->crd_sync);
- time_t tmp_time = (time_t) time((time_t*) 0);
- if ((spider_init_error_table =
- spider_get_init_error_table(spider->wide_handler->trx, share,
- FALSE)))
- {
- DBUG_PRINT("info",("spider diff2=%f",
- difftime(tmp_time, spider_init_error_table->init_error_time)));
- if (difftime(tmp_time,
- spider_init_error_table->init_error_time) <
- spider_param_table_init_error_interval())
- {
- *error_num = spider_init_error_table->init_error;
- if (spider_init_error_table->init_error_with_message)
- my_message(spider_init_error_table->init_error,
- spider_init_error_table->init_error_msg, MYF(0));
- pthread_mutex_unlock(&share->crd_mutex);
- pthread_mutex_unlock(&share->sts_mutex);
- goto error_after_alloc_dbton_handler;
- }
- }
-
- if (
- (
- !same_server_link ||
- load_sts_at_startup
- ) &&
- (*error_num = spider_get_sts(share, spider->search_link_idx,
- tmp_time, spider, sts_interval, sts_mode,
- sts_sync,
- 1, HA_STATUS_VARIABLE | HA_STATUS_CONST | HA_STATUS_AUTO))
- ) {
- if (*error_num != ER_SPIDER_SYS_TABLE_VERSION_NUM)
- {
- thd->clear_error();
- } else {
- pthread_mutex_unlock(&share->crd_mutex);
- pthread_mutex_unlock(&share->sts_mutex);
- goto error_after_alloc_dbton_handler;
- }
- }
- if (
- (
- !same_server_link ||
- load_crd_at_startup
- ) &&
- (*error_num = spider_get_crd(share, spider->search_link_idx,
- tmp_time, spider, table, crd_interval, crd_mode,
- crd_sync,
- 1))
- ) {
- if (*error_num != ER_SPIDER_SYS_TABLE_VERSION_NUM)
- {
- thd->clear_error();
- } else {
- pthread_mutex_unlock(&share->crd_mutex);
- pthread_mutex_unlock(&share->sts_mutex);
- goto error_after_alloc_dbton_handler;
- }
- }
- }
- share->init_error = FALSE;
+ if (spider_share_get_sts_crd(thd, spider, share, table, FALSE, TRUE,
+ error_num))
+ goto error_after_alloc_dbton_handler;
+ share->init_error= FALSE;
}
pthread_mutex_unlock(&share->crd_mutex);
pthread_mutex_unlock(&share->sts_mutex);
}
}
-
- DBUG_PRINT("info",("spider share=%p", share));
- DBUG_RETURN(share);
+ DBUG_RETURN(FALSE);
error_after_alloc_dbton_handler:
- for (roop_count = 0; roop_count < (int) share->use_dbton_count; ++roop_count)
+ for (int roop_count = 0; roop_count < (int) share->use_dbton_count; ++roop_count)
{
uint dbton_id = share->use_dbton_ids[roop_count];
if (spider->dbton_handler[dbton_id])
@@ -5408,21 +5576,104 @@ error_after_alloc_conn_keys:
spider_free(spider_current_trx, spider->conn_keys, MYF(0));
spider->conn_keys = NULL;
spider_free_share(share);
- goto error_but_no_delete;
+ DBUG_RETURN(TRUE);
+}
+
+/**
+ Gets or creates a spider share, then initialises it
+*/
+SPIDER_SHARE *spider_get_share(
+ const char *table_name,
+ TABLE *table,
+ THD *thd,
+ ha_spider *spider,
+ int *error_num
+) {
+ SPIDER_SHARE *share;
+ TABLE_SHARE *table_share = table->s;
+ DBUG_ENTER("spider_get_share");
+
+ const TABLE_SHARE *top_share = spider->wide_handler->top_share;
+ if (top_share &&
+ (*error_num = spider_check_for_self_reference(thd, top_share)))
+ DBUG_RETURN(NULL);
+
+ const uint length = (uint) strlen(table_name);
+ const my_hash_value_type hash_value =
+ my_calc_hash(&spider_open_tables, (uchar*) table_name, length);
+ pthread_mutex_lock(&spider_tbl_mutex);
+ if (!(share = (SPIDER_SHARE*) my_hash_search_using_hash_value(
+ &spider_open_tables, hash_value, (uchar*) table_name, length)))
+ {
+ if (!(share = spider_create_share(table_name, table_share,
+ table->part_info, hash_value,
+ error_num)))
+ goto error_alloc_share;
+
+ uint old_elements = spider_open_tables.array.max_element;
+ if (my_hash_insert(&spider_open_tables, (uchar*) share))
+ {
+ *error_num = HA_ERR_OUT_OF_MEM;
+ goto error_hash_insert;
+ }
+ if (spider_open_tables.array.max_element > old_elements)
+ {
+ spider_alloc_calc_mem(spider_current_trx,
+ spider_open_tables,
+ (spider_open_tables.array.max_element - old_elements) *
+ spider_open_tables.array.size_of_element);
+ }
+
+ spider->share = share;
+ uint tmp_conn_link_idx= 0;
+ spider->conn_link_idx = &tmp_conn_link_idx;
+
+ share->use_count++;
+ pthread_mutex_unlock(&spider_tbl_mutex);
+
+ if (spider_init_share(table_name, table, thd, spider, error_num, share,
+ table_share, TRUE))
+ DBUG_RETURN(NULL);
+
+ share->init = TRUE;
+ } else
+ {
+ share->use_count++;
+ pthread_mutex_unlock(&spider_tbl_mutex);
+
+ int sleep_cnt = 0;
+ while (!share->init)
+ {
+ // avoid for dead loop
+ if (sleep_cnt++ > 1000)
+ {
+ fprintf(stderr, " [WARN SPIDER RESULT] "
+ "Wait share->init too long, table_name %s %s %ld\n",
+ share->table_name, share->tgt_hosts[0], share->tgt_ports[0]);
+ *error_num = ER_SPIDER_TABLE_OPEN_TIMEOUT_NUM;
+ my_printf_error(ER_SPIDER_TABLE_OPEN_TIMEOUT_NUM,
+ ER_SPIDER_TABLE_OPEN_TIMEOUT_STR, MYF(0),
+ table_share->db.str, table_share->table_name.str);
+ spider_free_share(share);
+ DBUG_RETURN(NULL);
+ }
+ my_sleep(10000); // wait 10 ms
+ }
+
+ spider->share = share;
+
+ if (spider_init_share(table_name, table, thd, spider, error_num, share,
+ table_share, FALSE))
+ DBUG_RETURN(NULL);
+ }
+
+ DBUG_PRINT("info",("spider share=%p", share));
+ DBUG_RETURN(share);
error_hash_insert:
spider_free_share_resource_only(share);
error_alloc_share:
pthread_mutex_unlock(&spider_tbl_mutex);
-error_open_sys_table:
-error_crd_spider_init:
-error_sts_spider_init:
- if (init_mem_root)
- {
- free_root(&mem_root, MYF(0));
- init_mem_root = FALSE;
- }
-error_but_no_delete:
DBUG_RETURN(NULL);
}
@@ -5693,46 +5944,6 @@ int spider_free_wide_share(
DBUG_RETURN(0);
}
-void spider_copy_sts_to_wide_share(
- SPIDER_WIDE_SHARE *wide_share,
- SPIDER_SHARE *share
-) {
- DBUG_ENTER("spider_copy_sts_to_pt_share");
- wide_share->stat = share->stat;
- DBUG_VOID_RETURN;
-}
-
-void spider_copy_sts_to_share(
- SPIDER_SHARE *share,
- SPIDER_WIDE_SHARE *wide_share
-) {
- DBUG_ENTER("spider_copy_sts_to_share");
- share->stat = wide_share->stat;
- DBUG_VOID_RETURN;
-}
-
-void spider_copy_crd_to_wide_share(
- SPIDER_WIDE_SHARE *wide_share,
- SPIDER_SHARE *share,
- int fields
-) {
- DBUG_ENTER("spider_copy_crd_to_wide_share");
- memcpy(wide_share->cardinality, share->cardinality,
- sizeof(longlong) * fields);
- DBUG_VOID_RETURN;
-}
-
-void spider_copy_crd_to_share(
- SPIDER_SHARE *share,
- SPIDER_WIDE_SHARE *wide_share,
- int fields
-) {
- DBUG_ENTER("spider_copy_crd_to_share");
- memcpy(share->cardinality, wide_share->cardinality,
- sizeof(longlong) * fields);
- DBUG_VOID_RETURN;
-}
-
int spider_open_all_tables(
SPIDER_TRX *trx,
bool lock
@@ -5760,7 +5971,7 @@ int spider_open_all_tables(
if (
!(table_tables = spider_open_sys_table(
thd, SPIDER_SYS_TABLES_TABLE_NAME_STR,
- SPIDER_SYS_TABLES_TABLE_NAME_LEN, TRUE, &open_tables_backup, TRUE,
+ SPIDER_SYS_TABLES_TABLE_NAME_LEN, TRUE, &open_tables_backup,
&error_num))
)
DBUG_RETURN(error_num);
@@ -5770,12 +5981,10 @@ int spider_open_all_tables(
if (error_num != HA_ERR_KEY_NOT_FOUND && error_num != HA_ERR_END_OF_FILE)
{
table_tables->file->print_error(error_num, MYF(0));
- spider_close_sys_table(thd, table_tables,
- &open_tables_backup, TRUE);
+ spider_sys_close_table(thd, &open_tables_backup);
DBUG_RETURN(error_num);
} else {
- spider_close_sys_table(thd, table_tables,
- &open_tables_backup, TRUE);
+ spider_sys_close_table(thd, &open_tables_backup);
DBUG_RETURN(0);
}
}
@@ -5806,8 +6015,7 @@ int spider_open_all_tables(
))
) {
spider_sys_index_end(table_tables);
- spider_close_sys_table(thd, table_tables,
- &open_tables_backup, TRUE);
+ spider_sys_close_table(thd, &open_tables_backup);
spider_free_tmp_share_alloc(&tmp_share);
free_root(&mem_root, MYF(0));
DBUG_RETURN(error_num);
@@ -5830,22 +6038,18 @@ int spider_open_all_tables(
(error_num = spider_create_tmp_dbton_share(&tmp_share))
) {
spider_sys_index_end(table_tables);
- spider_close_sys_table(thd, table_tables,
- &open_tables_backup, TRUE);
+ spider_sys_close_table(thd, &open_tables_backup);
spider_free_tmp_share_alloc(&tmp_share);
free_root(&mem_root, MYF(0));
DBUG_RETURN(error_num);
}
/* create conn */
- if (
- !(conn = spider_get_conn(
- &tmp_share, 0, tmp_share.conn_keys[0], trx, NULL, FALSE, FALSE,
- SPIDER_CONN_KIND_MYSQL, &error_num))
- ) {
+ if (!(conn= spider_get_conn(&tmp_share, 0, tmp_share.conn_keys[0], trx,
+ NULL, FALSE, FALSE, &error_num)))
+ {
spider_sys_index_end(table_tables);
- spider_close_sys_table(thd, table_tables,
- &open_tables_backup, TRUE);
+ spider_sys_close_table(thd, &open_tables_backup);
spider_free_tmp_dbton_share(&tmp_share);
spider_free_tmp_share_alloc(&tmp_share);
free_root(&mem_root, MYF(0));
@@ -5870,8 +6074,7 @@ int spider_open_all_tables(
SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos);
pthread_mutex_unlock(&conn->mta_conn_mutex);
spider_sys_index_end(table_tables);
- spider_close_sys_table(thd, table_tables,
- &open_tables_backup, TRUE);
+ spider_sys_close_table(thd, &open_tables_backup);
spider_free_tmp_dbton_share(&tmp_share);
spider_free_tmp_share_alloc(&tmp_share);
free_root(&mem_root, MYF(0));
@@ -5889,8 +6092,7 @@ int spider_open_all_tables(
if (!(spider = new ha_spider()))
{
spider_sys_index_end(table_tables);
- spider_close_sys_table(thd, table_tables,
- &open_tables_backup, TRUE);
+ spider_sys_close_table(thd, &open_tables_backup);
spider_free_tmp_dbton_share(&tmp_share);
spider_free_tmp_share_alloc(&tmp_share);
free_root(&mem_root, MYF(0));
@@ -5916,8 +6118,7 @@ int spider_open_all_tables(
) {
delete spider;
spider_sys_index_end(table_tables);
- spider_close_sys_table(thd, table_tables,
- &open_tables_backup, TRUE);
+ spider_sys_close_table(thd, &open_tables_backup);
spider_free_tmp_dbton_share(&tmp_share);
spider_free_tmp_share_alloc(&tmp_share);
free_root(&mem_root, MYF(0));
@@ -5944,8 +6145,7 @@ int spider_open_all_tables(
spider_free(trx, share, MYF(0));
delete spider;
spider_sys_index_end(table_tables);
- spider_close_sys_table(thd, table_tables,
- &open_tables_backup, TRUE);
+ spider_sys_close_table(thd, &open_tables_backup);
spider_free_tmp_dbton_share(&tmp_share);
spider_free_tmp_share_alloc(&tmp_share);
free_root(&mem_root, MYF(0));
@@ -5953,17 +6153,14 @@ int spider_open_all_tables(
}
/* create another conn */
- if (
- (!(conn = spider_get_conn(
- &tmp_share, 0, tmp_share.conn_keys[0], trx, spider, TRUE, FALSE,
- SPIDER_CONN_KIND_MYSQL, &error_num)))
- ) {
+ if ((!(conn= spider_get_conn(&tmp_share, 0, tmp_share.conn_keys[0], trx,
+ spider, TRUE, FALSE, &error_num))))
+ {
spider_free_tmp_dbton_handler(spider);
spider_free(trx, share, MYF(0));
delete spider;
spider_sys_index_end(table_tables);
- spider_close_sys_table(thd, table_tables,
- &open_tables_backup, TRUE);
+ spider_sys_close_table(thd, &open_tables_backup);
spider_free_tmp_dbton_share(&tmp_share);
spider_free_tmp_share_alloc(&tmp_share);
free_root(&mem_root, MYF(0));
@@ -5989,8 +6186,7 @@ int spider_open_all_tables(
spider_free(trx, share, MYF(0));
delete spider;
spider_sys_index_end(table_tables);
- spider_close_sys_table(thd, table_tables,
- &open_tables_backup, TRUE);
+ spider_sys_close_table(thd, &open_tables_backup);
spider_free_tmp_dbton_share(&tmp_share);
spider_free_tmp_share_alloc(&tmp_share);
free_root(&mem_root, MYF(0));
@@ -6005,8 +6201,7 @@ int spider_open_all_tables(
free_root(&mem_root, MYF(0));
spider_sys_index_end(table_tables);
- spider_close_sys_table(thd, table_tables,
- &open_tables_backup, TRUE);
+ spider_sys_close_table(thd, &open_tables_backup);
DBUG_RETURN(0);
}
@@ -6287,6 +6482,24 @@ int spider_panic(
DBUG_RETURN(0);
}
+static void spider_update_optimizer_costs(OPTIMIZER_COSTS *costs)
+{
+ /* Assume 1 Gigabyte network */
+ costs->disk_read_cost= IO_SIZE/(1000000000/8)*1000.00000;
+ costs->index_block_copy_cost= 0; // Not used
+
+ /*
+ The following costs are copied from ha_innodb.cc
+ The assumption is that the default storage engine used with Spider is
+ InnoDB.
+ */
+ costs->row_next_find_cost= 0.00007013;
+ costs->row_lookup_cost= 0.00076597;
+ costs->key_next_find_cost= 0.00009900;
+ costs->key_lookup_cost= 0.00079112;
+ costs->row_copy_cost= 0.00006087;
+}
+
/*
Create or fix the system tables. See spd_init_query.h for the details.
*/
@@ -6346,7 +6559,7 @@ int spider_db_init(
void *p
) {
int error_num = HA_ERR_OUT_OF_MEM, roop_count;
- uint dbton_id = 0;
+ uint dbton_id;
uchar addr[6];
handlerton *spider_hton = (handlerton *)p;
DBUG_ENTER("spider_db_init");
@@ -6387,6 +6600,7 @@ int spider_db_init(
spider_hton->show_status = spider_show_status;
spider_hton->create_group_by = spider_create_group_by_handler;
spider_hton->table_options= spider_table_option_list;
+ spider_hton->update_optimizer_costs= spider_update_optimizer_costs;
if (my_gethwaddr((uchar *) addr))
{
@@ -6619,6 +6833,8 @@ int spider_db_init(
}
}
+ /** Populates `spider_dbton` with available `SPIDER_DBTON`s */
+ dbton_id = 0;
spider_dbton_mysql.dbton_id = dbton_id;
spider_dbton_mysql.db_util->dbton_id = dbton_id;
spider_dbton[dbton_id] = spider_dbton_mysql;
@@ -6627,15 +6843,11 @@ int spider_db_init(
spider_dbton_mariadb.db_util->dbton_id = dbton_id;
spider_dbton[dbton_id] = spider_dbton_mariadb;
++dbton_id;
- for (roop_count = 0; roop_count < SPIDER_DBTON_SIZE; roop_count++)
+ for (roop_count = 0; roop_count < (int) dbton_id; roop_count++)
{
- if (spider_dbton[roop_count].init)
- {
- if ((error_num = spider_dbton[roop_count].init()))
- {
+ if (spider_dbton[roop_count].init &&
+ (error_num = spider_dbton[roop_count].init()))
goto error_init_dbton;
- }
- }
}
DBUG_RETURN(0);
@@ -6643,9 +6855,7 @@ error_init_dbton:
for (roop_count--; roop_count >= 0; roop_count--)
{
if (spider_dbton[roop_count].deinit)
- {
spider_dbton[roop_count].deinit();
- }
}
roop_count = spider_param_table_crd_thread_count() - 1;
error_init_table_crd_threads:
@@ -6892,6 +7102,33 @@ void spider_get_partition_info(
DBUG_VOID_RETURN;
}
+/** Determines the get type for spider_get_sts() */
+enum ha_sts_crd_get_type spider_get_sts_type(
+ SPIDER_SHARE *share,
+ double sts_interval,
+ int sts_sync
+) {
+ if (sts_sync == 0)
+ return HA_GET_FETCH;
+ if (!share->wide_share->sts_init)
+ {
+ pthread_mutex_lock(&share->wide_share->sts_mutex);
+ if (!share->wide_share->sts_init)
+ return HA_GET_AFTER_LOCK;
+ pthread_mutex_unlock(&share->wide_share->sts_mutex);
+ return HA_GET_COPY;
+ }
+ if (difftime(share->sts_get_time, share->wide_share->sts_get_time) <
+ sts_interval)
+ return HA_GET_COPY;
+ if (!pthread_mutex_trylock(&share->wide_share->sts_mutex))
+ return HA_GET_AFTER_TRYLOCK;
+ return HA_GET_COPY;
+}
+
+/**
+ Populates share->stat or share->wide_share->stat with table status.
+*/
int spider_get_sts(
SPIDER_SHARE *share,
int link_idx,
@@ -6903,61 +7140,31 @@ int spider_get_sts(
int sts_sync_level,
uint flag
) {
- int get_type;
int error_num = 0;
DBUG_ENTER("spider_get_sts");
- if (
- sts_sync == 0
- ) {
- /* get */
- get_type = 1;
- } else if (
- !share->wide_share->sts_init
- ) {
- pthread_mutex_lock(&share->wide_share->sts_mutex);
- if (!share->wide_share->sts_init)
- {
- /* get after mutex_lock */
- get_type = 2;
- } else {
- pthread_mutex_unlock(&share->wide_share->sts_mutex);
- /* copy */
- get_type = 0;
- }
- } else if (
- difftime(share->sts_get_time, share->wide_share->sts_get_time) <
- sts_interval
- ) {
- /* copy */
- get_type = 0;
- } else if (
- !pthread_mutex_trylock(&share->wide_share->sts_mutex)
- ) {
- /* get after mutex_trylock */
- get_type = 3;
- } else {
- /* copy */
- get_type = 0;
- }
- if (get_type == 0)
- spider_copy_sts_to_share(share, share->wide_share);
+ enum ha_sts_crd_get_type get_type =
+ spider_get_sts_type(share, sts_interval, sts_sync);
+ if (get_type == HA_GET_COPY)
+ share->stat = share->wide_share->stat;
else
+ /* Executes a `show table status` query and store the results in
+ share->stat */
error_num = spider_db_show_table_status(spider, link_idx, sts_mode, flag);
- if (get_type >= 2)
+ if (get_type >= HA_GET_AFTER_LOCK)
pthread_mutex_unlock(&share->wide_share->sts_mutex);
+
if (error_num)
{
SPIDER_PARTITION_HANDLER *partition_handler =
spider->partition_handler;
- if (
- !share->wide_share->sts_init &&
- sts_sync >= sts_sync_level &&
- get_type > 1 &&
- partition_handler &&
- partition_handler->handlers &&
- partition_handler->handlers[0] == spider
- ) {
+ if (!share->wide_share->sts_init &&
+ sts_sync >= sts_sync_level &&
+ get_type > HA_GET_FETCH &&
+ partition_handler &&
+ partition_handler->handlers &&
+ partition_handler->handlers[0] == spider)
+ {
int roop_count;
ha_spider *tmp_spider;
SPIDER_SHARE *tmp_share;
@@ -6966,24 +7173,23 @@ int spider_get_sts(
int tmp_sts_sync;
THD *thd = spider->wide_handler->trx->thd;
for (roop_count = 1;
- roop_count < (int) partition_handler->no_parts;
- roop_count++)
+ roop_count < (int) partition_handler->no_parts;
+ roop_count++)
{
- tmp_spider =
- (ha_spider *) partition_handler->handlers[roop_count];
+ tmp_spider = (ha_spider *) partition_handler->handlers[roop_count];
tmp_share = tmp_spider->share;
tmp_sts_interval = spider_param_sts_interval(thd, share->sts_interval);
tmp_sts_mode = spider_param_sts_mode(thd, share->sts_mode);
tmp_sts_sync = spider_param_sts_sync(thd, share->sts_sync);
- spider_get_sts(tmp_share, tmp_spider->search_link_idx,
- tmp_time, tmp_spider, tmp_sts_interval, tmp_sts_mode, tmp_sts_sync,
- 1, flag);
+ spider_get_sts(tmp_share, tmp_spider->search_link_idx, tmp_time,
+ tmp_spider, tmp_sts_interval, tmp_sts_mode,
+ tmp_sts_sync, 1, flag);
if (share->wide_share->sts_init)
{
error_num = 0;
thd->clear_error();
- get_type = 0;
- spider_copy_sts_to_share(share, share->wide_share);
+ get_type = HA_GET_COPY;
+ share->stat = share->wide_share->stat;
break;
}
}
@@ -6991,9 +7197,10 @@ int spider_get_sts(
if (error_num)
DBUG_RETURN(error_num);
}
- if (sts_sync >= sts_sync_level && get_type > 0)
+
+ if (sts_sync >= sts_sync_level && get_type > HA_GET_COPY)
{
- spider_copy_sts_to_wide_share(share->wide_share, share);
+ share->wide_share->stat = share->stat;
share->wide_share->sts_get_time = tmp_time;
share->wide_share->sts_init = TRUE;
}
@@ -7002,6 +7209,34 @@ int spider_get_sts(
DBUG_RETURN(0);
}
+/** Determines the get type for spider_get_crd() */
+enum ha_sts_crd_get_type spider_get_crd_type(
+ SPIDER_SHARE *share,
+ double crd_interval,
+ int crd_sync
+) {
+ if (crd_sync == 0)
+ return HA_GET_FETCH;
+ if (!share->wide_share->crd_init)
+ {
+ pthread_mutex_lock(&share->wide_share->crd_mutex);
+ if (!share->wide_share->crd_init)
+ return HA_GET_AFTER_LOCK;
+ pthread_mutex_unlock(&share->wide_share->crd_mutex);
+ return HA_GET_COPY;
+ }
+ if (difftime(share->crd_get_time, share->wide_share->crd_get_time) <
+ crd_interval)
+ return HA_GET_COPY;
+ if (!pthread_mutex_trylock(&share->wide_share->crd_mutex))
+ return HA_GET_AFTER_TRYLOCK;
+ return HA_GET_COPY;
+}
+
+/**
+ Populates share->cardinality or share->wide_share->cardinality with
+ table index
+*/
int spider_get_crd(
SPIDER_SHARE *share,
int link_idx,
@@ -7013,57 +7248,24 @@ int spider_get_crd(
int crd_sync,
int crd_sync_level
) {
- int get_type;
int error_num = 0;
DBUG_ENTER("spider_get_crd");
- if (
- crd_sync == 0
- ) {
- /* get */
- get_type = 1;
- } else if (
- !share->wide_share->crd_init
- ) {
- pthread_mutex_lock(&share->wide_share->crd_mutex);
- if (!share->wide_share->crd_init)
- {
- /* get after mutex_lock */
- get_type = 2;
- } else {
- pthread_mutex_unlock(&share->wide_share->crd_mutex);
- /* copy */
- get_type = 0;
- }
- } else if (
- difftime(share->crd_get_time, share->wide_share->crd_get_time) <
- crd_interval
- ) {
- /* copy */
- get_type = 0;
- } else if (
- !pthread_mutex_trylock(&share->wide_share->crd_mutex)
- ) {
- /* get after mutex_trylock */
- get_type = 3;
- } else {
- /* copy */
- get_type = 0;
- }
- if (get_type >= 2)
+ enum ha_sts_crd_get_type get_type =
+ spider_get_crd_type(share, crd_interval, crd_sync);
+
+ if (get_type >= HA_GET_AFTER_LOCK)
pthread_mutex_unlock(&share->wide_share->crd_mutex);
if (error_num)
{
- SPIDER_PARTITION_HANDLER *partition_handler =
- spider->partition_handler;
- if (
- !share->wide_share->crd_init &&
- crd_sync >= crd_sync_level &&
- get_type > 1 &&
- partition_handler &&
- partition_handler->handlers &&
- partition_handler->handlers[0] == spider
- ) {
+ SPIDER_PARTITION_HANDLER *partition_handler = spider->partition_handler;
+ if (!share->wide_share->crd_init &&
+ crd_sync >= crd_sync_level &&
+ get_type > HA_GET_FETCH &&
+ partition_handler &&
+ partition_handler->handlers &&
+ partition_handler->handlers[0] == spider)
+ {
int roop_count;
ha_spider *tmp_spider;
SPIDER_SHARE *tmp_share;
@@ -7072,25 +7274,24 @@ int spider_get_crd(
int tmp_crd_sync;
THD *thd = spider->wide_handler->trx->thd;
for (roop_count = 1;
- roop_count < (int) partition_handler->no_parts;
- roop_count++)
+ roop_count < (int) partition_handler->no_parts;
+ roop_count++)
{
- tmp_spider =
- (ha_spider *) partition_handler->handlers[roop_count];
+ tmp_spider = (ha_spider *) partition_handler->handlers[roop_count];
tmp_share = tmp_spider->share;
tmp_crd_interval = spider_param_crd_interval(thd, share->crd_interval);
tmp_crd_mode = spider_param_crd_mode(thd, share->crd_mode);
tmp_crd_sync = spider_param_crd_sync(thd, share->crd_sync);
- spider_get_crd(tmp_share, tmp_spider->search_link_idx,
- tmp_time, tmp_spider, table, tmp_crd_interval, tmp_crd_mode,
- tmp_crd_sync, 1);
+ spider_get_crd(tmp_share, tmp_spider->search_link_idx, tmp_time,
+ tmp_spider, table, tmp_crd_interval, tmp_crd_mode,
+ tmp_crd_sync, 1);
if (share->wide_share->crd_init)
{
error_num = 0;
thd->clear_error();
- get_type = 0;
- spider_copy_crd_to_share(share, share->wide_share,
- table->s->fields);
+ get_type = HA_GET_COPY;
+ memcpy(share->cardinality, share->wide_share->cardinality,
+ sizeof(longlong) * table->s->fields);
break;
}
}
@@ -7098,10 +7299,10 @@ int spider_get_crd(
if (error_num)
DBUG_RETURN(error_num);
}
- if (crd_sync >= crd_sync_level && get_type > 0)
+ if (crd_sync >= crd_sync_level && get_type > HA_GET_COPY)
{
- spider_copy_crd_to_wide_share(share->wide_share, share,
- table->s->fields);
+ memcpy(share->wide_share->cardinality, share->cardinality,
+ sizeof(longlong) * table->s->fields);
share->wide_share->crd_get_time = tmp_time;
share->wide_share->crd_init = TRUE;
}
@@ -7146,6 +7347,18 @@ void spider_set_result_list_param(
DBUG_VOID_RETURN;
}
+/**
+ Gets or creates a `SPIDER_INIT_ERROR_TABLE` with the table name from
+ a given `SPIDER_SHARE`
+
+ When creating, also add the newly created object to
+ `spider_init_error_tables`
+
+ @param trx Transaction
+ @param share The spider share providing the table name
+ @param create Whether to create a new `SPIDER_INIT_ERROR_TABLE` if one wi th the required table name does not exist yet
+ @return A `SPIDER_INIT_ERROR_TABLE` or NULL if failure
+*/
SPIDER_INIT_ERROR_TABLE *spider_get_init_error_table(
SPIDER_TRX *trx,
SPIDER_SHARE *share,
@@ -7165,11 +7378,11 @@ SPIDER_INIT_ERROR_TABLE *spider_get_init_error_table(
pthread_mutex_unlock(&spider_init_error_tbl_mutex);
DBUG_RETURN(NULL);
}
- if (!(spider_init_error_table = (SPIDER_INIT_ERROR_TABLE *)
- spider_bulk_malloc(spider_current_trx, SPD_MID_GET_INIT_ERROR_TABLE_1, MYF(MY_WME | MY_ZEROFILL),
+ if (!spider_bulk_malloc(spider_current_trx, SPD_MID_GET_INIT_ERROR_TABLE_1,
+ MYF(MY_WME | MY_ZEROFILL),
&spider_init_error_table, (uint) (sizeof(*spider_init_error_table)),
&tmp_name, (uint) (share->table_name_length + 1),
- NullS))
+ NullS)
) {
pthread_mutex_unlock(&spider_init_error_tbl_mutex);
DBUG_RETURN(NULL);
@@ -8176,6 +8389,7 @@ ulong spider_calc_for_sort(
DBUG_RETURN(sort);
}
+/** Generates a random number between 0 and 1 */
double spider_rand(
uint32 rand_source
) {
@@ -8273,7 +8487,7 @@ int spider_discover_table_structure(
if (
(table_tables = spider_open_sys_table(
thd, SPIDER_SYS_TABLES_TABLE_NAME_STR,
- SPIDER_SYS_TABLES_TABLE_NAME_LEN, TRUE, &open_tables_backup, FALSE,
+ SPIDER_SYS_TABLES_TABLE_NAME_LEN, TRUE, &open_tables_backup,
&error_num))
) {
if (thd->lex->create_info.or_replace())
@@ -8285,8 +8499,7 @@ int spider_discover_table_structure(
{
error_num = spider_insert_tables(table_tables, spider_share);
}
- spider_close_sys_table(thd, table_tables,
- &open_tables_backup, FALSE);
+ spider_sys_close_table(thd, &open_tables_backup);
}
}
@@ -8359,7 +8572,7 @@ int spider_discover_table_structure(
if (
!(table_tables = spider_open_sys_table(
thd, SPIDER_SYS_TABLES_TABLE_NAME_STR,
- SPIDER_SYS_TABLES_TABLE_NAME_LEN, TRUE, &open_tables_backup, FALSE,
+ SPIDER_SYS_TABLES_TABLE_NAME_LEN, TRUE, &open_tables_backup,
&error_num))
) {
DBUG_RETURN(error_num);
@@ -8434,8 +8647,7 @@ int spider_discover_table_structure(
break;
}
}
- spider_close_sys_table(thd, table_tables,
- &open_tables_backup, FALSE);
+ spider_sys_close_table(thd, &open_tables_backup);
}
}
@@ -8891,9 +9103,8 @@ void *spider_table_bg_sts_action(
if (!conns[spider->search_link_idx])
{
spider_get_conn(share, spider->search_link_idx,
- share->conn_keys[spider->search_link_idx],
- trx, spider, FALSE, FALSE, SPIDER_CONN_KIND_MYSQL,
- &error_num);
+ share->conn_keys[spider->search_link_idx], trx,
+ spider, FALSE, FALSE, &error_num);
if (conns[spider->search_link_idx])
{
conns[spider->search_link_idx]->error_mode = 0;
@@ -9037,9 +9248,8 @@ void *spider_table_bg_crd_action(
if (!conns[spider->search_link_idx])
{
spider_get_conn(share, spider->search_link_idx,
- share->conn_keys[spider->search_link_idx],
- trx, spider, FALSE, FALSE, SPIDER_CONN_KIND_MYSQL,
- &error_num);
+ share->conn_keys[spider->search_link_idx], trx,
+ spider, FALSE, FALSE, &error_num);
if (conns[spider->search_link_idx])
{
conns[spider->search_link_idx]->error_mode = 0;
diff --git a/storage/spider/spd_table.h b/storage/spider/spd_table.h
index 2bc123ab..a0a9df18 100644
--- a/storage/spider/spd_table.h
+++ b/storage/spider/spd_table.h
@@ -224,28 +224,6 @@ int spider_free_wide_share(
SPIDER_WIDE_SHARE *wide_share
);
-void spider_copy_sts_to_wide_share(
- SPIDER_WIDE_SHARE *wide_share,
- SPIDER_SHARE *share
-);
-
-void spider_copy_sts_to_share(
- SPIDER_SHARE *share,
- SPIDER_WIDE_SHARE *wide_share
-);
-
-void spider_copy_crd_to_wide_share(
- SPIDER_WIDE_SHARE *wide_share,
- SPIDER_SHARE *share,
- int fields
-);
-
-void spider_copy_crd_to_share(
- SPIDER_SHARE *share,
- SPIDER_WIDE_SHARE *wide_share,
- int fields
-);
-
int spider_open_all_tables(
SPIDER_TRX *trx,
bool lock
diff --git a/storage/spider/spd_trx.cc b/storage/spider/spd_trx.cc
index b7a92286..124e4736 100644
--- a/storage/spider/spd_trx.cc
+++ b/storage/spider/spd_trx.cc
@@ -1815,7 +1815,7 @@ int spider_internal_xa_commit(
if (
!(table_xa = spider_open_sys_table(
thd, SPIDER_SYS_XA_TABLE_NAME_STR, SPIDER_SYS_XA_TABLE_NAME_LEN,
- TRUE, &open_tables_backup, TRUE, &error_num))
+ TRUE, &open_tables_backup, &error_num))
)
goto error_open_table;
table_xa_opened = TRUE;
@@ -1866,7 +1866,7 @@ int spider_internal_xa_commit(
table_xa, &trx->xid, SPIDER_SYS_XA_COMMIT_STR))
)
goto error;
- spider_close_sys_table(thd, table_xa, &open_tables_backup, TRUE);
+ spider_sys_close_table(thd, &open_tables_backup);
table_xa_opened = FALSE;
}
@@ -1890,7 +1890,7 @@ int spider_internal_xa_commit(
error_num = tmp_error_num;
}
spider_sys_log_xa_failed(thd, &trx->xid, conn,
- SPIDER_SYS_XA_COMMIT_STR, TRUE);
+ SPIDER_SYS_XA_COMMIT_STR);
}
if ((tmp_error_num = spider_end_trx(trx, conn)))
{
@@ -1919,14 +1919,14 @@ int spider_internal_xa_commit(
if (
!(table_xa_member = spider_open_sys_table(
thd, SPIDER_SYS_XA_MEMBER_TABLE_NAME_STR,
- SPIDER_SYS_XA_MEMBER_TABLE_NAME_LEN, TRUE, &open_tables_backup, TRUE,
+ SPIDER_SYS_XA_MEMBER_TABLE_NAME_LEN, TRUE, &open_tables_backup,
&error_num))
)
goto error_open_table;
table_xa_member_opened = TRUE;
if ((error_num = spider_delete_xa_member(table_xa_member, &trx->xid)))
goto error;
- spider_close_sys_table(thd, table_xa_member, &open_tables_backup, TRUE);
+ spider_sys_close_table(thd, &open_tables_backup);
table_xa_member_opened = FALSE;
/*
@@ -1940,13 +1940,13 @@ int spider_internal_xa_commit(
if (
!(table_xa = spider_open_sys_table(
thd, SPIDER_SYS_XA_TABLE_NAME_STR, SPIDER_SYS_XA_TABLE_NAME_LEN,
- TRUE, &open_tables_backup, TRUE, &error_num))
+ TRUE, &open_tables_backup, &error_num))
)
goto error_open_table;
table_xa_opened = TRUE;
if ((error_num = spider_delete_xa(table_xa, &trx->xid)))
goto error;
- spider_close_sys_table(thd, table_xa, &open_tables_backup, TRUE);
+ spider_sys_close_table(thd, &open_tables_backup);
table_xa_opened = FALSE;
}
if (trx->internal_xa)
@@ -1957,9 +1957,9 @@ int spider_internal_xa_commit(
error:
if (table_xa_opened)
- spider_close_sys_table(thd, table_xa, &open_tables_backup, TRUE);
+ spider_sys_close_table(thd, &open_tables_backup);
if (table_xa_member_opened)
- spider_close_sys_table(thd, table_xa_member, &open_tables_backup, TRUE);
+ spider_sys_close_table(thd, &open_tables_backup);
error_in_commit:
error_open_table:
if (trx->internal_xa)
@@ -2005,7 +2005,7 @@ int spider_internal_xa_rollback(
if (
!(table_xa = spider_open_sys_table(
thd, SPIDER_SYS_XA_TABLE_NAME_STR, SPIDER_SYS_XA_TABLE_NAME_LEN,
- TRUE, &open_tables_backup, TRUE, &error_num))
+ TRUE, &open_tables_backup, &error_num))
)
goto error_open_table;
table_xa_opened = TRUE;
@@ -2056,7 +2056,7 @@ int spider_internal_xa_rollback(
table_xa, &trx->xid, SPIDER_SYS_XA_ROLLBACK_STR))
)
goto error;
- spider_close_sys_table(thd, table_xa, &open_tables_backup, TRUE);
+ spider_sys_close_table(thd, &open_tables_backup);
table_xa_opened = FALSE;
}
@@ -2157,14 +2157,14 @@ int spider_internal_xa_rollback(
if (
!(table_xa_member = spider_open_sys_table(
thd, SPIDER_SYS_XA_MEMBER_TABLE_NAME_STR,
- SPIDER_SYS_XA_MEMBER_TABLE_NAME_LEN, TRUE, &open_tables_backup, TRUE,
+ SPIDER_SYS_XA_MEMBER_TABLE_NAME_LEN, TRUE, &open_tables_backup,
&error_num))
)
goto error_open_table;
table_xa_member_opened = TRUE;
if ((error_num = spider_delete_xa_member(table_xa_member, &trx->xid)))
goto error;
- spider_close_sys_table(thd, table_xa_member, &open_tables_backup, TRUE);
+ spider_sys_close_table(thd, &open_tables_backup);
table_xa_member_opened = FALSE;
/*
@@ -2178,13 +2178,13 @@ int spider_internal_xa_rollback(
if (
!(table_xa = spider_open_sys_table(
thd, SPIDER_SYS_XA_TABLE_NAME_STR, SPIDER_SYS_XA_TABLE_NAME_LEN,
- TRUE, &open_tables_backup, TRUE, &error_num))
+ TRUE, &open_tables_backup, &error_num))
)
goto error_open_table;
table_xa_opened = TRUE;
if ((error_num = spider_delete_xa(table_xa, &trx->xid)))
goto error;
- spider_close_sys_table(thd, table_xa, &open_tables_backup, TRUE);
+ spider_sys_close_table(thd, &open_tables_backup);
table_xa_opened = FALSE;
}
if (trx->internal_xa)
@@ -2195,9 +2195,9 @@ int spider_internal_xa_rollback(
error:
if (table_xa_opened)
- spider_close_sys_table(thd, table_xa, &open_tables_backup, TRUE);
+ spider_sys_close_table(thd, &open_tables_backup);
if (table_xa_member_opened)
- spider_close_sys_table(thd, table_xa_member, &open_tables_backup, TRUE);
+ spider_sys_close_table(thd, &open_tables_backup);
error_in_rollback:
error_open_table:
if (trx->internal_xa)
@@ -2232,7 +2232,7 @@ int spider_internal_xa_prepare(
if (
!(table_xa = spider_open_sys_table(
thd, SPIDER_SYS_XA_TABLE_NAME_STR, SPIDER_SYS_XA_TABLE_NAME_LEN,
- TRUE, &open_tables_backup, TRUE, &error_num))
+ TRUE, &open_tables_backup, &error_num))
)
goto error_open_table;
table_xa_opened = TRUE;
@@ -2241,13 +2241,13 @@ int spider_internal_xa_prepare(
table_xa, &trx->xid, SPIDER_SYS_XA_NOT_YET_STR))
)
goto error;
- spider_close_sys_table(thd, table_xa, &open_tables_backup, TRUE);
+ spider_sys_close_table(thd, &open_tables_backup);
table_xa_opened = FALSE;
if (
!(table_xa_member = spider_open_sys_table(
thd, SPIDER_SYS_XA_MEMBER_TABLE_NAME_STR,
- SPIDER_SYS_XA_MEMBER_TABLE_NAME_LEN, TRUE, &open_tables_backup, TRUE,
+ SPIDER_SYS_XA_MEMBER_TABLE_NAME_LEN, TRUE, &open_tables_backup,
&error_num))
)
goto error_open_table;
@@ -2340,7 +2340,7 @@ int spider_internal_xa_prepare(
}
if (trx->updated_in_this_trx || spider_param_xa_register_mode(thd) == 0)
{
- spider_close_sys_table(thd, table_xa_member, &open_tables_backup, TRUE);
+ spider_sys_close_table(thd, &open_tables_backup);
table_xa_member_opened = FALSE;
/*
@@ -2356,7 +2356,7 @@ int spider_internal_xa_prepare(
if (
!(table_xa = spider_open_sys_table(
thd, SPIDER_SYS_XA_TABLE_NAME_STR, SPIDER_SYS_XA_TABLE_NAME_LEN,
- TRUE, &open_tables_backup, TRUE, &error_num))
+ TRUE, &open_tables_backup, &error_num))
)
goto error_open_table;
table_xa_opened = TRUE;
@@ -2365,16 +2365,16 @@ int spider_internal_xa_prepare(
table_xa, &trx->xid, SPIDER_SYS_XA_PREPARED_STR))
)
goto error;
- spider_close_sys_table(thd, table_xa, &open_tables_backup, TRUE);
+ spider_sys_close_table(thd, &open_tables_backup);
table_xa_opened = FALSE;
}
DBUG_RETURN(0);
error:
if (table_xa_opened)
- spider_close_sys_table(thd, table_xa, &open_tables_backup, TRUE);
+ spider_sys_close_table(thd, &open_tables_backup);
if (table_xa_member_opened)
- spider_close_sys_table(thd, table_xa_member, &open_tables_backup, TRUE);
+ spider_sys_close_table(thd, &open_tables_backup);
error_open_table:
DBUG_RETURN(error_num);
}
@@ -2404,7 +2404,7 @@ int spider_internal_xa_recover(
if (
!(table_xa = spider_open_sys_table(
thd, SPIDER_SYS_XA_TABLE_NAME_STR, SPIDER_SYS_XA_TABLE_NAME_LEN,
- FALSE, &open_tables_backup, TRUE, &my_errno))
+ FALSE, &open_tables_backup, &my_errno))
)
goto error_open_table;
spider_store_xa_status(table_xa, SPIDER_SYS_XA_PREPARED_STR);
@@ -2429,11 +2429,11 @@ int spider_internal_xa_recover(
} while (my_errno == 0 && cnt < (int) len);
free_root(&mem_root, MYF(0));
spider_sys_index_end(table_xa);
- spider_close_sys_table(thd, table_xa, &open_tables_backup, TRUE);
+ spider_sys_close_table(thd, &open_tables_backup);
DBUG_RETURN(cnt);
error:
- spider_close_sys_table(thd, table_xa, &open_tables_backup, TRUE);
+ spider_sys_close_table(thd, &open_tables_backup);
error_open_table:
DBUG_RETURN(0);
}
@@ -2474,7 +2474,7 @@ int spider_initinal_xa_recover(
if (
!(table_xa = spider_open_sys_table(
thd, SPIDER_SYS_XA_TABLE_NAME_STR, SPIDER_SYS_XA_TABLE_NAME_LEN,
- FALSE, &open_tables_backup, TRUE, &error_num))
+ FALSE, &open_tables_backup, &error_num))
)
goto error_open_table;
SPIDER_init_read_record(read_record, thd, table_xa, NULL, NULL, TRUE,
@@ -2489,7 +2489,7 @@ int spider_initinal_xa_recover(
free_root(&mem_root, MYF(0));
end_read_record(read_record);
- spider_close_sys_table(thd, table_xa, &open_tables_backup, TRUE);
+ spider_sys_close_table(thd, &open_tables_backup);
table_xa = NULL;
spider_free_tmp_thd(thd);
thd = NULL;
@@ -2541,7 +2541,7 @@ int spider_internal_xa_commit_by_xid(
if (
!(table_xa = spider_open_sys_table(
thd, SPIDER_SYS_XA_TABLE_NAME_STR, SPIDER_SYS_XA_TABLE_NAME_LEN,
- TRUE, &open_tables_backup, TRUE, &error_num))
+ TRUE, &open_tables_backup, &error_num))
)
goto error_open_table;
table_xa_opened = TRUE;
@@ -2593,7 +2593,7 @@ int spider_internal_xa_commit_by_xid(
free_root(&mem_root, MYF(0));
goto error;
}
- spider_close_sys_table(thd, table_xa, &open_tables_backup, TRUE);
+ spider_sys_close_table(thd, &open_tables_backup);
table_xa_opened = FALSE;
/*
@@ -2614,7 +2614,7 @@ int spider_internal_xa_commit_by_xid(
if (
!(table_xa_member = spider_open_sys_table(
thd, SPIDER_SYS_XA_MEMBER_TABLE_NAME_STR,
- SPIDER_SYS_XA_MEMBER_TABLE_NAME_LEN, TRUE, &open_tables_backup, TRUE,
+ SPIDER_SYS_XA_MEMBER_TABLE_NAME_LEN, TRUE, &open_tables_backup,
&error_num))
) {
free_root(&mem_root, MYF(0));
@@ -2633,7 +2633,7 @@ int spider_internal_xa_commit_by_xid(
goto error;
} else {
free_root(&mem_root, MYF(0));
- spider_close_sys_table(thd, table_xa_member, &open_tables_backup, TRUE);
+ spider_sys_close_table(thd, &open_tables_backup);
table_xa_member_opened = FALSE;
goto xa_delete;
}
@@ -2654,13 +2654,11 @@ int spider_internal_xa_commit_by_xid(
goto error;
}
- if (
- !(conn = spider_get_conn(
- &tmp_share, 0, tmp_share.conn_keys[0], trx, NULL, FALSE, FALSE,
- SPIDER_CONN_KIND_MYSQL, &error_num)) &&
- (force_commit == 0 ||
- (force_commit == 1 && error_num != ER_XAER_NOTA))
- ) {
+ if (!(conn= spider_get_conn(&tmp_share, 0, tmp_share.conn_keys[0], trx,
+ NULL, FALSE, FALSE, &error_num)) &&
+ (force_commit == 0 ||
+ (force_commit == 1 && error_num != ER_XAER_NOTA)))
+ {
spider_sys_index_end(table_xa_member);
spider_free_tmp_share_alloc(&tmp_share);
free_root(&mem_root, MYF(0));
@@ -2704,7 +2702,7 @@ int spider_internal_xa_commit_by_xid(
*/
if ((error_num = spider_delete_xa_member(table_xa_member, xid)))
goto error;
- spider_close_sys_table(thd, table_xa_member, &open_tables_backup, TRUE);
+ spider_sys_close_table(thd, &open_tables_backup);
table_xa_member_opened = FALSE;
xa_delete:
@@ -2719,21 +2717,21 @@ xa_delete:
if (
!(table_xa = spider_open_sys_table(
thd, SPIDER_SYS_XA_TABLE_NAME_STR, SPIDER_SYS_XA_TABLE_NAME_LEN,
- TRUE, &open_tables_backup, TRUE, &error_num))
+ TRUE, &open_tables_backup, &error_num))
)
goto error_open_table;
table_xa_opened = TRUE;
if ((error_num = spider_delete_xa(table_xa, xid)))
goto error;
- spider_close_sys_table(thd, table_xa, &open_tables_backup, TRUE);
+ spider_sys_close_table(thd, &open_tables_backup);
table_xa_opened = FALSE;
DBUG_RETURN(0);
error:
if (table_xa_opened)
- spider_close_sys_table(thd, table_xa, &open_tables_backup, TRUE);
+ spider_sys_close_table(thd, &open_tables_backup);
if (table_xa_member_opened)
- spider_close_sys_table(thd, table_xa_member, &open_tables_backup, TRUE);
+ spider_sys_close_table(thd, &open_tables_backup);
error_open_table:
DBUG_RETURN(error_num);
}
@@ -2772,7 +2770,7 @@ int spider_internal_xa_rollback_by_xid(
if (
!(table_xa = spider_open_sys_table(
thd, SPIDER_SYS_XA_TABLE_NAME_STR, SPIDER_SYS_XA_TABLE_NAME_LEN,
- TRUE, &open_tables_backup, TRUE, &error_num))
+ TRUE, &open_tables_backup, &error_num))
)
goto error_open_table;
table_xa_opened = TRUE;
@@ -2822,7 +2820,7 @@ int spider_internal_xa_rollback_by_xid(
free_root(&mem_root, MYF(0));
goto error;
}
- spider_close_sys_table(thd, table_xa, &open_tables_backup, TRUE);
+ spider_sys_close_table(thd, &open_tables_backup);
table_xa_opened = FALSE;
/*
@@ -2843,7 +2841,7 @@ int spider_internal_xa_rollback_by_xid(
if (
!(table_xa_member = spider_open_sys_table(
thd, SPIDER_SYS_XA_MEMBER_TABLE_NAME_STR,
- SPIDER_SYS_XA_MEMBER_TABLE_NAME_LEN, TRUE, &open_tables_backup, TRUE,
+ SPIDER_SYS_XA_MEMBER_TABLE_NAME_LEN, TRUE, &open_tables_backup,
&error_num))
) {
free_root(&mem_root, MYF(0));
@@ -2862,7 +2860,7 @@ int spider_internal_xa_rollback_by_xid(
goto error;
} else {
free_root(&mem_root, MYF(0));
- spider_close_sys_table(thd, table_xa_member, &open_tables_backup, TRUE);
+ spider_sys_close_table(thd, &open_tables_backup);
table_xa_member_opened = FALSE;
goto xa_delete;
}
@@ -2883,13 +2881,11 @@ int spider_internal_xa_rollback_by_xid(
goto error;
}
- if (
- !(conn = spider_get_conn(
- &tmp_share, 0, tmp_share.conn_keys[0], trx, NULL, FALSE, FALSE,
- SPIDER_CONN_KIND_MYSQL, &error_num)) &&
- (force_commit == 0 ||
- (force_commit == 1 && error_num != ER_XAER_NOTA))
- ) {
+ if (!(conn= spider_get_conn(&tmp_share, 0, tmp_share.conn_keys[0], trx,
+ NULL, FALSE, FALSE, &error_num)) &&
+ (force_commit == 0 ||
+ (force_commit == 1 && error_num != ER_XAER_NOTA)))
+ {
spider_sys_index_end(table_xa_member);
spider_free_tmp_share_alloc(&tmp_share);
free_root(&mem_root, MYF(0));
@@ -2933,7 +2929,7 @@ int spider_internal_xa_rollback_by_xid(
*/
if ((error_num = spider_delete_xa_member(table_xa_member, xid)))
goto error;
- spider_close_sys_table(thd, table_xa_member, &open_tables_backup, TRUE);
+ spider_sys_close_table(thd, &open_tables_backup);
table_xa_member_opened = FALSE;
xa_delete:
@@ -2948,21 +2944,21 @@ xa_delete:
if (
!(table_xa = spider_open_sys_table(
thd, SPIDER_SYS_XA_TABLE_NAME_STR, SPIDER_SYS_XA_TABLE_NAME_LEN,
- TRUE, &open_tables_backup, TRUE, &error_num))
+ TRUE, &open_tables_backup, &error_num))
)
goto error_open_table;
table_xa_opened = TRUE;
if ((error_num = spider_delete_xa(table_xa, xid)))
goto error;
- spider_close_sys_table(thd, table_xa, &open_tables_backup, TRUE);
+ spider_sys_close_table(thd, &open_tables_backup);
table_xa_opened = FALSE;
DBUG_RETURN(0);
error:
if (table_xa_opened)
- spider_close_sys_table(thd, table_xa, &open_tables_backup, TRUE);
+ spider_sys_close_table(thd, &open_tables_backup);
if (table_xa_member_opened)
- spider_close_sys_table(thd, table_xa_member, &open_tables_backup, TRUE);
+ spider_sys_close_table(thd, &open_tables_backup);
error_open_table:
DBUG_RETURN(error_num);
}
@@ -3387,11 +3383,8 @@ int spider_end_trx(
DBUG_RETURN(error_num);
}
-int spider_check_trx_and_get_conn(
- THD *thd,
- ha_spider *spider,
- bool use_conn_kind
-) {
+int spider_check_trx_and_get_conn(THD *thd, ha_spider *spider)
+{
int error_num, roop_count, search_link_idx;
SPIDER_TRX *trx;
SPIDER_SHARE *share = spider->share;
@@ -3491,22 +3484,16 @@ int spider_check_trx_and_get_conn(
spider->conn_link_idx, roop_count, share->link_count,
SPIDER_LINK_STATUS_RECOVERY)
) {
- uint tgt_conn_kind = (use_conn_kind ? spider->conn_kind[roop_count] :
- SPIDER_CONN_KIND_MYSQL);
if (roop_count == spider->search_link_idx)
search_link_idx_is_checked = TRUE;
- if (
- tgt_conn_kind == SPIDER_CONN_KIND_MYSQL &&
- !spider->conns[roop_count]
- ) {
+ if (!spider->conns[roop_count])
+ {
*spider->conn_keys[roop_count] = first_byte;
if (
!(conn =
spider_get_conn(share, roop_count,
spider->conn_keys[roop_count], trx,
spider, FALSE, TRUE,
- use_conn_kind ? spider->conn_kind[roop_count] :
- SPIDER_CONN_KIND_MYSQL,
&error_num))
) {
if (
@@ -3586,8 +3573,6 @@ int spider_check_trx_and_get_conn(
spider_get_conn(share, roop_count,
spider->conn_keys[roop_count], trx,
spider, FALSE, TRUE,
- use_conn_kind ? spider->conn_kind[roop_count] :
- SPIDER_CONN_KIND_MYSQL,
&error_num))
) {
if (
@@ -3801,46 +3786,59 @@ void spider_reuse_trx_ha(
DBUG_VOID_RETURN;
}
+/**
+ Sets link indices for load balancing read connections
+
+ Assuming `spider->share->link_count` is the number of active servers
+ to use, this function updates `spider->conn_link_idx` with the first
+ server in the same "modulus group" whose link status is not
+ `SPIDER_LINK_STATUS_NG`, or if one cannot be found, use the
+ `link_idx`th server
+*/
void spider_trx_set_link_idx_for_all(
ha_spider *spider
) {
- int roop_count, roop_count2;
SPIDER_SHARE *share = spider->share;
long *link_statuses = share->link_statuses;
uint *conn_link_idx = spider->conn_link_idx;
- int link_count = share->link_count;
- int all_link_count = share->all_link_count;
+ uint link_count = share->link_count;
+ uint all_link_count = share->all_link_count;
uchar *conn_can_fo = spider->conn_can_fo;
DBUG_ENTER("spider_trx_set_link_idx_for_all");
DBUG_PRINT("info",("spider set link_count=%d", link_count));
DBUG_PRINT("info",("spider set all_link_count=%d", all_link_count));
memset(conn_can_fo, 0, sizeof(uchar) * share->link_bitmap_size);
- for (roop_count = 0; roop_count < link_count; roop_count++)
- {
- for (roop_count2 = roop_count; roop_count2 < all_link_count;
- roop_count2 += link_count)
+ /* We change the name from roop_count and roop_count2 to link_idx
+ and all_link_idx because the latter are generally used in the
+ same context. */
+ for (uint link_idx = 0; link_idx < link_count; link_idx++)
+ {
+ uint all_link_idx;
+ for (all_link_idx = link_idx; all_link_idx < all_link_count;
+ all_link_idx += link_count)
{
- if (link_statuses[roop_count2] <= SPIDER_LINK_STATUS_RECOVERY)
+ if (link_statuses[all_link_idx] <= SPIDER_LINK_STATUS_RECOVERY)
break;
}
- if (roop_count2 < all_link_count)
+ if (all_link_idx < all_link_count)
{
- conn_link_idx[roop_count] = roop_count2;
- if (roop_count2 + link_count < all_link_count)
- spider_set_bit(conn_can_fo, roop_count);
+ conn_link_idx[link_idx] = all_link_idx;
+ if (all_link_idx + link_count < all_link_count)
+ spider_set_bit(conn_can_fo, link_idx);
DBUG_PRINT("info",("spider set conn_link_idx[%d]=%d",
- roop_count, roop_count2));
- } else {
- conn_link_idx[roop_count] = roop_count;
+ link_idx, all_link_idx));
+ } else
+ {
+ conn_link_idx[link_idx] = link_idx;
DBUG_PRINT("info",("spider set2 conn_link_idx[%d]=%d",
- roop_count, roop_count));
+ link_idx, link_idx));
}
- spider->conn_keys[roop_count] =
+ spider->conn_keys[link_idx] =
ADD_TO_PTR(spider->conn_keys_first_ptr,
- PTR_BYTE_DIFF(share->conn_keys[conn_link_idx[roop_count]],
+ PTR_BYTE_DIFF(share->conn_keys[conn_link_idx[link_idx]],
share->conn_keys[0]), char*);
DBUG_PRINT("info",("spider conn_keys[%d]=%s",
- roop_count, spider->conn_keys[roop_count]));
+ link_idx, spider->conn_keys[link_idx]));
}
DBUG_VOID_RETURN;
}
diff --git a/storage/spider/spd_trx.h b/storage/spider/spd_trx.h
index 2055a497..93b03fce 100644
--- a/storage/spider/spd_trx.h
+++ b/storage/spider/spd_trx.h
@@ -227,11 +227,7 @@ int spider_end_trx(
SPIDER_CONN *conn
);
-int spider_check_trx_and_get_conn(
- THD *thd,
- ha_spider *spider,
- bool use_conn_kind
-);
+int spider_check_trx_and_get_conn(THD *thd, ha_spider *spider);
THD *spider_create_tmp_thd();