summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--BUILD/FINISH.sh7
-rwxr-xr-xBUILD/SETUP.sh8
-rw-r--r--CMakeLists.txt2
-rw-r--r--VERSION2
-rw-r--r--client/completion_hash.cc2
-rw-r--r--client/mysql.cc2
-rw-r--r--client/mysql_upgrade.c9
-rw-r--r--client/mysqlbinlog.cc6
-rw-r--r--client/mysqlcheck.c6
-rw-r--r--client/mysqldump.c8
-rw-r--r--client/mysqltest.cc27
-rw-r--r--cmake/build_configurations/mysql_release.cmake2
-rw-r--r--cmake/configure.pl15
-rw-r--r--cmake/cpack_rpm.cmake35
-rw-r--r--cmake/create_initial_db.cmake.in12
-rw-r--r--cmake/info_macros.cmake.in8
-rw-r--r--cmake/install_layout.cmake7
-rw-r--r--cmake/mysql_version.cmake2
-rw-r--r--cmake/package_name.cmake2
-rw-r--r--cmake/plugin.cmake1
-rw-r--r--debian/dist/Debian/mariadb-server-10.0.files1
-rwxr-xr-xdebian/dist/Debian/rules2
-rw-r--r--debian/dist/Ubuntu/mariadb-server-10.0.files1
-rwxr-xr-xdebian/dist/Ubuntu/rules2
-rwxr-xr-xdebian/patches/38_scripts__mysqld_safe.sh__signals.dpatch20
-rw-r--r--extra/comp_err.c4
-rw-r--r--extra/replace.c4
-rw-r--r--extra/resolve_stack_dump.c2
-rw-r--r--include/hash.h1
-rw-r--r--include/heap.h1
-rw-r--r--include/ma_dyncol.h102
-rw-r--r--include/my_dir.h5
-rw-r--r--include/my_global.h2
-rw-r--r--include/my_pthread.h6
-rw-r--r--include/my_sys.h44
-rw-r--r--include/my_tree.h6
-rw-r--r--include/myisamchk.h1
-rw-r--r--include/mysql.h.pp4
-rw-r--r--include/mysql/plugin.h19
-rw-r--r--include/mysql/plugin_audit.h.pp11
-rw-r--r--include/mysql/plugin_auth.h.pp11
-rw-r--r--include/mysql/plugin_ftparser.h.pp11
-rw-r--r--include/mysql/service_kill_statement.h71
-rw-r--r--include/mysql/services.h1
-rw-r--r--include/mysql_com.h70
-rw-r--r--include/service_versions.h14
-rw-r--r--libmysql/CMakeLists.txt173
-rw-r--r--libmysql/libmysql.c7
-rw-r--r--libmysql/libmysql_rpm_version.in48
-rw-r--r--libmysql/rpm_support.cc41
-rw-r--r--libmysqld/CMakeLists.txt15
-rw-r--r--libmysqld/emb_qcache.cc2
-rw-r--r--libmysqld/lib_sql.cc10
-rw-r--r--libservices/CMakeLists.txt3
-rw-r--r--libservices/kill_statement_service.c18
-rw-r--r--mysql-test/extra/binlog_tests/mysqlbinlog_row_engine.inc (renamed from mysql-test/include/mysqlbinlog_row_engine.inc)0
-rw-r--r--mysql-test/include/have_cassandra.inc10
-rw-r--r--mysql-test/include/have_cassandra.opt1
-rw-r--r--mysql-test/include/have_dbi_dbd-mysql.inc4
-rw-r--r--mysql-test/include/plugin.defs1
-rw-r--r--mysql-test/include/rpl_start_server.inc15
-rwxr-xr-xmysql-test/lib/v1/mysql-test-run.pl2
-rwxr-xr-xmysql-test/mysql-test-run.pl8
-rw-r--r--mysql-test/r/alias.result2
-rw-r--r--mysql-test/r/cassandra.result593
-rw-r--r--mysql-test/r/change_user_notembedded.result5
-rw-r--r--mysql-test/r/contributors.result2
-rw-r--r--mysql-test/r/create.result8
-rw-r--r--mysql-test/r/create_delayed.result3
-rw-r--r--mysql-test/r/ctype_ucs.result26
-rw-r--r--mysql-test/r/ctype_utf16.result8
-rw-r--r--mysql-test/r/ctype_utf8.result8
-rw-r--r--mysql-test/r/datetime_456.result2
-rw-r--r--mysql-test/r/derived_view.result49
-rw-r--r--mysql-test/r/distinct.result32
-rw-r--r--mysql-test/r/dyncol.result352
-rw-r--r--mysql-test/r/failed_auth_3909.result21
-rw-r--r--mysql-test/r/func_gconcat.result5
-rw-r--r--mysql-test/r/func_misc.result33
-rw-r--r--mysql-test/r/func_time.result2
-rw-r--r--mysql-test/r/gis2.result14
-rw-r--r--mysql-test/r/grant_lowercase.result20
-rw-r--r--mysql-test/r/group_by.result86
-rw-r--r--mysql-test/r/group_by_innodb.result30
-rw-r--r--mysql-test/r/group_min_max.result7
-rw-r--r--mysql-test/r/handlersocket.result2
-rw-r--r--mysql-test/r/information_schema2.result8
-rw-r--r--mysql-test/r/loaddata.result29
-rw-r--r--mysql-test/r/mysql.result4
-rw-r--r--mysql-test/r/mysqltest.result6
-rw-r--r--mysql-test/r/plugin.result8
-rw-r--r--mysql-test/r/plugin_auth.result19
-rw-r--r--mysql-test/r/show_check.result11
-rw-r--r--mysql-test/r/show_explain.result156
-rw-r--r--mysql-test/r/sp.result38
-rw-r--r--mysql-test/r/sp_notembedded.result5
-rw-r--r--mysql-test/r/stat_tables_par.result20
-rw-r--r--mysql-test/r/stat_tables_par_innodb.result20
-rw-r--r--mysql-test/r/subselect4.result47
-rw-r--r--mysql-test/r/subselect_innodb.result18
-rw-r--r--mysql-test/r/subselect_sj.result75
-rw-r--r--mysql-test/r/subselect_sj_jcl6.result79
-rw-r--r--mysql-test/r/sum_distinct-big.result15
-rw-r--r--mysql-test/r/type_year.result1
-rw-r--r--mysql-test/r/user_var.result5
-rw-r--r--mysql-test/r/view.result41
-rw-r--r--mysql-test/suite/binlog/r/binlog_database.result6
-rw-r--r--mysql-test/suite/binlog/r/binlog_mysqlbinlog-cp932.result (renamed from mysql-test/r/mysqlbinlog-cp932.result)0
-rw-r--r--mysql-test/suite/binlog/r/binlog_mysqlbinlog2.result (renamed from mysql-test/r/mysqlbinlog2.result)0
-rw-r--r--mysql-test/suite/binlog/r/binlog_mysqlbinlog_base64.result (renamed from mysql-test/r/mysqlbinlog_base64.result)0
-rw-r--r--mysql-test/suite/binlog/r/binlog_mysqlbinlog_row.result (renamed from mysql-test/r/mysqlbinlog_row.result)382
-rw-r--r--mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_innodb.result (renamed from mysql-test/r/mysqlbinlog_row_innodb.result)202
-rw-r--r--mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_myisam.result (renamed from mysql-test/r/mysqlbinlog_row_myisam.result)202
-rw-r--r--mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_trans.result (renamed from mysql-test/r/mysqlbinlog_row_trans.result)56
-rw-r--r--mysql-test/suite/binlog/r/binlog_row_annotate.result192
-rw-r--r--mysql-test/suite/binlog/r/binlog_row_mysqlbinlog_options.result56
-rw-r--r--mysql-test/suite/binlog/r/binlog_row_mysqlbinlog_verbose.result56
-rw-r--r--mysql-test/suite/binlog/t/binlog_mysqlbinlog-cp932-master.opt (renamed from mysql-test/t/mysqlbinlog-cp932-master.opt)0
-rw-r--r--mysql-test/suite/binlog/t/binlog_mysqlbinlog-cp932.test (renamed from mysql-test/t/mysqlbinlog-cp932.test)0
-rw-r--r--mysql-test/suite/binlog/t/binlog_mysqlbinlog2-master.opt (renamed from mysql-test/t/mysqlbinlog2-master.opt)0
-rw-r--r--mysql-test/suite/binlog/t/binlog_mysqlbinlog2.test (renamed from mysql-test/t/mysqlbinlog2.test)0
-rw-r--r--mysql-test/suite/binlog/t/binlog_mysqlbinlog_base64.test (renamed from mysql-test/t/mysqlbinlog_base64.test)0
-rw-r--r--mysql-test/suite/binlog/t/binlog_mysqlbinlog_row-master.opt (renamed from mysql-test/t/mysqlbinlog_row-master.opt)0
-rw-r--r--mysql-test/suite/binlog/t/binlog_mysqlbinlog_row.test (renamed from mysql-test/t/mysqlbinlog_row.test)0
-rw-r--r--mysql-test/suite/binlog/t/binlog_mysqlbinlog_row_innodb-master.opt (renamed from mysql-test/t/mysqlbinlog_row_innodb-master.opt)0
-rw-r--r--mysql-test/suite/binlog/t/binlog_mysqlbinlog_row_innodb.test (renamed from mysql-test/t/mysqlbinlog_row_innodb.test)2
-rw-r--r--mysql-test/suite/binlog/t/binlog_mysqlbinlog_row_myisam-master.opt (renamed from mysql-test/t/mysqlbinlog_row_myisam-master.opt)0
-rw-r--r--mysql-test/suite/binlog/t/binlog_mysqlbinlog_row_myisam.test (renamed from mysql-test/t/mysqlbinlog_row_myisam.test)2
-rw-r--r--mysql-test/suite/binlog/t/binlog_mysqlbinlog_row_trans-master.opt (renamed from mysql-test/t/mysqlbinlog_row_trans-master.opt)0
-rw-r--r--mysql-test/suite/binlog/t/binlog_mysqlbinlog_row_trans.test (renamed from mysql-test/t/mysqlbinlog_row_trans.test)0
-rw-r--r--mysql-test/suite/engines/funcs/r/tc_rename_error.result2
-rw-r--r--mysql-test/suite/engines/iuds/r/insert_time.result7
-rw-r--r--mysql-test/suite/funcs_1/datadict/processlist_priv.inc32
-rw-r--r--mysql-test/suite/funcs_1/datadict/processlist_val.inc16
-rw-r--r--mysql-test/suite/funcs_1/r/is_columns_is.result4
-rw-r--r--mysql-test/suite/funcs_1/r/is_columns_is_embedded.result4
-rw-r--r--mysql-test/suite/funcs_1/r/processlist_priv_no_prot.result166
-rw-r--r--mysql-test/suite/funcs_1/r/processlist_priv_ps.result166
-rw-r--r--mysql-test/suite/funcs_1/r/processlist_val_no_prot.result48
-rw-r--r--mysql-test/suite/funcs_1/r/processlist_val_ps.result48
-rw-r--r--mysql-test/suite/innodb/r/binlog_consistent.result16
-rw-r--r--mysql-test/suite/innodb/r/innodb-autoinc.result40
-rw-r--r--mysql-test/suite/innodb/r/innodb-zip.result6
-rw-r--r--mysql-test/suite/innodb/r/innodb.result2
-rw-r--r--mysql-test/suite/innodb/r/innodb_bug14704286.result53
-rw-r--r--mysql-test/suite/innodb/r/innodb_bug53591.result2
-rw-r--r--mysql-test/suite/innodb/r/innodb_prefix_index_liftedlimit.result2
-rw-r--r--mysql-test/suite/innodb/t/innodb-autoinc.opt (renamed from mysql-test/suite/innodb/t/innodb-autoinc-master.opt)0
-rw-r--r--mysql-test/suite/innodb/t/innodb-autoinc.test22
-rw-r--r--mysql-test/suite/innodb/t/innodb-zip.test5
-rw-r--r--mysql-test/suite/innodb/t/innodb.test5
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug14704286.test95
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug53591.test4
-rw-r--r--mysql-test/suite/innodb/t/innodb_prefix_index_liftedlimit.test5
-rw-r--r--mysql-test/suite/maria/truncate.result12
-rw-r--r--mysql-test/suite/maria/truncate.test13
-rw-r--r--mysql-test/suite/multi_source/multisource.result4
-rw-r--r--mysql-test/suite/multi_source/multisource.test9
-rw-r--r--mysql-test/suite/perfschema/include/upgrade_check.inc2
-rw-r--r--mysql-test/suite/perfschema/r/digest_table_full.result2
-rw-r--r--mysql-test/suite/perfschema/r/func_file_io.result25
-rw-r--r--mysql-test/suite/perfschema/r/func_mutex.result33
-rw-r--r--mysql-test/suite/perfschema/r/pfs_upgrade.result495
-rw-r--r--mysql-test/suite/perfschema/r/statement_digest.result44
-rw-r--r--mysql-test/suite/perfschema/r/statement_digest_consumers.result44
-rw-r--r--mysql-test/suite/perfschema/r/statement_digest_long_query.result4
-rw-r--r--mysql-test/suite/perfschema/t/func_file_io.test7
-rw-r--r--mysql-test/suite/perfschema/t/func_mutex.test12
-rw-r--r--mysql-test/suite/plugins/r/audit_null_debug.result12
-rw-r--r--mysql-test/suite/plugins/t/audit_null_debug.test27
-rw-r--r--mysql-test/suite/rpl/r/rpl_password_boundaries.result59
-rw-r--r--mysql-test/suite/rpl/r/rpl_semi_sync.result29
-rw-r--r--mysql-test/suite/rpl/t/rpl_password_boundaries.test112
-rw-r--r--mysql-test/suite/rpl/t/rpl_semi_sync.test13
-rw-r--r--mysql-test/suite/sphinx/sphinx.result13
-rw-r--r--mysql-test/suite/storage_engine/misc.result9
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_change_buffering_debug_basic.result3
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_changed_pages_limit_basic.result1
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_locking_fake_changes_basic.result1
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_max_bitmap_file_size_basic.result1
-rw-r--r--mysql-test/suite/sys_vars/r/pseudo_thread_id_basic.result3
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_change_buffering_debug_basic.test4
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_changed_pages_limit_basic.test1
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_locking_fake_changes_basic.test1
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_max_bitmap_file_size_basic.test1
-rw-r--r--mysql-test/suite/sys_vars/t/pseudo_thread_id_basic.test3
-rw-r--r--mysql-test/suite/vcol/r/vcol_misc.result11
-rw-r--r--mysql-test/suite/vcol/t/vcol_misc.test19
-rw-r--r--mysql-test/t/alias.test11
-rw-r--r--mysql-test/t/cassandra.test719
-rw-r--r--mysql-test/t/change_user_notembedded.test24
-rw-r--r--mysql-test/t/create_delayed.test34
-rw-r--r--mysql-test/t/ctype_ucs.test32
-rw-r--r--mysql-test/t/ctype_utf16.test4
-rw-r--r--mysql-test/t/ctype_utf8.test5
-rw-r--r--mysql-test/t/derived_view.test61
-rw-r--r--mysql-test/t/distinct.test25
-rw-r--r--mysql-test/t/dyncol.test161
-rw-r--r--mysql-test/t/failed_auth_3909.test37
-rw-r--r--mysql-test/t/file_contents.test4
-rw-r--r--mysql-test/t/func_gconcat.test10
-rw-r--r--mysql-test/t/func_misc.test19
-rw-r--r--mysql-test/t/gis2.test17
-rw-r--r--mysql-test/t/grant_lowercase.opt1
-rw-r--r--mysql-test/t/grant_lowercase.test31
-rw-r--r--mysql-test/t/group_by.test78
-rw-r--r--mysql-test/t/group_by_innodb.test38
-rw-r--r--mysql-test/t/group_min_max.test9
-rw-r--r--mysql-test/t/information_schema2.test9
-rw-r--r--mysql-test/t/loaddata.test62
-rw-r--r--mysql-test/t/mysql.test12
-rw-r--r--mysql-test/t/plugin.test18
-rw-r--r--mysql-test/t/plugin_auth.test26
-rw-r--r--mysql-test/t/show_check.test14
-rw-r--r--mysql-test/t/show_explain.test167
-rw-r--r--mysql-test/t/sp.test20
-rw-r--r--mysql-test/t/sp_notembedded.test21
-rw-r--r--mysql-test/t/stat_tables_par.test33
-rw-r--r--mysql-test/t/subselect4.test51
-rw-r--r--mysql-test/t/subselect_innodb.test14
-rw-r--r--mysql-test/t/subselect_sj.test69
-rw-r--r--mysql-test/t/sum_distinct-big.test17
-rw-r--r--mysql-test/t/user_var.test14
-rw-r--r--mysql-test/t/view.test47
-rw-r--r--mysql-test/valgrind.supp8
-rw-r--r--mysys/array.c34
-rw-r--r--mysys/default.c6
-rw-r--r--mysys/hash.c6
-rw-r--r--mysys/ma_dyncol.c3556
-rw-r--r--mysys/mf_tempdir.c2
-rw-r--r--mysys/my_alloc.c37
-rw-r--r--mysys/my_chmod.c2
-rw-r--r--mysys/my_chsize.c2
-rw-r--r--mysys/my_copy.c2
-rw-r--r--mysys/my_create.c2
-rw-r--r--mysys/my_delete.c2
-rw-r--r--mysys/my_error.c6
-rw-r--r--mysys/my_fopen.c6
-rw-r--r--mysys/my_fstream.c8
-rw-r--r--mysys/my_getwd.c4
-rw-r--r--mysys/my_lib.c17
-rw-r--r--mysys/my_lock.c2
-rw-r--r--mysys/my_malloc.c126
-rw-r--r--mysys/my_open.c4
-rw-r--r--mysys/my_pread.c4
-rw-r--r--mysys/my_read.c2
-rw-r--r--mysys/my_redel.c12
-rw-r--r--mysys/my_rename.c2
-rw-r--r--mysys/my_seek.c4
-rw-r--r--mysys/my_sync.c7
-rw-r--r--mysys/my_thr_init.c7
-rw-r--r--mysys/my_write.c2
-rw-r--r--mysys/mysys_priv.h9
-rw-r--r--mysys/safemalloc.c116
-rw-r--r--mysys/string.c104
-rw-r--r--mysys/tree.c15
-rw-r--r--mysys/waiting_threads.c4
-rw-r--r--packaging/rpm-uln/CMakeLists.txt38
-rw-r--r--packaging/rpm-uln/README-ULN15
-rw-r--r--packaging/rpm-uln/README.mysql-docs4
-rwxr-xr-xpackaging/rpm-uln/filter-requires-mysql.sh3
-rwxr-xr-xpackaging/rpm-uln/generate-tarball.sh15
-rw-r--r--packaging/rpm-uln/my.cnf10
-rw-r--r--packaging/rpm-uln/my_config.h29
-rw-r--r--packaging/rpm-uln/mysql-5.5-errno.patch21
-rw-r--r--packaging/rpm-uln/mysql-5.5-fix-tests.patch34
-rw-r--r--packaging/rpm-uln/mysql-5.5-libdir.patch28
-rw-r--r--packaging/rpm-uln/mysql-5.5-mtr1.patch25
-rw-r--r--packaging/rpm-uln/mysql-5.5-stack-guard.patch140
-rw-r--r--packaging/rpm-uln/mysql-5.5-testing.patch23
-rw-r--r--packaging/rpm-uln/mysql-chain-certs.patch45
-rw-r--r--packaging/rpm-uln/mysql-embedded-check.c26
-rw-r--r--packaging/rpm-uln/mysql-expired-certs.patch555
-rw-r--r--packaging/rpm-uln/mysql-install-test.patch33
-rw-r--r--packaging/rpm-uln/mysql-strmov.patch32
-rw-r--r--packaging/rpm-uln/mysql.init209
-rw-r--r--packaging/rpm-uln/mysql.spec.sh1959
-rw-r--r--packaging/rpm-uln/scriptstub.c32
-rw-r--r--plugin/feedback/utils.cc6
-rw-r--r--scripts/CMakeLists.txt8
-rw-r--r--scripts/mysql_install_db.pl.in16
-rw-r--r--scripts/mysql_install_db.sh7
-rw-r--r--scripts/mysql_performance_tables.sql1451
-rw-r--r--scripts/mysql_system_tables.sql1453
-rw-r--r--scripts/mysql_system_tables_fix.sql23
-rw-r--r--scripts/mysqlaccess.sh6
-rw-r--r--scripts/mysqld_multi.sh22
-rw-r--r--scripts/mysqld_safe.sh83
-rw-r--r--sql-common/client.c14
-rw-r--r--sql-common/client_plugin.c2
-rw-r--r--sql/CMakeLists.txt4
-rw-r--r--sql/debug_sync.cc3
-rw-r--r--sql/event_data_objects.cc2
-rw-r--r--sql/event_db_repository.cc10
-rw-r--r--sql/event_scheduler.cc17
-rw-r--r--sql/events.cc2
-rw-r--r--sql/field.cc15
-rw-r--r--sql/field.h1
-rw-r--r--sql/filesort.cc44
-rw-r--r--sql/filesort_utils.cc6
-rw-r--r--sql/ha_ndbcluster.cc6
-rw-r--r--sql/ha_ndbcluster_binlog.cc7
-rw-r--r--sql/ha_partition.cc222
-rw-r--r--sql/ha_partition.h4
-rw-r--r--sql/handler.cc70
-rw-r--r--sql/handler.h7
-rw-r--r--sql/hostname.cc56
-rw-r--r--sql/item.cc20
-rw-r--r--sql/item.h45
-rw-r--r--sql/item_cmpfunc.cc96
-rw-r--r--sql/item_cmpfunc.h36
-rw-r--r--sql/item_create.cc95
-rw-r--r--sql/item_create.h1
-rw-r--r--sql/item_func.cc50
-rw-r--r--sql/item_func.h75
-rw-r--r--sql/item_geofunc.cc4
-rw-r--r--sql/item_geofunc.h30
-rw-r--r--sql/item_row.cc5
-rw-r--r--sql/item_strfunc.cc361
-rw-r--r--sql/item_strfunc.h55
-rw-r--r--sql/item_subselect.cc35
-rw-r--r--sql/item_sum.cc59
-rw-r--r--sql/item_sum.h2
-rw-r--r--sql/item_timefunc.cc21
-rw-r--r--sql/item_timefunc.h42
-rw-r--r--sql/item_xmlfunc.cc1
-rw-r--r--sql/item_xmlfunc.h8
-rw-r--r--sql/lex.h3
-rw-r--r--sql/log.cc69
-rw-r--r--sql/log_event.cc88
-rw-r--r--sql/log_event.h6
-rw-r--r--sql/log_event_old.cc7
-rw-r--r--sql/mdl.cc15
-rw-r--r--sql/mysqld.cc125
-rw-r--r--sql/mysqld.h6
-rw-r--r--sql/net_serv.cc15
-rw-r--r--sql/opt_range.cc100
-rw-r--r--sql/opt_range_mrr.cc1
-rw-r--r--sql/opt_subselect.cc6
-rw-r--r--sql/protocol.cc2
-rw-r--r--sql/records.cc12
-rw-r--r--sql/rpl_filter.cc2
-rw-r--r--sql/rpl_handler.cc2
-rw-r--r--sql/rpl_handler.h2
-rw-r--r--sql/rpl_mi.cc2
-rw-r--r--sql/rpl_mi.h6
-rw-r--r--sql/rpl_rli.cc3
-rw-r--r--sql/rpl_tblmap.cc2
-rw-r--r--sql/rpl_utility.cc2
-rw-r--r--sql/slave.cc35
-rw-r--r--sql/sp.cc16
-rw-r--r--sql/sp_head.cc60
-rw-r--r--sql/sp_pcontext.cc40
-rw-r--r--sql/sp_rcontext.cc13
-rw-r--r--sql/sp_rcontext.h45
-rw-r--r--sql/sql_acl.cc258
-rw-r--r--sql/sql_analyse.h14
-rw-r--r--sql/sql_array.h3
-rw-r--r--sql/sql_audit.cc47
-rw-r--r--sql/sql_audit.h2
-rw-r--r--sql/sql_base.cc13
-rw-r--r--sql/sql_base.h1
-rw-r--r--sql/sql_cache.cc4
-rw-r--r--sql/sql_class.cc124
-rw-r--r--sql/sql_class.h29
-rw-r--r--sql/sql_connect.cc13
-rw-r--r--sql/sql_const.h4
-rw-r--r--sql/sql_db.cc5
-rw-r--r--sql/sql_delete.cc3
-rw-r--r--sql/sql_error.cc25
-rw-r--r--sql/sql_error.h8
-rw-r--r--sql/sql_handler.cc31
-rw-r--r--sql/sql_help.cc10
-rw-r--r--sql/sql_insert.cc89
-rw-r--r--sql/sql_join_cache.cc994
-rw-r--r--sql/sql_lex.cc4
-rw-r--r--sql/sql_lex.h2
-rw-r--r--sql/sql_list.h11
-rw-r--r--sql/sql_load.cc10
-rw-r--r--sql/sql_parse.cc73
-rw-r--r--sql/sql_plugin.cc60
-rw-r--r--sql/sql_plugin_services.h15
-rw-r--r--sql/sql_prepare.cc6
-rw-r--r--sql/sql_priv.h35
-rw-r--r--sql/sql_profile.cc29
-rw-r--r--sql/sql_profile.h6
-rw-r--r--sql/sql_reload.cc2
-rw-r--r--sql/sql_repl.cc50
-rw-r--r--sql/sql_repl.h6
-rw-r--r--sql/sql_select.cc238
-rw-r--r--sql/sql_servers.cc6
-rw-r--r--sql/sql_show.cc77
-rw-r--r--sql/sql_signal.cc12
-rw-r--r--sql/sql_statistics.cc15
-rw-r--r--sql/sql_string.cc87
-rw-r--r--sql/sql_string.h27
-rw-r--r--sql/sql_table.cc9
-rw-r--r--sql/sql_test.cc4
-rw-r--r--sql/sql_time.cc4
-rw-r--r--sql/sql_trigger.cc4
-rw-r--r--sql/sql_truncate.cc3
-rw-r--r--sql/sql_udf.cc4
-rw-r--r--sql/sql_union.cc2
-rw-r--r--sql/sql_update.cc14
-rw-r--r--sql/sql_yacc.yy27
-rw-r--r--sql/sys_vars.cc4
-rw-r--r--sql/table.cc65
-rw-r--r--sql/table.h4
-rw-r--r--sql/thr_malloc.cc5
-rw-r--r--sql/thr_malloc.h3
-rw-r--r--sql/tztime.cc42
-rw-r--r--sql/uniques.cc162
-rw-r--r--sql/unireg.cc8
-rw-r--r--storage/archive/ha_archive.cc2
-rw-r--r--storage/archive/ha_archive.h2
-rw-r--r--storage/cassandra/CMakeLists.txt68
-rw-r--r--storage/cassandra/cassandra.cnf2
-rw-r--r--storage/cassandra/cassandra_se.cc800
-rw-r--r--storage/cassandra/cassandra_se.h123
-rw-r--r--storage/cassandra/gen-cpp/Cassandra.cpp12871
-rw-r--r--storage/cassandra/gen-cpp/Cassandra.h5466
-rw-r--r--storage/cassandra/gen-cpp/Cassandra_server.skeleton.cpp219
-rw-r--r--storage/cassandra/gen-cpp/cassandra_constants.cpp18
-rw-r--r--storage/cassandra/gen-cpp/cassandra_constants.h26
-rw-r--r--storage/cassandra/gen-cpp/cassandra_types.cpp3512
-rw-r--r--storage/cassandra/gen-cpp/cassandra_types.h2149
-rw-r--r--storage/cassandra/ha_cassandra.cc2619
-rw-r--r--storage/cassandra/ha_cassandra.h275
-rw-r--r--storage/csv/ha_tina.cc4
-rw-r--r--storage/federated/ha_federated.cc7
-rw-r--r--storage/federated/ha_federated.h2
-rw-r--r--storage/federatedx/federatedx_io_mysql.cc2
-rw-r--r--storage/federatedx/ha_federatedx.cc8
-rw-r--r--storage/federatedx/ha_federatedx.h2
-rw-r--r--storage/heap/ha_heap.cc2
-rw-r--r--storage/heap/heapdef.h3
-rw-r--r--storage/heap/hp_block.c8
-rw-r--r--storage/heap/hp_create.c9
-rw-r--r--storage/heap/hp_open.c4
-rw-r--r--storage/heap/hp_write.c4
-rw-r--r--storage/innobase/btr/btr0btr.cc32
-rw-r--r--storage/innobase/btr/btr0cur.cc26
-rw-r--r--storage/innobase/buf/buf0buf.cc7
-rw-r--r--storage/innobase/buf/buf0lru.cc4
-rw-r--r--storage/innobase/dict/dict0dict.cc18
-rw-r--r--storage/innobase/fil/fil0fil.cc127
-rw-r--r--storage/innobase/handler/ha_innodb.cc65
-rw-r--r--storage/innobase/handler/ha_innodb.h9
-rw-r--r--storage/innobase/handler/handler0alter.cc8
-rw-r--r--storage/innobase/ibuf/ibuf0ibuf.cc44
-rw-r--r--storage/innobase/include/btr0cur.h2
-rw-r--r--storage/innobase/include/dict0mem.h7
-rw-r--r--storage/innobase/include/fil0fil.h15
-rw-r--r--storage/innobase/include/lock0lock.h25
-rw-r--r--storage/innobase/include/page0zip.h8
-rw-r--r--storage/innobase/include/row0undo.h7
-rw-r--r--storage/innobase/include/row0upd.ic3
-rw-r--r--storage/innobase/lock/lock0lock.cc10
-rw-r--r--storage/innobase/log/log0recv.cc5
-rw-r--r--storage/innobase/mysql-test/storage_engine/alter_tablespace.rdiff11
-rw-r--r--storage/innobase/mysql-test/storage_engine/tbl_opt_row_format.rdiff2
-rw-r--r--storage/innobase/os/os0file.cc13
-rw-r--r--storage/innobase/page/page0cur.cc6
-rw-r--r--storage/innobase/page/page0page.cc14
-rw-r--r--storage/innobase/page/page0zip.cc158
-rw-r--r--storage/innobase/row/row0mysql.cc6
-rw-r--r--storage/innobase/row/row0sel.cc25
-rw-r--r--storage/innobase/row/row0umod.cc52
-rw-r--r--storage/innobase/row/row0undo.cc19
-rw-r--r--storage/maria/ha_maria.cc3
-rw-r--r--storage/maria/ma_bitmap.c2
-rw-r--r--storage/maria/ma_blockrec.c2
-rw-r--r--storage/maria/ma_check.c6
-rw-r--r--storage/maria/ma_ft_boolean_search.c4
-rw-r--r--storage/maria/ma_ft_nlq_search.c4
-rw-r--r--storage/maria/ma_ft_parser.c6
-rw-r--r--storage/maria/ma_loghandler.c6
-rw-r--r--storage/maria/ma_open.c2
-rw-r--r--storage/maria/ma_sort.c4
-rw-r--r--storage/maria/ma_write.c6
-rw-r--r--storage/maria/maria_pack.c4
-rw-r--r--storage/maria/unittest/sequence_storage.c2
-rw-r--r--storage/myisam/ft_boolean_search.c4
-rw-r--r--storage/myisam/ft_nlq_search.c4
-rw-r--r--storage/myisam/ft_parser.c5
-rw-r--r--storage/myisam/ft_stopwords.c3
-rw-r--r--storage/myisam/mi_check.c6
-rw-r--r--storage/myisam/mi_open.c3
-rw-r--r--storage/myisam/mi_write.c6
-rw-r--r--storage/myisam/myisamchk.c9
-rw-r--r--storage/myisam/myisamlog.c5
-rw-r--r--storage/myisam/myisampack.c4
-rw-r--r--storage/myisam/sort.c4
-rw-r--r--storage/myisammrg/ha_myisammrg.cc2
-rw-r--r--storage/myisammrg/mysql-test/storage_engine/vcol.rdiff2
-rw-r--r--storage/perfschema/pfs.cc2
-rw-r--r--storage/perfschema/pfs_check.cc2
-rw-r--r--storage/perfschema/pfs_instr.cc3
-rw-r--r--storage/perfschema/pfs_server.cc3
-rw-r--r--storage/sphinx/ha_sphinx.cc12
-rw-r--r--storage/xtradb/btr/btr0cur.c68
-rw-r--r--storage/xtradb/btr/btr0pcur.c1
-rw-r--r--storage/xtradb/buf/buf0lru.c40
-rw-r--r--storage/xtradb/buf/buf0rea.c4
-rw-r--r--storage/xtradb/fsp/fsp0fsp.c6
-rw-r--r--storage/xtradb/handler/ha_innodb.cc83
-rw-r--r--storage/xtradb/handler/ha_innodb.h1
-rw-r--r--storage/xtradb/handler/i_s.cc282
-rw-r--r--storage/xtradb/ibuf/ibuf0ibuf.c2
-rw-r--r--storage/xtradb/include/btr0btr.h5
-rw-r--r--storage/xtradb/include/btr0cur.h5
-rw-r--r--storage/xtradb/include/log0online.h104
-rw-r--r--storage/xtradb/include/srv0srv.h7
-rw-r--r--storage/xtradb/include/univ.i2
-rw-r--r--storage/xtradb/include/ut0ut.h9
-rw-r--r--storage/xtradb/include/ut0ut.ic13
-rw-r--r--storage/xtradb/lock/lock0lock.c18
-rw-r--r--storage/xtradb/log/log0log.c4
-rw-r--r--storage/xtradb/log/log0online.c829
-rw-r--r--storage/xtradb/os/os0file.c6
-rw-r--r--storage/xtradb/row/row0ins.c7
-rw-r--r--storage/xtradb/row/row0mysql.c28
-rw-r--r--storage/xtradb/row/row0upd.c3
-rw-r--r--storage/xtradb/srv/srv0srv.c6
-rw-r--r--storage/xtradb/srv/srv0start.c35
-rw-r--r--strings/ctype-ucs2.c3
-rw-r--r--strings/my_vsnprintf.c2
-rw-r--r--support-files/compiler_warnings.supp18
-rw-r--r--support-files/mysql.spec.sh41
-rw-r--r--tests/mysql_client_test.c180
-rw-r--r--win/create_def_file.js1
531 files changed, 47529 insertions, 6551 deletions
diff --git a/BUILD/FINISH.sh b/BUILD/FINISH.sh
index b7ff195ccf6..e29b6936849 100644
--- a/BUILD/FINISH.sh
+++ b/BUILD/FINISH.sh
@@ -27,6 +27,11 @@ then
configure="$configure --print"
fi
+if test "$AM_EXTRA_MAKEFLAGS" = "VERBOSE=1" -o "$verbose_make" = "1"
+then
+ configure="$configure --verbose"
+fi
+
commands="\
/bin/rm -rf configure;
/bin/rm -rf CMakeCache.txt CMakeFiles/
@@ -45,7 +50,7 @@ if [ -z "$just_configure" -a -z "$just_clean" ]
then
commands="$commands
-$make $AM_MAKEFLAGS $AM_EXTRA_MAKEFLAGS $EXTRA_MAKEFLAGS"
+$make $AM_MAKEFLAGS $AM_EXTRA_MAKEFLAGS"
if [ "x$strip" = "xyes" ]
then
diff --git a/BUILD/SETUP.sh b/BUILD/SETUP.sh
index 5154f64b98f..a4853c823ab 100755
--- a/BUILD/SETUP.sh
+++ b/BUILD/SETUP.sh
@@ -30,6 +30,11 @@ Usage: $0 [-h|-n] [configure-options]
-h, --help Show this help message.
-n, --just-print Don't actually run any commands; just print them.
-c, --just-configure Stop after running configure.
+ --extra-configs=xxx Add this to configure options
+ --extra-flags=xxx Add this C and CXX flags
+ --extra-cflags=xxx Add this to C flags
+ --extra-cxxflags=xxx Add this to CXX flags
+ --verbose Print out full compile lines
--with-debug=full Build with full debug(no optimizations, keep call stack).
--warning-mode=[old|pedantic|maintainer]
Influences the debug flags. Old is default.
@@ -64,6 +69,8 @@ parse_options()
just_configure=1;;
-n | --just-print | --print)
just_print=1;;
+ --verbose)
+ verbose_make=1;;
-h | --help)
usage
exit 0;;
@@ -89,6 +96,7 @@ just_configure=
warning_mode=
maintainer_mode=
full_debug=
+verbose_make=
parse_options "$@"
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 84a2a1d625b..1b29c559415 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -20,6 +20,7 @@ if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" GREATER 2.6)
CMAKE_POLICY(VERSION 2.8)
endif()
+MESSAGE(STATUS "Running cmake version ${CMAKE_VERSION}")
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake)
@@ -324,6 +325,7 @@ IF(NOT WITHOUT_SERVER)
IF(EXISTS ${CMAKE_SOURCE_DIR}/internal/CMakeLists.txt)
ADD_SUBDIRECTORY(internal)
ENDIF()
+ ADD_SUBDIRECTORY(packaging/rpm-uln)
ENDIF()
IF(UNIX)
diff --git a/VERSION b/VERSION
index 1bff368662b..2dacb98ef55 100644
--- a/VERSION
+++ b/VERSION
@@ -4,5 +4,5 @@
#
MYSQL_VERSION_MAJOR=10
MYSQL_VERSION_MINOR=0
-MYSQL_VERSION_PATCH=0
+MYSQL_VERSION_PATCH=1
MYSQL_VERSION_EXTRA=
diff --git a/client/completion_hash.cc b/client/completion_hash.cc
index 9ffb2082c06..c170b69de2d 100644
--- a/client/completion_hash.cc
+++ b/client/completion_hash.cc
@@ -49,7 +49,7 @@ int completion_hash_init(HashTable *ht, uint nSize)
ht->initialized = 0;
return FAILURE;
}
- init_alloc_root(&ht->mem_root, 8192, 0);
+ init_alloc_root(&ht->mem_root, 8192, 0, MYF(0));
ht->pHashFunction = hashpjw;
ht->nTableSize = nSize;
ht->initialized = 1;
diff --git a/client/mysql.cc b/client/mysql.cc
index 5e844f82b42..331302757a6 100644
--- a/client/mysql.cc
+++ b/client/mysql.cc
@@ -1157,7 +1157,7 @@ int main(int argc,char *argv[])
}
glob_buffer.realloc(512);
completion_hash_init(&ht, 128);
- init_alloc_root(&hash_mem_root, 16384, 0);
+ init_alloc_root(&hash_mem_root, 16384, 0, MYF(0));
bzero((char*) &mysql, sizeof(mysql));
if (sql_connect(current_host,current_db,current_user,opt_password,
opt_silent))
diff --git a/client/mysql_upgrade.c b/client/mysql_upgrade.c
index 40cd9a7fe9c..feaf23b15ba 100644
--- a/client/mysql_upgrade.c
+++ b/client/mysql_upgrade.c
@@ -22,7 +22,7 @@
#include <welcome_copyright_notice.h> /* ORACLE_WELCOME_COPYRIGHT_NOTICE */
-#define VER "1.2"
+#define VER "1.3"
#ifdef HAVE_SYS_WAIT_H
#include <sys/wait.h>
@@ -148,6 +148,8 @@ static struct my_option my_long_options[]=
&opt_user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"verbose", 'v', "Display more output about the process.",
&opt_not_used, &opt_not_used, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
+ {"version", 'V', "Output version information and exit.", 0, 0, 0,
+ GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"write-binlog", OPT_WRITE_BINLOG,
"All commands including mysqlcheck are binlogged. Enabled by default;"
"use --skip-write-binlog when commands should not be sent to replication slaves.",
@@ -298,6 +300,11 @@ get_one_option(int optid, const struct my_option *opt,
}
add_option= 0;
break;
+ case 'V':
+ printf("%s Ver %s Distrib %s, for %s (%s)\n",
+ my_progname, VER, MYSQL_SERVER_VERSION, SYSTEM_TYPE, MACHINE_TYPE);
+ die(0);
+ break;
case OPT_SILENT:
opt_verbose= 0;
add_option= 0;
diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc
index 8f6baea4b9f..87198347b10 100644
--- a/client/mysqlbinlog.cc
+++ b/client/mysqlbinlog.cc
@@ -278,8 +278,8 @@ public:
int init()
{
- return init_dynamic_array(&file_names, sizeof(File_name_record),
- 100, 100);
+ return my_init_dynamic_array(&file_names, sizeof(File_name_record),
+ 100, 100, MYF(0));
}
void init_by_dir_name(const char *dir)
@@ -2393,7 +2393,7 @@ int main(int argc, char** argv)
my_init_time(); // for time functions
- init_alloc_root(&s_mem_root, 16384, 0);
+ init_alloc_root(&s_mem_root, 16384, 0, MYF(0));
if (load_defaults("my", load_groups, &argc, &argv))
exit(1);
diff --git a/client/mysqlcheck.c b/client/mysqlcheck.c
index cd92793ef58..60778e12f06 100644
--- a/client/mysqlcheck.c
+++ b/client/mysqlcheck.c
@@ -998,8 +998,10 @@ int main(int argc, char **argv)
}
if (opt_auto_repair &&
- (my_init_dynamic_array(&tables4repair, sizeof(char)*(NAME_LEN*2+2),16,64) ||
- my_init_dynamic_array(&tables4rebuild, sizeof(char)*(NAME_LEN*2+2),16,64)))
+ (my_init_dynamic_array(&tables4repair, sizeof(char)*(NAME_LEN*2+2),16,
+ 64, MYF(0)) ||
+ my_init_dynamic_array(&tables4rebuild, sizeof(char)*(NAME_LEN*2+2),16,
+ 64, MYF(0))))
goto end;
if (opt_alldbs)
diff --git a/client/mysqldump.c b/client/mysqldump.c
index 19ec5e52ca8..1cf66fe3dd1 100644
--- a/client/mysqldump.c
+++ b/client/mysqldump.c
@@ -1,6 +1,6 @@
/*
Copyright (c) 2000, 2012, Oracle and/or its affiliates.
- Copyright (c) 2010, 2012, Monty Program Ab.
+ Copyright (c) 2010, 2013, Monty Program Ab.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -1182,13 +1182,13 @@ check_consistent_binlog_pos(char *binlog_pos_file, char *binlog_pos_offset)
found= 0;
while ((row= mysql_fetch_row(res)))
{
- if (0 == strcmp(row[0], "binlog_snapshot_file"))
+ if (0 == strcmp(row[0], "Binlog_snapshot_file"))
{
if (binlog_pos_file)
strmake(binlog_pos_file, row[1], FN_REFLEN-1);
found++;
}
- else if (0 == strcmp(row[0], "binlog_snapshot_position"))
+ else if (0 == strcmp(row[0], "Binlog_snapshot_position"))
{
if (binlog_pos_offset)
strmake(binlog_pos_offset, row[1], LONGLONG_LEN);
@@ -4587,7 +4587,7 @@ static int dump_selected_tables(char *db, char **table_names, int tables)
if (init_dumping(db, init_dumping_tables))
DBUG_RETURN(1);
- init_alloc_root(&root, 8192, 0);
+ init_alloc_root(&root, 8192, 0, MYF(0));
if (!(dump_tables= pos= (char**) alloc_root(&root, tables * sizeof(char *))))
die(EX_EOM, "alloc_root failure.");
diff --git a/client/mysqltest.cc b/client/mysqltest.cc
index a34edf228da..e2a939dbd73 100644
--- a/client/mysqltest.cc
+++ b/client/mysqltest.cc
@@ -1660,12 +1660,12 @@ int cat_file(DYNAMIC_STRING* ds, const char* filename)
{
int fd;
size_t len;
- char buff[512];
+ char buff[16384];
if ((fd= my_open(filename, O_RDONLY, MYF(0))) < 0)
return 1;
while((len= my_read(fd, (uchar*)&buff,
- sizeof(buff), MYF(0))) > 0)
+ sizeof(buff)-1, MYF(0))) > 0)
{
char *p= buff, *start= buff;
while (p < buff+len)
@@ -1676,7 +1676,8 @@ int cat_file(DYNAMIC_STRING* ds, const char* filename)
/* Add fake newline instead of cr and output the line */
*p= '\n';
p++; /* Step past the "fake" newline */
- dynstr_append_mem(ds, start, p-start);
+ *p= 0;
+ replace_dynstr_append_mem(ds, start, p-start);
p++; /* Step past the "fake" newline */
start= p;
}
@@ -1684,7 +1685,8 @@ int cat_file(DYNAMIC_STRING* ds, const char* filename)
p++;
}
/* Output any chars that migh be left */
- dynstr_append_mem(ds, start, p-start);
+ *p= 0;
+ replace_dynstr_append_mem(ds, start, p-start);
}
my_close(fd, MYF(0));
return 0;
@@ -4397,7 +4399,10 @@ void do_change_user(struct st_command *command)
cur_con->name, ds_user.str, ds_passwd.str, ds_db.str));
if (mysql_change_user(mysql, ds_user.str, ds_passwd.str, ds_db.str))
- die("change user failed: %s", mysql_error(mysql));
+ handle_error(command, mysql_errno(mysql), mysql_error(mysql),
+ mysql_sqlstate(mysql), &ds_res);
+ else
+ handle_no_error(command);
dynstr_free(&ds_user);
dynstr_free(&ds_passwd);
@@ -5174,7 +5179,7 @@ typedef struct
static st_error global_error_names[] =
{
- { "<No error>", -1U, "" },
+ { "<No error>", ~0U, "" },
#include <mysqld_ername.h>
{ 0, 0, 0 }
};
@@ -7288,7 +7293,7 @@ void init_win_path_patterns()
DBUG_ENTER("init_win_path_patterns");
- my_init_dynamic_array(&patterns, sizeof(const char*), 16, 16);
+ my_init_dynamic_array(&patterns, sizeof(const char*), 16, 16, MYF(0));
/* Loop through all paths in the array */
for (i= 0; i < num_paths; i++)
@@ -8901,7 +8906,7 @@ int main(int argc, char **argv)
cur_block->ok= TRUE; /* Outer block should always be executed */
cur_block->cmd= cmd_none;
- my_init_dynamic_array(&q_lines, sizeof(struct st_command*), 1024, 1024);
+ my_init_dynamic_array(&q_lines, sizeof(struct st_command*), 1024, 1024, MYF(0));
if (my_hash_init2(&var_hash, 64, charset_info,
128, 0, 0, get_var_key, var_free, MYF(0)))
@@ -8931,7 +8936,7 @@ int main(int argc, char **argv)
#endif
init_dynamic_string(&ds_res, "", 2048, 2048);
- init_alloc_root(&require_file_root, 1024, 1024);
+ init_alloc_root(&require_file_root, 1024, 1024, MYF(0));
parse_args(argc, argv);
@@ -9877,7 +9882,7 @@ struct st_replace_regex* init_replace_regex(char* expr)
/* my_malloc() will die on fail with MY_FAE */
res=(struct st_replace_regex*)my_malloc(
sizeof(*res)+expr_len ,MYF(MY_FAE+MY_WME));
- my_init_dynamic_array(&res->regex_arr,sizeof(struct st_regex),128,128);
+ my_init_dynamic_array(&res->regex_arr,sizeof(struct st_regex), 128, 128, MYF(0));
buf= (char*)res + sizeof(*res);
expr_end= expr + expr_len;
@@ -10932,7 +10937,7 @@ void dynstr_append_sorted(DYNAMIC_STRING* ds, DYNAMIC_STRING *ds_input,
if (!*start)
DBUG_VOID_RETURN; /* No input */
- my_init_dynamic_array(&lines, sizeof(const char*), 32, 32);
+ my_init_dynamic_array(&lines, sizeof(const char*), 32, 32, MYF(0));
if (keep_header)
{
diff --git a/cmake/build_configurations/mysql_release.cmake b/cmake/build_configurations/mysql_release.cmake
index 5b2596491ad..a8097f03824 100644
--- a/cmake/build_configurations/mysql_release.cmake
+++ b/cmake/build_configurations/mysql_release.cmake
@@ -46,6 +46,8 @@ SET(FEATURE_SET_large 5)
SET(FEATURE_SET_xlarge 6)
SET(FEATURE_SET_community 7)
+#SET(WITH_CASSANDRA_STORAGE_ENGINE ON)
+
IF(FEATURE_SET)
STRING(TOLOWER ${FEATURE_SET} feature_set)
SET(num ${FEATURE_SET_${feature_set}})
diff --git a/cmake/configure.pl b/cmake/configure.pl
index 3a7d187c0be..51e83c2815c 100644
--- a/cmake/configure.pl
+++ b/cmake/configure.pl
@@ -222,6 +222,21 @@ foreach my $option (@ARGV)
$cmakeargs = $cmakeargs." -DENABLE_GCOV=ON";
next;
}
+ if ($option =~ /verbose/)
+ {
+ $cmakeargs = $cmakeargs." -DCMAKE_VERBOSE_MAKEFILE=1";
+ next;
+ }
+ if ($option =~ /with-client-ldflags/)
+ {
+ print("configure.pl : ignoring $option\n");
+ next;
+ }
+ if ($option =~ /with-mysqld-ldflags=/)
+ {
+ print("configure.pl : ignoring $option\n");
+ next;
+ }
$option = uc($option);
$option =~ s/-/_/g;
diff --git a/cmake/cpack_rpm.cmake b/cmake/cpack_rpm.cmake
index f5017d6c984..056366e6ee6 100644
--- a/cmake/cpack_rpm.cmake
+++ b/cmake/cpack_rpm.cmake
@@ -64,10 +64,31 @@ SET(CPACK_RPM_SPEC_MORE_DEFINE "${CPACK_RPM_SPEC_MORE_DEFINE}
SET(CPACK_RPM_PACKAGE_REQUIRES "MariaDB-common")
-SET(CPACK_RPM_server_USER_FILELIST "%ignore /etc" "%ignore /etc/init.d" "%config(noreplace) /etc/my.cnf.d/*")
-SET(CPACK_RPM_common_USER_FILELIST "%config(noreplace) /etc/my.cnf")
-SET(CPACK_RPM_shared_USER_FILELIST "%config(noreplace) /etc/my.cnf.d/*")
-SET(CPACK_RPM_client_USER_FILELIST "%config(noreplace) /etc/my.cnf.d/*")
+SET(ignored
+ "%ignore /etc"
+ "%ignore /etc/init.d"
+ "%ignore /etc/logrotate.d"
+ "%ignore /usr"
+ "%ignore /usr/bin"
+ "%ignore /usr/include"
+ "%ignore /usr/lib"
+ "%ignore /usr/lib64"
+ "%ignore /usr/sbin"
+ "%ignore /usr/share"
+ "%ignore /usr/share/aclocal"
+ "%ignore /usr/share/doc"
+ "%ignore /usr/share/man"
+ "%ignore /usr/share/man/man1*"
+ "%ignore /usr/share/man/man8*"
+ )
+
+SET(CPACK_RPM_server_USER_FILELIST ${ignored} "%config(noreplace) /etc/my.cnf.d/*")
+SET(CPACK_RPM_common_USER_FILELIST ${ignored} "%config(noreplace) /etc/my.cnf")
+SET(CPACK_RPM_shared_USER_FILELIST ${ignored} "%config(noreplace) /etc/my.cnf.d/*")
+SET(CPACK_RPM_client_USER_FILELIST ${ignored} "%config(noreplace) /etc/my.cnf.d/*")
+SET(CPACK_RPM_compat_USER_FILELIST ${ignored})
+SET(CPACK_RPM_devel_USER_FILELIST ${ignored})
+SET(CPACK_RPM_test_USER_FILELIST ${ignored})
SET(CPACK_RPM_client_PACKAGE_OBSOLETES "mysql-client MySQL-client MySQL-OurDelta-client")
SET(CPACK_RPM_client_PACKAGE_PROVIDES "MariaDB-client MySQL-client mysql-client")
@@ -88,8 +109,8 @@ SET(CPACK_RPM_server_PRE_UNINSTALL_SCRIPT_FILE ${CMAKE_SOURCE_DIR}/support-files
SET(CPACK_RPM_server_POST_INSTALL_SCRIPT_FILE ${CMAKE_SOURCE_DIR}/support-files/rpm/server-postin.sh)
SET(CPACK_RPM_server_POST_UNINSTALL_SCRIPT_FILE ${CMAKE_SOURCE_DIR}/support-files/rpm/server-postun.sh)
-SET(CPACK_RPM_shared_PACKAGE_OBSOLETES "mysql-shared MySQL-shared-standard MySQL-shared-pro MySQL-shared-pro-cert MySQL-shared-pro-gpl MySQL-shared-pro-gpl-cert MySQL-shared MySQL-OurDelta-shared")
-SET(CPACK_RPM_shared_PACKAGE_PROVIDES "MariaDB-shared MySQL-shared mysql-shared libmysqlclient.so.18 libmysqlclient.so.18(libmysqlclient_16) libmysqlclient.so.18(libmysqlclient_18) libmysqlclient_r.so.18 libmysqlclient_r.so.18(libmysqlclient_18)")
+SET(CPACK_RPM_shared_PACKAGE_OBSOLETES "mysql-shared MySQL-shared-standard MySQL-shared-pro MySQL-shared-pro-cert MySQL-shared-pro-gpl MySQL-shared-pro-gpl-cert MySQL-shared MySQL-OurDelta-shared mysql-libs")
+SET(CPACK_RPM_shared_PACKAGE_PROVIDES "MariaDB-shared MySQL-shared mysql-shared libmysqlclient.so.18 libmysqlclient.so.18(libmysqlclient_16) libmysqlclient.so.18(libmysqlclient_18) libmysqlclient_r.so.18 libmysqlclient_r.so.18(libmysqlclient_18) mysql-libs")
SET(CPACK_RPM_shared_POST_INSTALL_SCRIPT_FILE ${CMAKE_SOURCE_DIR}/support-files/rpm/shared-post.sh)
SET(CPACK_RPM_shared_POST_UNINSTALL_SCRIPT_FILE ${CMAKE_SOURCE_DIR}/support-files/rpm/shared-post.sh)
@@ -97,7 +118,7 @@ SET(CPACK_RPM_test_PACKAGE_OBSOLETES "mysql-test MySQL-test MySQL-OurDelta-test"
SET(CPACK_RPM_test_PACKAGE_PROVIDES "MariaDB-test MySQL-test mysql-test")
# workaround for lots of perl dependencies added by rpmbuild
-SET(CPACK_RPM_test_PACKAGE_PROVIDES "${CPACK_RPM_test_PACKAGE_PROVIDES} perl(lib::mtr_gcov.pl) perl(lib::mtr_gprof.pl) perl(lib::mtr_io.pl) perl(lib::mtr_misc.pl) perl(lib::mtr_process.pl) perl(lib::v1/mtr_cases.pl) perl(lib::v1/mtr_gcov.pl) perl(lib::v1/mtr_gprof.pl) perl(lib::v1/mtr_im.pl) perl(lib::v1/mtr_io.pl) perl(lib::v1/mtr_match.pl) perl(lib::v1/mtr_misc.pl) perl(lib::v1/mtr_process.pl) perl(lib::v1/mtr_report.pl) perl(lib::v1/mtr_stress.pl) perl(lib::v1/mtr_timer.pl) perl(lib::v1/mtr_unique.pl) perl(mtr_misc.pl)")
+SET(CPACK_RPM_test_PACKAGE_PROVIDES "${CPACK_RPM_test_PACKAGE_PROVIDES} perl(lib::mtr_gcov.pl) perl(lib::mtr_gprof.pl) perl(lib::mtr_io.pl) perl(lib::mtr_misc.pl) perl(lib::mtr_process.pl) perl(lib::v1/mtr_cases.pl) perl(lib::v1/mtr_gcov.pl) perl(lib::v1/mtr_gprof.pl) perl(lib::v1/mtr_im.pl) perl(lib::v1/mtr_io.pl) perl(lib::v1/mtr_match.pl) perl(lib::v1/mtr_misc.pl) perl(lib::v1/mtr_process.pl) perl(lib::v1/mtr_report.pl) perl(lib::v1/mtr_stress.pl) perl(lib::v1/mtr_timer.pl) perl(lib::v1/mtr_unique.pl) perl(mtr_cases) perl(mtr_io.pl) perl(mtr_match) perl(mtr_misc.pl) perl(mtr_report) perl(mtr_results) perl(mtr_unique)")
# If we want to build build MariaDB-shared-compat,
# extract compat libraries from MariaDB-shared-5.3 rpm
diff --git a/cmake/create_initial_db.cmake.in b/cmake/create_initial_db.cmake.in
index e12ef0fa97f..f330c13b09d 100644
--- a/cmake/create_initial_db.cmake.in
+++ b/cmake/create_initial_db.cmake.in
@@ -31,7 +31,7 @@ ENDIF()
# Create bootstrapper SQL script
FILE(WRITE bootstrap.sql "use mysql;\n" )
-FOREACH(FILENAME mysql_system_tables.sql mysql_system_tables_data.sql)
+FOREACH(FILENAME mysql_system_tables.sql mysql_system_tables_data.sql mysql_performance_tables.sql)
FILE(STRINGS ${CMAKE_SOURCE_DIR}/scripts/${FILENAME} CONTENTS)
FOREACH(STR ${CONTENTS})
IF(NOT STR MATCHES "@current_hostname")
@@ -68,10 +68,13 @@ EXECUTE_PROCESS(
COMMAND "@CMAKE_COMMAND@" -E echo Executing ${BOOTSTRAP_COMMAND}
)
EXECUTE_PROCESS (
- COMMAND "@CMAKE_COMMAND@" -E echo input file bootstrap.sql, current directory ${CWD}
+ COMMAND "@CMAKE_COMMAND@" -E
+ echo input file bootstrap.sql, current directory ${CWD}
)
EXECUTE_PROCESS (
- COMMAND ${BOOTSTRAP_COMMAND} INPUT_FILE bootstrap.sql OUTPUT_VARIABLE OUT
+ COMMAND ${BOOTSTRAP_COMMAND}
+ INPUT_FILE bootstrap.sql
+ OUTPUT_VARIABLE OUT
ERROR_VARIABLE ERR
RESULT_VARIABLE RESULT
)
@@ -80,3 +83,6 @@ IF(NOT RESULT EQUAL 0)
MESSAGE(FATAL_ERROR "Could not create initial database \n ${OUT} \n ${ERR}")
ENDIF()
+EXECUTE_PROCESS (
+ COMMAND "@CMAKE_COMMAND@" -E touch ${CMAKE_CURRENT_BINARY_DIR}/initdb.dep
+)
diff --git a/cmake/info_macros.cmake.in b/cmake/info_macros.cmake.in
index 9e08cffb2bf..9f40a419c61 100644
--- a/cmake/info_macros.cmake.in
+++ b/cmake/info_macros.cmake.in
@@ -1,4 +1,4 @@
-# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -82,9 +82,11 @@ MACRO(CREATE_INFO_BIN)
FILE(WRITE ${INFO_BIN} "===== Information about the build process: =====\n")
IF (WIN32)
- EXECUTE_PROCESS(COMMAND cmd /c date /T OUTPUT_VARIABLE TMP_DATE)
+ EXECUTE_PROCESS(COMMAND cmd /c date /T
+ OUTPUT_VARIABLE TMP_DATE OUTPUT_STRIP_TRAILING_WHITESPACE)
ELSEIF(UNIX)
- EXECUTE_PROCESS(COMMAND date "+%Y-%m-%d %H:%M:%S" OUTPUT_VARIABLE TMP_DATE OUTPUT_STRIP_TRAILING_WHITESPACE)
+ EXECUTE_PROCESS(COMMAND date "+%Y-%m-%d %H:%M:%S"
+ OUTPUT_VARIABLE TMP_DATE OUTPUT_STRIP_TRAILING_WHITESPACE)
ELSE()
SET(TMP_DATE "(no date command known for this platform)")
ENDIF()
diff --git a/cmake/install_layout.cmake b/cmake/install_layout.cmake
index 3ad6da5d433..0542b8d2e21 100644
--- a/cmake/install_layout.cmake
+++ b/cmake/install_layout.cmake
@@ -1,4 +1,4 @@
-# Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -100,7 +100,10 @@ ENDIF()
# just use if(INSTALL_PLUGINTESTDIR).
# The plugin must set its own install path for tests
#
-FILE(GLOB plugin_tests ${CMAKE_SOURCE_DIR}/plugin/*/tests)
+FILE(GLOB plugin_tests
+ ${CMAKE_SOURCE_DIR}/plugin/*/tests
+ ${CMAKE_SOURCE_DIR}/internal/plugin/*/tests
+)
#
# STANDALONE layout
diff --git a/cmake/mysql_version.cmake b/cmake/mysql_version.cmake
index ce6ff994eda..9dd2dfed1e6 100644
--- a/cmake/mysql_version.cmake
+++ b/cmake/mysql_version.cmake
@@ -56,7 +56,7 @@ IF(NOT "${MAJOR_VERSION}" MATCHES "[0-9]+" OR
ENDIF()
SET(VERSION "${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}${EXTRA_VERSION}")
- MESSAGE("-- MariaDB ${VERSION}")
+ MESSAGE(STATUS "MariaDB ${VERSION}")
SET(MYSQL_BASE_VERSION "${MAJOR_VERSION}.${MINOR_VERSION}" CACHE INTERNAL "MySQL Base version")
SET(MYSQL_NO_DASH_VERSION "${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}")
# Use NDBVERSION irregardless of whether this is Cluster or not, if not
diff --git a/cmake/package_name.cmake b/cmake/package_name.cmake
index 5c99a110e7c..93e7d968b2a 100644
--- a/cmake/package_name.cmake
+++ b/cmake/package_name.cmake
@@ -130,7 +130,7 @@ IF(NOT VERSION)
SET(package_name "mariadb${PRODUCT_TAG}-${VERSION}-${SYSTEM_NAME_AND_PROCESSOR}")
ENDIF()
- MESSAGE("-- Packaging as: ${package_name}")
+ MESSAGE(STATUS "Packaging as: ${package_name}")
# Sometimes package suffix is added (something like "-icc-glibc23")
IF(PACKAGE_SUFFIX)
diff --git a/cmake/plugin.cmake b/cmake/plugin.cmake
index 524f368c6d7..2978fb1a13c 100644
--- a/cmake/plugin.cmake
+++ b/cmake/plugin.cmake
@@ -39,6 +39,7 @@ MACRO(PLUGIN_APPEND_COLLECTIONS plugin)
GET_FILENAME_COMPONENT(fname ${cfile} NAME)
FILE(APPEND ${CMAKE_SOURCE_DIR}/mysql-test/collections/${fname} "${contents}")
FILE(APPEND ${fcopied} "${fname}\n")
+ MESSAGE(STATUS "Appended ${cfile}")
ENDFOREACH()
ENDIF()
ENDMACRO()
diff --git a/debian/dist/Debian/mariadb-server-10.0.files b/debian/dist/Debian/mariadb-server-10.0.files
index e910d18805b..6cb4d764660 100644
--- a/debian/dist/Debian/mariadb-server-10.0.files
+++ b/debian/dist/Debian/mariadb-server-10.0.files
@@ -61,4 +61,5 @@ usr/share/mysql/errmsg-utf8.txt
usr/share/mysql/fill_help_tables.sql
usr/share/mysql/mysql_system_tables_data.sql
usr/share/mysql/mysql_system_tables.sql
+usr/share/mysql/mysql_performance_tables.sql
usr/share/mysql/mysql_test_data_timezone.sql
diff --git a/debian/dist/Debian/rules b/debian/dist/Debian/rules
index 6ea5f40acf1..6de5c6603dc 100755
--- a/debian/dist/Debian/rules
+++ b/debian/dist/Debian/rules
@@ -84,7 +84,7 @@ build-stamp: configure
@echo "RULES.$@"
dh_testdir
- cd $(builddir) && $(MAKE) $(MAKE_J)
+ cd $(builddir) && $(MAKE) $(MAKE_J) $(AM_EXTRA_MAKEFLAGS)
ifeq ($(findstring nocheck,$(DEB_BUILD_OPTIONS)),)
# Don't know why the following is necessary...
diff --git a/debian/dist/Ubuntu/mariadb-server-10.0.files b/debian/dist/Ubuntu/mariadb-server-10.0.files
index bbee3dfede7..6054ad2d1c5 100644
--- a/debian/dist/Ubuntu/mariadb-server-10.0.files
+++ b/debian/dist/Ubuntu/mariadb-server-10.0.files
@@ -63,4 +63,5 @@ usr/share/mysql/errmsg-utf8.txt
usr/share/mysql/fill_help_tables.sql
usr/share/mysql/mysql_system_tables_data.sql
usr/share/mysql/mysql_system_tables.sql
+usr/share/mysql/mysql_performance_tables.sql
usr/share/mysql/mysql_test_data_timezone.sql
diff --git a/debian/dist/Ubuntu/rules b/debian/dist/Ubuntu/rules
index 22fd5fc2620..739cd91dcd8 100755
--- a/debian/dist/Ubuntu/rules
+++ b/debian/dist/Ubuntu/rules
@@ -84,7 +84,7 @@ build-stamp: configure
@echo "RULES.$@"
dh_testdir
- cd $(builddir) && $(MAKE) $(MAKE_J)
+ cd $(builddir) && $(MAKE) $(MAKE_J) $(AM_EXTRA_MAKEFLAGS)
ifeq ($(findstring nocheck,$(DEB_BUILD_OPTIONS)),)
# Don't know why the following is necessary...
diff --git a/debian/patches/38_scripts__mysqld_safe.sh__signals.dpatch b/debian/patches/38_scripts__mysqld_safe.sh__signals.dpatch
index 4a51eac8a45..81c1baf4375 100755
--- a/debian/patches/38_scripts__mysqld_safe.sh__signals.dpatch
+++ b/debian/patches/38_scripts__mysqld_safe.sh__signals.dpatch
@@ -7,18 +7,17 @@
@DPATCH@
---- old/scripts/mysqld_safe.sh 2006-07-29 13:12:34.000000000 +0200
-+++ old/scripts/mysqld_safe.sh 2006-07-29 13:14:08.000000000 +0200
-@@ -16,8 +16,6 @@
- # This command can be used as pipe to syslog. With "-s" it also logs to stderr.
- ERR_LOGGER="logger -p daemon.err -t mysqld_safe -i"
+--- a/scripts/mysqld_safe.sh 2013-01-11 16:02:41 +0000
++++ b/scripts/mysqld_safe.sh 2013-01-11 16:03:14 +0000
+@@ -30,7 +30,6 @@
+ syslog_tag_mysqld=mysqld
+ syslog_tag_mysqld_safe=mysqld_safe
-trap '' 1 2 3 15 # we shouldn't let anyone kill us
--
- umask 007
- defaults=
-@@ -122,7 +122,7 @@
+ # MySQL-specific environment variable. First off, it's not really a umask,
+ # it's the desired mode. Second, it follows umask(2), not umask(3) in that
+@@ -156,7 +155,7 @@
# sed buffers output (only GNU sed supports a -u (unbuffered) option)
# which means that messages may not get sent to syslog until the
# mysqld process quits.
@@ -27,7 +26,7 @@
;;
*)
echo "Internal program error (non-fatal):" \
-@@ -352,6 +350,13 @@
+@@ -758,6 +757,13 @@
fi
#
@@ -41,3 +40,4 @@
# Uncomment the following lines if you want all tables to be automatically
# checked and repaired during startup. You should add sensible key_buffer
# and sort_buffer values to my.cnf to improve check performance or require
+
diff --git a/extra/comp_err.c b/extra/comp_err.c
index b4f4b2ea337..fb51377ddc5 100644
--- a/extra/comp_err.c
+++ b/extra/comp_err.c
@@ -894,7 +894,7 @@ static struct errors *generate_empty_message(uint d_code)
if (!(new_error= (struct errors *) my_malloc(sizeof(*new_error),
MYF(MY_WME))))
return(0);
- if (my_init_dynamic_array(&new_error->msg, sizeof(struct message), 0, 1))
+ if (my_init_dynamic_array(&new_error->msg, sizeof(struct message), 0, 1, MYF(0)))
return(0); /* OOM: Fatal error */
new_error->er_name= NULL;
@@ -928,7 +928,7 @@ static struct errors *parse_error_string(char *str, int er_count)
MYF(MY_WME))))
DBUG_RETURN(0);
- if (my_init_dynamic_array(&new_error->msg, sizeof(struct message), 0, 0))
+ if (my_init_dynamic_array(&new_error->msg, sizeof(struct message), 0, 0, MYF(0)))
DBUG_RETURN(0); /* OOM: Fatal error */
/* getting the error name */
diff --git a/extra/replace.c b/extra/replace.c
index 8aef9f9a0a0..c2dcc9f50b5 100644
--- a/extra/replace.c
+++ b/extra/replace.c
@@ -265,7 +265,7 @@ static int insert_pointer_name(reg1 POINTER_ARRAY *pa,char * name)
if (!(pa->str= (uchar*) my_malloc((uint) (PS_MALLOC-MALLOC_OVERHEAD),
MYF(MY_WME))))
{
- my_free(pa->typelib.type_names);
+ my_free((char*) pa->typelib.type_names);
DBUG_RETURN (-1);
}
pa->max_count=(PC_MALLOC-MALLOC_OVERHEAD)/(sizeof(uchar*)+
@@ -327,7 +327,7 @@ static void free_pointer_array(reg1 POINTER_ARRAY *pa)
if (pa->typelib.count)
{
pa->typelib.count=0;
- my_free(pa->typelib.type_names);
+ my_free((char*) pa->typelib.type_names);
pa->typelib.type_names=0;
my_free(pa->str);
}
diff --git a/extra/resolve_stack_dump.c b/extra/resolve_stack_dump.c
index dd77e1785d0..576710e0bde 100644
--- a/extra/resolve_stack_dump.c
+++ b/extra/resolve_stack_dump.c
@@ -223,7 +223,7 @@ static void init_sym_table()
{
char buf[512];
if (my_init_dynamic_array(&sym_table, sizeof(SYM_ENTRY), INIT_SYM_TABLE,
- INC_SYM_TABLE))
+ INC_SYM_TABLE, MYF(0)))
die("Failed in my_init_dynamic_array() -- looks like out of memory problem");
while (fgets(buf, sizeof(buf), fp_sym))
diff --git a/include/hash.h b/include/hash.h
index 98bcf911db2..2ecfe0891d7 100644
--- a/include/hash.h
+++ b/include/hash.h
@@ -39,6 +39,7 @@ extern "C" {
/* flags for hash_init */
#define HASH_UNIQUE 1 /* hash_insert fails on duplicate key */
+#define HASH_THREAD_SPECIFIC 2 /* Mark allocated memory THREAD_SPECIFIC */
typedef uint my_hash_value_type;
typedef uchar *(*my_hash_get_key)(const uchar *,size_t*,my_bool);
diff --git a/include/heap.h b/include/heap.h
index 10b165d89c6..149f9ed5f56 100644
--- a/include/heap.h
+++ b/include/heap.h
@@ -153,6 +153,7 @@ typedef struct st_heap_share
THR_LOCK lock;
mysql_mutex_t intern_lock; /* Locking for use with _locking */
my_bool delete_on_close;
+ my_bool internal; /* Internal temporary table */
LIST open_list;
uint auto_key;
uint auto_key_type; /* real type of the auto key segment */
diff --git a/include/ma_dyncol.h b/include/ma_dyncol.h
index 6174328d62a..ed5eb1e6bae 100644
--- a/include/ma_dyncol.h
+++ b/include/ma_dyncol.h
@@ -34,10 +34,10 @@
#include <mysql_time.h>
/*
- Max length for data in a dynamic colums. This comes from how the
- how the offset are stored.
+ Limits of implementation
*/
-#define MAX_DYNAMIC_COLUMN_LENGTH 0X1FFFFFFFL
+#define MAX_TOTAL_NAME_LENGTH 65535
+#define MAX_NAME_LENGTH (MAX_TOTAL_NAME_LENGTH/4)
/* NO and OK is the same used just to show semantics */
#define ER_DYNCOL_NO ER_DYNCOL_OK
@@ -50,7 +50,8 @@ enum enum_dyncol_func_result
ER_DYNCOL_LIMIT= -2, /* Some limit reached */
ER_DYNCOL_RESOURCE= -3, /* Out of resourses */
ER_DYNCOL_DATA= -4, /* Incorrect input data */
- ER_DYNCOL_UNKNOWN_CHARSET= -5 /* Unknown character set */
+ ER_DYNCOL_UNKNOWN_CHARSET= -5, /* Unknown character set */
+ ER_DYNCOL_TRUNCATED= 2 /* OK, but data was truncated */
};
typedef DYNAMIC_STRING DYNAMIC_COLUMN;
@@ -65,7 +66,8 @@ enum enum_dynamic_column_type
DYN_COL_DECIMAL,
DYN_COL_DATETIME,
DYN_COL_DATE,
- DYN_COL_TIME
+ DYN_COL_TIME,
+ DYN_COL_DYNCOL
};
typedef enum enum_dynamic_column_type DYNAMIC_COLUMN_TYPE;
@@ -79,7 +81,7 @@ struct st_dynamic_column_value
unsigned long long ulong_value;
double double_value;
struct {
- LEX_STRING value;
+ MYSQL_LEX_STRING value;
CHARSET_INFO *charset;
} string;
struct {
@@ -92,6 +94,7 @@ struct st_dynamic_column_value
typedef struct st_dynamic_column_value DYNAMIC_COLUMN_VALUE;
+#ifdef MADYNCOL_DEPRECATED
enum enum_dyncol_func_result
dynamic_column_create(DYNAMIC_COLUMN *str,
uint column_nr, DYNAMIC_COLUMN_VALUE *value);
@@ -101,7 +104,6 @@ dynamic_column_create_many(DYNAMIC_COLUMN *str,
uint column_count,
uint *column_numbers,
DYNAMIC_COLUMN_VALUE *values);
-
enum enum_dyncol_func_result
dynamic_column_update(DYNAMIC_COLUMN *org, uint column_nr,
DYNAMIC_COLUMN_VALUE *value);
@@ -112,36 +114,102 @@ dynamic_column_update_many(DYNAMIC_COLUMN *str,
DYNAMIC_COLUMN_VALUE *values);
enum enum_dyncol_func_result
-dynamic_column_delete(DYNAMIC_COLUMN *org, uint column_nr);
+dynamic_column_exists(DYNAMIC_COLUMN *org, uint column_nr);
enum enum_dyncol_func_result
-dynamic_column_exists(DYNAMIC_COLUMN *org, uint column_nr);
+dynamic_column_list(DYNAMIC_COLUMN *org, DYNAMIC_ARRAY *array_of_uint);
+
+enum enum_dyncol_func_result
+dynamic_column_get(DYNAMIC_COLUMN *org, uint column_nr,
+ DYNAMIC_COLUMN_VALUE *store_it_here);
+#endif
+
+/* new functions */
+enum enum_dyncol_func_result
+mariadb_dyncol_create_many(DYNAMIC_COLUMN *str,
+ uint column_count,
+ uint *column_numbers,
+ DYNAMIC_COLUMN_VALUE *values,
+ my_bool new_string);
+enum enum_dyncol_func_result
+mariadb_dyncol_create_many_named(DYNAMIC_COLUMN *str,
+ uint column_count,
+ MYSQL_LEX_STRING *column_keys,
+ DYNAMIC_COLUMN_VALUE *values,
+ my_bool new_string);
+
+
+enum enum_dyncol_func_result
+mariadb_dyncol_update_many(DYNAMIC_COLUMN *str,
+ uint add_column_count,
+ uint *column_keys,
+ DYNAMIC_COLUMN_VALUE *values);
+enum enum_dyncol_func_result
+mariadb_dyncol_update_many_named(DYNAMIC_COLUMN *str,
+ uint add_column_count,
+ MYSQL_LEX_STRING *column_keys,
+ DYNAMIC_COLUMN_VALUE *values);
+
+
+enum enum_dyncol_func_result
+mariadb_dyncol_exists(DYNAMIC_COLUMN *org, uint column_nr);
+enum enum_dyncol_func_result
+mariadb_dyncol_exists_named(DYNAMIC_COLUMN *str, MYSQL_LEX_STRING *name);
/* List of not NULL columns */
enum enum_dyncol_func_result
-dynamic_column_list(DYNAMIC_COLUMN *org, DYNAMIC_ARRAY *array_of_uint);
+mariadb_dyncol_list(DYNAMIC_COLUMN *str, uint *count, uint **nums);
+enum enum_dyncol_func_result
+mariadb_dyncol_list_named(DYNAMIC_COLUMN *str, uint *count,
+ MYSQL_LEX_STRING **names);
/*
if the column do not exists it is NULL
*/
enum enum_dyncol_func_result
-dynamic_column_get(DYNAMIC_COLUMN *org, uint column_nr,
+mariadb_dyncol_get(DYNAMIC_COLUMN *org, uint column_nr,
DYNAMIC_COLUMN_VALUE *store_it_here);
+enum enum_dyncol_func_result
+mariadb_dyncol_get_named(DYNAMIC_COLUMN *str, MYSQL_LEX_STRING *name,
+ DYNAMIC_COLUMN_VALUE *store_it_here);
+
+my_bool mariadb_dyncol_has_names(DYNAMIC_COLUMN *str);
+
+enum enum_dyncol_func_result
+mariadb_dyncol_check(DYNAMIC_COLUMN *str);
+
+enum enum_dyncol_func_result
+mariadb_dyncol_json(DYNAMIC_COLUMN *str, DYNAMIC_STRING *json);
#define dynamic_column_initialize(A) memset((A), 0, sizeof(*(A)))
#define dynamic_column_column_free(V) dynstr_free(V)
-/***************************************************************************
- Internal functions, don't use if you don't know what you are doing...
-***************************************************************************/
+/* conversion of values to 3 base types */
+enum enum_dyncol_func_result
+mariadb_dyncol_val_str(DYNAMIC_STRING *str, DYNAMIC_COLUMN_VALUE *val,
+ CHARSET_INFO *cs, my_bool quote);
+enum enum_dyncol_func_result
+mariadb_dyncol_val_long(longlong *ll, DYNAMIC_COLUMN_VALUE *val);
+enum enum_dyncol_func_result
+mariadb_dyncol_val_double(double *dbl, DYNAMIC_COLUMN_VALUE *val);
+
+
+enum enum_dyncol_func_result
+mariadb_dyncol_unpack(DYNAMIC_COLUMN *str,
+ uint *count,
+ MYSQL_LEX_STRING **names, DYNAMIC_COLUMN_VALUE **vals);
-#define dynamic_column_reassociate(V,P,L, A) dynstr_reassociate((V),(P),(L),(A))
+int mariadb_dyncol_column_cmp_named(const MYSQL_LEX_STRING *s1,
+ const MYSQL_LEX_STRING *s2);
+
+enum enum_dyncol_func_result
+mariadb_dyncol_column_count(DYNAMIC_COLUMN *str, uint *column_count);
-#define dynamic_column_value_init(V) (V)->type= DYN_COL_NULL
+#define mariadb_dyncol_value_init(V) (V)->type= DYN_COL_NULL
/*
Prepare value for using as decimal
*/
-void dynamic_column_prepare_decimal(DYNAMIC_COLUMN_VALUE *value);
+void mariadb_dyncol_prepare_decimal(DYNAMIC_COLUMN_VALUE *value);
#endif
diff --git a/include/my_dir.h b/include/my_dir.h
index 1ee002cc380..6a941b37d79 100644
--- a/include/my_dir.h
+++ b/include/my_dir.h
@@ -45,8 +45,9 @@ extern "C" {
#define MY_S_ISREG(m) (((m) & MY_S_IFMT) == MY_S_IFREG)
#define MY_S_ISFIFO(m) (((m) & MY_S_IFMT) == MY_S_IFIFO)
-#define MY_DONT_SORT 512 /* my_lib; Don't sort files */
-#define MY_WANT_STAT 1024 /* my_lib; stat files */
+/* Ensure these dosn't clash with anything in my_sys.h */
+#define MY_DONT_SORT 8192 /* my_lib; Don't sort files */
+#define MY_WANT_STAT 16384 /* my_lib; stat files */
/* typedefs for my_dir & my_stat */
diff --git a/include/my_global.h b/include/my_global.h
index ed9ac83cfe6..7c133268f59 100644
--- a/include/my_global.h
+++ b/include/my_global.h
@@ -994,7 +994,7 @@ typedef struct st_mysql_lex_string LEX_STRING;
#define SOCKET_EMFILE EMFILE
#endif
-typedef int myf; /* Type of MyFlags in my_funcs */
+typedef ulong myf; /* Type of MyFlags in my_funcs */
typedef char my_bool; /* Small bool */
/* Macros for converting *constants* to the right type */
diff --git a/include/my_pthread.h b/include/my_pthread.h
index 5872f7c5904..8c16a112eac 100644
--- a/include/my_pthread.h
+++ b/include/my_pthread.h
@@ -350,9 +350,9 @@ int my_pthread_mutex_trylock(pthread_mutex_t *mutex);
#ifndef set_timespec_time_nsec
#define set_timespec_time_nsec(ABSTIME,NSEC) do { \
- ulonglong now= (NSEC); \
- (ABSTIME).MY_tv_sec= (now / 1000000000ULL); \
- (ABSTIME).MY_tv_nsec= (now % 1000000000ULL); \
+ ulonglong _now_= (NSEC); \
+ (ABSTIME).MY_tv_sec= (_now_ / 1000000000ULL); \
+ (ABSTIME).MY_tv_nsec= (_now_ % 1000000000ULL); \
} while(0)
#endif /* !set_timespec_time_nsec */
diff --git a/include/my_sys.h b/include/my_sys.h
index 30513d17e0a..48459c3fb83 100644
--- a/include/my_sys.h
+++ b/include/my_sys.h
@@ -86,6 +86,10 @@ typedef struct my_aio_result {
#define MY_SYNC 4096 /* my_copy(): sync dst file */
#define MY_SYNC_DIR 32768 /* my_create/delete/rename: sync directory */
#define MY_SYNC_FILESIZE 65536 /* my_sync(): safe sync when file is extended */
+#define MY_THREAD_SPECIFIC 0x10000 /* my_malloc(): thread specific */
+#define MY_THREAD_MOVE 0x20000 /* realloc(); Memory can move */
+/* Tree that should delete things automaticly */
+#define MY_TREE_WITH_DELETE 0x40000
#define MY_CHECK_ERROR 1 /* Params to my_end; Check open-close */
#define MY_GIVE_INFO 2 /* Give time info about process*/
@@ -148,6 +152,18 @@ typedef struct my_aio_result {
/* Extra length needed for filename if one calls my_create_backup_name */
#define MY_BACKUP_NAME_EXTRA_LENGTH 17
+/* If we have our own safemalloc (for debugging) */
+#if defined(SAFEMALLOC)
+void sf_report_leaked_memory(my_thread_id id);
+extern my_thread_id (*sf_malloc_dbug_id)(void);
+#define SAFEMALLOC_REPORT_MEMORY(X) sf_report_leaked_memory(X)
+#else
+#define SAFEMALLOC_REPORT_MEMORY(X) do {} while(0)
+#endif
+
+typedef void (*MALLOC_SIZE_CB) (long long size, my_bool is_thread_specific);
+extern void set_malloc_size_cb(MALLOC_SIZE_CB func);
+
/* defines when allocating data */
extern void *my_malloc(size_t Size,myf MyFlags);
extern void *my_multi_malloc(myf MyFlags, ...);
@@ -183,7 +199,7 @@ extern void my_large_free(uchar *ptr);
#define my_alloca(SZ) alloca((size_t) (SZ))
#define my_afree(PTR) ((void)0)
#else
-#define my_alloca(SZ) my_malloc(SZ,MYF(MY_FAE))
+#define my_alloca(SZ) my_malloc(SZ,MYF(MY_FAE|MY_THREAD_SPECIFIC))
#define my_afree(PTR) my_free(PTR)
#endif /* HAVE_ALLOCA */
@@ -323,6 +339,7 @@ typedef struct st_dynamic_array
uint elements,max_element;
uint alloc_increment;
uint size_of_element;
+ myf malloc_flags;
} DYNAMIC_ARRAY;
typedef struct st_my_tmpdir
@@ -773,16 +790,10 @@ extern my_bool real_open_cached_file(IO_CACHE *cache);
extern void close_cached_file(IO_CACHE *cache);
File create_temp_file(char *to, const char *dir, const char *pfx,
int mode, myf MyFlags);
-#define my_init_dynamic_array(A,B,C,D) init_dynamic_array2(A,B,NULL,C,D)
-#define my_init_dynamic_array_ci(A,B,C,D) init_dynamic_array2(A,B,NULL,C,D)
-#define my_init_dynamic_array2(A,B,C,D,E) init_dynamic_array2(A,B,C,D,E)
-#define my_init_dynamic_array2_ci(A,B,C,D,E) init_dynamic_array2(A,B,C,D,E)
-extern my_bool init_dynamic_array2(DYNAMIC_ARRAY *array, uint element_size,
+#define my_init_dynamic_array(A,B,C,D,E) my_init_dynamic_array2(A,B,NULL,C,D,E)
+extern my_bool my_init_dynamic_array2(DYNAMIC_ARRAY *array, uint element_size,
void *init_buffer, uint init_alloc,
- uint alloc_increment);
-/* init_dynamic_array() function is deprecated */
-extern my_bool init_dynamic_array(DYNAMIC_ARRAY *array, uint element_size,
- uint init_alloc, uint alloc_increment);
+ uint alloc_increment, myf my_flags);
extern my_bool insert_dynamic(DYNAMIC_ARRAY *array, const void* element);
extern void *alloc_dynamic(DYNAMIC_ARRAY *array);
extern void *pop_dynamic(DYNAMIC_ARRAY*);
@@ -807,12 +818,23 @@ my_bool dynstr_append_mem(DYNAMIC_STRING *str, const char *append,
size_t length);
extern my_bool dynstr_append_os_quoted(DYNAMIC_STRING *str, const char *append,
...);
+extern my_bool dynstr_append_quoted(DYNAMIC_STRING *str,
+ const char *append, size_t len,
+ char quote);
extern my_bool dynstr_set(DYNAMIC_STRING *str, const char *init_str);
extern my_bool dynstr_realloc(DYNAMIC_STRING *str, size_t additional_size);
extern my_bool dynstr_trunc(DYNAMIC_STRING *str, size_t n);
extern void dynstr_free(DYNAMIC_STRING *str);
+extern uint32 copy_and_convert_extended(char *to, uint32 to_length,
+ CHARSET_INFO *to_cs,
+ const char *from, uint32 from_length,
+ CHARSET_INFO *from_cs, uint *errors);
extern void dynstr_reassociate(DYNAMIC_STRING *str, char **res, size_t *length,
size_t *alloc_length);
+extern uint32 copy_and_convert_extended(char *to, uint32 to_length,
+ CHARSET_INFO *to_cs,
+ const char *from, uint32 from_length,
+ CHARSET_INFO *from_cs, uint *errors);
#ifdef HAVE_MLOCK
extern void *my_malloc_lock(size_t length,myf flags);
extern void my_free_lock(void *ptr);
@@ -824,7 +846,7 @@ extern void my_free_lock(void *ptr);
#define ALLOC_ROOT_MIN_BLOCK_SIZE (MALLOC_OVERHEAD + sizeof(USED_MEM) + 8)
#define clear_alloc_root(A) do { (A)->free= (A)->used= (A)->pre_alloc= 0; (A)->min_malloc=0;} while(0)
extern void init_alloc_root(MEM_ROOT *mem_root, size_t block_size,
- size_t pre_alloc_size);
+ size_t pre_alloc_size, myf my_flags);
extern void *alloc_root(MEM_ROOT *mem_root, size_t Size);
extern void *multi_alloc_root(MEM_ROOT *mem_root, ...);
extern void free_root(MEM_ROOT *root, myf MyFLAGS);
diff --git a/include/my_tree.h b/include/my_tree.h
index 3dd92712af2..f8be55f84b2 100644
--- a/include/my_tree.h
+++ b/include/my_tree.h
@@ -68,13 +68,15 @@ typedef struct st_tree {
MEM_ROOT mem_root;
my_bool with_delete;
tree_element_free free;
+ myf my_flags;
uint flag;
} TREE;
/* Functions on whole tree */
void init_tree(TREE *tree, size_t default_alloc_size, size_t memory_limit,
- int size, qsort_cmp2 compare, my_bool with_delete,
- tree_element_free free_element, void *custom_arg);
+ int size, qsort_cmp2 compare,
+ tree_element_free free_element, void *custom_arg,
+ myf my_flags);
void delete_tree(TREE*);
void reset_tree(TREE*);
diff --git a/include/myisamchk.h b/include/myisamchk.h
index 789e95572b3..7e7b685a88a 100644
--- a/include/myisamchk.h
+++ b/include/myisamchk.h
@@ -164,6 +164,7 @@ typedef struct st_handler_check_param
mysql_mutex_t print_msg_mutex;
my_bool need_print_msg_lock;
+ myf malloc_flags;
} HA_CHECK;
diff --git a/include/mysql.h.pp b/include/mysql.h.pp
index 361f1a323ae..f2bb110a3e7 100644
--- a/include/mysql.h.pp
+++ b/include/mysql.h.pp
@@ -28,7 +28,7 @@ typedef struct st_net {
unsigned char reading_or_writing;
char save_char;
char net_skip_rest_factor;
- my_bool unused1;
+ my_bool thread_specific_malloc;
my_bool compress;
my_bool unused3;
unsigned char *unused;
@@ -80,7 +80,7 @@ enum enum_mysql_set_option
MYSQL_OPTION_MULTI_STATEMENTS_ON,
MYSQL_OPTION_MULTI_STATEMENTS_OFF
};
-my_bool my_net_init(NET *net, Vio* vio);
+my_bool my_net_init(NET *net, Vio* vio, unsigned int my_flags);
void my_net_local_init(NET *net);
void net_end(NET *net);
void net_clear(NET *net, my_bool clear_buffer);
diff --git a/include/mysql/plugin.h b/include/mysql/plugin.h
index b8e90f764bd..38573180232 100644
--- a/include/mysql/plugin.h
+++ b/include/mysql/plugin.h
@@ -72,7 +72,7 @@ typedef struct st_mysql_xid MYSQL_XID;
#define MYSQL_PLUGIN_INTERFACE_VERSION 0x0103
/* MariaDB plugin interface version */
-#define MARIA_PLUGIN_INTERFACE_VERSION 0x0103
+#define MARIA_PLUGIN_INTERFACE_VERSION 0x0104
/*
The allowable types of plugins
@@ -626,23 +626,6 @@ void thd_inc_row_count(MYSQL_THD thd);
int mysql_tmpfile(const char *prefix);
/**
- Check the killed state of a connection
-
- @details
- In MySQL support for the KILL statement is cooperative. The KILL
- statement only sets a "killed" flag. This function returns the value
- of that flag. A thread should check it often, especially inside
- time-consuming loops, and gracefully abort the operation if it is
- non-zero.
-
- @param thd user thread connection handle
- @retval 0 the connection is active
- @retval 1 the connection has been killed
-*/
-int thd_killed(const MYSQL_THD thd);
-
-
-/**
Return the thread id of a user thread
@param thd user thread connection handle
diff --git a/include/mysql/plugin_audit.h.pp b/include/mysql/plugin_audit.h.pp
index dea2446ac9c..fbd4ec2dd3f 100644
--- a/include/mysql/plugin_audit.h.pp
+++ b/include/mysql/plugin_audit.h.pp
@@ -82,6 +82,16 @@ const char *set_thd_proc_info(void*, const char * info, const char *func,
const char *file, unsigned int line);
#include <mysql/service_debug_sync.h>
extern void (*debug_sync_C_callback_ptr)(void*, const char *, size_t);
+#include <mysql/service_kill_statement.h>
+enum thd_kill_levels {
+ THD_IS_NOT_KILLED=0,
+ THD_ABORT_SOFTLY=50,
+ THD_ABORT_ASAP=100,
+};
+extern struct kill_statement_service_st {
+ enum thd_kill_levels (*thd_kill_level_func)(const void*);
+} *thd_kill_statement_service;
+enum thd_kill_levels thd_kill_level(const void*);
struct st_mysql_xid {
long formatID;
long gtrid_length;
@@ -226,7 +236,6 @@ char *thd_security_context(void* thd, char *buffer, unsigned int length,
unsigned int max_query_len);
void thd_inc_row_count(void* thd);
int mysql_tmpfile(const char *prefix);
-int thd_killed(const void* thd);
unsigned long thd_get_thread_id(const void* thd);
void thd_get_xid(const void* thd, MYSQL_XID *xid);
void mysql_query_cache_invalidate4(void* thd,
diff --git a/include/mysql/plugin_auth.h.pp b/include/mysql/plugin_auth.h.pp
index f1213a73bc6..46811825142 100644
--- a/include/mysql/plugin_auth.h.pp
+++ b/include/mysql/plugin_auth.h.pp
@@ -82,6 +82,16 @@ const char *set_thd_proc_info(void*, const char * info, const char *func,
const char *file, unsigned int line);
#include <mysql/service_debug_sync.h>
extern void (*debug_sync_C_callback_ptr)(void*, const char *, size_t);
+#include <mysql/service_kill_statement.h>
+enum thd_kill_levels {
+ THD_IS_NOT_KILLED=0,
+ THD_ABORT_SOFTLY=50,
+ THD_ABORT_ASAP=100,
+};
+extern struct kill_statement_service_st {
+ enum thd_kill_levels (*thd_kill_level_func)(const void*);
+} *thd_kill_statement_service;
+enum thd_kill_levels thd_kill_level(const void*);
struct st_mysql_xid {
long formatID;
long gtrid_length;
@@ -226,7 +236,6 @@ char *thd_security_context(void* thd, char *buffer, unsigned int length,
unsigned int max_query_len);
void thd_inc_row_count(void* thd);
int mysql_tmpfile(const char *prefix);
-int thd_killed(const void* thd);
unsigned long thd_get_thread_id(const void* thd);
void thd_get_xid(const void* thd, MYSQL_XID *xid);
void mysql_query_cache_invalidate4(void* thd,
diff --git a/include/mysql/plugin_ftparser.h.pp b/include/mysql/plugin_ftparser.h.pp
index 74b298098dd..49cf7e5b931 100644
--- a/include/mysql/plugin_ftparser.h.pp
+++ b/include/mysql/plugin_ftparser.h.pp
@@ -82,6 +82,16 @@ const char *set_thd_proc_info(void*, const char * info, const char *func,
const char *file, unsigned int line);
#include <mysql/service_debug_sync.h>
extern void (*debug_sync_C_callback_ptr)(void*, const char *, size_t);
+#include <mysql/service_kill_statement.h>
+enum thd_kill_levels {
+ THD_IS_NOT_KILLED=0,
+ THD_ABORT_SOFTLY=50,
+ THD_ABORT_ASAP=100,
+};
+extern struct kill_statement_service_st {
+ enum thd_kill_levels (*thd_kill_level_func)(const void*);
+} *thd_kill_statement_service;
+enum thd_kill_levels thd_kill_level(const void*);
struct st_mysql_xid {
long formatID;
long gtrid_length;
@@ -179,7 +189,6 @@ char *thd_security_context(void* thd, char *buffer, unsigned int length,
unsigned int max_query_len);
void thd_inc_row_count(void* thd);
int mysql_tmpfile(const char *prefix);
-int thd_killed(const void* thd);
unsigned long thd_get_thread_id(const void* thd);
void thd_get_xid(const void* thd, MYSQL_XID *xid);
void mysql_query_cache_invalidate4(void* thd,
diff --git a/include/mysql/service_kill_statement.h b/include/mysql/service_kill_statement.h
new file mode 100644
index 00000000000..995b21f0a9f
--- /dev/null
+++ b/include/mysql/service_kill_statement.h
@@ -0,0 +1,71 @@
+/* Copyright (c) 2013, Monty Program Ab.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
+
+#ifndef MYSQL_SERVICE_KILL_STATEMENT_INCLUDED
+#define MYSQL_SERVICE_KILL_STATEMENT_INCLUDED
+
+/**
+ @file
+ This service provides functions that allow plugins to support
+ the KILL statement.
+
+ In MySQL support for the KILL statement is cooperative. The KILL
+ statement only sets a "killed" flag. This function returns the value
+ of that flag. A thread should check it often, especially inside
+ time-consuming loops, and gracefully abort the operation if it is
+ non-zero.
+
+ thd_is_killed(thd)
+ @return 0 - no KILL statement was issued, continue normally
+ @return 1 - there was a KILL statement, abort the execution.
+
+ thd_kill_level(thd)
+ @return thd_kill_levels_enum values
+*/
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+enum thd_kill_levels {
+ THD_IS_NOT_KILLED=0,
+ THD_ABORT_SOFTLY=50, /**< abort when possible, don't leave tables corrupted */
+ THD_ABORT_ASAP=100, /**< abort asap */
+};
+
+extern struct kill_statement_service_st {
+ enum thd_kill_levels (*thd_kill_level_func)(const MYSQL_THD);
+} *thd_kill_statement_service;
+
+/* backward compatibility helper */
+#define thd_killed(THD) (thd_kill_level(THD) == THD_ABORT_ASAP)
+
+#ifdef MYSQL_DYNAMIC_PLUGIN
+
+#define thd_kill_level(THD) \
+ thd_kill_statement_service->thd_kill_level_func(THD)
+
+#else
+
+enum thd_kill_levels thd_kill_level(const MYSQL_THD);
+
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
diff --git a/include/mysql/services.h b/include/mysql/services.h
index 8eb506e1c37..b5b331d4923 100644
--- a/include/mysql/services.h
+++ b/include/mysql/services.h
@@ -24,6 +24,7 @@ extern "C" {
#include <mysql/service_thread_scheduler.h>
#include <mysql/service_progress_report.h>
#include <mysql/service_debug_sync.h>
+#include <mysql/service_kill_statement.h>
#ifdef __cplusplus
}
diff --git a/include/mysql_com.h b/include/mysql_com.h
index b5b4dc585b8..63b95bb5295 100644
--- a/include/mysql_com.h
+++ b/include/mysql_com.h
@@ -1,5 +1,5 @@
/* Copyright (c) 2000, 2011, Oracle and/or its affiliates.
- Copyright (c) 2010, 2011, Monty Program Ab
+ Copyright (c) 2010, 2013, Monty Program Ab
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -128,39 +128,39 @@ enum enum_server_command
#define HAS_EXPLICIT_VALUE (1 << 26) /* An INSERT/UPDATE operation supplied
an explicit default value */
-#define REFRESH_GRANT 1 /* Refresh grant tables */
-#define REFRESH_LOG 2 /* Start on new log file */
-#define REFRESH_TABLES 4 /* close all tables */
-#define REFRESH_HOSTS 8 /* Flush host cache */
-#define REFRESH_STATUS 16 /* Flush status variables */
-#define REFRESH_THREADS 32 /* Flush thread cache */
-#define REFRESH_SLAVE 64 /* Reset master info and restart slave
- thread */
-#define REFRESH_MASTER 128 /* Remove all bin logs in the index
- and truncate the index */
+#define REFRESH_GRANT (1UL << 0) /* Refresh grant tables */
+#define REFRESH_LOG (1UL << 1) /* Start on new log file */
+#define REFRESH_TABLES (1UL << 2) /* close all tables */
+#define REFRESH_HOSTS (1UL << 3) /* Flush host cache */
+#define REFRESH_STATUS (1UL << 4) /* Flush status variables */
+#define REFRESH_THREADS (1UL << 5) /* Flush thread cache */
+#define REFRESH_SLAVE (1UL << 6) /* Reset master info and restart slave
+ thread */
+#define REFRESH_MASTER (1UL << 7) /* Remove all bin logs in the index
+ and truncate the index */
/* The following can't be set with mysql_refresh() */
-#define REFRESH_ERROR_LOG 256 /* Rotate only the erorr log */
-#define REFRESH_ENGINE_LOG 512 /* Flush all storage engine logs */
-#define REFRESH_BINARY_LOG 1024 /* Flush the binary log */
-#define REFRESH_RELAY_LOG 2048 /* Flush the relay log */
-#define REFRESH_GENERAL_LOG 4096 /* Flush the general log */
-#define REFRESH_SLOW_LOG 8192 /* Flush the slow query log */
-
-#define REFRESH_READ_LOCK 16384 /* Lock tables for read */
-#define REFRESH_FAST 32768 /* Intern flag */
-
-/* RESET (remove all queries) from query cache */
-#define REFRESH_QUERY_CACHE 65536
-#define REFRESH_QUERY_CACHE_FREE 0x20000L /* pack query cache */
-#define REFRESH_DES_KEY_FILE 0x40000L
-#define REFRESH_USER_RESOURCES 0x80000L
-#define REFRESH_CHECKPOINT 0x100000L /* Don't do checkpoints */
-
-#define REFRESH_TABLE_STATS (1L << 20) /* Refresh table stats hash table */
-#define REFRESH_INDEX_STATS (1L << 21) /* Refresh index stats hash table */
-#define REFRESH_USER_STATS (1L << 22) /* Refresh user stats hash table */
-#define REFRESH_CLIENT_STATS (1L << 23) /* Refresh client stats hash table */
+#define REFRESH_ERROR_LOG (1UL << 8) /* Rotate only the erorr log */
+#define REFRESH_ENGINE_LOG (1UL << 9) /* Flush all storage engine logs */
+#define REFRESH_BINARY_LOG (1UL << 10) /* Flush the binary log */
+#define REFRESH_RELAY_LOG (1UL << 11) /* Flush the relay log */
+#define REFRESH_GENERAL_LOG (1UL << 12) /* Flush the general log */
+#define REFRESH_SLOW_LOG (1UL << 13) /* Flush the slow query log */
+
+#define REFRESH_READ_LOCK (1UL << 14) /* Lock tables for read */
+#define REFRESH_CHECKPOINT (1UL << 15) /* With REFRESH_READ_LOCK: block checkpoints too */
+
+#define REFRESH_QUERY_CACHE (1UL << 16) /* clear the query cache */
+#define REFRESH_QUERY_CACHE_FREE (1UL << 17) /* pack query cache */
+#define REFRESH_DES_KEY_FILE (1UL << 18)
+#define REFRESH_USER_RESOURCES (1UL << 19)
+
+#define REFRESH_TABLE_STATS (1UL << 20) /* Refresh table stats hash table */
+#define REFRESH_INDEX_STATS (1UL << 21) /* Refresh index stats hash table */
+#define REFRESH_USER_STATS (1UL << 22) /* Refresh user stats hash table */
+#define REFRESH_CLIENT_STATS (1UL << 23) /* Refresh client stats hash table */
+
+#define REFRESH_FAST (1UL << 31) /* Intern flag */
#define CLIENT_LONG_PASSWORD 1 /* new more secure passwords */
#define CLIENT_FOUND_ROWS 2 /* Found instead of affected rows */
@@ -340,7 +340,7 @@ typedef struct st_net {
unsigned char reading_or_writing;
char save_char;
char net_skip_rest_factor;
- my_bool unused1; /* Please remove with the next incompatible ABI change */
+ my_bool thread_specific_malloc;
my_bool compress;
my_bool unused3; /* Please remove with the next incompatible ABI change. */
/*
@@ -475,10 +475,10 @@ enum enum_mysql_set_option
extern "C" {
#endif
-my_bool my_net_init(NET *net, Vio* vio);
+my_bool my_net_init(NET *net, Vio* vio, unsigned int my_flags);
void my_net_local_init(NET *net);
void net_end(NET *net);
- void net_clear(NET *net, my_bool clear_buffer);
+void net_clear(NET *net, my_bool clear_buffer);
my_bool net_realloc(NET *net, size_t length);
my_bool net_flush(NET *net);
my_bool my_net_write(NET *net,const unsigned char *packet, size_t len);
diff --git a/include/service_versions.h b/include/service_versions.h
index 436941643ec..9b41da7440e 100644
--- a/include/service_versions.h
+++ b/include/service_versions.h
@@ -19,9 +19,11 @@
#define SERVICE_VERSION void *
#endif
-#define VERSION_my_snprintf 0x0100
-#define VERSION_thd_alloc 0x0100
-#define VERSION_thd_wait 0x0100
-#define VERSION_my_thread_scheduler 0x0100
-#define VERSION_progress_report 0x0100
-#define VERSION_debug_sync 0x1000
+#define VERSION_my_snprintf 0x0100
+#define VERSION_thd_alloc 0x0100
+#define VERSION_thd_wait 0x0100
+#define VERSION_my_thread_scheduler 0x0100
+#define VERSION_progress_report 0x0100
+#define VERSION_debug_sync 0x1000
+#define VERSION_kill_statement 0x1000
+
diff --git a/libmysql/CMakeLists.txt b/libmysql/CMakeLists.txt
index f67b3962c1a..29c8298a825 100644
--- a/libmysql/CMakeLists.txt
+++ b/libmysql/CMakeLists.txt
@@ -23,7 +23,7 @@ INCLUDE_DIRECTORIES(
${ZLIB_INCLUDE_DIR})
ADD_DEFINITIONS(${SSL_DEFINES})
-SET(CLIENT_API_FUNCTIONS
+SET(CLIENT_API_FUNCTIONS_5_1
get_tty_password
handle_options
load_defaults
@@ -58,6 +58,7 @@ mysql_field_count
mysql_field_seek
mysql_field_tell
mysql_free_result
+mysql_get_parameters
mysql_get_client_info
mysql_get_host_info
mysql_get_proto_info
@@ -129,12 +130,173 @@ mysql_server_init
mysql_server_end
mysql_set_character_set
mysql_get_character_set_info
-mysql_stmt_next_result
+)
-CACHE INTERNAL "Functions exported by client API"
+SET(CLIENT_API_FUNCTIONS_5_5
+mysql_stmt_next_result
+# Client plugins
+mysql_client_find_plugin
+mysql_client_register_plugin
+mysql_load_plugin
+mysql_load_plugin_v
+mysql_plugin_options
+# Async API
+mysql_autocommit_cont
+mysql_autocommit_start
+mysql_change_user_cont
+mysql_change_user_start
+mysql_close_cont
+mysql_close_slow_part_cont
+mysql_close_slow_part_start
+mysql_close_start
+mysql_commit_cont
+mysql_commit_start
+mysql_fetch_row_cont
+mysql_fetch_row_start
+mysql_free_result_cont
+mysql_free_result_start
+mysql_kill_cont
+mysql_kill_start
+mysql_list_dbs_cont
+mysql_list_dbs_start
+mysql_list_fields_cont
+mysql_list_fields_start
+mysql_list_processes_cont
+mysql_list_processes_start
+mysql_list_tables_cont
+mysql_list_tables_start
+mysql_next_result_cont
+mysql_next_result_start
+mysql_ping_cont
+mysql_ping_start
+mysql_query_cont
+mysql_query_start
+mysql_read_query_result_cont
+mysql_read_query_result_start
+mysql_real_connect_cont
+mysql_real_connect_start
+mysql_real_query_cont
+mysql_real_query_start
+mysql_refresh_cont
+mysql_refresh_start
+mysql_rollback_cont
+mysql_rollback_start
+mysql_select_db_cont
+mysql_select_db_start
+mysql_send_query_cont
+mysql_send_query_start
+mysql_set_character_set_cont
+mysql_set_character_set_start
+mysql_set_server_option_cont
+mysql_set_server_option_start
+mysql_shutdown_cont
+mysql_shutdown_start
+mysql_stat_cont
+mysql_stat_start
+mysql_stmt_close_cont
+mysql_stmt_close_start
+mysql_stmt_execute_cont
+mysql_stmt_execute_start
+mysql_stmt_fetch_cont
+mysql_stmt_fetch_start
+mysql_stmt_free_result_cont
+mysql_stmt_free_result_start
+mysql_stmt_next_result_cont
+mysql_stmt_next_result_start
+mysql_stmt_prepare_cont
+mysql_stmt_prepare_start
+mysql_stmt_reset_cont
+mysql_stmt_reset_start
+mysql_stmt_send_long_data_cont
+mysql_stmt_send_long_data_start
+mysql_stmt_store_result_cont
+mysql_stmt_store_result_start
+mysql_store_result_cont
+mysql_store_result_start
+#dynamic columns api
+dynamic_column_create
+dynamic_column_create_many
+dynamic_column_update
+dynamic_column_update_many
+dynamic_column_exists
+dynamic_column_list
+dynamic_column_get
+dynamic_column_prepare_decimal
+)
+SET(CLIENT_API_FUNCTIONS
+ ${CLIENT_API_FUNCTIONS_5_1}
+ ${CLIENT_API_FUNCTIONS_5_5}
+ CACHE INTERNAL
+ "Client functions"
)
+IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
+ # When building RPM, or DEB package on Debian, use ELF symbol versioning
+ # for compatibility with distribution packages, so client shared library can
+ # painlessly replace the one supplied by the distribution.
+
+ # Also list of exported symbols in distributions may differ from what is considered
+ # official API. Define CLIENT_API_EXTRA for the set of symbols, that required to
+ # be exported on different platforms.
+
+ IF(RPM)
+ # Fedora & Co declared following functions as part of API
+ # These functions are alias of another function (given mysql_ prefix=. The
+ # renaming is handled in rpm_support.cc below
+ SET(CLIENT_API_EXTRA
+ mysql_default_charset_info
+ mysql_get_charset
+ mysql_get_charset_by_csname
+ mysql_net_realloc
+ mysql_client_errors
+ )
+ # Add special script to fix symbols renames by Fedora
+ SET(CLIENT_SOURCES_EXTRA ${CLIENT_SOURCES} rpm_support.cc)
+ SET(VERSION_SCRIPT_TEMPLATE
+ ${CMAKE_CURRENT_SOURCE_DIR}/libmysql_rpm_version.in)
+ ELSEIF(DEB)
+ # libmyodbc on Ubuntu is using functions below
+ # If we don't export them, linker would just remove
+ # them (they are not used inside libmysqlclient)
+ SET(CLIENT_API_EXTRA
+ strfill
+ init_dynamic_string
+ )
+ # MySQL supplied with Ubuntu does not have versioning, bug Debian does.
+ IF(DEB MATCHES "debian")
+ SET(VERSION_SCRIPT_TEMPLATE ${CMAKE_CURRENT_SOURCE_DIR}/libmysql.ver.in)
+ ENDIF()
+ ENDIF()
+
+ IF(VERSION_SCRIPT_TEMPLATE)
+ # Generate version script.
+ # Create semicolon separated lists of functions to export from
+ # Since RPM packages use separate versioning for 5.1 API
+ # and 5.5 API (libmysqlclient_16 vs libmysqlclient_18),
+ # we need 2 lists.
+ SET (CLIENT_API_5_1_LIST)
+ FOREACH (f ${CLIENT_API_FUNCTIONS_5_1})
+ SET(CLIENT_API_5_1_LIST "${CLIENT_API_5_1_LIST}\n${f};")
+ ENDFOREACH()
+
+ SET (CLIENT_API_5_5_LIST)
+ FOREACH (f ${CLIENT_API_FUNCTIONS_5_5})
+ SET(CLIENT_API_5_5_LIST "${CLIENT_API_5_5_LIST}\n${f};")
+ ENDFOREACH()
+
+ CONFIGURE_FILE(
+ ${VERSION_SCRIPT_TEMPLATE}
+ ${CMAKE_CURRENT_BINARY_DIR}/libmysql.version
+ @ONLY@
+ )
+ SET(VERSION_SCRIPT_LINK_FLAGS
+ "-Wl,--version-script=${CMAKE_CURRENT_BINARY_DIR}/libmysql.version")
+ ENDIF()
+
+ENDIF()
+
+
SET(CLIENT_SOURCES
get_password.c
libmysql.c
@@ -146,6 +308,7 @@ SET(CLIENT_SOURCES
../sql/net_serv.cc
../sql-common/pack.c
../sql/password.c
+ ${CLIENT_SOURCES_EXTRA}
)
ADD_CONVENIENCE_LIBRARY(clientlib ${CLIENT_SOURCES})
DTRACE_INSTRUMENT(clientlib)
@@ -193,13 +356,13 @@ IF(NOT DISABLE_SHARED)
OUTPUT_NAME mysqlclient
VERSION "${OS_SHARED_LIB_VERSION}"
SOVERSION "${SHARED_LIB_MAJOR_VERSION}")
- IF(LINK_FLAG_NO_UNDEFINED)
+ IF(LINK_FLAG_NO_UNDEFINED OR VERSION_SCRIPT_LINK_FLAGS)
GET_TARGET_PROPERTY(libmysql_link_flags libmysql LINK_FLAGS)
IF(NOT libmysql_link_flag)
SET(libmysql_link_flags)
ENDIF()
SET_TARGET_PROPERTIES(libmysql PROPERTIES LINK_FLAGS
- "${libmysql_link_flags} ${LINK_FLAG_NO_UNDEFINED}")
+ "${libmysql_link_flags} ${LINK_FLAG_NO_UNDEFINED} ${VERSION_SCRIPT_LINK_FLAGS}")
ENDIF()
# clean direct output needs to be set several targets have the same name
#(mysqlclient in this case)
diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c
index f90cc96a90f..69fce429ab9 100644
--- a/libmysql/libmysql.c
+++ b/libmysql/libmysql.c
@@ -1520,8 +1520,8 @@ mysql_stmt_init(MYSQL *mysql)
DBUG_RETURN(NULL);
}
- init_alloc_root(&stmt->mem_root, 2048, 2048);
- init_alloc_root(&stmt->result.alloc, 4096, 4096);
+ init_alloc_root(&stmt->mem_root, 2048, 2048, MYF(MY_THREAD_SPECIFIC));
+ init_alloc_root(&stmt->result.alloc, 4096, 4096, MYF(MY_THREAD_SPECIFIC));
stmt->result.alloc.min_malloc= sizeof(MYSQL_ROWS);
mysql->stmts= list_add(mysql->stmts, &stmt->list);
stmt->list.data= stmt;
@@ -1532,7 +1532,8 @@ mysql_stmt_init(MYSQL *mysql)
strmov(stmt->sqlstate, not_error_sqlstate);
/* The rest of statement members was bzeroed inside malloc */
- init_alloc_root(&stmt->extension->fields_mem_root, 2048, 0);
+ init_alloc_root(&stmt->extension->fields_mem_root, 2048, 0,
+ MYF(MY_THREAD_SPECIFIC));
DBUG_RETURN(stmt);
}
diff --git a/libmysql/libmysql_rpm_version.in b/libmysql/libmysql_rpm_version.in
new file mode 100644
index 00000000000..ad15c8aa2c8
--- /dev/null
+++ b/libmysql/libmysql_rpm_version.in
@@ -0,0 +1,48 @@
+# This version script is heavily inspired by Fedora's and Mageia's version scripts for
+# MySQL client shared library. It is used in MariaDB for building RPMs.
+
+libmysqlclient_16 {
+ global:
+@CLIENT_API_5_1_LIST@
+
+# some stuff from Mageia, I have no idea why it is there
+# But too afraid to throw anything away
+ _fini;
+ _init;
+ my_init;
+ my_progname;
+ myodbc_remove_escape;
+
+# These are documented in Paul DuBois' MySQL book, so we treat them as part
+# of the de-facto API.
+ free_defaults;
+ handle_options;
+ load_defaults;
+ my_print_help;
+# pure-ftpd requires this
+ my_make_scrambled_password;
+# hydra requires this
+ scramble;
+# DBD::mysql requires this
+ is_prefix;
+ local:
+ *;
+};
+
+libmysqlclient_18 {
+ global:
+ @CLIENT_API_5_5_LIST@
+#
+# Ideally the following symbols wouldn't be exported, but various applications
+# require them. We limit the namespace damage by prefixing mysql_
+# (see mysql-dubious-exports.patch), which means the symbols are not present
+# in libmysqlclient_16.
+#
+# mysql-connector-odbc requires these
+ mysql_default_charset_info;
+ mysql_get_charset;
+ mysql_get_charset_by_csname;
+ mysql_net_realloc;
+# PHP's mysqli.so requires this (via the ER() macro)
+ mysql_client_errors;
+};
diff --git a/libmysql/rpm_support.cc b/libmysql/rpm_support.cc
new file mode 100644
index 00000000000..8c9a1e8683d
--- /dev/null
+++ b/libmysql/rpm_support.cc
@@ -0,0 +1,41 @@
+/*
+ Provide aliases for several symbols, to support drop-in replacement for
+ MariaDB on Fedora and several derives distributions.
+
+ These distributions redefine several symbols (in a way that is no compatible
+ with either MySQL or MariaDB) and export it from the client library ( as seen
+ e.g from this patch)
+http://lists.fedoraproject.org/pipermail/scm-commits/2010-December/537257.html
+
+ MariaDB handles compatibility distribution by providing the same symbols from
+ the client library if it is built with -DRPM
+
+*/
+#include <errmsg.h>
+#include <my_sys.h>
+#include <mysql.h>
+extern "C" {
+
+CHARSET_INFO *mysql_default_charset_info = default_charset_info;
+
+CHARSET_INFO *mysql_get_charset(uint cs_number, myf flags)
+{
+ return get_charset(cs_number, flags);
+}
+
+CHARSET_INFO *mysql_get_charset_by_csname(const char *cs_name,
+ uint cs_flags, myf my_flags)
+{
+ return get_charset_by_csname(cs_name, cs_flags, my_flags);
+}
+
+
+my_bool mysql_net_realloc(NET *net, size_t length)
+{
+ return net_realloc(net,length);
+}
+
+const char **mysql_client_errors = client_errors;
+
+} /*extern "C" */
+
diff --git a/libmysqld/CMakeLists.txt b/libmysqld/CMakeLists.txt
index 9f79b94c6a9..c1e4cdb0543 100644
--- a/libmysqld/CMakeLists.txt
+++ b/libmysqld/CMakeLists.txt
@@ -150,8 +150,21 @@ IF(UNIX)
${CMAKE_STATIC_LIBRARY_PREFIX}mysqld-debug)
ENDIF()
+# List of exported functions in embedded (client api except client plugin or
+# async (*_start/*_cont functions)
+
+SET(EMBEDDED_API)
+
+FOREACH(f ${CLIENT_API_FUNCTIONS})
+ IF(f MATCHES "plugin|_start$|_cont$")
+ # Ignore functions, embedded does not export them
+ ELSE()
+ SET(EMBEDDED_API ${EMBEDDED_API} ${f})
+ ENDIF()
+ENDFOREACH()
+
IF(NOT DISABLE_SHARED)
- MERGE_LIBRARIES(libmysqld SHARED mysqlserver EXPORTS ${CLIENT_API_FUNCTIONS}
+ MERGE_LIBRARIES(libmysqld SHARED mysqlserver EXPORTS ${EMBEDDED_API}
COMPONENT Server)
IF(UNIX)
# Name the shared library, handle versioning (provides same api as client
diff --git a/libmysqld/emb_qcache.cc b/libmysqld/emb_qcache.cc
index d263e5d5fe8..abb0631ebfb 100644
--- a/libmysqld/emb_qcache.cc
+++ b/libmysqld/emb_qcache.cc
@@ -415,7 +415,7 @@ int emb_load_querycache_result(THD *thd, Querycache_stream *src)
if (!data)
goto err;
- init_alloc_root(&data->alloc, 8192,0);
+ init_alloc_root(&data->alloc, 8192,0,MYF(0));
f_alloc= &data->alloc;
data->fields= src->load_int();
diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc
index 0a7853e3640..6d718a6baa6 100644
--- a/libmysqld/lib_sql.cc
+++ b/libmysqld/lib_sql.cc
@@ -520,7 +520,8 @@ int init_embedded_server(int argc, char **argv, char **groups)
if (!groups)
groups= (char**) fake_groups;
- my_progname= (char *)"mysql_embedded";
+ if (!my_progname)
+ my_progname= (char *)"mysql_embedded";
/*
Perform basic logger initialization logger. Should be called after
@@ -634,7 +635,7 @@ void init_embedded_mysql(MYSQL *mysql, int client_flag)
mysql->server_version= server_version;
mysql->client_flag= client_flag;
//mysql->server_capabilities= client_flag;
- init_alloc_root(&mysql->field_alloc, 8192, 0);
+ init_alloc_root(&mysql->field_alloc, 8192, 0, MYF(0));
}
/**
@@ -906,8 +907,9 @@ int Protocol::begin_dataset()
if (!data)
return 1;
alloc= &data->alloc;
- init_alloc_root(alloc,8192,0); /* Assume rowlength < 8192 */
- alloc->min_malloc=sizeof(MYSQL_ROWS);
+ /* Assume rowlength < 8192 */
+ init_alloc_root(alloc, 8192, 0, MYF(0));
+ alloc->min_malloc= sizeof(MYSQL_ROWS);
return 0;
}
diff --git a/libservices/CMakeLists.txt b/libservices/CMakeLists.txt
index eb8ff7ffe09..1583d1ff792 100644
--- a/libservices/CMakeLists.txt
+++ b/libservices/CMakeLists.txt
@@ -21,7 +21,8 @@ SET(MYSQLSERVICES_SOURCES
thd_wait_service.c
my_thread_scheduler_service.c
progress_report_service.c
- debug_sync_service.c)
+ debug_sync_service.c
+ kill_statement_service.c)
ADD_CONVENIENCE_LIBRARY(mysqlservices ${MYSQLSERVICES_SOURCES})
INSTALL(TARGETS mysqlservices DESTINATION ${INSTALL_LIBDIR} COMPONENT Development)
diff --git a/libservices/kill_statement_service.c b/libservices/kill_statement_service.c
new file mode 100644
index 00000000000..4c7cacb241d
--- /dev/null
+++ b/libservices/kill_statement_service.c
@@ -0,0 +1,18 @@
+/* Copyright (c) 2013, Monty Program Ab.
+ Use is subject to license terms.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
+
+#include <service_versions.h>
+SERVICE_VERSION thd_kill_statement_service= (void*)VERSION_kill_statement;
diff --git a/mysql-test/include/mysqlbinlog_row_engine.inc b/mysql-test/extra/binlog_tests/mysqlbinlog_row_engine.inc
index 95440ab04a0..95440ab04a0 100644
--- a/mysql-test/include/mysqlbinlog_row_engine.inc
+++ b/mysql-test/extra/binlog_tests/mysqlbinlog_row_engine.inc
diff --git a/mysql-test/include/have_cassandra.inc b/mysql-test/include/have_cassandra.inc
new file mode 100644
index 00000000000..d358e2ecc26
--- /dev/null
+++ b/mysql-test/include/have_cassandra.inc
@@ -0,0 +1,10 @@
+#
+# suite.pm will make sure that all tests including this file
+# will be skipped unless innodb or xtradb is enabled
+#
+# The test below is redundant
+
+if (`SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.ENGINES WHERE engine = 'cassandra' AND support IN ('YES', 'DEFAULT', 'ENABLED')`)
+{
+ --skip Test requires Cassandra.
+}
diff --git a/mysql-test/include/have_cassandra.opt b/mysql-test/include/have_cassandra.opt
new file mode 100644
index 00000000000..98a4a081de5
--- /dev/null
+++ b/mysql-test/include/have_cassandra.opt
@@ -0,0 +1 @@
+--plugin-load=$HA_CASSANDRA_SO --loose-cassandra=on
diff --git a/mysql-test/include/have_dbi_dbd-mysql.inc b/mysql-test/include/have_dbi_dbd-mysql.inc
index 212e36ac353..7c2113a8109 100644
--- a/mysql-test/include/have_dbi_dbd-mysql.inc
+++ b/mysql-test/include/have_dbi_dbd-mysql.inc
@@ -58,9 +58,7 @@
--let $perlChecker= $MYSQLTEST_VARDIR/std_data/checkDBI_DBD-mysql.pl
--let $resultFile= $MYSQL_TMP_DIR/dbidbd-mysql.txt
-# Make the script executable and execute it.
---chmod 0755 $perlChecker
---exec $perlChecker
+--exec perl $perlChecker
# Source the resulting temporary file and look for a variable being set.
--source $resultFile
diff --git a/mysql-test/include/plugin.defs b/mysql-test/include/plugin.defs
index d0dbfd35bee..f2b754eb93a 100644
--- a/mysql-test/include/plugin.defs
+++ b/mysql-test/include/plugin.defs
@@ -41,3 +41,4 @@ ha_blackhole storage/blackhole BLACKHOLE_PLUGIN
ha_federated storage/federated FEDERATED_PLUGIN
mypluglib plugin/fulltext SIMPLE_PARSER
libdaemon_example plugin/daemon_example DAEMONEXAMPLE
+adt_null plugin/audit_null AUDIT_NULL
diff --git a/mysql-test/include/rpl_start_server.inc b/mysql-test/include/rpl_start_server.inc
index c59c7759910..932fc9da7ef 100644
--- a/mysql-test/include/rpl_start_server.inc
+++ b/mysql-test/include/rpl_start_server.inc
@@ -8,6 +8,7 @@
# --let $rpl_server_number= N
# [--let $rpl_server_parameters= --flag1 --flag2 ...]
# [--let $rpl_debug= 1]
+# [--let $rpl_server_error= 0]
# --source include/rpl_start_server.inc
#
# Parameters:
@@ -21,6 +22,9 @@
# If set, extra parameters given by this variable are passed to
# mysqld.
#
+# $rpl_server_error
+# If set, failure of the server startup is expected.
+#
# $rpl_debug
# See include/rpl_init.inc
#
@@ -47,8 +51,9 @@ if ($rpl_server_parameters)
# Write file to make mysql-test-run.pl start up the server again
--exec echo "$_rpl_start_server_command" > $MYSQLTEST_VARDIR/tmp/mysqld.$rpl_server_number.expect
---source include/rpl_reconnect.inc
-
-
---let $include_filename= rpl_start_server.inc $_rpl_start_server_args
---source include/end_include_file.inc
+if (!$rpl_server_error)
+{
+ --source include/rpl_reconnect.inc
+ --let $include_filename= rpl_start_server.inc $_rpl_start_server_args
+ --source include/end_include_file.inc
+}
diff --git a/mysql-test/lib/v1/mysql-test-run.pl b/mysql-test/lib/v1/mysql-test-run.pl
index 41247366c4b..b3360aec986 100755
--- a/mysql-test/lib/v1/mysql-test-run.pl
+++ b/mysql-test/lib/v1/mysql-test-run.pl
@@ -3229,6 +3229,8 @@ sub install_db ($$) {
# for a production system
mtr_appendfile_to_file("$path_sql_dir/mysql_system_tables.sql",
$bootstrap_sql_file);
+ mtr_appendfile_to_file("$path_sql_dir/mysql_performance_tables.sql",
+ $bootstrap_sql_file);
# Add the mysql system tables initial data
# for a production system
diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl
index b0dca9426ac..46f2215ffb8 100755
--- a/mysql-test/mysql-test-run.pl
+++ b/mysql-test/mysql-test-run.pl
@@ -3525,6 +3525,11 @@ sub mysql_install_db {
mtr_appendfile_to_file("$sql_dir/mysql_system_tables.sql",
$bootstrap_sql_file);
+ # Add the performance tables
+ # for a production system
+ mtr_appendfile_to_file("$sql_dir/mysql_performance_tables.sql",
+ $bootstrap_sql_file);
+
# Add the mysql system tables initial data
# for a production system
mtr_appendfile_to_file("$sql_dir/mysql_system_tables_data.sql",
@@ -3593,9 +3598,10 @@ sub mysql_install_db {
verbose => $opt_verbose,
) != 0)
{
+ my $data= mtr_grab_file($path_bootstrap_log);
mtr_error("Error executing mysqld --bootstrap\n" .
"Could not install system database from $bootstrap_sql_file\n" .
- "see $path_bootstrap_log for errors");
+ "The $path_bootstrap_log file contains:\n$data\n");
}
}
diff --git a/mysql-test/r/alias.result b/mysql-test/r/alias.result
index 9e4ce9f84a9..9d826dd9bd7 100644
--- a/mysql-test/r/alias.result
+++ b/mysql-test/r/alias.result
@@ -212,3 +212,5 @@ drop table t4;
create table t4 select t2.*, d as 'x', d as 'z' from t2;
drop table t4;
drop table t1,t2,t3;
+DELETE ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZROM t1 WHERE 1=1;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 't1 WHERE 1=1' at line 1
diff --git a/mysql-test/r/cassandra.result b/mysql-test/r/cassandra.result
new file mode 100644
index 00000000000..e26df069f93
--- /dev/null
+++ b/mysql-test/r/cassandra.result
@@ -0,0 +1,593 @@
+drop table if exists t0, t1;
+create table t1 (a int) engine=cassandra
+thrift_host='localhost' keyspace='foo' column_family='colfam';
+ERROR 42000: This table type requires a primary key
+create table t1 (a int primary key, b int) engine=cassandra
+thrift_host='localhost' keyspace='foo' column_family='colfam';
+ERROR HY000: Unable to connect to foreign data source: Default TException. [Keyspace foo does not exist]
+create table t1 (rowkey char(10) primary key, column1 char(10)) engine=cassandra
+thrift_host='127.0.0.2' keyspace='foo' column_family='colfam';
+ERROR HY000: Unable to connect to foreign data source: connect() failed: Connection refused [1]
+create table t1 (rowkey char(10) primary key, column1 char(10)) engine=cassandra
+thrift_host='localhost' keyspace='no_such_keyspace' column_family='colfam';
+ERROR HY000: Unable to connect to foreign data source: Default TException. [Keyspace no_such_keyspace does not exist]
+create table t1 (rowkey char(10) primary key, column1 char(10)) engine=cassandra
+thrift_host='localhost' keyspace='no_such_keyspace';
+ERROR HY000: Unable to connect to foreign data source: keyspace and column_family table options must be specified
+# Now, create a table for real and insert data
+create table t1 (pk varchar(36) primary key, data1 varchar(60), data2 bigint) engine=cassandra
+thrift_host='localhost' keyspace='mariadbtest2' column_family='cf1';
+# Just in case there were left-overs from previous:
+delete from t1;
+select * from t1;
+pk data1 data2
+insert into t1 values ('rowkey10', 'data1-value', 123456);
+insert into t1 values ('rowkey11', 'data1-value2', 34543);
+insert into t1 values ('rowkey12', 'data1-value3', 454);
+select * from t1;
+pk data1 data2
+rowkey12 data1-value3 454
+rowkey10 data1-value 123456
+rowkey11 data1-value2 34543
+explain
+select * from t1 where pk='rowkey11';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 const PRIMARY PRIMARY 38 const 1
+select * from t1 where pk='rowkey11';
+pk data1 data2
+rowkey11 data1-value2 34543
+delete from t1 where pk='rowkey11';
+select * from t1;
+pk data1 data2
+rowkey12 data1-value3 454
+rowkey10 data1-value 123456
+delete from t1;
+select * from t1;
+pk data1 data2
+#
+# A query with filesort (check that table_flags() & HA_REC_NOT_IN_SEQ,
+# also check ::rnd_pos()
+#
+insert into t1 values ('rowkey10', 'data1-value', 123456);
+insert into t1 values ('rowkey11', 'data1-value2', 34543);
+insert into t1 values ('rowkey12', 'data1-value3', 454);
+select * from t1 order by data2;
+pk data1 data2
+rowkey12 data1-value3 454
+rowkey11 data1-value2 34543
+rowkey10 data1-value 123456
+delete from t1;
+drop table t1;
+#
+# MDEV-476: Cassandra: Server crashes in calculate_key_len on DELETE with ORDER BY
+#
+CREATE TABLE t1 (rowkey BIGINT PRIMARY KEY, a BIGINT) ENGINE=CASSANDRA
+thrift_host='localhost' keyspace='mariadbtest2' column_family = 'cf2';
+INSERT INTO t1 VALUES (1,1),(2,2);
+DELETE FROM t1 ORDER BY a LIMIT 1;
+DROP TABLE t1;
+#
+# Batched INSERT
+#
+show variables like 'cassandra_insert_batch_size';
+Variable_name Value
+cassandra_insert_batch_size 100
+show status like 'cassandra_row_insert%';
+Variable_name Value
+Cassandra_row_insert_batches 7
+Cassandra_row_inserts 8
+CREATE TABLE t1 (rowkey BIGINT PRIMARY KEY, a BIGINT) ENGINE=CASSANDRA
+thrift_host='localhost' keyspace='mariadbtest2' column_family = 'cf2';
+delete from t1;
+INSERT INTO t1 VALUES (1,1),(2,2);
+DELETE FROM t1 ORDER BY a LIMIT 1;
+DROP TABLE t1;
+show status like 'cassandra_row_insert%';
+Variable_name Value
+Cassandra_row_insert_batches 8
+Cassandra_row_inserts 10
+# FLUSH STATUS doesn't work for our variables, just like with InnoDB.
+flush status;
+show status like 'cassandra_row_insert%';
+Variable_name Value
+Cassandra_row_insert_batches 0
+Cassandra_row_inserts 0
+#
+# Batched Key Access
+#
+# Control variable (we are not yet able to make use of MRR's buffer)
+show variables like 'cassandra_multi%';
+Variable_name Value
+cassandra_multiget_batch_size 100
+# MRR-related status variables:
+show status like 'cassandra_multi%';
+Variable_name Value
+Cassandra_multiget_keys_scanned 0
+Cassandra_multiget_reads 0
+Cassandra_multiget_rows_read 0
+CREATE TABLE t1 (rowkey BIGINT PRIMARY KEY, a BIGINT) ENGINE=CASSANDRA
+thrift_host='localhost' keyspace='mariadbtest2' column_family = 'cf2';
+delete from t1;
+INSERT INTO t1 VALUES (0,0),(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9);
+set @tmp_jcl=@@join_cache_level;
+set join_cache_level=8;
+explain select * from t1 A, t1 B where B.rowkey=A.a;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE A ALL NULL NULL NULL NULL 1000 Using where
+1 SIMPLE B eq_ref PRIMARY PRIMARY 8 test.A.a 1 Using join buffer (flat, BKAH join); multiget_slice
+select * from t1 A, t1 B where B.rowkey=A.a;
+rowkey a rowkey a
+0 0 0 0
+1 1 1 1
+2 2 2 2
+3 3 3 3
+4 4 4 4
+5 5 5 5
+6 6 6 6
+7 7 7 7
+8 8 8 8
+9 9 9 9
+show status like 'cassandra_multi%';
+Variable_name Value
+Cassandra_multiget_keys_scanned 10
+Cassandra_multiget_reads 1
+Cassandra_multiget_rows_read 10
+insert into t1 values(1, 8);
+insert into t1 values(3, 8);
+insert into t1 values(5, 8);
+insert into t1 values(7, 8);
+select * from t1 A, t1 B where B.rowkey=A.a;
+rowkey a rowkey a
+0 0 0 0
+2 2 2 2
+4 4 4 4
+6 6 6 6
+1 8 8 8
+7 8 8 8
+8 8 8 8
+5 8 8 8
+3 8 8 8
+9 9 9 9
+show status like 'cassandra_multi%';
+Variable_name Value
+Cassandra_multiget_keys_scanned 16
+Cassandra_multiget_reads 2
+Cassandra_multiget_rows_read 16
+delete from t1;
+drop table t1;
+#
+# MDEV-480: TRUNCATE TABLE on a Cassandra table does not remove rows
+#
+CREATE TABLE t1 (rowkey BIGINT PRIMARY KEY, a BIGINT) ENGINE=CASSANDRA
+thrift_host='localhost' keyspace='mariadbtest2' column_family = 'cf2';
+INSERT INTO t1 VALUES (0,0),(1,1),(2,2);
+truncate table t1;
+select * from t1;
+rowkey a
+drop table t1;
+#
+# MDEV-494, part #1: phantom row for big full-scan selects
+#
+create table t0 (a int);
+insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+CREATE TABLE t1 (rowkey BIGINT PRIMARY KEY, a BIGINT) ENGINE=CASSANDRA
+thrift_host='localhost' keyspace='mariadbtest2' column_family = 'cf2';
+insert into t1 select A.a + 10 * B.a + 100*C.a, 12345 from t0 A, t0 B, t0 C;
+select count(*) from t1;
+count(*)
+1000
+select count(*) from t1 where a=12345;
+count(*)
+1000
+delete from t1;
+drop table t1;
+drop table t0;
+# 32-bit INT type support
+CREATE TABLE t1 (rowkey BIGINT PRIMARY KEY, intcol INT) ENGINE=CASSANDRA
+thrift_host='localhost' keyspace='mariadbtest2' column_family = 'cf3';
+insert into t1 values (10,10);
+insert into t1 values (12,12);
+delete from t1;
+drop table t1;
+#
+# Try accessing column family w/o explicitly defined columns
+#
+CREATE TABLE t1 (my_primary_key varchar(10) PRIMARY KEY) ENGINE=CASSANDRA
+thrift_host='localhost' keyspace='mariadbtest2' column_family = 'cf10';
+ERROR HY000: Internal error: 'target column family has no key_alias defined, PRIMARY KEY column must be named 'rowkey''
+CREATE TABLE t1 (rowkey varchar(10) PRIMARY KEY) ENGINE=CASSANDRA
+thrift_host='localhost' keyspace='mariadbtest2' column_family = 'cf10';
+DROP TABLE t1;
+#
+# Timestamp datatype support
+#
+CREATE TABLE t2 (rowkey bigint PRIMARY KEY, datecol timestamp) ENGINE=CASSANDRA
+thrift_host='localhost' keyspace='mariadbtest2' column_family = 'cf4';
+delete from t2;
+insert into t2 values (1, '2012-08-29 01:23:45');
+select * from t2;
+rowkey datecol
+1 2012-08-29 01:23:45
+delete from t2;
+# MDEV-498: Cassandra: Inserting a timestamp does not work on a 32-bit system
+INSERT INTO t2 VALUES (10,'2012-12-12 12:12:12');
+SELECT * FROM t2;
+rowkey datecol
+10 2012-12-12 12:12:12
+delete from t2;
+#
+# (no MDEV#) Check that insert counters work correctly
+#
+create table t0 (a int);
+insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+set cassandra_insert_batch_size=10;
+insert into t2 select A.a+10*B.a, now() from t0 A, t0 B;
+inserts insert_batches
+100 10
+set cassandra_insert_batch_size=1;
+insert into t2 select A.a+10*B.a+100, now() from t0 A, t0 B;
+inserts insert_batches
+100 100
+delete from t2;
+drop table t2;
+drop table t0;
+#
+# UUID datatype support
+#
+CREATE TABLE t2 (rowkey bigint PRIMARY KEY, uuidcol char(36)) ENGINE=CASSANDRA
+thrift_host='localhost' keyspace='mariadbtest2' column_family = 'cf5';
+delete from t2;
+insert into t2 values(1,'9b5658dc-f32f-11e1-94cd-f46d046e9f09');
+insert into t2 values(2,'not-an-uuid');
+ERROR 22003: Out of range value for column 'uuidcol' at row 1
+insert into t2 values(3,'9b5658dc-f32f-11e1=94cd-f46d046e9f09');
+ERROR 22003: Out of range value for column 'uuidcol' at row 1
+insert into t2 values(4,'9b5658dc-fzzf-11e1-94cd-f46d046e9f09');
+ERROR 22003: Out of range value for column 'uuidcol' at row 1
+insert into t2 values
+(5,'9b5658dc-f11f-11e1-94cd-f46d046e9f09'),
+(6,'9b5658dc-f11f011e1-94cd-f46d046e9f09');
+ERROR 22003: Out of range value for column 'uuidcol' at row 2
+select * from t2;
+rowkey uuidcol
+1 9b5658dc-f32f-11e1-94cd-f46d046e9f09
+5 9b5658dc-f11f-11e1-94cd-f46d046e9f09
+delete from t2;
+drop table t2;
+CREATE TABLE t2 (rowkey char(36) PRIMARY KEY, col1 int) ENGINE=CASSANDRA
+thrift_host='localhost' keyspace='mariadbtest2' column_family = 'cf6';
+delete from t2;
+insert into t2 values('9b5658dc-f32f-11e1-94cd-f46d046e9f09', 1234);
+insert into t2 values('not-an-uuid', 563);
+ERROR 22003: Out of range value for column 'rowkey' at row 1
+select * from t2;
+rowkey col1
+9b5658dc-f32f-11e1-94cd-f46d046e9f09 1234
+delete from t2;
+drop table t2;
+#
+# boolean datatype support
+#
+CREATE TABLE t2 (rowkey int PRIMARY KEY, boolcol bool) ENGINE=CASSANDRA
+thrift_host='localhost' keyspace='mariadbtest2' column_family = 'cf7';
+insert into t2 values (0, 0);
+insert into t2 values (1, 1);
+select * from t2;
+rowkey boolcol
+0 0
+1 1
+delete from t2;
+drop table t2;
+#
+# Counter datatype support (read-only)
+#
+CREATE TABLE t2 (rowkey varchar(32) PRIMARY KEY, countercol bigint) ENGINE=CASSANDRA
+thrift_host='localhost' keyspace='mariadbtest2' column_family = 'cf8';
+select * from t2;
+rowkey countercol
+cnt1 1
+cnt2 100
+drop table t2;
+#
+# Check that @@cassandra_default_thrift_host works
+#
+show variables like 'cassandra_default_thrift_host';
+Variable_name Value
+cassandra_default_thrift_host
+set @tmp=@@cassandra_default_thrift_host;
+set cassandra_default_thrift_host='localhost';
+ERROR HY000: Variable 'cassandra_default_thrift_host' is a GLOBAL variable and should be set with SET GLOBAL
+set global cassandra_default_thrift_host='localhost';
+# Try creating a table without specifying thrift_host:
+CREATE TABLE t2 (rowkey varchar(32) PRIMARY KEY, countercol bigint) ENGINE=CASSANDRA
+keyspace='mariadbtest2' column_family = 'cf8';
+select * from t2;
+rowkey countercol
+cnt1 1
+cnt2 100
+drop table t2;
+set global cassandra_default_thrift_host=@tmp;
+#
+# Consistency settings
+#
+show variables like 'cassandra_%consistency';
+Variable_name Value
+cassandra_read_consistency ONE
+cassandra_write_consistency ONE
+set @tmp=@@cassandra_write_consistency;
+# Unfortunately, there is no easy way to check if setting have the effect..
+set cassandra_write_consistency='ONE';
+set cassandra_write_consistency='QUORUM';
+set cassandra_write_consistency='LOCAL_QUORUM';
+set cassandra_write_consistency='EACH_QUORUM';
+set cassandra_write_consistency='ALL';
+set cassandra_write_consistency='ANY';
+set cassandra_write_consistency='TWO';
+set cassandra_write_consistency='THREE';
+set cassandra_write_consistency=@tmp;
+#
+# varint datatype support
+#
+CREATE TABLE t2 (rowkey varchar(32) PRIMARY KEY, varint_col varbinary(32)) ENGINE=CASSANDRA
+thrift_host='localhost' keyspace='mariadbtest2' column_family = 'cf9';
+select rowkey, hex(varint_col) from t2;
+rowkey hex(varint_col)
+val-01 01
+val-0x123456 123456
+val-0x12345678 12345678
+drop table t2;
+# now, let's check what happens when MariaDB's column is not wide enough:
+CREATE TABLE t2 (rowkey varchar(32) PRIMARY KEY, varint_col varbinary(2)) ENGINE=CASSANDRA
+thrift_host='localhost' keyspace='mariadbtest2' column_family = 'cf9';
+select rowkey, hex(varint_col) from t2;
+ERROR HY000: Internal error: 'Unable to convert value for field `varint_col` from Cassandra's data format. Source data is 4 bytes, 0x12345678'
+drop table t2;
+#
+# Decimal datatype support
+#
+CREATE TABLE t2 (rowkey varchar(32) PRIMARY KEY, decimal_col varbinary(32)) ENGINE=CASSANDRA
+thrift_host='localhost' keyspace='mariadbtest2' column_family = 'cf11';
+select rowkey, hex(decimal_col) from t2;
+rowkey hex(decimal_col)
+val_1.5 000000010F
+val_0.5 0000000105
+val_1234 0000000004D2
+drop table t2;
+#
+# Mapping TIMESTAMP -> int64
+#
+set @save_tz= @@time_zone;
+set time_zone='UTC';
+CREATE TABLE t2 (rowkey bigint PRIMARY KEY, datecol timestamp) ENGINE=CASSANDRA
+thrift_host='localhost' keyspace='mariadbtest2' column_family = 'cf4';
+insert into t2 values (1, '2012-08-29 01:23:45');
+INSERT INTO t2 VALUES (10,'2012-08-29 01:23:46');
+drop table t2;
+CREATE TABLE t2 (rowkey bigint PRIMARY KEY, datecol bigint) ENGINE=CASSANDRA
+thrift_host='localhost' keyspace='mariadbtest2' column_family = 'cf4';
+select * from t2;
+rowkey datecol
+1 1346203425000
+10 1346203426000
+delete from t2;
+drop table t2;
+set time_zone=@save_tz;
+#
+# Check whether changing parameters with ALTER TABLE works.
+#
+CREATE TABLE t2 (rowkey varchar(32) PRIMARY KEY, decimal_col varbinary(32)) ENGINE=CASSANDRA
+thrift_host='localhost' keyspace='mariadbtest2' column_family = 'cf11';
+drop table t2;
+CREATE TABLE t2 (rowkey varchar(32) PRIMARY KEY, decimal_col varbinary(32)) ENGINE=CASSANDRA
+thrift_host='localhost' keyspace='mariadbtest2' column_family = 'cf11';
+alter table t2 column_family='cf12';
+Writes made during ALTER TABLE
+0
+drop table t2;
+#
+# UPDATE command support
+#
+create table t1 (pk varchar(36) primary key, data1 varchar(60), data2 bigint) engine=cassandra
+thrift_host='localhost' keyspace='mariadbtest2' column_family='cf1';
+insert into t1 values ('rowkey10', 'data1-value', 123456);
+insert into t1 values ('rowkey11', 'data1-value2', 34543);
+insert into t1 values ('rowkey12', 'data1-value3', 454);
+select * from t1;
+pk data1 data2
+rowkey12 data1-value3 454
+rowkey10 data1-value 123456
+rowkey11 data1-value2 34543
+update t1 set data1='updated-1' where pk='rowkey11';
+select * from t1;
+pk data1 data2
+rowkey12 data1-value3 454
+rowkey10 data1-value 123456
+rowkey11 updated-1 34543
+update t1 set pk='new-rowkey12' where pk='rowkey12';
+select * from t1;
+pk data1 data2
+rowkey10 data1-value 123456
+new-rowkey12 data1-value3 454
+rowkey11 updated-1 34543
+delete from t1;
+drop table t1;
+#
+# Dynamic columns support
+#
+CREATE TABLE t2 (rowkey bigint PRIMARY KEY, uuidcol blob DYNAMIC_COLUMN_STORAGE=1) ENGINE=CASSANDRA thrift_host='localhost' keyspace='mariadbtest2' column_family = 'cf5';
+drop table t2;
+#error: dynamic column is not a blob
+CREATE TABLE t2 (rowkey bigint PRIMARY KEY, uuidcol char(36) DYNAMIC_COLUMN_STORAGE=1) ENGINE=CASSANDRA thrift_host='localhost' keyspace='mariadbtest2' column_family = 'cf5';
+ERROR 42000: Incorrect column specifier for column 'uuidcol'
+#error: double dynamic column
+CREATE TABLE t2 (rowkey bigint PRIMARY KEY, uuidcol blob DYNAMIC_COLUMN_STORAGE=1, textcol blob DYNAMIC_COLUMN_STORAGE=1) ENGINE=CASSANDRA thrift_host='localhost' keyspace='mariadbtest2' column_family = 'cf5';
+ERROR 42000: Incorrect column specifier for column 'textcol'
+#
+# Dynamic column read
+#
+CREATE TABLE t2 (rowkey bigint PRIMARY KEY, uuidcol char(36)) ENGINE=CASSANDRA
+thrift_host='localhost' keyspace='mariadbtest2' column_family = 'cf5';
+delete from t2;
+insert into t2 values(1,'9b5658dc-f32f-11e1-94cd-f46d046e9f09');
+insert into t2 values(2,'9b5658dc-f32f-11e1-94cd-f46d046e9f0a');
+drop table t2;
+CREATE TABLE t2 (rowkey bigint PRIMARY KEY, dyn blob DYNAMIC_COLUMN_STORAGE=yes) ENGINE=CASSANDRA thrift_host='localhost' keyspace='mariadbtest2' column_family = 'cf5';
+select rowkey, column_list(dyn), column_get(dyn, 'uuidcol' as char) from t2;
+rowkey column_list(dyn) column_get(dyn, 'uuidcol' as char)
+1 `uuidcol` 9b5658dc-f32f-11e1-94cd-f46d046e9f09
+2 `uuidcol` 9b5658dc-f32f-11e1-94cd-f46d046e9f0a
+drop table t2;
+CREATE TABLE t2 (rowkey bigint PRIMARY KEY, uuidcol char(36)) ENGINE=CASSANDRA
+thrift_host='localhost' keyspace='mariadbtest2' column_family = 'cf5';
+delete from t2;
+drop table t2;
+#
+# Dynamic column insert
+#
+CREATE TABLE t2 (rowkey bigint PRIMARY KEY, dyn blob DYNAMIC_COLUMN_STORAGE=yes) ENGINE=CASSANDRA thrift_host='localhost' keyspace='mariadbtest2' column_family = 'cf5';
+insert into t2 values (1, column_create("dyn1", 1, "dyn2", "two"));
+select rowkey, column_json(dyn) from t2;
+rowkey column_json(dyn)
+1 {"dyn1":"1","dyn2":"two"}
+delete from t2;
+drop table t2;
+# bigint
+CREATE TABLE t1 (rowkey bigint PRIMARY KEY, dyn blob DYNAMIC_COLUMN_STORAGE=yes) ENGINE=CASSANDRA thrift_host='localhost' keyspace='mariadbtest2' column_family = 'cf2';
+insert into t1 values (1, column_create("dyn1", 1, "dyn2", "two", 'a', 254324));
+insert into t1 values (2, column_create("dyn1", 1, "dyn2", "two", 'a', 2543));
+select rowkey, column_json(dyn) from t1;
+rowkey column_json(dyn)
+1 {"a":254324,"dyn1":"1","dyn2":"two"}
+2 {"a":2543,"dyn1":"1","dyn2":"two"}
+delete from t1;
+drop table t1;
+# int
+CREATE TABLE t1 (rowkey bigint PRIMARY KEY, dyn blob DYNAMIC_COLUMN_STORAGE=yes) ENGINE=CASSANDRA thrift_host='localhost' keyspace='mariadbtest2' column_family = 'cf3';
+insert into t1 values (1, column_create("dyn1", 1, "dyn2", "two", 'intcol', 254324));
+insert into t1 values (2, column_create("dyn1", 1, "dyn2", "two", 'intcol', 2543));
+select rowkey, column_json(dyn) from t1;
+rowkey column_json(dyn)
+1 {"dyn1":"1","dyn2":"two","intcol":254324}
+2 {"dyn1":"1","dyn2":"two","intcol":2543}
+delete from t1;
+drop table t1;
+# timestamp
+CREATE TABLE t1 (rowkey bigint PRIMARY KEY, dyn blob DYNAMIC_COLUMN_STORAGE=yes) ENGINE=CASSANDRA thrift_host='localhost' keyspace='mariadbtest2' column_family = 'cf4';
+insert into t1 values (1, column_create("dyn1", 1, "dyn2", "two", 'datecol', 254324));
+insert into t1 values (2, column_create("dyn1", 1, "dyn2", "two", 'datecol', 2543));
+select rowkey, column_json(dyn) from t1;
+rowkey column_json(dyn)
+1 {"dyn1":"1","dyn2":"two","datecol":254324}
+2 {"dyn1":"1","dyn2":"two","datecol":2543}
+delete from t1;
+drop table t1;
+# boolean
+CREATE TABLE t1 (rowkey int PRIMARY KEY, dyn blob DYNAMIC_COLUMN_STORAGE=yes) ENGINE=CASSANDRA thrift_host='localhost' keyspace='mariadbtest2' column_family = 'cf7';
+insert into t1 values (1, column_create("dyn1", 1, "dyn2", "two", 'boolcol', 254324));
+insert into t1 values (2, column_create("dyn1", 1, "dyn2", "two", 'boolcol', 0));
+select rowkey, column_json(dyn) from t1;
+rowkey column_json(dyn)
+1 {"dyn1":"1","dyn2":"two","boolcol":1}
+2 {"dyn1":"1","dyn2":"two","boolcol":0}
+select rowkey, column_json(dyn) from t1;
+rowkey column_json(dyn)
+1 {"dyn1":"1","dyn2":"two","boolcol":1}
+2 {"dyn1":"1","dyn2":"two","boolcol":0}
+update t1 set dyn=column_add(dyn, "dyn2", null, "dyn3", "3");
+select rowkey, column_json(dyn) from t1;
+rowkey column_json(dyn)
+1 {"dyn1":"1","dyn3":"3","boolcol":1}
+2 {"dyn1":"1","dyn3":"3","boolcol":0}
+update t1 set dyn=column_add(dyn, "dyn1", null) where rowkey= 1;
+select rowkey, column_json(dyn) from t1;
+rowkey column_json(dyn)
+1 {"dyn3":"3","boolcol":1}
+2 {"dyn1":"1","dyn3":"3","boolcol":0}
+update t1 set dyn=column_add(dyn, "dyn3", null, "a", "ddd");
+select rowkey, column_json(dyn) from t1;
+rowkey column_json(dyn)
+1 {"a":"ddd","boolcol":1}
+2 {"a":"ddd","dyn1":"1","boolcol":0}
+update t1 set dyn=column_add(dyn, "12345678901234", "ddd");
+select rowkey, column_json(dyn) from t1;
+rowkey column_json(dyn)
+1 {"a":"ddd","boolcol":1,"12345678901234":"ddd"}
+2 {"a":"ddd","dyn1":"1","boolcol":0,"12345678901234":"ddd"}
+update t1 set dyn=column_add(dyn, "12345678901234", null);
+select rowkey, column_json(dyn) from t1;
+rowkey column_json(dyn)
+1 {"a":"ddd","boolcol":1}
+2 {"a":"ddd","dyn1":"1","boolcol":0}
+update t1 set dyn=column_add(dyn, 'boolcol', null) where rowkey= 2;
+select rowkey, column_json(dyn) from t1;
+rowkey column_json(dyn)
+1 {"a":"ddd","boolcol":1}
+2 {"a":"ddd","dyn1":"1"}
+update t1 set rowkey= 3, dyn=column_add(dyn, "dyn1", null, 'boolcol', 0) where rowkey= 2;
+select rowkey, column_json(dyn) from t1;
+rowkey column_json(dyn)
+1 {"a":"ddd","boolcol":1}
+3 {"a":"ddd","boolcol":0}
+delete from t1;
+drop table t1;
+CREATE TABLE t1 (rowkey varchar(10) PRIMARY KEY, dyn blob DYNAMIC_COLUMN_STORAGE=yes) ENGINE=CASSANDRA thrift_host='localhost' keyspace='mariadbtest2' column_family = 'cfd1';
+select * from t1;
+ERROR HY000: Internal error: 'Unable to convert value for field `dyn` from Cassandra's data format. Name length exceed limit of 16383: 'very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_v'
+drop table t1;
+CREATE TABLE t1 (rowkey int PRIMARY KEY, dyn blob DYNAMIC_COLUMN_STORAGE=yes)
+ENGINE=CASSANDRA thrift_host='localhost' keyspace='mariadbtest2' column_family = 'cfd2';
+DELETE FROM t1;
+insert into t1 values (1, column_create("dyn", 1));
+select rowkey, column_list(dyn) from t1;
+rowkey column_list(dyn)
+1 `dyn`
+delete from t1;
+DROP TABLE t1;
+CREATE TABLE t1 (rowkey int PRIMARY KEY, dyn blob DYNAMIC_COLUMN_STORAGE=yes)
+ENGINE=CASSANDRA thrift_host='localhost' keyspace='mariadbtest2' column_family = 'cfd2';
+insert into t1 values (1,'9b5658dc-f32f-11e1-94cd-f46d046e9f0a');
+ERROR HY000: Encountered illegal format of dynamic column string
+delete from t1;
+DROP TABLE t1;
+#
+# MDEV-565: Server crashes in ha_cassandra::write_row on
+# inserting NULL into a dynamic column
+#
+CREATE TABLE t1 (rowkey int PRIMARY KEY, dyn blob DYNAMIC_COLUMN_STORAGE=yes)
+ENGINE=CASSANDRA thrift_host='localhost' keyspace='mariadbtest2' column_family = 'cfd2';
+insert into t1 values (1, NULL);
+delete from t1;
+DROP TABLE t1;
+#
+# strange side effect of Cassandra - remiving all columns of primary
+# key removes all row.
+#
+CREATE TABLE t1 (rowkey int PRIMARY KEY, dyn blob DYNAMIC_COLUMN_STORAGE=yes)
+ENGINE=CASSANDRA thrift_host='localhost' keyspace='mariadbtest2' column_family = 'cfd2';
+INSERT INTO t1 VALUES(2,column_create("ab","ab"));
+select rowkey, column_json(dyn) from t1;
+rowkey column_json(dyn)
+2 {"ab":"ab"}
+UPDATE t1 set dyn=NULL;
+select rowkey, column_json(dyn) from t1;
+rowkey column_json(dyn)
+INSERT INTO t1 VALUES(2,column_create("ab","ab"));
+select rowkey, column_json(dyn) from t1;
+rowkey column_json(dyn)
+2 {"ab":"ab"}
+UPDATE t1 set dyn="";
+select rowkey, column_json(dyn) from t1;
+rowkey column_json(dyn)
+delete from t1;
+DROP TABLE t1;
+#
+# MDEV-4005 #Server crashes on creating a Cassandra table
+# with a mix of static and dynamic columns
+#
+DROP TABLE IF EXISTS t1, t2;
+CREATE TABLE t1 (
+pk int primary key,
+col_int int,
+dyncol blob DYNAMIC_COLUMN_STORAGE=yes
+) ENGINE=cassandra keyspace='bug' thrift_host = '127.0.0.1' column_family='cf1';
+drop table t1;
diff --git a/mysql-test/r/change_user_notembedded.result b/mysql-test/r/change_user_notembedded.result
new file mode 100644
index 00000000000..60579d15ec2
--- /dev/null
+++ b/mysql-test/r/change_user_notembedded.result
@@ -0,0 +1,5 @@
+ERROR 28000: Access denied for user 'foo'@'localhost' (using password: YES)
+ERROR 28000: Access denied for user 'foo'@'localhost' (using password: NO)
+ERROR 28000: Access denied for user 'foo'@'localhost' (using password: YES)
+ERROR 08S01: Unknown command
+ERROR 08S01: Unknown command
diff --git a/mysql-test/r/contributors.result b/mysql-test/r/contributors.result
index 5739c2244c3..19fdd96b4fb 100644
--- a/mysql-test/r/contributors.result
+++ b/mysql-test/r/contributors.result
@@ -3,3 +3,5 @@ Name Location Comment
Ronald Bradford Brisbane, Australia EFF contribution for UC2006 Auction
Sheeri Kritzer Boston, Mass. USA EFF contribution for UC2006 Auction
Mark Shuttleworth London, UK. EFF contribution for UC2006 Auction
+Warnings:
+Warning 1681 'SHOW CONTRIBUTORS' is deprecated and will be removed in a future release.
diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result
index 86050a3c792..7c556354d2e 100644
--- a/mysql-test/r/create.result
+++ b/mysql-test/r/create.result
@@ -1762,7 +1762,9 @@ t1 CREATE TABLE `t1` (
`TIME_MS` decimal(22,3) NOT NULL DEFAULT '0.000',
`STAGE` tinyint(2) NOT NULL DEFAULT '0',
`MAX_STAGE` tinyint(2) NOT NULL DEFAULT '0',
- `PROGRESS` decimal(7,3) NOT NULL DEFAULT '0.000'
+ `PROGRESS` decimal(7,3) NOT NULL DEFAULT '0.000',
+ `MEMORY_USED` int(7) NOT NULL DEFAULT '0',
+ `EXAMINED_ROWS` int(7) NOT NULL DEFAULT '0'
) DEFAULT CHARSET=utf8
drop table t1;
create temporary table t1 like information_schema.processlist;
@@ -1780,7 +1782,9 @@ t1 CREATE TEMPORARY TABLE `t1` (
`TIME_MS` decimal(22,3) NOT NULL DEFAULT '0.000',
`STAGE` tinyint(2) NOT NULL DEFAULT '0',
`MAX_STAGE` tinyint(2) NOT NULL DEFAULT '0',
- `PROGRESS` decimal(7,3) NOT NULL DEFAULT '0.000'
+ `PROGRESS` decimal(7,3) NOT NULL DEFAULT '0.000',
+ `MEMORY_USED` int(7) NOT NULL DEFAULT '0',
+ `EXAMINED_ROWS` int(7) NOT NULL DEFAULT '0'
) DEFAULT CHARSET=utf8
drop table t1;
create table t1 like information_schema.character_sets;
diff --git a/mysql-test/r/create_delayed.result b/mysql-test/r/create_delayed.result
new file mode 100644
index 00000000000..c36a8e60cbb
--- /dev/null
+++ b/mysql-test/r/create_delayed.result
@@ -0,0 +1,3 @@
+drop table if exists t1;
+Starting test
+# All done
diff --git a/mysql-test/r/ctype_ucs.result b/mysql-test/r/ctype_ucs.result
index d463ce87c92..cc43dd2d7dc 100644
--- a/mysql-test/r/ctype_ucs.result
+++ b/mysql-test/r/ctype_ucs.result
@@ -191,6 +191,32 @@ t1 CREATE TABLE `t1` (
`r` varchar(10) CHARACTER SET ucs2 NOT NULL DEFAULT ''
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
+#
+# Bug #51876 : crash/memory underrun when loading data with ucs2
+# and reverse() function
+#
+# Problem # 1 (original report): wrong parsing of ucs2 data
+SELECT '00' UNION SELECT '10' INTO OUTFILE 'tmpp.txt';
+CREATE TABLE t1(a INT);
+LOAD DATA INFILE 'tmpp.txt' INTO TABLE t1 CHARACTER SET ucs2
+(@b) SET a=REVERSE(@b);
+# should return 2 zeroes (as the value is truncated)
+SELECT * FROM t1;
+a
+0
+1
+DROP TABLE t1;
+# Problem # 2 : if you write and read ucs2 data to a file they're lost
+SELECT '00' UNION SELECT '10' INTO OUTFILE 'tmpp2.txt' CHARACTER SET ucs2;
+CREATE TABLE t1(a INT);
+LOAD DATA INFILE 'tmpp2.txt' INTO TABLE t1 CHARACTER SET ucs2
+(@b) SET a=REVERSE(@b);
+# should return 0 and 1 (10 reversed)
+SELECT * FROM t1;
+a
+0
+1
+DROP TABLE t1;
create table t2(f1 Char(30));
insert into t2 values ("103000"), ("22720000"), ("3401200"), ("78000");
select lpad(f1, 12, "-o-/") from t2;
diff --git a/mysql-test/r/ctype_utf16.result b/mysql-test/r/ctype_utf16.result
index f0e6ea5f1ad..2eb0f8e9ba6 100644
--- a/mysql-test/r/ctype_utf16.result
+++ b/mysql-test/r/ctype_utf16.result
@@ -1140,6 +1140,14 @@ id l
a 512
Warnings:
Warning 1260 Row 1 was cut by GROUP_CONCAT()
+SELECT id, CHAR_LENGTH(GROUP_CONCAT(body)) AS l
+FROM (SELECT 'a' AS id, REPEAT('foo bar', 100) AS body
+UNION ALL
+SELECT 'a' AS id, REPEAT('bla bla', 100) AS body) t1;
+id l
+a 512
+Warnings:
+Warning 1260 Row 1 was cut by GROUP_CONCAT()
#
# End of 5.5 tests
#
diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result
index 69e32977103..d25c454913d 100644
--- a/mysql-test/r/ctype_utf8.result
+++ b/mysql-test/r/ctype_utf8.result
@@ -5055,6 +5055,14 @@ id l
a 1024
Warnings:
Warning 1260 Row 2 was cut by GROUP_CONCAT()
+SELECT id, CHAR_LENGTH(GROUP_CONCAT(body)) AS l
+FROM (SELECT 'a' AS id, REPEAT('foo bar', 100) AS body
+UNION ALL
+SELECT 'a' AS id, REPEAT('bla bla', 100) AS body) t1;
+id l
+a 1024
+Warnings:
+Warning 1260 Row 2 was cut by GROUP_CONCAT()
#
# End of 5.5 tests
#
diff --git a/mysql-test/r/datetime_456.result b/mysql-test/r/datetime_456.result
index ba020a250b7..44351a821bc 100644
--- a/mysql-test/r/datetime_456.result
+++ b/mysql-test/r/datetime_456.result
@@ -4,5 +4,5 @@ insert t1 values (addtime('9999-12-31 23:59:59', '00:00:01')),
select * from t1;
d
NULL
-NULL
+0000-00-00 00:00:00
drop table t1;
diff --git a/mysql-test/r/derived_view.result b/mysql-test/r/derived_view.result
index ba01db4a66f..95ff464918c 100644
--- a/mysql-test/r/derived_view.result
+++ b/mysql-test/r/derived_view.result
@@ -2115,6 +2115,55 @@ a
4
drop table t1,t2;
#
+# MDEV-3873: Wrong result (extra rows) with NOT IN and
+# a subquery from a MERGE view
+#
+CREATE TABLE t1 (a INT NOT NULL) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (4),(7),(0);
+CREATE TABLE t2 (b INT NOT NULL) ENGINE=MyISAM;
+INSERT INTO t2 VALUES (1),(2);
+CREATE TABLE t3 (c INT NOT NULL) ENGINE=MyISAM;
+INSERT INTO t3 VALUES (4),(6),(3);
+CREATE TABLE t4 (d INT NOT NULL) ENGINE=MyISAM;
+INSERT INTO t4 VALUES (4),(5),(3);
+CREATE TABLE tv (e INT NOT NULL) ENGINE=MyISAM;
+INSERT INTO tv VALUES (1),(3);
+CREATE ALGORITHM=TEMPTABLE VIEW v_temptable AS SELECT * FROM tv;
+CREATE ALGORITHM=MERGE VIEW v_merge AS SELECT * FROM tv;
+SELECT * FROM t1, t2
+WHERE a NOT IN ( SELECT e FROM t3 LEFT JOIN v_temptable ON (c = e) WHERE c <> b ) AND a < b;
+a b
+SELECT * FROM t1, t2
+WHERE a NOT IN ( SELECT e FROM t3 LEFT JOIN v_merge ON (c = e) WHERE c <> b ) AND a < b;
+a b
+SELECT * FROM t1, t2
+WHERE a NOT IN ( SELECT e FROM t3 LEFT JOIN (SELECT * FROM tv) as derived ON (c = e) WHERE c <> b ) AND a < b;
+a b
+drop view v_temptable, v_merge;
+drop table t1,t2,t3,t4,tv;
+#
+# MDEV-3912: Wrong result (extra rows) with FROM subquery inside
+# ALL subquery, LEFT JOIN, derived_merge.
+# (duplicate of MDEV-3873 (above))
+#
+SET @save3912_optimizer_switch=@@optimizer_switch;
+SET optimizer_switch = 'derived_merge=on,in_to_exists=on';
+CREATE TABLE t1 (a INT) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (4),(8);
+CREATE TABLE t2 (b INT) ENGINE=MyISAM;
+INSERT INTO t2 VALUES (7),(0);
+CREATE TABLE t3 (c INT, d INT NOT NULL) ENGINE=MyISAM;
+INSERT INTO t3 VALUES (0,4),(8,6);
+SELECT * FROM t1
+WHERE a >= ALL (
+SELECT d FROM t2 LEFT JOIN ( SELECT * FROM t3 ) AS alias ON ( c = b )
+WHERE b >= a
+);
+a
+8
+set optimizer_switch=@save3912_optimizer_switch;
+drop table t1, t2, t3;
+#
# end of 5.3 tests
#
set optimizer_switch=@exit_optimizer_switch;
diff --git a/mysql-test/r/distinct.result b/mysql-test/r/distinct.result
index 75f054ecbbe..459ece978fd 100644
--- a/mysql-test/r/distinct.result
+++ b/mysql-test/r/distinct.result
@@ -847,6 +847,38 @@ time(f1)
00:00:00.000200
00:00:00.000300
drop table t1;
+create table t1(i int, g int);
+insert into t1 values (null, 1), (0, 2);
+select distinct i from t1 group by g;
+i
+NULL
+0
+drop table t1;
+create table t1(i int, g blob);
+insert into t1 values (null, 1), (0, 2);
+select distinct i from t1 group by g;
+i
+NULL
+0
+drop table t1;
+create table t1 (a int) engine=myisam;
+insert into t1 values (0),(7);
+create table t2 (b int) engine=myisam;
+insert into t2 values (7),(0),(3);
+create algorithm=temptable view v as
+select distinct (select max(a) from t1 where alias.b = a) as field1 from t2 as alias group by field1;
+select * from v;
+field1
+NULL
+0
+7
+select distinct (select max(a) from t1 where alias.b = a) as field1 from t2 as alias group by field1;
+field1
+NULL
+0
+7
+drop view v;
+drop table t1, t2;
#
# Bug #11744875: 4082: integer lengths cause truncation with distinct concat and innodb
#
diff --git a/mysql-test/r/dyncol.result b/mysql-test/r/dyncol.result
index 13543223ad8..925fb38a0f8 100644
--- a/mysql-test/r/dyncol.result
+++ b/mysql-test/r/dyncol.result
@@ -1088,7 +1088,7 @@ column_list(column_add(column_create(1, 1), 1, null))
select column_list(column_add(column_create(1, 1), 1, ""));
column_list(column_add(column_create(1, 1), 1, ""))
-1
+`1`
select hex(column_add("", 1, 1));
hex(column_add("", 1, 1))
00010001000002
@@ -1133,10 +1133,10 @@ column_exists(column_create(1, 1212 as integer, 2, 1212 as integer), 4)
# column list
select column_list(column_create(1, 1212 as integer, 2, 1212 as integer));
column_list(column_create(1, 1212 as integer, 2, 1212 as integer))
-1,2
+`1`,`2`
select column_list(column_create(1, 1212 as integer));
column_list(column_create(1, 1212 as integer))
-1
+`1`
select column_list(column_create(1, NULL as integer));
column_list(column_create(1, NULL as integer))
@@ -1218,35 +1218,35 @@ sum(column_get(str, 1 as int))
11
select id, column_list(str) from t1 where id= 5;
id column_list(str)
-5 1,2,3,10
+5 `1`,`2`,`3`,`10`
update t1 set str=column_delete(str, 3, 4, 2) where id= 5;
select id, length(str), column_list(str), column_get(str, 1 as int), column_get(str, 2 as char), column_get(str, 3 as int) from t1;
id length(str) column_list(str) column_get(str, 1 as int) column_get(str, 2 as char) column_get(str, 3 as int)
-1 12 1,2 1 a NULL
-2 12 1,2 2 a NULL
-3 12 2,3 NULL c 100
-4 16 1,2,3 5 c 100
-5 15 1,10 6 NULL NULL
-6 21 2,3,10 NULL c 100
+1 12 `1`,`2` 1 a NULL
+2 12 `1`,`2` 2 a NULL
+3 12 `2`,`3` NULL c 100
+4 16 `1`,`2`,`3` 5 c 100
+5 15 `1`,`10` 6 NULL NULL
+6 21 `2`,`3`,`10` NULL c 100
update t1 set str=column_add(str, 4, 45 as char, 2, 'c') where id= 5;
select id, length(str), column_list(str), column_get(str, 1 as int), column_get(str, 2 as char), column_get(str, 3 as int) from t1 where id = 5;
id length(str) column_list(str) column_get(str, 1 as int) column_get(str, 2 as char) column_get(str, 3 as int)
-5 26 1,2,4,10 6 c NULL
+5 26 `1`,`2`,`4`,`10` 6 c NULL
select id, length(str), column_list(str), column_exists(str, 4) from t1;
id length(str) column_list(str) column_exists(str, 4)
-1 12 1,2 0
-2 12 1,2 0
-3 12 2,3 0
-4 16 1,2,3 0
-5 26 1,2,4,10 1
-6 21 2,3,10 0
+1 12 `1`,`2` 0
+2 12 `1`,`2` 0
+3 12 `2`,`3` 0
+4 16 `1`,`2`,`3` 0
+5 26 `1`,`2`,`4`,`10` 1
+6 21 `2`,`3`,`10` 0
select sum(column_get(str, 1 as int)), column_list(str) from t1 group by 2;
sum(column_get(str, 1 as int)) column_list(str)
-3 1,2
-5 1,2,3
-6 1,2,4,10
-NULL 2,3
-NULL 2,3,10
+3 `1`,`2`
+5 `1`,`2`,`3`
+6 `1`,`2`,`4`,`10`
+NULL `2`,`3`
+NULL `2`,`3`,`10`
select id, hex(str) from t1;
id hex(str)
1 00020001000002000B020861
@@ -1282,11 +1282,11 @@ id
5
select id, column_list(str), length(str) from t1 where id=5;
id column_list(str) length(str)
-5 1,2,4,5,10 100048
+5 `1`,`2`,`4`,`5`,`10` 100048
update t1 set str=column_delete(str, 5) where id=5;
select id, column_list(str), length(str) from t1 where id=5;
id column_list(str) length(str)
-5 1,2,4,10 34
+5 `1`,`2`,`4`,`10` 34
drop table t1;
#
# LP#778905: Assertion `value->year <= 9999' failed in
@@ -1306,7 +1306,7 @@ INSERT INTO t1 SET f1 = COLUMN_CREATE( 2 , 'cde' );
SELECT HEX(COLUMN_ADD(f1, 1, 'abc')), COLUMN_LIST(f1) FROM t1;
HEX(COLUMN_ADD(f1, 1, 'abc')) COLUMN_LIST(f1)
NULL NULL
-0002000100030200230861626308636465 2
+0002000100030200230861626308636465 `2`
SELECT COLUMN_ADD(f1, 1, 'abc'), COLUMN_LIST(f1) FROM t1;
DROP TABLE t1;
#
@@ -1335,3 +1335,305 @@ hex(COLUMN_CREATE(0, COLUMN_GET(COLUMN_CREATE(0, 0.0 as decimal), 0 as decimal))
select hex(COLUMN_CREATE(0, 0.0 as decimal));
hex(COLUMN_CREATE(0, 0.0 as decimal))
000100000004
+#
+# test of symbolic names
+#
+# creation test (names)
+set names utf8;
+select hex(column_create("адын", 1212));
+hex(column_create("адын", 1212))
+040100080000000000D0B0D0B4D18BD0BD7809
+select hex(column_create("1212", 1212));
+hex(column_create("1212", 1212))
+040100040000000000313231327809
+select hex(column_create(1212, 2, "www", 3));
+hex(column_create(1212, 2, "www", 3))
+04020007000000000003001000777777313231320604
+select hex(column_create("1212", 2, "www", 3));
+hex(column_create("1212", 2, "www", 3))
+04020007000000000003001000777777313231320604
+select hex(column_create("1212", 2, 3, 3));
+hex(column_create("1212", 2, 3, 3))
+0402000500000000000100100033313231320604
+select hex(column_create("1212", 2, "адын", 1, 3, 3));
+hex(column_create("1212", 2, "адын", 1, 3, 3))
+0403000D000000000001001000050020003331323132D0B0D0B4D18BD0BD060402
+set names default;
+# fetching column test (names)
+set names utf8;
+select column_get(column_create("адын", 1212), "адын" as int);
+column_get(column_create("адын", 1212), "адын" as int)
+1212
+select column_get(column_create("1212", 2, "адын", 1, 3, 3), "адын" as int);
+column_get(column_create("1212", 2, "адын", 1, 3, 3), "адын" as int)
+1
+select column_get(column_create("1212", 2, "адын", 1, 3, 3), 1212 as int);
+column_get(column_create("1212", 2, "адын", 1, 3, 3), 1212 as int)
+2
+select column_get(column_create("1212", 2, "адын", 1, 3, 3), "3" as int);
+column_get(column_create("1212", 2, "адын", 1, 3, 3), "3" as int)
+3
+select column_get(column_create("1212", 2, "адын", 1, 3, 3), 3 as int);
+column_get(column_create("1212", 2, "адын", 1, 3, 3), 3 as int)
+3
+select column_get(column_create("1212", 2, "адын", 1, 3, 3), 4 as int);
+column_get(column_create("1212", 2, "адын", 1, 3, 3), 4 as int)
+NULL
+select column_get(column_create("1212", 2, "адын", 1, 3, 3), "4" as int);
+column_get(column_create("1212", 2, "адын", 1, 3, 3), "4" as int)
+NULL
+set names default;
+# column existance test (names)
+set names utf8;
+select column_exists(column_create("адын", 1212), "адын");
+column_exists(column_create("адын", 1212), "адын")
+1
+select column_exists(column_create("адын", 1212), "aады");
+column_exists(column_create("адын", 1212), "aады")
+0
+select column_exists(column_create("1212", 2, "адын", 1, 3, 3), "адын");
+column_exists(column_create("1212", 2, "адын", 1, 3, 3), "адын")
+1
+select column_exists(column_create("1212", 2, "адын", 1, 3, 3), 1212);
+column_exists(column_create("1212", 2, "адын", 1, 3, 3), 1212)
+1
+select column_exists(column_create("1212", 2, "адын", 1, 3, 3), "3");
+column_exists(column_create("1212", 2, "адын", 1, 3, 3), "3")
+1
+select column_exists(column_create("1212", 2, "адын", 1, 3, 3), 3);
+column_exists(column_create("1212", 2, "адын", 1, 3, 3), 3)
+1
+select column_exists(column_create("1212", 2, "адын", 1, 3, 3), 4);
+column_exists(column_create("1212", 2, "адын", 1, 3, 3), 4)
+0
+select column_exists(column_create("1212", 2, "адын", 1, 3, 3), "4");
+column_exists(column_create("1212", 2, "адын", 1, 3, 3), "4")
+0
+set names default;
+# column changing test (names)
+select hex(column_add(column_create(1, "AAA"), "b", "BBB"));
+hex(column_add(column_create(1, "AAA"), "b", "BBB"))
+0402000200000003000100430031620841414108424242
+select hex(column_add(column_create("1", "AAA"), "b", "BBB"));
+hex(column_add(column_create("1", "AAA"), "b", "BBB"))
+0402000200000003000100430031620841414108424242
+select column_get(column_add(column_create(1, "AAA"), "b", "BBB"), 1 as char);
+column_get(column_add(column_create(1, "AAA"), "b", "BBB"), 1 as char)
+AAA
+select column_get(column_add(column_create(1, "AAA"), "b", "BBB"), "b" as char);
+column_get(column_add(column_create(1, "AAA"), "b", "BBB"), "b" as char)
+BBB
+select hex(column_add(column_create("a", "AAA"), 1, "BBB"));
+hex(column_add(column_create("a", "AAA"), 1, "BBB"))
+0402000200000003000100430031610842424208414141
+select hex(column_add(column_create("a", "AAA"), "1", "BBB"));
+hex(column_add(column_create("a", "AAA"), "1", "BBB"))
+0402000200000003000100430031610842424208414141
+select hex(column_add(column_create("a", 1212 as integer), "b", "1212" as integer));
+hex(column_add(column_create("a", 1212 as integer), "b", "1212" as integer))
+04020002000000000001002000616278097809
+select hex(column_add(column_create("a", 1212 as integer), "a", "1212" as integer));
+hex(column_add(column_create("a", 1212 as integer), "a", "1212" as integer))
+040100010000000000617809
+select hex(column_add(column_create("a", 1212 as integer), "a", NULL as integer));
+hex(column_add(column_create("a", 1212 as integer), "a", NULL as integer))
+0400000000
+select hex(column_add(column_create("a", 1212 as integer), "b", NULL as integer));
+hex(column_add(column_create("a", 1212 as integer), "b", NULL as integer))
+040100010000000000617809
+select hex(column_add(column_create("a", 1212 as integer), "b", 1212 as integer, "a", 11 as integer));
+hex(column_add(column_create("a", 1212 as integer), "b", 1212 as integer, "a", 11 as integer))
+040200020000000000010010006162167809
+select column_get(column_add(column_create("a", 1212 as integer), "b", 1212 as integer, "a", 11 as integer), "a" as integer);
+column_get(column_add(column_create("a", 1212 as integer), "b", 1212 as integer, "a", 11 as integer), "a" as integer)
+11
+select column_get(column_add(column_create("a", 1212 as integer), "b", 1212 as integer, "a", 11 as integer), "b" as integer);
+column_get(column_add(column_create("a", 1212 as integer), "b", 1212 as integer, "a", 11 as integer), "b" as integer)
+1212
+select hex(column_add(column_create("a", 1212 as integer), "a", 1212 as integer, "b", 11 as integer));
+hex(column_add(column_create("a", 1212 as integer), "a", 1212 as integer, "b", 11 as integer))
+040200020000000000010020006162780916
+select hex(column_add(column_create("a", NULL as integer), "a", 1212 as integer, "b", 11 as integer));
+hex(column_add(column_create("a", NULL as integer), "a", 1212 as integer, "b", 11 as integer))
+040200020000000000010020006162780916
+select hex(column_add(column_create("a", 1212 as integer, "b", 1212 as integer), "a", 11 as integer));
+hex(column_add(column_create("a", 1212 as integer, "b", 1212 as integer), "a", 11 as integer))
+040200020000000000010010006162167809
+select hex(column_add(column_create("a", 1), "a", null));
+hex(column_add(column_create("a", 1), "a", null))
+0400000000
+select column_list(column_add(column_create("a", 1), "a", null));
+column_list(column_add(column_create("a", 1), "a", null))
+
+select column_list(column_add(column_create("a", 1), "a", ""));
+column_list(column_add(column_create("a", 1), "a", ""))
+`a`
+select hex(column_add("", "a", 1));
+hex(column_add("", "a", 1))
+0401000100000000006102
+# column delete (names)
+select hex(column_delete(column_create("a", 1212 as integer, "b", 1212 as integer), "a"));
+hex(column_delete(column_create("a", 1212 as integer, "b", 1212 as integer), "a"))
+040100010000000000627809
+select hex(column_delete(column_create("a", 1 as integer, "b", 2 as integer, "c", 3 as integer), "b"));
+hex(column_delete(column_create("a", 1 as integer, "b", 2 as integer, "c", 3 as integer), "b"))
+0402000200000000000100100061630206
+select hex(column_create("a", 1 as integer, "b", 2 as integer, "c", 3 as integer));
+hex(column_create("a", 1 as integer, "b", 2 as integer, "c", 3 as integer))
+0403000300000000000100100002002000616263020406
+select hex(column_delete(column_create("a", 1 as integer, "b", 2 as integer, "c", 3 as integer), "c"));
+hex(column_delete(column_create("a", 1 as integer, "b", 2 as integer, "c", 3 as integer), "c"))
+0402000200000000000100100061620204
+select hex(column_delete(column_create("a", 1 as integer, "b", 2 as integer, "c", 3 as integer), "d"));
+hex(column_delete(column_create("a", 1 as integer, "b", 2 as integer, "c", 3 as integer), "d"))
+0403000300000000000100100002002000616263020406
+select hex(column_delete(column_create("a", 1 as integer, "b", 2 as integer, "c", 3 as integer), "b", "a"));
+hex(column_delete(column_create("a", 1 as integer, "b", 2 as integer, "c", 3 as integer), "b", "a"))
+0401000100000000006306
+select hex(column_delete(column_create("a", 1 as integer, "b", 2 as integer, "c", 3 as integer), "b", "c"));
+hex(column_delete(column_create("a", 1 as integer, "b", 2 as integer, "c", 3 as integer), "b", "c"))
+0401000100000000006102
+select hex(column_delete(column_create("a", 1 as integer, "b", 2 as integer, "c", 3 as integer), "a", "b", "c"));
+hex(column_delete(column_create("a", 1 as integer, "b", 2 as integer, "c", 3 as integer), "a", "b", "c"))
+0400000000
+select hex(column_delete(column_create("a", 1 as integer, "b", 2 as integer, "c", 3 as integer), "a", "b", "c", "e"));
+hex(column_delete(column_create("a", 1 as integer, "b", 2 as integer, "c", 3 as integer), "a", "b", "c", "e"))
+0400000000
+select hex(column_delete(column_create("a", 1), "a"));
+hex(column_delete(column_create("a", 1), "a"))
+0400000000
+select hex(column_delete("", "a"));
+hex(column_delete("", "a"))
+
+#
+# MDEV-458 DNAMES: Server crashes on using an unquoted string
+# as a dynamic column name
+#
+select COLUMN_CREATE(color, "black");
+ERROR 42S22: Unknown column 'color' in 'field list'
+#
+# MDEV-489 Assertion `offset < 0x1f' failed in
+# type_and_offset_store on COLUMN_ADD
+#
+CREATE TABLE t1 (f1 tinyblob);
+INSERT INTO t1 VALUES (COLUMN_CREATE('col1', REPEAT('a',30)));
+select column_check(f1) from t1;
+column_check(f1)
+1
+UPDATE t1 SET f1 = COLUMN_ADD( f1, REPEAT('b',211), 'val2' );
+Warnings:
+Warning 1265 Data truncated for column 'f1' at row 1
+select column_check(f1) from t1;
+column_check(f1)
+0
+UPDATE t1 SET f1 = COLUMN_ADD( f1, REPEAT('c',211), 'val3' );
+Warnings:
+Warning 1265 Data truncated for column 'f1' at row 1
+select column_check(f1) from t1;
+column_check(f1)
+0
+drop table t1;
+#
+# MDEV-490/MDEV-491 null as arguments
+#
+SELECT COLUMN_GET( COLUMN_CREATE( 'col', 'val' ), NULL AS CHAR );
+COLUMN_GET( COLUMN_CREATE( 'col', 'val' ), NULL AS CHAR )
+NULL
+SELECT COLUMN_GET( NULL, 'col' as char );
+COLUMN_GET( NULL, 'col' as char )
+NULL
+SELECT COLUMN_EXISTS( COLUMN_CREATE( 'col', 'val' ), NULL);
+COLUMN_EXISTS( COLUMN_CREATE( 'col', 'val' ), NULL)
+NULL
+SELECT COLUMN_EXISTS( NULL, 'col');
+COLUMN_EXISTS( NULL, 'col')
+NULL
+SELECT COLUMN_CREATE( NULL, 'val' );
+COLUMN_CREATE( NULL, 'val' )
+NULL
+SELECT COLUMN_ADD( NULL, 'val', 'col');
+COLUMN_ADD( NULL, 'val', 'col')
+NULL
+#
+# MDEV-488: Assertion `column_name->length < 255' failed on a
+# column name with length 255 (precisely)
+#
+SELECT hex(COLUMN_CREATE(REPEAT('a',255),1));
+hex(COLUMN_CREATE(REPEAT('a',255),1))
+040100FF000000000061616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616102
+SELECT hex(COLUMN_CREATE(REPEAT('a',65536),1));
+ERROR 22007: Illegal value used as argument of dynamic column function
+#
+# JSON conversion
+#
+select column_json(column_create("int", -1212 as int, "uint", 12334 as unsigned int, "decimal", "23.344" as decimal, "double", 1.23444e50 as double, "string", 'gdgd\\dhdjh"dhdhd' as char, "time", "0:45:49.000001" AS time, "datetime", "2011-04-05 0:45:49.000001" AS datetime, "date", "2011-04-05" AS date));
+column_json(column_create("int", -1212 as int, "uint", 12334 as unsigned int, "decimal", "23.344" as decimal, "double", 1.23444e50 as double, "string", 'gdgd\\dhdjh"dhdhd' as char, "time", "0:45:49.000001" AS time, "datetime", "2011-04-05 0:45:49.000001"
+{"int":-1212,"date":"2011-04-05","time":"00:45:49.000001","uint":12334,"double":"1.2e50","string":"gdgd\\dhdjh\"dhdhd","decimal":23.344,"datetime":"2011-04-05 00:45:49.000001"}
+select column_json(column_create(1, -1212 as int, 2, 12334 as unsigned int, 3, "23.344" as decimal, 4, 1.23444e50 as double, 5, 'gdgd\\dhdjh"dhdhd' as char, 6, "0:45:49.000001" AS time, 7, "2011-04-05 0:45:49.000001" AS datetime, 8, "2011-04-05" AS date));
+column_json(column_create(1, -1212 as int, 2, 12334 as unsigned int, 3, "23.344" as decimal, 4, 1.23444e50 as double, 5, 'gdgd\\dhdjh"dhdhd' as char, 6, "0:45:49.000001" AS time, 7, "2011-04-05 0:45:49.000001" AS datetime, 8, "2011-04-05" AS date))
+{"1":-1212,"2":12334,"3":23.344,"4":"1.2e50","5":"gdgd\\dhdjh\"dhdhd","6":"00:45:49.000001","7":"2011-04-05 00:45:49.000001","8":"2011-04-05"}
+#
+# CHECK test
+#
+SELECT COLUMN_CHECK(COLUMN_CREATE(1,'a'));
+COLUMN_CHECK(COLUMN_CREATE(1,'a'))
+1
+SELECT COLUMN_CHECK('abracadabra');
+COLUMN_CHECK('abracadabra')
+0
+SELECT COLUMN_CHECK('');
+COLUMN_CHECK('')
+1
+SELECT COLUMN_CHECK(NULL);
+COLUMN_CHECK(NULL)
+NULL
+#
+# escaping check
+#
+select column_json(column_create("string", "'\"/\\`.,whatever")),hex(column_create("string", "'\"/\\`.,whatever"));
+column_json(column_create("string", "'\"/\\`.,whatever")) hex(column_create("string", "'\"/\\`.,whatever"))
+{"string":"'\"/\\`.,whatever"} 040100060000000300737472696E670827222F5C602E2C7768617465766572
+#
+# embedding test
+#
+select column_json(column_create("val", "val", "emb", column_create("val2", "val2")));
+column_json(column_create("val", "val", "emb", column_create("val2", "val2")))
+{"emb":{"val2":"val2"},"val":"val"}
+select column_json(column_create(1, "val", 2, column_create(3, "val2")));
+column_json(column_create(1, "val", 2, column_create(3, "val2")))
+{"1":"val","2":{"3":"val2"}}
+#
+# Time encoding
+#
+select hex(column_create("t", "800:46:06.23434" AS time)) as hex,
+column_json(column_create("t", "800:46:06.23434" AS time)) as json;
+hex json
+04010001000000070074649363B82003 {"t":"800:46:06.234340"}
+select hex(column_create(1, "800:46:06.23434" AS time)) as hex,
+column_json(column_create(1, "800:46:06.23434" AS time)) as json;
+hex json
+000100010007649363B82003 {"1":"800:46:06.234340"}
+select hex(column_create("t", "800:46:06" AS time)) as hex,
+column_json(column_create("t", "800:46:06" AS time)) as json;
+hex json
+04010001000000070074860B32 {"t":"800:46:06"}
+select hex(column_create(1, "800:46:06" AS time)) as hex,
+column_json(column_create(1, "800:46:06" AS time)) as json;
+hex json
+000100010007000060B82003 {"1":"800:46:06"}
+select hex(column_create("t", "2012-12-21 10:46:06.23434" AS datetime)) as hex,
+column_json(column_create("t", "2012-12-21 10:46:06.23434" AS datetime)) as json;
+hex json
+0401000100000005007495B90F649363B80A00 {"t":"2012-12-21 10:46:06.234340"}
+select hex(column_create(1, "2012-12-21 10:46:06.23434" AS datetime)) as hex,
+column_json(column_create(1, "2012-12-21 10:46:06.23434" AS datetime)) as json;
+hex json
+00010001000595B90F649363B80A00 {"1":"2012-12-21 10:46:06.234340"}
+select hex(column_create("t", "2012-12-21 10:46:06" AS datetime)) as hex,
+column_json(column_create("t", "2012-12-21 10:46:06" AS datetime)) as json;
+hex json
+0401000100000005007495B90F86AB00 {"t":"2012-12-21 10:46:06"}
+select hex(column_create(1, "2012-12-21 10:46:06" AS datetime)) as hex,
+column_json(column_create(1, "2012-12-21 10:46:06" AS datetime)) as json;
+hex json
+00010001000595B90F000060B80A00 {"1":"2012-12-21 10:46:06"}
diff --git a/mysql-test/r/failed_auth_3909.result b/mysql-test/r/failed_auth_3909.result
new file mode 100644
index 00000000000..0a757e2cee2
--- /dev/null
+++ b/mysql-test/r/failed_auth_3909.result
@@ -0,0 +1,21 @@
+optimize table mysql.user;
+Table Op Msg_type Msg_text
+mysql.user optimize status OK
+insert mysql.user (user,plugin) values ('foo','bar'),('bar','bar'),('baz','bar');
+Warnings:
+Warning 1364 Field 'ssl_cipher' doesn't have a default value
+Warning 1364 Field 'x509_issuer' doesn't have a default value
+Warning 1364 Field 'x509_subject' doesn't have a default value
+Warning 1364 Field 'authentication_string' doesn't have a default value
+flush privileges;
+connect(localhost,u1,,test,MASTER_PORT,MASTER_SOCKET);
+ERROR HY000: Plugin 'bar' is not loaded
+connect(localhost,u2,,test,MASTER_PORT,MASTER_SOCKET);
+ERROR 28000: Access denied for user 'u2'@'localhost' (using password: NO)
+connect(localhost,u2,password,test,MASTER_PORT,MASTER_SOCKET);
+ERROR 28000: Access denied for user 'u2'@'localhost' (using password: YES)
+ERROR HY000: Plugin 'bar' is not loaded
+ERROR 28000: Access denied for user 'u2'@'localhost' (using password: NO)
+ERROR 28000: Access denied for user 'u2'@'localhost' (using password: YES)
+delete from mysql.user where plugin = 'bar';
+flush privileges;
diff --git a/mysql-test/r/func_gconcat.result b/mysql-test/r/func_gconcat.result
index bc72e04b5a0..b60deae1c80 100644
--- a/mysql-test/r/func_gconcat.result
+++ b/mysql-test/r/func_gconcat.result
@@ -1086,3 +1086,8 @@ ERROR HY000: Row 3 was cut by GROUP_CONCAT()
SET group_concat_max_len = DEFAULT;
SET @@sql_mode = @old_sql_mode;
DROP TABLE t1, t2;
+create table t1 (a char(1) character set utf8);
+insert into t1 values ('a'),('b');
+select 1 from t1 where a in (select group_concat(a) from t1);
+1
+drop table t1;
diff --git a/mysql-test/r/func_misc.result b/mysql-test/r/func_misc.result
index 514994ed27c..55b0f9d3c57 100644
--- a/mysql-test/r/func_misc.result
+++ b/mysql-test/r/func_misc.result
@@ -305,6 +305,39 @@ SELECT 1 from t1 HAVING NAME_CONST('', a);
ERROR HY000: Incorrect arguments to NAME_CONST
DROP TABLE t1;
#
+# Test or correct maybe_null of last_value
+#
+CREATE TABLE t1 (a char(2) not null );
+INSERT INTO t1 VALUES (4),(7),(1);
+set @optimizer_switch_save= @@optimizer_switch;
+set optimizer_switch='materialization=off';
+CREATE TABLE tv (e char(2) not null ) engine=mysql;
+Warnings:
+Warning 1286 Unknown storage engine 'mysql'
+Warning 1266 Using storage engine MyISAM for table 'tv'
+INSERT INTO tv VALUES (1);
+CREATE ALGORITHM=MERGE VIEW v_merge AS SELECT * FROM tv;
+CREATE ALGORITHM=MERGE VIEW vm AS SELECT * FROM tv;
+explain extended
+select a from t1 left join v_merge on (a=e) where last_value(NULL,e) not in (select last_value(NULL,e) from vm);
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00
+1 PRIMARY tv ALL NULL NULL NULL NULL 1 100.00 Using where; Using join buffer (flat, BNL join)
+2 DEPENDENT SUBQUERY tv system NULL NULL NULL NULL 1 100.00
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` left join (`test`.`tv`) on((`test`.`tv`.`e` = `test`.`t1`.`a`)) where (not(<expr_cache><last_value(NULL,`test`.`tv`.`e`)>(<in_optimizer>(last_value(NULL,`test`.`tv`.`e`),<exists>(select last_value(NULL,'1') from dual where trigcond((<cache>(last_value(NULL,`test`.`tv`.`e`)) = last_value(NULL,'1'))))))))
+explain extended
+select a from t1 left join v_merge on (a=e) where e not in (select last_value(NULL,e) from vm);
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00
+1 PRIMARY tv ALL NULL NULL NULL NULL 1 100.00 Using where; Using join buffer (flat, BNL join)
+2 DEPENDENT SUBQUERY tv system NULL NULL NULL NULL 1 100.00
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` left join (`test`.`tv`) on((`test`.`tv`.`e` = `test`.`t1`.`a`)) where (not(<expr_cache><`test`.`tv`.`e`>(<in_optimizer>(`test`.`tv`.`e`,<exists>(select last_value(NULL,'1') from dual where trigcond((<cache>(`test`.`tv`.`e`) = last_value(NULL,'1'))))))))
+set optimizer_switch=@optimizer_switch_save;
+drop view v_merge, vm;
+drop table t1,tv;
+#
# End of 5.5 tests
#
#
diff --git a/mysql-test/r/func_time.result b/mysql-test/r/func_time.result
index 98854db4812..dd4b73b0b05 100644
--- a/mysql-test/r/func_time.result
+++ b/mysql-test/r/func_time.result
@@ -1423,7 +1423,7 @@ MAKEDATE(11111111,1)
NULL
SELECT WEEK(DATE_ADD(FROM_DAYS(1),INTERVAL 1 MONTH), 1);
WEEK(DATE_ADD(FROM_DAYS(1),INTERVAL 1 MONTH), 1)
-NULL
+0
#
# Bug#12584302 AFTER FIX FOR #12403504: ASSERTION FAILED: DELSUM+(INT) Y/4-TEMP > 0,
#
diff --git a/mysql-test/r/gis2.result b/mysql-test/r/gis2.result
new file mode 100644
index 00000000000..214431e1d2d
--- /dev/null
+++ b/mysql-test/r/gis2.result
@@ -0,0 +1,14 @@
+CREATE TABLE t1 (
+id INT UNSIGNED NOT NULL AUTO_INCREMENT,
+point_data POINT NOT NULL,
+PRIMARY KEY (id),
+KEY idx_point_data(point_data)
+) ENGINE=MyISAM;
+INSERT t1 (point_data) VALUES
+(GeomFromText('Point(37.0248492 23.8512726)')),
+(GeomFromText('Point(38.0248492 23.8512726)'));
+SELECT id FROM t1
+WHERE ST_Contains(point_data, GeomFromText('Point(38.0248492 23.8512726)'));
+id
+2
+DROP TABLE t1;
diff --git a/mysql-test/r/grant_lowercase.result b/mysql-test/r/grant_lowercase.result
new file mode 100644
index 00000000000..489f990daf1
--- /dev/null
+++ b/mysql-test/r/grant_lowercase.result
@@ -0,0 +1,20 @@
+grant file on *.* to user1@localhost with grant option;
+grant select on `a%`.* to user1@localhost with grant option;
+grant file on aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.* to 'user'@'%' identified by 'secret';
+ERROR 42000: Incorrect database name 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
+drop user user1@localhost;
+call mtr.add_suppression("Incorrect database name");
+alter table mysql.host modify Db varchar(200);
+alter table mysql.db modify Db varchar(200);
+insert mysql.host set db=concat('=>', repeat(_utf8 'й', 200));
+Warnings:
+Warning 1265 Data truncated for column 'Db' at row 1
+insert mysql.db set db=concat('=>', repeat(_utf8 'й', 200));
+Warnings:
+Warning 1265 Data truncated for column 'Db' at row 1
+flush privileges;
+delete from mysql.host where db like '=>%';
+delete from mysql.db where db like '=>%';
+alter table mysql.host modify Db char(64);
+alter table mysql.db modify Db char(64);
+flush privileges;
diff --git a/mysql-test/r/group_by.result b/mysql-test/r/group_by.result
index 1983d1cc784..085003c7790 100644
--- a/mysql-test/r/group_by.result
+++ b/mysql-test/r/group_by.result
@@ -2130,6 +2130,47 @@ the value below *must* be 1
show status like 'Created_tmp_disk_tables';
Variable_name Value
Created_tmp_disk_tables 1
+#
+# Bug #1002146: Unneeded filesort if usage of join buffer is not allowed
+# (bug mdev-645)
+#
+CREATE TABLE t1 (pk int PRIMARY KEY, a int, INDEX idx(a));
+INSERT INTO t1 VALUES (3,2), (2,3), (5,3), (6,4);
+CREATE TABLE t2 (pk int PRIMARY KEY, a int, INDEX idx(a));
+INSERT INTO t2 VALUES (9,0), (10,3), (6,4), (1,6), (3,100), (5,200);
+set join_cache_level=0;
+EXPLAIN
+SELECT t2.a FROM t2 STRAIGHT_JOIN t1 ON t2.a <> 0 WHERE t2.a <> 6
+GROUP BY t2.a;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 range idx idx 5 NULL 5 Using where; Using index
+1 SIMPLE t1 index NULL PRIMARY 4 NULL 4 Using index
+SELECT t2.a FROM t2 STRAIGHT_JOIN t1 ON t2.a <> 0 WHERE t2.a <> 6
+GROUP BY t2.a;
+a
+3
+4
+100
+200
+set join_cache_level=default;
+set @save_optimizer_switch=@@optimizer_switch;
+set optimizer_switch='outer_join_with_cache=off';
+EXPLAIN
+SELECT t2.a FROM t2 LEFT JOIN t1 ON t2.a <> 0 WHERE t2.a <> 6
+GROUP BY t2.a;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 range idx idx 5 NULL 5 Using where; Using index
+1 SIMPLE t1 index NULL PRIMARY 4 NULL 4 Using where; Using index
+SELECT t2.a FROM t2 LEFT JOIN t1 ON t2.a <> 0 WHERE t2.a <> 6
+GROUP BY t2.a;
+a
+0
+3
+4
+100
+200
+set optimizer_switch=@save_optimizer_switch;
+DROP TABLE t1,t2;
# End of 5.3 tests
#
# Bug#49771: Incorrect MIN (date) when minimum value is 0000-00-00
@@ -2161,6 +2202,51 @@ f1 MIN(f2) MAX(f2)
DROP TABLE t1;
#End of test#49771
#
+# Test of bug in GROUP_CONCAT with ROLLUP
+#
+CREATE TABLE t1 ( b VARCHAR(8) NOT NULL, a INT NOT NULL ) ENGINE=MyISAM;
+INSERT INTO t1 (a,b) VALUES (1,'c'),(2,'v');
+CREATE TABLE t2 ( c VARCHAR(8), d INT, KEY (c, d) ) ENGINE=MyISAM;
+INSERT INTO t2 VALUES ('v',6),('c',4),('v',3);
+SELECT b, GROUP_CONCAT( a, b ORDER BY a, b )
+FROM t1 JOIN t2 ON c = b GROUP BY b;
+b GROUP_CONCAT( a, b ORDER BY a, b )
+c 1c
+v 2v,2v
+SELECT b, GROUP_CONCAT( a, b ORDER BY a, b )
+FROM t1 JOIN t2 ON c = b GROUP BY b WITH ROLLUP;
+b GROUP_CONCAT( a, b ORDER BY a, b )
+c 1c
+v 2v,2v
+NULL 1c,2v,2v
+DROP TABLE t1,t2;
+#
+# Test of MDEV-4002
+#
+CREATE TABLE t1 (
+pk INT NOT NULL PRIMARY KEY,
+d1 DOUBLE,
+d2 DOUBLE,
+i INT NOT NULL DEFAULT '0',
+KEY (i)
+) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1,1.0,1.1,1),(2,2.0,2.2,2);
+PREPARE stmt FROM "
+SELECT DISTINCT i, GROUP_CONCAT( d1, d2 ORDER BY d1, d2 )
+FROM t1 a1 NATURAL JOIN t1 a2 GROUP BY i WITH ROLLUP
+";
+EXECUTE stmt;
+i GROUP_CONCAT( d1, d2 ORDER BY d1, d2 )
+1 11.1
+2 22.2
+NULL 11.1,22.2
+EXECUTE stmt;
+i GROUP_CONCAT( d1, d2 ORDER BY d1, d2 )
+1 11.1
+2 22.2
+NULL 11.1,22.2
+DROP TABLE t1;
+#
# Bug #58782
# Missing rows with SELECT .. WHERE .. IN subquery
# with full GROUP BY and no aggr
diff --git a/mysql-test/r/group_by_innodb.result b/mysql-test/r/group_by_innodb.result
new file mode 100644
index 00000000000..d165834cbe3
--- /dev/null
+++ b/mysql-test/r/group_by_innodb.result
@@ -0,0 +1,30 @@
+#
+# MDEV-3992 Server crash or valgrind errors in test_if_skip_sort_order/test_if_cheaper_ordering
+# on GROUP BY with indexes on InnoDB table
+#
+CREATE TABLE t1 (
+pk INT PRIMARY KEY,
+a VARCHAR(1) NOT NULL,
+KEY (pk)
+) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1,'a'),(2,'b');
+EXPLAIN
+SELECT COUNT(*), pk field1, pk AS field2
+FROM t1 WHERE a = 'r' OR pk = 183
+GROUP BY field1, field2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index PRIMARY,pk pk 4 NULL 2 Using where
+SELECT COUNT(*), pk field1, pk AS field2
+FROM t1 WHERE a = 'r' OR pk = 183
+GROUP BY field1, field2;
+COUNT(*) field1 field2
+EXPLAIN
+SELECT COUNT(*), pk field1 FROM t1
+WHERE a = 'r' OR pk = 183 GROUP BY field1, field1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index PRIMARY,pk pk 4 NULL 2 Using where
+SELECT COUNT(*), pk field1 FROM t1
+WHERE a = 'r' OR pk = 183 GROUP BY field1, field1;
+COUNT(*) field1
+drop table t1;
+End of 5.5 tests
diff --git a/mysql-test/r/group_min_max.result b/mysql-test/r/group_min_max.result
index ce0793b70a6..d1faec7f758 100644
--- a/mysql-test/r/group_min_max.result
+++ b/mysql-test/r/group_min_max.result
@@ -2933,6 +2933,13 @@ ORDER BY min_a;
min_a
NULL
DROP TABLE t1;
+create table t1 (a int, b varchar(1), key(b,a)) engine=myisam;
+insert t1 values (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'),(6,'f'),(7,'g'),(8,'h'),(null,'i');
+select min(a), b from t1 where a=7 or b='z' group by b;
+min(a) b
+7 g
+flush tables;
+drop table t1;
#
# LP BUG#888456 Wrong result with DISTINCT , ANY , subquery_cache=off , NOT NULL
#
diff --git a/mysql-test/r/handlersocket.result b/mysql-test/r/handlersocket.result
index a415b12f92d..9e5d273cbb6 100644
--- a/mysql-test/r/handlersocket.result
+++ b/mysql-test/r/handlersocket.result
@@ -5,7 +5,7 @@ plugin_version 1.0
plugin_status ACTIVE
plugin_type DAEMON
plugin_library handlersocket.so
-plugin_library_version 1.3
+plugin_library_version 1.4
plugin_author higuchi dot akira at dena dot jp
plugin_description Direct access into InnoDB
plugin_license BSD
diff --git a/mysql-test/r/information_schema2.result b/mysql-test/r/information_schema2.result
new file mode 100644
index 00000000000..60a20944839
--- /dev/null
+++ b/mysql-test/r/information_schema2.result
@@ -0,0 +1,8 @@
+select variable_name from information_schema.session_status where variable_name =
+(select variable_name from information_schema.session_status where variable_name = 'uptime');
+variable_name
+UPTIME
+select variable_name from information_schema.session_variables where variable_name =
+(select variable_name from information_schema.session_variables where variable_name = 'basedir');
+variable_name
+BASEDIR
diff --git a/mysql-test/r/loaddata.result b/mysql-test/r/loaddata.result
index c4c8216c14a..932c1c76027 100644
--- a/mysql-test/r/loaddata.result
+++ b/mysql-test/r/loaddata.result
@@ -504,35 +504,6 @@ CREATE TABLE t1 (id INT NOT NULL);
LOAD DATA LOCAL INFILE 'tb.txt' INTO TABLE t1;
DROP TABLE t1;
#
-# Bug #51876 : crash/memory underrun when loading data with ucs2
-# and reverse() function
-#
-# Problem # 1 (original report): wrong parsing of ucs2 data
-SELECT '00' UNION SELECT '10' INTO OUTFILE 'tmpp.txt';
-CREATE TABLE t1(a INT);
-LOAD DATA INFILE 'tmpp.txt' INTO TABLE t1 CHARACTER SET ucs2
-(@b) SET a=REVERSE(@b);
-Warnings:
-Warning 1366 Incorrect integer value: '?' for column 'a' at row 1
-Warning 1366 Incorrect integer value: '?' for column 'a' at row 2
-# should return 2 zeroes (as the value is truncated)
-SELECT * FROM t1;
-a
-0
-0
-DROP TABLE t1;
-# Problem # 2 : if you write and read ucs2 data to a file they're lost
-SELECT '00' UNION SELECT '10' INTO OUTFILE 'tmpp2.txt' CHARACTER SET ucs2;
-CREATE TABLE t1(a INT);
-LOAD DATA INFILE 'tmpp2.txt' INTO TABLE t1 CHARACTER SET ucs2
-(@b) SET a=REVERSE(@b);
-# should return 0 and 1 (10 reversed)
-SELECT * FROM t1;
-a
-0
-1
-DROP TABLE t1;
-#
# Bug#11765139 58069: LOAD DATA INFILE: VALGRIND REPORTS INVALID MEMORY READS AND WRITES WITH U
#
CREATE TABLE t1(f1 INT);
diff --git a/mysql-test/r/mysql.result b/mysql-test/r/mysql.result
index 3fb190bf963..e0670f7d643 100644
--- a/mysql-test/r/mysql.result
+++ b/mysql-test/r/mysql.result
@@ -509,5 +509,9 @@ SHOW TABLES IN connected_db;
Tables_in_connected_db
table_in_connected_db
DROP DATABASE connected_db;
+create database `aa``bb````cc`;
+DATABASE()
+aa`bb``cc
+drop database `aa``bb````cc`;
End of tests
diff --git a/mysql-test/r/mysqltest.result b/mysql-test/r/mysqltest.result
index d08ffd96a04..811861a6d93 100644
--- a/mysql-test/r/mysqltest.result
+++ b/mysql-test/r/mysqltest.result
@@ -935,9 +935,9 @@ a int(11) YES NULL
b varchar(255) YES NULL
c datetime YES NULL
drop table t1;
-mysqltest: At line 1: change user failed: Unknown database 'inexistent'
-mysqltest: At line 1: change user failed: Access denied for user 'inexistent'@'localhost' (using password: NO)
-mysqltest: At line 1: change user failed: Access denied for user 'root'@'localhost' (using password: YES)
+mysqltest: At line 1: query 'change_user root,,inexistent' failed: 1049: Unknown database 'inexistent'
+mysqltest: At line 1: query 'change_user inexistent,,test' failed: 1045: Access denied for user 'inexistent'@'localhost' (using password: NO)
+mysqltest: At line 1: query 'change_user root,inexistent,test' failed: 1045: Access denied for user 'root'@'localhost' (using password: YES)
REPLACED_FILE1.txt
file1.txt
file2.txt
diff --git a/mysql-test/r/plugin.result b/mysql-test/r/plugin.result
index b5addf16147..62864d0f16d 100644
--- a/mysql-test/r/plugin.result
+++ b/mysql-test/r/plugin.result
@@ -15,7 +15,7 @@ PLUGIN_STATUS ACTIVE
PLUGIN_TYPE STORAGE ENGINE
PLUGIN_TYPE_VERSION #
PLUGIN_LIBRARY ha_example.so
-PLUGIN_LIBRARY_VERSION 1.3
+PLUGIN_LIBRARY_VERSION 1.4
PLUGIN_AUTHOR Brian Aker, MySQL AB
PLUGIN_DESCRIPTION Example storage engine
PLUGIN_LICENSE GPL
@@ -28,7 +28,7 @@ PLUGIN_STATUS ACTIVE
PLUGIN_TYPE DAEMON
PLUGIN_TYPE_VERSION #
PLUGIN_LIBRARY ha_example.so
-PLUGIN_LIBRARY_VERSION 1.3
+PLUGIN_LIBRARY_VERSION 1.4
PLUGIN_AUTHOR Sergei Golubchik
PLUGIN_DESCRIPTION Unusable Daemon
PLUGIN_LICENSE GPL
@@ -57,7 +57,7 @@ PLUGIN_STATUS DELETED
PLUGIN_TYPE STORAGE ENGINE
PLUGIN_TYPE_VERSION #
PLUGIN_LIBRARY ha_example.so
-PLUGIN_LIBRARY_VERSION 1.3
+PLUGIN_LIBRARY_VERSION 1.4
PLUGIN_AUTHOR Brian Aker, MySQL AB
PLUGIN_DESCRIPTION Example storage engine
PLUGIN_LICENSE GPL
@@ -69,6 +69,8 @@ UNINSTALL PLUGIN EXAMPLE;
ERROR 42000: PLUGIN EXAMPLE does not exist
UNINSTALL PLUGIN non_exist;
ERROR 42000: PLUGIN non_exist does not exist
+UNINSTALL SONAME 'non_exist';
+ERROR 42000: SONAME non_exist.so does not exist
#
# Bug#32034: check_func_enum() does not check correct values but set it
# to impossible int val
diff --git a/mysql-test/r/plugin_auth.result b/mysql-test/r/plugin_auth.result
index de523b78625..f8ebf65c0c5 100644
--- a/mysql-test/r/plugin_auth.result
+++ b/mysql-test/r/plugin_auth.result
@@ -121,17 +121,20 @@ ERROR 28000: Access denied for user 'grant_plug_dest'@'localhost'
this should fail : not the same user
GRANT PROXY ON grant_plug TO grant_plug_dest;
ERROR 28000: Access denied for user 'grant_plug_dest'@'localhost'
-this should fail : same user, but on a different host
+This is a valid grant
GRANT PROXY ON grant_plug_dest TO grant_plug;
-ERROR 28000: Access denied for user 'grant_plug_dest'@'localhost'
-this should work : same user
-GRANT PROXY ON grant_plug_dest@localhost TO grant_plug_dest2;
-REVOKE PROXY ON grant_plug_dest@localhost FROM grant_plug_dest2;
+REVOKE PROXY ON grant_plug_dest FROM grant_plug;
this should work : same user
+GRANT PROXY ON grant_plug_dest TO grant_plug_dest2;
+REVOKE PROXY ON grant_plug_dest FROM grant_plug_dest2;
+this should fail : not the same user
GRANT PROXY ON grant_plug_dest@localhost TO grant_plug WITH GRANT OPTION;
+ERROR 28000: Access denied for user 'grant_plug_dest'@'localhost'
+this should fail : not the same user
REVOKE PROXY ON grant_plug_dest@localhost FROM grant_plug;
+ERROR 28000: Access denied for user 'grant_plug_dest'@'localhost'
this should fail : can't create users
-GRANT PROXY ON grant_plug_dest@localhost TO grant_plug@localhost;
+GRANT PROXY ON grant_plug_dest TO grant_plug@localhost;
ERROR 42000: You are not allowed to create a user with GRANT
in default connection
# test what root can grant
@@ -149,12 +152,12 @@ GRANT PROXY ON future_user TO grant_plug;
in default connection
SHOW GRANTS FOR grant_plug;
Grants for grant_plug@%
-GRANT ALL PRIVILEGES ON *.* TO 'grant_plug'@'%' IDENTIFIED VIA test_plugin_server USING 'grant_plug_dest' WITH GRANT OPTION
+GRANT ALL PRIVILEGES ON *.* TO 'grant_plug'@'%' IDENTIFIED VIA test_plugin_server USING 'grant_plug_dest'
GRANT PROXY ON 'future_user'@'%' TO 'grant_plug'@'%'
REVOKE PROXY ON future_user FROM grant_plug;
SHOW GRANTS FOR grant_plug;
Grants for grant_plug@%
-GRANT ALL PRIVILEGES ON *.* TO 'grant_plug'@'%' IDENTIFIED VIA test_plugin_server USING 'grant_plug_dest' WITH GRANT OPTION
+GRANT ALL PRIVILEGES ON *.* TO 'grant_plug'@'%' IDENTIFIED VIA test_plugin_server USING 'grant_plug_dest'
## testing drop user
CREATE USER test_drop@localhost;
GRANT PROXY ON future_user TO test_drop@localhost;
diff --git a/mysql-test/r/show_check.result b/mysql-test/r/show_check.result
index b0a812c7b18..1818713d443 100644
--- a/mysql-test/r/show_check.result
+++ b/mysql-test/r/show_check.result
@@ -1552,3 +1552,14 @@ RELEASE_LOCK('t')
óóóó
1
SET NAMES latin1;
+#
+# WL#6454: Deprecate SHOW AUTHORS and SHOW CONTRIBUTORS
+#
+SHOW AUTHORS;
+SHOW WARNINGS;
+Level Code Message
+Warning 1681 'SHOW AUTHORS' is deprecated and will be removed in a future release.
+SHOW CONTRIBUTORS;
+SHOW WARNINGS;
+Level Code Message
+Warning 1681 'SHOW CONTRIBUTORS' is deprecated and will be removed in a future release.
diff --git a/mysql-test/r/show_explain.result b/mysql-test/r/show_explain.result
index 176f82ad9e3..da132a102e2 100644
--- a/mysql-test/r/show_explain.result
+++ b/mysql-test/r/show_explain.result
@@ -1,5 +1,6 @@
drop table if exists t0, t1, t2, t3, t4;
drop view if exists v1;
+SET @old_debug= @@session.debug;
set debug_sync='RESET';
create table t0 (a int);
insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
@@ -12,12 +13,13 @@ show explain for 2000000000;
ERROR HY000: Unknown thread id: 2000000000
show explain for (select max(a) from t0);
ERROR HY000: You may only use constant expressions in this statement
+SET @old_debug= @@session.debug;
show explain for $thr2;
ERROR HY000: Target is not running an EXPLAINable command
show explain for $thr1;
ERROR HY000: Target is not running an EXPLAINable command
set @show_explain_probe_select_id=1;
-set debug_dbug='d,show_explain_probe_join_exec_start';
+set debug_dbug='+d,show_explain_probe_join_exec_start';
select count(*) from t1 where a < 100000;
show explain for $thr2;
id select_type table type possible_keys key key_len ref rows Extra
@@ -46,9 +48,10 @@ Note 1003 explain select max(c) from t1 where a < 10
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range a a 5 NULL 10 Using index condition; Rowid-ordered scan
set optimizer_switch= @show_expl_tmp;
+set debug_dbug=@old_debug;
# UNION, first branch
set @show_explain_probe_select_id=1;
-set debug_dbug='d,show_explain_probe_join_exec_start';
+set debug_dbug='+d,show_explain_probe_join_exec_start';
explain select a from t0 A union select a+1 from t0 B;
show explain for $thr2;
id select_type table type possible_keys key key_len ref rows Extra
@@ -61,9 +64,10 @@ id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY A ALL NULL NULL NULL NULL 10
2 UNION B ALL NULL NULL NULL NULL 10
NULL UNION RESULT <union1,2> ALL NULL NULL NULL NULL NULL
+set debug_dbug=@old_debug;
# UNION, second branch
set @show_explain_probe_select_id=1;
-set debug_dbug='d,show_explain_probe_join_exec_start';
+set debug_dbug='+d,show_explain_probe_join_exec_start';
explain select a from t0 A union select a+1 from t0 B;
show explain for $thr2;
id select_type table type possible_keys key key_len ref rows Extra
@@ -76,9 +80,10 @@ id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY A ALL NULL NULL NULL NULL 10
2 UNION B ALL NULL NULL NULL NULL 10
NULL UNION RESULT <union1,2> ALL NULL NULL NULL NULL NULL
+set debug_dbug=@old_debug;
# Uncorrelated subquery, select
set @show_explain_probe_select_id=1;
-set debug_dbug='d,show_explain_probe_join_exec_start';
+set debug_dbug='+d,show_explain_probe_join_exec_start';
select a, (select max(a) from t0 B) from t0 A where a<1;
show explain for $thr2;
id select_type table type possible_keys key key_len ref rows Extra
@@ -88,9 +93,10 @@ Warnings:
Note 1003 select a, (select max(a) from t0 B) from t0 A where a<1
a (select max(a) from t0 B)
0 9
+set debug_dbug=@old_debug;
# Uncorrelated subquery, explain
set @show_explain_probe_select_id=1;
-set debug_dbug='d,show_explain_probe_join_exec_start';
+set debug_dbug='+d,show_explain_probe_join_exec_start';
explain select a, (select max(a) from t0 B) from t0 A where a<1;
show explain for $thr2;
id select_type table type possible_keys key key_len ref rows Extra
@@ -101,9 +107,10 @@ Note 1003 explain select a, (select max(a) from t0 B) from t0 A where a<1
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY A ALL NULL NULL NULL NULL 10 Using where
2 SUBQUERY B ALL NULL NULL NULL NULL 10
+set debug_dbug=@old_debug;
# correlated subquery, select
set @show_explain_probe_select_id=1;
-set debug_dbug='d,show_explain_probe_join_exec_start';
+set debug_dbug='+d,show_explain_probe_join_exec_start';
select a, (select max(a) from t0 b where b.a+a.a<10) from t0 a where a<1;
show explain for $thr2;
id select_type table type possible_keys key key_len ref rows Extra
@@ -113,9 +120,10 @@ Warnings:
Note 1003 select a, (select max(a) from t0 b where b.a+a.a<10) from t0 a where a<1
a (select max(a) from t0 b where b.a+a.a<10)
0 9
+set debug_dbug=@old_debug;
# correlated subquery, explain
set @show_explain_probe_select_id=1;
-set debug_dbug='d,show_explain_probe_join_exec_start';
+set debug_dbug='+d,show_explain_probe_join_exec_start';
select a, (select max(a) from t0 b where b.a+a.a<10) from t0 a where a<1;
show explain for $thr2;
id select_type table type possible_keys key key_len ref rows Extra
@@ -125,9 +133,10 @@ Warnings:
Note 1003 select a, (select max(a) from t0 b where b.a+a.a<10) from t0 a where a<1
a (select max(a) from t0 b where b.a+a.a<10)
0 9
+set debug_dbug=@old_debug;
# correlated subquery, select, while inside the subquery
set @show_explain_probe_select_id=2;
-set debug_dbug='d,show_explain_probe_join_exec_start';
+set debug_dbug='+d,show_explain_probe_join_exec_start';
select a, (select max(a) from t0 b where b.a+a.a<10) from t0 a where a<1;
show explain for $thr2;
id select_type table type possible_keys key key_len ref rows Extra
@@ -137,9 +146,10 @@ Warnings:
Note 1003 select a, (select max(a) from t0 b where b.a+a.a<10) from t0 a where a<1
a (select max(a) from t0 b where b.a+a.a<10)
0 9
+set debug_dbug=@old_debug;
# correlated subquery, explain, while inside the subquery
set @show_explain_probe_select_id=2;
-set debug_dbug='d,show_explain_probe_join_exec_start';
+set debug_dbug='+d,show_explain_probe_join_exec_start';
select a, (select max(a) from t0 b where b.a+a.a<10) from t0 a where a<1;
show explain for $thr2;
id select_type table type possible_keys key key_len ref rows Extra
@@ -149,52 +159,57 @@ Warnings:
Note 1003 select a, (select max(a) from t0 b where b.a+a.a<10) from t0 a where a<1
a (select max(a) from t0 b where b.a+a.a<10)
0 9
+set debug_dbug=@old_debug;
# correlated subquery, explain, while inside the subquery
set @show_explain_probe_select_id=1;
-set debug_dbug='d,show_explain_probe_join_exec_end';
+set debug_dbug='+d,show_explain_probe_join_exec_end';
select a, (select max(a) from t0 b where b.a+a.a<10) from t0 a where a<1;
show explain for $thr2;
ERROR HY000: Target is not running an EXPLAINable command
a (select max(a) from t0 b where b.a+a.a<10)
0 9
+set debug_dbug=@old_debug;
# Try to do SHOW EXPLAIN for a query that runs a SET command:
# I've found experimentally that select_id==2 here...
#
set @show_explain_probe_select_id=2;
-set debug_dbug='d,show_explain_probe_join_exec_start';
+set debug_dbug='+d,show_explain_probe_join_exec_start';
set @foo= (select max(a) from t0 where sin(a) >0);
show explain for $thr2;
ERROR HY000: Target is not running an EXPLAINable command
+set debug_dbug=@old_debug;
#
# Attempt SHOW EXPLAIN for an UPDATE
#
create table t2 as select a as a, a as dummy from t0 limit 2;
set @show_explain_probe_select_id=2;
-set debug_dbug='d,show_explain_probe_join_exec_start';
+set debug_dbug='+d,show_explain_probe_join_exec_start';
update t2 set dummy=0 where (select max(a) from t0 where t2.a + t0.a <3) >3 ;
show explain for $thr2;
ERROR HY000: Target is not running an EXPLAINable command
show explain for $thr2;
ERROR HY000: Target is not running an EXPLAINable command
drop table t2;
+set debug_dbug=@old_debug;
#
# Attempt SHOW EXPLAIN for a DELETE
#
create table t2 as select a as a, a as dummy from t0 limit 2;
set @show_explain_probe_select_id=2;
-set debug_dbug='d,show_explain_probe_join_exec_start';
+set debug_dbug='+d,show_explain_probe_join_exec_start';
delete from t2 where (select max(a) from t0 where t2.a + t0.a <3) >3 ;
show explain for $thr2;
ERROR HY000: Target is not running an EXPLAINable command
show explain for $thr2;
ERROR HY000: Target is not running an EXPLAINable command
drop table t2;
+set debug_dbug=@old_debug;
#
# Multiple SHOW EXPLAIN calls for one select
#
create table t2 as select a as a, a as dummy from t0 limit 3;
set @show_explain_probe_select_id=2;
-set debug_dbug='d,show_explain_probe_join_exec_start';
+set debug_dbug='+d,show_explain_probe_join_exec_start';
select t2.a, ((select max(a) from t0 where t2.a + t0.a <3) >3) as SUBQ from t2;
show explain for $thr2;
id select_type table type possible_keys key key_len ref rows Extra
@@ -219,13 +234,14 @@ a SUBQ
1 0
2 0
drop table t2;
+set debug_dbug=@old_debug;
#
# SHOW EXPLAIN for SELECT ... ORDER BY with "Using filesort"
#
explain select * from t0 order by a;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t0 ALL NULL NULL NULL NULL 10 Using filesort
-set debug_dbug='d,show_explain_probe_join_exec_start';
+set debug_dbug='+d,show_explain_probe_join_exec_start';
set @show_explain_probe_select_id=1;
select * from t0 order by a;
show explain for $thr2;
@@ -244,13 +260,14 @@ a
7
8
9
+set debug_dbug=@old_debug;
#
# SHOW EXPLAIN for SELECT ... with "Using temporary"
#
explain select distinct a from t0;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t0 ALL NULL NULL NULL NULL 10 Using temporary
-set debug_dbug='d,show_explain_probe_join_exec_start';
+set debug_dbug='+d,show_explain_probe_join_exec_start';
set @show_explain_probe_select_id=1;
select distinct a from t0;
show explain for $thr2;
@@ -269,13 +286,14 @@ a
7
8
9
+set debug_dbug=@old_debug;
#
# SHOW EXPLAIN for SELECT ... with "Using temporary; Using filesort"
#
explain select distinct a from t0;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t0 ALL NULL NULL NULL NULL 10 Using temporary
-set debug_dbug='d,show_explain_probe_join_exec_start';
+set debug_dbug='+d,show_explain_probe_join_exec_start';
set @show_explain_probe_select_id=1;
select distinct a from t0;
show explain for $thr2;
@@ -294,7 +312,7 @@ a
7
8
9
-set debug_dbug='';
+set debug_dbug=@old_debug;
#
# MDEV-238: SHOW EXPLAIN: Server crashes in JOIN::print_explain with FROM subquery and GROUP BY
#
@@ -304,7 +322,7 @@ explain SELECT alias.a FROM t2, ( SELECT * FROM t2 ) AS alias GROUP BY alias.a;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 5 Using temporary; Using filesort
1 SIMPLE t2 ALL NULL NULL NULL NULL 5 Using join buffer (flat, BNL join)
-set debug_dbug='d,show_explain_in_find_all_keys';
+set debug_dbug='+d,show_explain_in_find_all_keys';
SELECT alias.a FROM t2, ( SELECT * FROM t2 ) AS alias GROUP BY alias.a;
# FIXED by "conservative assumptions about when QEP is available" fix:
# NOTE: current code will not show "Using join buffer":
@@ -314,7 +332,7 @@ a
1
2
4
-set debug_dbug='';
+set debug_dbug=@old_debug;
DROP TABLE t2;
#
# MDEV-239: Assertion `field_types == 0 ... ' failed in Protocol_text::store(double, uint32, String*) with
@@ -329,7 +347,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
Warnings:
Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` join `test`.`t2` group by `test`.`t2`.`a`
set @show_explain_probe_select_id=1;
-set debug_dbug='d,show_explain_probe_join_exec_end';
+set debug_dbug='+d,show_explain_probe_join_exec_end';
EXPLAIN EXTENDED SELECT alias.a FROM t2, ( SELECT * FROM t2 ) AS alias GROUP BY alias.a ;
show explain for $thr2;
id select_type table type possible_keys key key_len ref rows Extra
@@ -342,7 +360,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 5 100.00 Using join buffer (flat, BNL join)
Warnings:
Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` join `test`.`t2` group by `test`.`t2`.`a`
-set debug_dbug='';
+set debug_dbug=@old_debug;
DROP TABLE t2;
#
# MDEV-240: SHOW EXPLAIN: Assertion `this->optimized == 2' failed in
@@ -359,7 +377,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 6
2 DERIVED t3 system NULL NULL NULL NULL 1
set @show_explain_probe_select_id=2;
-set debug_dbug='d,show_explain_probe_join_exec_end';
+set debug_dbug='+d,show_explain_probe_join_exec_end';
SELECT * FROM v1, t2;
show explain for $thr2;
ERROR HY000: Target is not running an EXPLAINable command
@@ -370,14 +388,14 @@ a b
8 7
8 8
8 9
-set debug_dbug='';
+set debug_dbug=@old_debug;
DROP VIEW v1;
DROP TABLE t2, t3;
#
# MDEV-267: SHOW EXPLAIN: Server crashes in JOIN::print_explain on most of queries
#
set @show_explain_probe_select_id=1;
-set debug_dbug='d,show_explain_probe_join_exec_end';
+set debug_dbug='+d,show_explain_probe_join_exec_end';
select sleep(1);
show explain for $thr2;
id select_type table type possible_keys key key_len ref rows Extra
@@ -386,29 +404,29 @@ Warnings:
Note 1003 select sleep(1)
sleep(1)
0
-set debug_dbug='';
+set debug_dbug=@old_debug;
#
# Same as above, but try another reason for JOIN to be degenerate
#
set @show_explain_probe_select_id=1;
-set debug_dbug='d,show_explain_probe_join_exec_end';
+set debug_dbug='+d,show_explain_probe_join_exec_end';
select * from t0 where 1>10;
show explain for $thr2;
ERROR HY000: Target is not running an EXPLAINable command
a
-set debug_dbug='';
+set debug_dbug=@old_debug;
#
# Same as above, but try another reason for JOIN to be degenerate (2)
#
create table t3(a int primary key);
insert into t3 select a from t0;
set @show_explain_probe_select_id=1;
-set debug_dbug='d,show_explain_probe_join_exec_end';
+set debug_dbug='+d,show_explain_probe_join_exec_end';
select * from t0,t3 where t3.a=112233;
show explain for $thr2;
ERROR HY000: Target is not running an EXPLAINable command
a a
-set debug_dbug='';
+set debug_dbug=@old_debug;
drop table t3;
#
# MDEV-270: SHOW EXPLAIN: server crashes in JOIN::print_explain on a query with
@@ -427,7 +445,7 @@ id select_type table type possible_keys key key_len ref rows Extra
2 SUBQUERY t2 const PRIMARY PRIMARY 4 const 1 Using where
3 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
set @show_explain_probe_select_id=2;
-set debug_dbug='d,show_explain_probe_do_select';
+set debug_dbug='+d,show_explain_probe_do_select';
SELECT * FROM t2 WHERE a =
(SELECT MAX(a) FROM t2
WHERE pk= (SELECT MAX(pk) FROM t2 WHERE pk = 3)
@@ -447,7 +465,7 @@ pk a
6 7
7 7
9 7
-set debug_dbug='';
+set debug_dbug=@old_debug;
drop table t2;
#
# MDEV-273: SHOW EXPLAIN: server crashes in JOIN::print_explain on a query with impossible WHERE
@@ -479,7 +497,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t3 ALL NULL NULL NULL NULL 87 Using join buffer (flat, BNL join)
2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
set @show_explain_probe_select_id=1;
-set debug_dbug='d,show_explain_probe_do_select';
+set debug_dbug='+d,show_explain_probe_do_select';
SELECT count(*) FROM t2, t3
WHERE a1 < ALL (
SELECT a1 FROM t2
@@ -498,7 +516,7 @@ WHERE a1 IN ( SELECT a1 FROM t2, t4 )
)
count(*)
1740
-set debug_dbug='';
+set debug_dbug=@old_debug;
drop table t2, t3, t4;
#
# MDEV-275: SHOW EXPLAIN: server crashes in JOIN::print_explain with IN subquery and aggregate function
@@ -508,12 +526,12 @@ INSERT INTO t2 VALUES
(1,5),(2,4),(3,6),(4,9),(5,2),(6,8),(7,4),(8,8),(9,0),(10,43),
(11,23),(12,3),(13,45),(14,16),(15,2),(16,33),(17,2),(18,5),(19,9),(20,2);
set @show_explain_probe_select_id=1;
-set debug_dbug='d,show_explain_probe_join_exec_end';
+set debug_dbug='+d,show_explain_probe_join_exec_end';
SELECT * FROM t2 WHERE (5, 78) IN (SELECT `a1`, MAX(`a1`) FROM t2 GROUP BY `a1`);
show explain for $thr2;
ERROR HY000: Target is not running an EXPLAINable command
pk a1
-set debug_dbug='';
+set debug_dbug=@old_debug;
DROP TABLE t2;
DROP TABLE t1;
#
@@ -522,7 +540,7 @@ DROP TABLE t1;
CREATE TABLE t1(a INT, KEY(a));
INSERT INTO t1 VALUES (3),(1),(5),(1);
set @show_explain_probe_select_id=1;
-set debug_dbug='d,show_explain_probe_join_exec_start';
+set debug_dbug='+d,show_explain_probe_join_exec_start';
SELECT 'test' FROM t1 WHERE a=1;
show explain for $thr2;
id select_type table type possible_keys key key_len ref rows Extra
@@ -532,7 +550,7 @@ Note 1003 SELECT 'test' FROM t1 WHERE a=1
test
test
test
-set debug_dbug='';
+set debug_dbug=@old_debug;
DROP TABLE t1;
#
# MDEV-299: SHOW EXPLAIN: Plan produced by SHOW EXPLAIN changes back and forth during query execution
@@ -550,7 +568,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE A ALL NULL NULL NULL NULL 100 Using where
1 SIMPLE B ALL key1 NULL NULL NULL 100 Range checked for each record (index map: 0x1)
set @show_explain_probe_select_id=1;
-set debug_dbug='d,show_explain_probe_test_if_quick_select';
+set debug_dbug='+d,show_explain_probe_test_if_quick_select';
select count(*) from t1 A, t1 B where B.key1 < A.col2 and A.col1=3 AND B.col2 + 1 < 100;
show explain for $thr2;
id select_type table type possible_keys key key_len ref rows Extra
@@ -578,7 +596,7 @@ Warnings:
Note 1003 select count(*) from t1 A, t1 B where B.key1 < A.col2 and A.col1=3 AND B.col2 + 1 < 100
count(*)
212
-set debug_dbug='';
+set debug_dbug=@old_debug;
drop table t1;
#
# MDEV-297: SHOW EXPLAIN: Server gets stuck until timeout occurs while
@@ -587,7 +605,7 @@ drop table t1;
CREATE TABLE t1(a INT, b INT, c INT, KEY(a), KEY(b), KEY(c));
INSERT INTO t1 (a) VALUES (3),(1),(5),(1);
set @show_explain_probe_select_id=1;
-set debug_dbug='d,show_explain_probe_join_exec_start';
+set debug_dbug='+d,show_explain_probe_join_exec_start';
SHOW INDEX FROM t1;
show explain for $thr2;
id select_type table type possible_keys key key_len ref rows Extra
@@ -598,7 +616,7 @@ Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_par
t1 1 a 1 a A NULL NULL NULL YES BTREE
t1 1 b 1 b A NULL NULL NULL YES BTREE
t1 1 c 1 c A NULL NULL NULL YES BTREE
-set debug_dbug='';
+set debug_dbug=@old_debug;
DROP TABLE t1;
#
# MDEV-324: SHOW EXPLAIN: Plan produced by SHOW EXPLAIN for a query with TEMPTABLE view
@@ -611,7 +629,7 @@ EXPLAIN SELECT a + 1 FROM v1;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2
2 DERIVED t1 ALL NULL NULL NULL NULL 2
-set debug_dbug='d,show_explain_probe_join_tab_preread';
+set debug_dbug='+d,show_explain_probe_join_tab_preread';
set @show_explain_probe_select_id=1;
SELECT a + 1 FROM v1;
show explain for $thr2;
@@ -623,7 +641,7 @@ Note 1003 SELECT a + 1 FROM v1
a + 1
2
3
-set debug_dbug='';
+set debug_dbug=@old_debug;
DROP VIEW v1;
DROP TABLE t1;
#
@@ -639,7 +657,7 @@ id select_type table type possible_keys key key_len ref rows Extra
2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL No tables used
3 DEPENDENT UNION NULL NULL NULL NULL NULL NULL NULL No tables used
NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL
-set debug_dbug='d,show_explain_probe_union_read';
+set debug_dbug='+d,show_explain_probe_union_read';
SELECT a FROM t1 WHERE a IN ( SELECT 1+SLEEP(0.01) UNION SELECT 2 );
show explain for $thr2;
id select_type table type possible_keys key key_len ref rows Extra
@@ -658,7 +676,7 @@ NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL
Warnings:
Note 1003 SELECT a FROM t1 WHERE a IN ( SELECT 1+SLEEP(0.01) UNION SELECT 2 )
a
-set debug_dbug='';
+set debug_dbug=@old_debug;
DROP TABLE t1;
#
# MDEV-327: SHOW EXPLAIN: Different select_type in plans produced by SHOW EXPLAIN
@@ -681,7 +699,7 @@ id select_type table type possible_keys key key_len ref rows Extra
3 SUBQUERY t1 ALL NULL NULL NULL NULL 20
3 SUBQUERY t2 ALL NULL NULL NULL NULL 20 Using where
set @show_explain_probe_select_id=1;
-set debug_dbug='d,show_explain_probe_join_exec_start';
+set debug_dbug='+d,show_explain_probe_join_exec_start';
SELECT * FROM t1, ( SELECT * FROM t2 ) AS alias
WHERE a < ALL ( SELECT b FROM t1, t2 WHERE a = b );
show explain for $thr2;
@@ -694,7 +712,7 @@ Warnings:
Note 1003 SELECT * FROM t1, ( SELECT * FROM t2 ) AS alias
WHERE a < ALL ( SELECT b FROM t1, t2 WHERE a = b )
a b
-set debug_dbug='';
+set debug_dbug=@old_debug;
DROP TABLE t1, t2;
#
# Test that SHOW EXPLAIN will print 'Distinct'.
@@ -716,7 +734,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index PRIMARY PRIMARY 4 NULL 4 Using index; Using temporary
1 SIMPLE t3 ref a a 5 test.t1.a 7 Using index; Distinct
set @show_explain_probe_select_id=1;
-set debug_dbug='d,show_explain_probe_join_exec_start';
+set debug_dbug='+d,show_explain_probe_join_exec_start';
select distinct t1.a from t1,t3 where t1.a=t3.a;
show explain for $thr2;
id select_type table type possible_keys key key_len ref rows Extra
@@ -727,7 +745,7 @@ Note 1003 select distinct t1.a from t1,t3 where t1.a=t3.a
a
1
2
-set debug_dbug='';
+set debug_dbug=@old_debug;
drop table t1,t3,t4;
#
# ---------- SHOW EXPLAIN and permissions -----------------
@@ -738,7 +756,7 @@ grant super on *.* to test2@localhost;
# First, make sure that user 'test2' cannot do SHOW EXPLAIN on us
#
set @show_explain_probe_select_id=1;
-set debug_dbug='d,show_explain_probe_join_exec_start';
+set debug_dbug='+d,show_explain_probe_join_exec_start';
select * from t0 where a < 3;
show explain for $thr2;
ERROR 42000: Access denied; you need (at least one of) the PROCESS privilege(s) for this operation
@@ -751,12 +769,12 @@ a
0
1
2
-set debug_dbug='';
+set debug_dbug=@old_debug;
#
# Check that user test2 can do SHOW EXPLAIN on its own queries
#
set @show_explain_probe_select_id=1;
-set debug_dbug='d,show_explain_probe_join_exec_start';
+set debug_dbug='+d,show_explain_probe_join_exec_start';
select * from t0 where a < 3;
show explain for $thr_con2;
id select_type table type possible_keys key key_len ref rows Extra
@@ -771,8 +789,9 @@ a
# Now, grant test2 a PROCESSLIST permission, and see that he's able to observe us
#
grant process on *.* to test2@localhost;
+set debug_dbug=@old_debug;
set @show_explain_probe_select_id=1;
-set debug_dbug='d,show_explain_probe_join_exec_start';
+set debug_dbug='+d,show_explain_probe_join_exec_start';
select * from t0 where a < 3;
show explain for $thr2;
id select_type table type possible_keys key key_len ref rows Extra
@@ -783,7 +802,7 @@ a
0
1
2
-set debug_dbug='';
+set debug_dbug=@old_debug;
revoke all privileges on test.* from test2@localhost;
drop user test2@localhost;
#
@@ -848,7 +867,7 @@ ORDER BY b;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index_merge a,b a,b 5,5 NULL 8 Using sort_union(a,b); Using where; Using filesort
set @show_explain_probe_select_id=1;
-set debug_dbug='d,show_explain_probe_join_exec_start';
+set debug_dbug='+d,show_explain_probe_join_exec_start';
SELECT a+SLEEP(0.01) FROM t1
WHERE a IN ( 255, 0 ) OR b BETWEEN 6 AND 129
ORDER BY b;
@@ -867,8 +886,9 @@ a+SLEEP(0.01)
0
0
0
+set debug_dbug=@old_debug;
set @show_explain_probe_select_id=1;
-set debug_dbug='d,show_explain_probe_do_select';
+set debug_dbug='+d,show_explain_probe_do_select';
SELECT a+SLEEP(0.01) FROM t1
WHERE a IN ( 255, 0 ) OR b BETWEEN 6 AND 129
ORDER BY b;
@@ -887,7 +907,7 @@ a+SLEEP(0.01)
0
0
0
-set debug_dbug='';
+set debug_dbug=@old_debug;
drop table t1;
#
# MDEV-298: SHOW EXPLAIN: Plan returned by SHOW EXPLAIN only contains
@@ -901,7 +921,7 @@ EXPLAIN SELECT a FROM t1 GROUP BY a;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 4112 Using temporary; Using filesort
set @show_explain_probe_select_id=1;
-set debug_dbug='d,show_explain_probe_join_exec_start';
+set debug_dbug='+d,show_explain_probe_join_exec_start';
SELECT a FROM t1 GROUP BY a;
show explain for $thr2;
id select_type table type possible_keys key key_len ref rows Extra
@@ -925,7 +945,7 @@ a
14
15
16
-set debug_dbug='';
+set debug_dbug=@old_debug;
drop table t1;
#
# MDEV-408: SHOW EXPLAIN: Some values are chopped off in SHOW EXPLAIN output
@@ -939,7 +959,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using where
2 DEPENDENT SUBQUERY t2 index_subquery PRIMARY,c c 5 func 1 Using index; Using where
set @show_explain_probe_select_id=1;
-set debug_dbug='d,show_explain_probe_join_exec_start';
+set debug_dbug='+d,show_explain_probe_join_exec_start';
SELECT SUM(a + SLEEP(0.1)) FROM t1 WHERE a IN ( SELECT c FROM t2 WHERE d < b ) OR b < 's';
show explain for $thr2;
id select_type table type possible_keys key key_len ref rows Extra
@@ -949,7 +969,7 @@ Warnings:
Note 1003 SELECT SUM(a + SLEEP(0.1)) FROM t1 WHERE a IN ( SELECT c FROM t2 WHERE d < b ) OR b < 's'
SUM(a + SLEEP(0.1))
7862
-set debug_dbug='';
+set debug_dbug=@old_debug;
drop table t1, t2;
#
# MDEV-412: SHOW EXPLAIN: Server crashes in JOIN::print_explain on a query with inner join and ORDER BY the same column twice
@@ -987,7 +1007,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index b b 6 NULL 107 Using where; Using index
1 SIMPLE t3 ref PRIMARY PRIMARY 5 test.t1.b 1 Using index
set @show_explain_probe_select_id=1;
-set debug_dbug='d,show_explain_probe_do_select';
+set debug_dbug='+d,show_explain_probe_do_select';
SELECT b AS field1, b AS field2 FROM t1, t2, t3 WHERE d = b ORDER BY field1, field2;
show explain for $thr2;
id select_type table type possible_keys key key_len ref rows Extra
@@ -997,7 +1017,7 @@ id select_type table type possible_keys key key_len ref rows Extra
Warnings:
Note 1003 SELECT b AS field1, b AS field2 FROM t1, t2, t3 WHERE d = b ORDER BY field1, field2
field1 field2
-set debug_dbug='';
+set debug_dbug=@old_debug;
DROP TABLE t1,t2,t3;
#
# MDEV-423: SHOW EXPLAIN: 'Using where' for a subquery is shown in EXPLAIN, but not in SHOW EXPLAIN output
@@ -1018,7 +1038,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 20
3 SUBQUERY t3 ALL NULL NULL NULL NULL 20 Using where
set @show_explain_probe_select_id=1;
-set debug_dbug='d,show_explain_probe_join_exec_start';
+set debug_dbug='+d,show_explain_probe_join_exec_start';
SELECT max(a+b+c) FROM t1 AS alias1, ( SELECT * FROM t2 ) AS alias
WHERE EXISTS ( SELECT * FROM t3 WHERE b = c ) OR a <= 10;
show explain for $thr2;
@@ -1031,7 +1051,7 @@ Note 1003 SELECT max(a+b+c) FROM t1 AS alias1, ( SELECT * FROM t2 ) AS alias
WHERE EXISTS ( SELECT * FROM t3 WHERE b = c ) OR a <= 10
max(a+b+c)
279
-set debug_dbug='';
+set debug_dbug=@old_debug;
DROP TABLE t1,t2,t3;
#
# MDEV-416: Server crashes in SQL_SELECT::cleanup on EXPLAIN with SUM ( DISTINCT ) in a non-correlated subquery (5.5-show-explain tree)
@@ -1057,7 +1077,7 @@ select hex('ãû');
hex('ãû')
E3FB
set @show_explain_probe_select_id=1;
-set debug_dbug='d,show_explain_probe_join_exec_start';
+set debug_dbug='+d,show_explain_probe_join_exec_start';
select * from t0 where length('ãû') = a;
set names utf8;
show explain for $thr2;
@@ -1068,7 +1088,7 @@ Note 1003 select * from t0 where length('гы') = a
set names default;
a
2
-set debug_dbug='';
+set debug_dbug=@old_debug;
set names default;
#
# MDEV-462: SHOW EXPLAIN: Assertion `table_list->table' fails in find_field_in_table_ref if FOR contains a non-numeric value
diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result
index 293400ece2f..c297ceda572 100644
--- a/mysql-test/r/sp.result
+++ b/mysql-test/r/sp.result
@@ -6530,16 +6530,16 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ref c1 c1 5 const 1 Using index
EXPLAIN SELECT * FROM t1 WHERE c1=f1();
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ref c1 c1 5 const 0 Using where; Using index
+1 SIMPLE t1 ref c1 c1 5 const 1 Using where; Using index
EXPLAIN SELECT * FROM v1 WHERE c1=1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ref c1 c1 5 const 1 Using index
EXPLAIN SELECT * FROM v1 WHERE c1=f1();
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ref c1 c1 5 const 0 Using where; Using index
+1 SIMPLE t1 ref c1 c1 5 const 1 Using where; Using index
EXPLAIN SELECT * FROM t1 WHERE c1=f2(10);
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ref c1 c1 5 const 0 Using where; Using index
+1 SIMPLE t1 ref c1 c1 5 const 1 Using where; Using index
EXPLAIN SELECT * FROM t1 WHERE c1=f2(c1);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index NULL c1 5 NULL 5 Using where; Using index
@@ -7852,6 +7852,38 @@ c1 c2 count(c3)
2012-03-01 01:00:00 3 1
2012-03-01 02:00:00 3 1
DROP PROCEDURE p1;
+
+MDEV-3900 Optimizer difference between MySQL and MariaDB with stored functions in WHERE clause of UPDATE or DELETE statements
+
+CREATE FUNCTION tdn() RETURNS int(7) DETERMINISTIC RETURN to_days(now());
+CREATE TABLE t1 (pk INT NOT NULL AUTO_INCREMENT PRIMARY KEY, daynum INT, a CHAR(1), INDEX(daynum), INDEX(a)) ENGINE=MyISAM;
+INSERT INTO t1 (daynum) VALUES (1),(2),(3),(4),(5),(TO_DAYS(NOW())),(7),(8);
+INSERT INTO t1 (daynum) SELECT a1.daynum FROM t1 a1, t1 a2, t1 a3, t1 a4, t1 a5;
+FLUSH TABLES;
+FLUSH STATUS;
+SHOW STATUS LIKE '%Handler_read%';
+Variable_name Value
+Handler_read_first 0
+Handler_read_key 0
+Handler_read_last 0
+Handler_read_next 0
+Handler_read_prev 0
+Handler_read_rnd 0
+Handler_read_rnd_deleted 0
+Handler_read_rnd_next 0
+UPDATE t1 SET a = '+' WHERE daynum=tdn();
+SHOW STATUS LIKE '%Handler_read%';
+Variable_name Value
+Handler_read_first 0
+Handler_read_key 2
+Handler_read_last 0
+Handler_read_next 4097
+Handler_read_prev 0
+Handler_read_rnd 0
+Handler_read_rnd_deleted 0
+Handler_read_rnd_next 0
+drop function tdn;
+drop table t1;
#
# lp:1002157 : testing stored function
# bug#62125 result for null incorrectly yields 1292 warning.
diff --git a/mysql-test/r/sp_notembedded.result b/mysql-test/r/sp_notembedded.result
index 0b4b1726e22..540a66e7508 100644
--- a/mysql-test/r/sp_notembedded.result
+++ b/mysql-test/r/sp_notembedded.result
@@ -259,7 +259,6 @@ SELECT `my.db`.f1(2);
# Switching to default connection.
DROP DATABASE `my.db`;
USE test;
-set @@global.concurrent_insert= @old_concurrent_insert;
#
# Bug#11763507 - 56224: FUNCTION NAME IS CASE-SENSITIVE
#
@@ -280,3 +279,7 @@ Event sql_mode time_zone Create Event character_set_client collation_connection
teste_bug11763507 SYSTEM # latin1 latin1_swedish_ci latin1_swedish_ci
DROP EVENT teste_bug11763507;
#END OF BUG#11763507 test.
+# ------------------------------------------------------------------
+# -- End of 5.1 tests
+# ------------------------------------------------------------------
+set @@global.concurrent_insert= @old_concurrent_insert;
diff --git a/mysql-test/r/stat_tables_par.result b/mysql-test/r/stat_tables_par.result
index 76a42e993f6..a98f934fa96 100644
--- a/mysql-test/r/stat_tables_par.result
+++ b/mysql-test/r/stat_tables_par.result
@@ -219,4 +219,24 @@ set debug_sync='RESET';
set global use_stat_tables=@save_global_use_stat_tables;
DROP DATABASE dbt3_s001;
use test;
+set @save_global_use_stat_tables=@@global.use_stat_tables;
+set global use_stat_tables='preferably';
+set debug_sync='RESET';
+create table t1 (a int, b int, key(a));
+insert t1 values (1,1),(2,2);
+analyze table t1;
+Table Op Msg_type Msg_text
+test.t1 analyze status OK
+SET debug_sync='after_open_table_ignore_flush WAIT_FOR go';
+select * from information_schema.statistics where table_schema='test';
+select * from t1;
+a b
+1 1
+2 2
+SET DEBUG_SYNC= "now SIGNAL go";
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME NON_UNIQUE INDEX_SCHEMA INDEX_NAME SEQ_IN_INDEX COLUMN_NAME COLLATION CARDINALITY SUB_PART PACKED NULLABLE INDEX_TYPE COMMENT INDEX_COMMENT
+def test t1 1 test a 1 a A 2 NULL NULL YES BTREE
+set debug_sync='RESET';
+drop table t1;
+set global use_stat_tables=@save_global_use_stat_tables;
set use_stat_tables=@save_use_stat_tables;
diff --git a/mysql-test/r/stat_tables_par_innodb.result b/mysql-test/r/stat_tables_par_innodb.result
index ff1a296e5af..e0c00c482a0 100644
--- a/mysql-test/r/stat_tables_par_innodb.result
+++ b/mysql-test/r/stat_tables_par_innodb.result
@@ -228,6 +228,26 @@ set debug_sync='RESET';
set global use_stat_tables=@save_global_use_stat_tables;
DROP DATABASE dbt3_s001;
use test;
+set @save_global_use_stat_tables=@@global.use_stat_tables;
+set global use_stat_tables='preferably';
+set debug_sync='RESET';
+create table t1 (a int, b int, key(a));
+insert t1 values (1,1),(2,2);
+analyze table t1;
+Table Op Msg_type Msg_text
+test.t1 analyze status OK
+SET debug_sync='after_open_table_ignore_flush WAIT_FOR go';
+select * from information_schema.statistics where table_schema='test';
+select * from t1;
+a b
+1 1
+2 2
+SET DEBUG_SYNC= "now SIGNAL go";
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME NON_UNIQUE INDEX_SCHEMA INDEX_NAME SEQ_IN_INDEX COLUMN_NAME COLLATION CARDINALITY SUB_PART PACKED NULLABLE INDEX_TYPE COMMENT INDEX_COMMENT
+def test t1 1 test a 1 a A 2 NULL NULL YES BTREE
+set debug_sync='RESET';
+drop table t1;
+set global use_stat_tables=@save_global_use_stat_tables;
set use_stat_tables=@save_use_stat_tables;
set optimizer_switch=@save_optimizer_switch_for_stat_tables_test;
SET SESSION STORAGE_ENGINE=DEFAULT;
diff --git a/mysql-test/r/subselect4.result b/mysql-test/r/subselect4.result
index 697226c5740..2814e5a6dcd 100644
--- a/mysql-test/r/subselect4.result
+++ b/mysql-test/r/subselect4.result
@@ -2248,6 +2248,53 @@ NULL NULL
drop table t1, t2;
set optimizer_switch=@subselect4_tmp;
#
+# MDEV-3928 Assertion `example' failed in Item_cache::is_expensive_processor with a 2-level IN subquery
+#
+CREATE TABLE t1 (a1 INT, b1 TIME) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (4,'21:22:34'),(6,'10:50:38');
+CREATE TABLE t2 (a2 INT, b2 TIME) ENGINE=MyISAM;
+INSERT INTO t2 VALUES (8, '06:17:39');
+CREATE TABLE t3 (a3 INT, b3 TIME) ENGINE=MyISAM;
+INSERT INTO t3 VALUES (1,'00:00:01'),(7,'00:00:02');
+EXPLAIN
+SELECT * FROM t1 WHERE a1 IN (
+SELECT a2 FROM t2 WHERE a2 IN (
+SELECT a3 FROM t3 WHERE b2 = b1 AND b2 <= b1 ORDER BY b3
+)
+);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t2 system NULL NULL NULL NULL 1
+1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using where
+3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 2 Using where
+SELECT * FROM t1 WHERE a1 IN (
+SELECT a2 FROM t2 WHERE a2 IN (
+SELECT a3 FROM t3 WHERE b2 = b1 AND b2 <= b1 ORDER BY b3
+)
+);
+a1 b1
+drop table t1, t2, t3;
+#
+# MDEV-4056:Server crashes in Item_func_trig_cond::val_int
+# with FROM and NOT IN subqueries, LEFT JOIN, derived_merge+in_to_exists
+#
+set @optimizer_switch_MDEV4056 = @@optimizer_switch;
+SET optimizer_switch = 'derived_merge=on,in_to_exists=on';
+CREATE TABLE t1 (a VARCHAR(1)) ENGINE=MyISAM;
+INSERT INTO t1 VALUES ('x'),('d');
+CREATE TABLE t2 (pk INT PRIMARY KEY, b INT, c VARCHAR(1)) ENGINE=MyISAM;
+INSERT INTO t2 VALUES (1,2,'v'),(2,150,'v');
+SELECT * FROM t1 LEFT JOIN (
+SELECT * FROM t2 WHERE ( pk, pk ) NOT IN (
+SELECT MIN(b), SUM(pk) FROM t1
+)
+) AS alias1 ON (a = c)
+WHERE b IS NULL OR a < 'u';
+a pk b c
+x NULL NULL NULL
+d NULL NULL NULL
+drop table t1,t2;
+set @@optimizer_switch = @optimizer_switch_MDEV4056;
+#
# MDEV-3899 Valgrind warnings (blocks are definitely lost) in filesort on IN subquery with SUM and DISTINCT
#
CREATE TABLE t1 (a INT) ENGINE=MyISAM;
diff --git a/mysql-test/r/subselect_innodb.result b/mysql-test/r/subselect_innodb.result
index 6c1e52a112e..8932acf8ffd 100644
--- a/mysql-test/r/subselect_innodb.result
+++ b/mysql-test/r/subselect_innodb.result
@@ -432,4 +432,22 @@ select 1 from t1 where 1 like (select 1 from t1 where 1 <=> (select 1 from t1 gr
1
1
drop table t1;
+#
+# MDEV-3988 crash in create_tmp_table
+#
+drop table if exists `t1`,`t2`;
+Warnings:
+Note 1051 Unknown table 't1'
+Note 1051 Unknown table 't2'
+create table `t1`(`a` char(1) character set utf8)engine=innodb;
+create table `t2`(`b` char(1) character set utf8)engine=memory;
+select distinct (select 1 from `t2` where `a`) `d2` from `t1`;
+d2
+select distinct (select 1 from `t2` where `a`) `d2`, a from `t1`;
+d2 a
+select distinct a, (select 1 from `t2` where `a`) `d2` from `t1`;
+a d2
+select distinct (1 + (select 1 from `t2` where `a`)) `d2` from `t1`;
+d2
+drop table t1,t2;
set optimizer_switch=@subselect_innodb_tmp;
diff --git a/mysql-test/r/subselect_sj.result b/mysql-test/r/subselect_sj.result
index 660137affec..d9fa9853da5 100644
--- a/mysql-test/r/subselect_sj.result
+++ b/mysql-test/r/subselect_sj.result
@@ -2767,4 +2767,79 @@ GROUP BY b
HAVING t1sum <> 1;
t1sum b
DROP TABLE t1, t2;
+#
+# MDEV-3911: Assertion `fixed == 0' failed in Item_field::fix_fields
+# on 2nd execution of PS with semijoin=on and IN subquery
+#
+CREATE TABLE t1 (a INT, b INT) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (0,4),(8,6);
+CREATE TABLE t2 (c INT, d INT) ENGINE=MyISAM;
+INSERT INTO t2 VALUES (7,1),(0,7);
+PREPARE stmt FROM ' SELECT * FROM t1 WHERE ( a, b ) IN ( SELECT c, d FROM t2 ) ';
+execute stmt;
+a b
+execute stmt;
+a b
+deallocate prepare stmt;
+drop table t1,t2;
+#
+# MySQL Bug#13340270: assertion table->sort.record_pointers == __null
+#
+CREATE TABLE t1 (
+pk int NOT NULL,
+col_int_key int DEFAULT NULL,
+col_varchar_key varchar(1) DEFAULT NULL,
+col_varchar_nokey varchar(1) DEFAULT NULL,
+PRIMARY KEY (pk),
+KEY col_int_key (col_int_key),
+KEY col_varchar_key (col_varchar_key, col_int_key)
+) ENGINE=InnoDB;
+Warnings:
+Warning 1286 Unknown storage engine 'InnoDB'
+Warning 1266 Using storage engine MyISAM for table 't1'
+INSERT INTO t1 VALUES
+(10,8,'x','x'),
+(11,7,'d','d'),
+(12,1,'r','r'),
+(13,7,'f','f'),
+(14,9,'y','y'),
+(15,NULL,'u','u'),
+(16,1,'m','m'),
+(17,9,NULL,NULL),
+(18,2,'o','o'),
+(19,9,'w','w'),
+(20,2,'m','m'),
+(21,4,'q','q');
+CREATE TABLE t2
+SELECT alias1.col_varchar_nokey AS field1
+FROM t1 AS alias1 JOIN t1 AS alias2
+ON alias2.col_int_key = alias1.pk OR
+alias2.col_int_key = alias1.col_int_key
+WHERE alias1.pk = 58 OR alias1.col_varchar_key = 'o'
+
+;
+EXPLAIN SELECT *
+FROM t2
+WHERE (field1) IN (SELECT alias1.col_varchar_nokey AS field1
+FROM t1 AS alias1 JOIN t1 AS alias2
+ON alias2.col_int_key = alias1.pk OR
+alias2.col_int_key = alias1.col_int_key
+WHERE alias1.pk = 58 OR alias1.col_varchar_key = 'o'
+);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t2 ALL NULL NULL NULL NULL 2
+1 PRIMARY alias1 index_merge PRIMARY,col_int_key,col_varchar_key PRIMARY,col_varchar_key 4,4 NULL 2 Using sort_union(PRIMARY,col_varchar_key); Using where
+1 PRIMARY alias2 ALL col_int_key NULL NULL NULL 12 Range checked for each record (index map: 0x2); FirstMatch(t2)
+SELECT *
+FROM t2
+WHERE (field1) IN (SELECT alias1.col_varchar_nokey AS field1
+FROM t1 AS alias1 JOIN t1 AS alias2
+ON alias2.col_int_key = alias1.pk OR
+alias2.col_int_key = alias1.col_int_key
+WHERE alias1.pk = 58 OR alias1.col_varchar_key = 'o'
+);
+field1
+o
+o
+DROP TABLE t1, t2;
set optimizer_switch=@subselect_sj_tmp;
diff --git a/mysql-test/r/subselect_sj_jcl6.result b/mysql-test/r/subselect_sj_jcl6.result
index aa7ad59fda3..1ca8b44a0b8 100644
--- a/mysql-test/r/subselect_sj_jcl6.result
+++ b/mysql-test/r/subselect_sj_jcl6.result
@@ -2781,6 +2781,81 @@ GROUP BY b
HAVING t1sum <> 1;
t1sum b
DROP TABLE t1, t2;
+#
+# MDEV-3911: Assertion `fixed == 0' failed in Item_field::fix_fields
+# on 2nd execution of PS with semijoin=on and IN subquery
+#
+CREATE TABLE t1 (a INT, b INT) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (0,4),(8,6);
+CREATE TABLE t2 (c INT, d INT) ENGINE=MyISAM;
+INSERT INTO t2 VALUES (7,1),(0,7);
+PREPARE stmt FROM ' SELECT * FROM t1 WHERE ( a, b ) IN ( SELECT c, d FROM t2 ) ';
+execute stmt;
+a b
+execute stmt;
+a b
+deallocate prepare stmt;
+drop table t1,t2;
+#
+# MySQL Bug#13340270: assertion table->sort.record_pointers == __null
+#
+CREATE TABLE t1 (
+pk int NOT NULL,
+col_int_key int DEFAULT NULL,
+col_varchar_key varchar(1) DEFAULT NULL,
+col_varchar_nokey varchar(1) DEFAULT NULL,
+PRIMARY KEY (pk),
+KEY col_int_key (col_int_key),
+KEY col_varchar_key (col_varchar_key, col_int_key)
+) ENGINE=InnoDB;
+Warnings:
+Warning 1286 Unknown storage engine 'InnoDB'
+Warning 1266 Using storage engine MyISAM for table 't1'
+INSERT INTO t1 VALUES
+(10,8,'x','x'),
+(11,7,'d','d'),
+(12,1,'r','r'),
+(13,7,'f','f'),
+(14,9,'y','y'),
+(15,NULL,'u','u'),
+(16,1,'m','m'),
+(17,9,NULL,NULL),
+(18,2,'o','o'),
+(19,9,'w','w'),
+(20,2,'m','m'),
+(21,4,'q','q');
+CREATE TABLE t2
+SELECT alias1.col_varchar_nokey AS field1
+FROM t1 AS alias1 JOIN t1 AS alias2
+ON alias2.col_int_key = alias1.pk OR
+alias2.col_int_key = alias1.col_int_key
+WHERE alias1.pk = 58 OR alias1.col_varchar_key = 'o'
+
+;
+EXPLAIN SELECT *
+FROM t2
+WHERE (field1) IN (SELECT alias1.col_varchar_nokey AS field1
+FROM t1 AS alias1 JOIN t1 AS alias2
+ON alias2.col_int_key = alias1.pk OR
+alias2.col_int_key = alias1.col_int_key
+WHERE alias1.pk = 58 OR alias1.col_varchar_key = 'o'
+);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t2 ALL NULL NULL NULL NULL 2
+1 PRIMARY alias1 index_merge PRIMARY,col_int_key,col_varchar_key PRIMARY,col_varchar_key 4,4 NULL 2 Using sort_union(PRIMARY,col_varchar_key); Using where
+1 PRIMARY alias2 ALL col_int_key NULL NULL NULL 12 Range checked for each record (index map: 0x2); FirstMatch(t2)
+SELECT *
+FROM t2
+WHERE (field1) IN (SELECT alias1.col_varchar_nokey AS field1
+FROM t1 AS alias1 JOIN t1 AS alias2
+ON alias2.col_int_key = alias1.pk OR
+alias2.col_int_key = alias1.col_int_key
+WHERE alias1.pk = 58 OR alias1.col_varchar_key = 'o'
+);
+field1
+o
+o
+DROP TABLE t1, t2;
set optimizer_switch=@subselect_sj_tmp;
#
# BUG#49129: Wrong result with IN-subquery with join_cache_level=6 and firstmatch=off
@@ -2988,7 +3063,7 @@ EXPLAIN
SELECT a FROM t1 t WHERE a IN (SELECT b FROM t1, t2 WHERE b = a)
GROUP BY a HAVING a != 'z';
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t index idx_a idx_a 4 NULL 3 Using index; Using temporary; Using filesort
+1 PRIMARY t index idx_a idx_a 4 NULL 3 Using index
1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
2 MATERIALIZED t2 ALL NULL NULL NULL NULL 2 Using where
2 MATERIALIZED t1 ref idx_a idx_a 4 test.t2.b 2 Using index
@@ -3002,7 +3077,7 @@ EXPLAIN
SELECT a FROM t1 t WHERE a IN (SELECT b FROM t1, t2 WHERE b = a)
GROUP BY a HAVING a != 'z';
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t index idx_a idx_a 4 NULL 3 Using index; Using temporary; Using filesort
+1 PRIMARY t index idx_a idx_a 4 NULL 3 Using index
1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
2 MATERIALIZED t2 ALL NULL NULL NULL NULL 2 Using where
2 MATERIALIZED t1 ref idx_a idx_a 4 test.t2.b 2 Using index
diff --git a/mysql-test/r/sum_distinct-big.result b/mysql-test/r/sum_distinct-big.result
index 9b55d59ab91..d4933b31f80 100644
--- a/mysql-test/r/sum_distinct-big.result
+++ b/mysql-test/r/sum_distinct-big.result
@@ -103,5 +103,20 @@ sm
10323810
10325070
10326330
+#
+# Bug mdev-4063: SUM(DISTINCT...) with small'max_heap_table_size
+# (bug #56927)
+#
+SET max_heap_table_size=default;
+INSERT INTO t1 SELECT id+16384 FROM t1;
+DELETE FROM t2;
+INSERT INTO t2 SELECT id FROM t1 ORDER BY id*rand();
+SELECT SUM(DISTINCT id) sm FROM t2;
+sm
+536887296
+SET max_heap_table_size=16384;
+SELECT SUM(DISTINCT id) sm FROM t2;
+sm
+536887296
DROP TABLE t1;
DROP TABLE t2;
diff --git a/mysql-test/r/type_year.result b/mysql-test/r/type_year.result
index 4b9bf6f433f..38bddd42cfa 100644
--- a/mysql-test/r/type_year.result
+++ b/mysql-test/r/type_year.result
@@ -389,6 +389,7 @@ select a from t1 where a=(select 2000 from dual where 1);
a
select a from t1 where a=y2k();
a
+00
select a from t1 where a=b;
a
drop table t1;
diff --git a/mysql-test/r/user_var.result b/mysql-test/r/user_var.result
index 9c4fd02fcdd..6cbbe934bde 100644
--- a/mysql-test/r/user_var.result
+++ b/mysql-test/r/user_var.result
@@ -530,4 +530,9 @@ SELECT @a;
@a
1
DROP TABLE t1;
+#
+# Check that used memory extends if we set a variable
+#
+set @var= repeat('a',20000);
+1
End of 5.5 tests
diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result
index 622cc001f63..1e5e91b272c 100644
--- a/mysql-test/r/view.result
+++ b/mysql-test/r/view.result
@@ -4780,6 +4780,30 @@ id id bbb iddqd val1
drop view v2;
drop table t1,t2;
#
+# MDEV-3914: Wrong result (NULLs instead of real values)
+# with INNER and RIGHT JOIN in a FROM subquery, derived_merge=on
+# (fix of above MDEV-486 fix)
+#
+SET @save_optimizer_switch_MDEV_3914=@@optimizer_switch;
+SET optimizer_switch = 'derived_merge=on';
+CREATE TABLE t1 (a INT) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (1),(2);
+CREATE TABLE t2 (b INT) ENGINE=MyISAM;
+INSERT INTO t2 VALUES (3),(4);
+CREATE TABLE t3 (c INT) ENGINE=MyISAM;
+INSERT INTO t3 VALUES (5),(6);
+SELECT * FROM ( SELECT c FROM ( t1 INNER JOIN t2 ) RIGHT JOIN t3 ON a = c ) AS alias;
+c
+5
+6
+SET optimizer_switch = 'derived_merge=off';
+SELECT * FROM ( SELECT c FROM ( t1 INNER JOIN t2 ) RIGHT JOIN t3 ON a = c ) AS alias;
+c
+5
+6
+SET optimizer_switch=@save_optimizer_switch_MDEV_3914;
+drop table t1,t2,t3;
+#
# MDEV-589 (LP BUG#1007647) :
# Assertion `vcol_table == 0 || vcol_table == table' failed in
# fill_record(THD*, List<Item>&, List<Item>&, bool)
@@ -4822,6 +4846,23 @@ f2 f1
7 NULL
8 NULL
drop tables t1,t2;
+#
+# MDEV-3876 Wrong result (extra rows) with ALL subquery
+# from a MERGE view (duplicate of MDEV-3873)
+#
+CREATE TABLE t1 (a INT NOT NULL) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (1),(2);
+CREATE TABLE t2 (b INT NOT NULL) ENGINE=MyISAM;
+INSERT INTO t2 VALUES (1),(3);
+CREATE OR REPLACE ALGORITHM=MERGE VIEW v1 AS SELECT * FROM t2;
+SELECT a FROM t1 AS alias
+WHERE a >= ALL (
+SELECT b FROM t1 LEFT JOIN v1 ON (a = b)
+WHERE a = alias.a );
+a
+1
+drop view v1;
+drop table t1,t2;
# -----------------------------------------------------------------
# -- End of 5.3 tests.
# -----------------------------------------------------------------
diff --git a/mysql-test/suite/binlog/r/binlog_database.result b/mysql-test/suite/binlog/r/binlog_database.result
index 1fa3419738f..7e67ee78efa 100644
--- a/mysql-test/suite/binlog/r/binlog_database.result
+++ b/mysql-test/suite/binlog/r/binlog_database.result
@@ -58,7 +58,7 @@ Tables_in_db1
t2
include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `db1`; drop table `t1`
+master-bin.000001 # Query # # use `db1`; DROP TABLE `t1`
DROP TABLE t3;
DROP DATABASE db1;
set binlog_format=mixed;
@@ -121,7 +121,7 @@ Tables_in_db1
t2
include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `db1`; drop table `t1`
+master-bin.000001 # Query # # use `db1`; DROP TABLE `t1`
DROP TABLE t3;
DROP DATABASE db1;
set binlog_format=row;
@@ -185,7 +185,7 @@ Tables_in_db1
t2
include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `db1`; drop table `t1`
+master-bin.000001 # Query # # use `db1`; DROP TABLE `t1`
DROP TABLE t3;
DROP DATABASE db1;
show databases;
diff --git a/mysql-test/r/mysqlbinlog-cp932.result b/mysql-test/suite/binlog/r/binlog_mysqlbinlog-cp932.result
index cbf6159516a..cbf6159516a 100644
--- a/mysql-test/r/mysqlbinlog-cp932.result
+++ b/mysql-test/suite/binlog/r/binlog_mysqlbinlog-cp932.result
diff --git a/mysql-test/r/mysqlbinlog2.result b/mysql-test/suite/binlog/r/binlog_mysqlbinlog2.result
index bf65bab602d..bf65bab602d 100644
--- a/mysql-test/r/mysqlbinlog2.result
+++ b/mysql-test/suite/binlog/r/binlog_mysqlbinlog2.result
diff --git a/mysql-test/r/mysqlbinlog_base64.result b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_base64.result
index 72d49c16cc8..72d49c16cc8 100644
--- a/mysql-test/r/mysqlbinlog_base64.result
+++ b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_base64.result
diff --git a/mysql-test/r/mysqlbinlog_row.result b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row.result
index 6361cdadb32..8f481b25251 100644
--- a/mysql-test/r/mysqlbinlog_row.result
+++ b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row.result
@@ -359,7 +359,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1=b'0' /* BIT(1) meta=1 nullable=1 is_null=0 */
# at #
@@ -376,7 +376,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1=b'1' /* BIT(1) meta=1 nullable=1 is_null=0 */
# at #
@@ -403,7 +403,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1=b'0000001' /* BIT(7) meta=7 nullable=1 is_null=0 */
# at #
@@ -420,7 +420,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1=b'0000010' /* BIT(7) meta=7 nullable=1 is_null=0 */
# at #
@@ -437,7 +437,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1=b'0000100' /* BIT(7) meta=7 nullable=1 is_null=0 */
# at #
@@ -454,7 +454,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1=b'0001000' /* BIT(7) meta=7 nullable=1 is_null=0 */
# at #
@@ -471,7 +471,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1=b'0010000' /* BIT(7) meta=7 nullable=1 is_null=0 */
# at #
@@ -488,7 +488,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1=b'0100000' /* BIT(7) meta=7 nullable=1 is_null=0 */
# at #
@@ -505,7 +505,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1=b'1000000' /* BIT(7) meta=7 nullable=1 is_null=0 */
# at #
@@ -522,7 +522,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1=b'1111111' /* BIT(7) meta=7 nullable=1 is_null=0 */
# at #
@@ -539,7 +539,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
-### DELETE FROM test.t1
+### DELETE FROM `test`.`t1`
### WHERE
### @1=b'1111111' /* BIT(7) meta=7 nullable=1 is_null=0 */
# at #
@@ -556,7 +556,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Update_rows: table id # flags: STMT_END_F
-### UPDATE test.t1
+### UPDATE `test`.`t1`
### WHERE
### @1=b'0010000' /* BIT(7) meta=7 nullable=1 is_null=0 */
### SET
@@ -585,7 +585,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1=b'00010010010010001001' /* BIT(20) meta=516 nullable=1 is_null=0 */
### @2='ab' /* STRING(2) meta=65026 nullable=1 is_null=0 */
@@ -613,7 +613,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1=b'0000000000000000000000000000000000000000000000000000000000000001' /* BIT(64) meta=2048 nullable=1 is_null=0 */
# at #
@@ -630,7 +630,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1=b'0000000000000000000000000000000000000000000000000000000000000010' /* BIT(64) meta=2048 nullable=1 is_null=0 */
# at #
@@ -647,7 +647,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1=b'0000000000000000000000000000000000000000000000000000000010000000' /* BIT(64) meta=2048 nullable=1 is_null=0 */
# at #
@@ -664,7 +664,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1=b'1111111111111111111111111111111111111111111111111111111111111111' /* BIT(64) meta=2048 nullable=1 is_null=0 */
# at #
@@ -691,13 +691,13 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1=1 /* TINYINT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1=2 /* TINYINT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1=3 /* TINYINT meta=0 nullable=1 is_null=0 */
# at #
@@ -714,7 +714,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1=-128 (128) /* TINYINT meta=0 nullable=1 is_null=0 */
# at #
@@ -731,7 +731,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Update_rows: table id # flags: STMT_END_F
-### UPDATE test.t1
+### UPDATE `test`.`t1`
### WHERE
### @1=1 /* TINYINT meta=0 nullable=1 is_null=0 */
### SET
@@ -750,7 +750,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
-### DELETE FROM test.t1
+### DELETE FROM `test`.`t1`
### WHERE
### @1=-128 (128) /* TINYINT meta=0 nullable=1 is_null=0 */
# at #
@@ -777,10 +777,10 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1=-128 (128) /* TINYINT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1=-1 (255) /* TINYINT meta=0 nullable=1 is_null=0 */
# at #
@@ -797,7 +797,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
-### DELETE FROM test.t1
+### DELETE FROM `test`.`t1`
### WHERE
### @1=-1 (255) /* TINYINT meta=0 nullable=1 is_null=0 */
# at #
@@ -824,7 +824,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1=1 /* TINYINT meta=0 nullable=1 is_null=0 */
# at #
@@ -841,7 +841,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
-### DELETE FROM test.t1
+### DELETE FROM `test`.`t1`
### WHERE
### @1=1 /* TINYINT meta=0 nullable=1 is_null=0 */
# at #
@@ -868,7 +868,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1=1234 /* SHORTINT meta=0 nullable=1 is_null=0 */
# at #
@@ -885,7 +885,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
-### DELETE FROM test.t1
+### DELETE FROM `test`.`t1`
### WHERE
### @1=1234 /* SHORTINT meta=0 nullable=1 is_null=0 */
# at #
@@ -912,10 +912,10 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1=-32768 (32768) /* SHORTINT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1=-1 (65535) /* SHORTINT meta=0 nullable=1 is_null=0 */
# at #
@@ -932,7 +932,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Update_rows: table id # flags: STMT_END_F
-### UPDATE test.t1
+### UPDATE `test`.`t1`
### WHERE
### @1=-32768 (32768) /* SHORTINT meta=0 nullable=1 is_null=0 */
### SET
@@ -951,7 +951,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
-### DELETE FROM test.t1
+### DELETE FROM `test`.`t1`
### WHERE
### @1=-1 (65535) /* SHORTINT meta=0 nullable=1 is_null=0 */
# at #
@@ -978,7 +978,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1=12345 /* MEDIUMINT meta=0 nullable=1 is_null=0 */
# at #
@@ -995,7 +995,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
-### DELETE FROM test.t1
+### DELETE FROM `test`.`t1`
### WHERE
### @1=12345 /* MEDIUMINT meta=0 nullable=1 is_null=0 */
# at #
@@ -1022,10 +1022,10 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1=-8388608 (8388608) /* MEDIUMINT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1=-1 (16777215) /* MEDIUMINT meta=0 nullable=1 is_null=0 */
# at #
@@ -1042,7 +1042,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Update_rows: table id # flags: STMT_END_F
-### UPDATE test.t1
+### UPDATE `test`.`t1`
### WHERE
### @1=-8388608 (8388608) /* MEDIUMINT meta=0 nullable=1 is_null=0 */
### SET
@@ -1061,7 +1061,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
-### DELETE FROM test.t1
+### DELETE FROM `test`.`t1`
### WHERE
### @1=-1 (16777215) /* MEDIUMINT meta=0 nullable=1 is_null=0 */
# at #
@@ -1088,7 +1088,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1=123456 /* INT meta=0 nullable=1 is_null=0 */
# at #
@@ -1105,7 +1105,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
-### DELETE FROM test.t1
+### DELETE FROM `test`.`t1`
### WHERE
### @1=123456 /* INT meta=0 nullable=1 is_null=0 */
# at #
@@ -1132,10 +1132,10 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1=-2147483648 (2147483648) /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1=-1 (4294967295) /* INT meta=0 nullable=1 is_null=0 */
# at #
@@ -1152,7 +1152,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Update_rows: table id # flags: STMT_END_F
-### UPDATE test.t1
+### UPDATE `test`.`t1`
### WHERE
### @1=-2147483648 (2147483648) /* INT meta=0 nullable=1 is_null=0 */
### SET
@@ -1171,7 +1171,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
-### DELETE FROM test.t1
+### DELETE FROM `test`.`t1`
### WHERE
### @1=-1 (4294967295) /* INT meta=0 nullable=1 is_null=0 */
# at #
@@ -1198,7 +1198,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1=1234567890 /* LONGINT meta=0 nullable=1 is_null=0 */
# at #
@@ -1215,7 +1215,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
-### DELETE FROM test.t1
+### DELETE FROM `test`.`t1`
### WHERE
### @1=1234567890 /* LONGINT meta=0 nullable=1 is_null=0 */
# at #
@@ -1242,10 +1242,10 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1=-9223372036854775808 (9223372036854775808) /* LONGINT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1=-1 (18446744073709551615) /* LONGINT meta=0 nullable=1 is_null=0 */
# at #
@@ -1262,7 +1262,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Update_rows: table id # flags: STMT_END_F
-### UPDATE test.t1
+### UPDATE `test`.`t1`
### WHERE
### @1=-9223372036854775808 (9223372036854775808) /* LONGINT meta=0 nullable=1 is_null=0 */
### SET
@@ -1281,7 +1281,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
-### DELETE FROM test.t1
+### DELETE FROM `test`.`t1`
### WHERE
### @1=-1 (18446744073709551615) /* LONGINT meta=0 nullable=1 is_null=0 */
# at #
@@ -1308,7 +1308,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1=123.223... /* FLOAT meta=4 nullable=1 is_null=0 */
# at #
@@ -1325,7 +1325,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
-### DELETE FROM test.t1
+### DELETE FROM `test`.`t1`
### WHERE
### @1=123.223... /* FLOAT meta=4 nullable=1 is_null=0 */
# at #
@@ -1352,7 +1352,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1=123434.223... /* DOUBLE meta=8 nullable=1 is_null=0 */
# at #
@@ -1369,7 +1369,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
-### DELETE FROM test.t1
+### DELETE FROM `test`.`t1`
### WHERE
### @1=123434.223... /* DOUBLE meta=8 nullable=1 is_null=0 */
# at #
@@ -1396,7 +1396,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1=000000124.450000000 /* DECIMAL(10,5) meta=2565 nullable=1 is_null=0 */
# at #
@@ -1413,7 +1413,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1=-000000543.210000000 /* DECIMAL(10,5) meta=2565 nullable=1 is_null=0 */
# at #
@@ -1430,7 +1430,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
-### DELETE FROM test.t1
+### DELETE FROM `test`.`t1`
### WHERE
### @1=000000124.450000000 /* DECIMAL(10,5) meta=2565 nullable=1 is_null=0 */
# at #
@@ -1457,7 +1457,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1='2001:02:03' /* DATE meta=0 nullable=1 is_null=0 */
# at #
@@ -1474,7 +1474,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
-### DELETE FROM test.t1
+### DELETE FROM `test`.`t1`
### WHERE
### @1='2001:02:03' /* DATE meta=0 nullable=1 is_null=0 */
# at #
@@ -1501,7 +1501,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1=2001-02-03 10:20:30 /* DATETIME meta=0 nullable=1 is_null=0 */
# at #
@@ -1518,7 +1518,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
-### DELETE FROM test.t1
+### DELETE FROM `test`.`t1`
### WHERE
### @1=2001-02-03 10:20:30 /* DATETIME meta=0 nullable=1 is_null=0 */
# at #
@@ -1546,7 +1546,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1=981184830 /* TIMESTAMP meta=0 nullable=0 is_null=0 */
# at #
@@ -1563,7 +1563,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
-### DELETE FROM test.t1
+### DELETE FROM `test`.`t1`
### WHERE
### @1=981184830 /* TIMESTAMP meta=0 nullable=0 is_null=0 */
# at #
@@ -1590,7 +1590,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1='11:22:33' /* TIME meta=0 nullable=1 is_null=0 */
# at #
@@ -1607,7 +1607,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
-### DELETE FROM test.t1
+### DELETE FROM `test`.`t1`
### WHERE
### @1='11:22:33' /* TIME meta=0 nullable=1 is_null=0 */
# at #
@@ -1634,7 +1634,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1=2001 /* YEAR meta=0 nullable=1 is_null=0 */
# at #
@@ -1651,7 +1651,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
-### DELETE FROM test.t1
+### DELETE FROM `test`.`t1`
### WHERE
### @1=2001 /* YEAR meta=0 nullable=1 is_null=0 */
# at #
@@ -1678,7 +1678,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1='a' /* STRING(1) meta=65025 nullable=1 is_null=0 */
# at #
@@ -1695,7 +1695,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
-### DELETE FROM test.t1
+### DELETE FROM `test`.`t1`
### WHERE
### @1='a' /* STRING(1) meta=65025 nullable=1 is_null=0 */
# at #
@@ -1722,7 +1722,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1='' /* STRING(0) meta=65024 nullable=1 is_null=0 */
# at #
@@ -1739,7 +1739,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
-### DELETE FROM test.t1
+### DELETE FROM `test`.`t1`
### WHERE
### @1='' /* STRING(0) meta=65024 nullable=1 is_null=0 */
# at #
@@ -1766,7 +1766,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1='b' /* STRING(1) meta=65025 nullable=1 is_null=0 */
# at #
@@ -1783,7 +1783,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
-### DELETE FROM test.t1
+### DELETE FROM `test`.`t1`
### WHERE
### @1='b' /* STRING(1) meta=65025 nullable=1 is_null=0 */
# at #
@@ -1810,7 +1810,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1='ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc' /* STRING(255) meta=65279 nullable=1 is_null=0 */
# at #
@@ -1827,7 +1827,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
-### DELETE FROM test.t1
+### DELETE FROM `test`.`t1`
### WHERE
### @1='ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc' /* STRING(255) meta=65279 nullable=1 is_null=0 */
# at #
@@ -1854,7 +1854,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1='a' /* STRING(3) meta=65027 nullable=1 is_null=0 */
# at #
@@ -1871,7 +1871,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
-### DELETE FROM test.t1
+### DELETE FROM `test`.`t1`
### WHERE
### @1='a' /* STRING(3) meta=65027 nullable=1 is_null=0 */
# at #
@@ -1898,7 +1898,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1='' /* STRING(0) meta=65024 nullable=1 is_null=0 */
# at #
@@ -1915,7 +1915,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
-### DELETE FROM test.t1
+### DELETE FROM `test`.`t1`
### WHERE
### @1='' /* STRING(0) meta=65024 nullable=1 is_null=0 */
# at #
@@ -1942,7 +1942,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1='a' /* STRING(3) meta=65027 nullable=1 is_null=0 */
# at #
@@ -1959,7 +1959,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
-### DELETE FROM test.t1
+### DELETE FROM `test`.`t1`
### WHERE
### @1='a' /* STRING(3) meta=65027 nullable=1 is_null=0 */
# at #
@@ -1986,7 +1986,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' /* STRING(765) meta=57085 nullable=1 is_null=0 */
# at #
@@ -2003,7 +2003,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1='ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß' /* STRING(765) meta=57085 nullable=1 is_null=0 */
# at #
@@ -2020,10 +2020,10 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
-### DELETE FROM test.t1
+### DELETE FROM `test`.`t1`
### WHERE
### @1='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' /* STRING(765) meta=57085 nullable=1 is_null=0 */
-### DELETE FROM test.t1
+### DELETE FROM `test`.`t1`
### WHERE
### @1='ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß' /* STRING(765) meta=57085 nullable=1 is_null=0 */
# at #
@@ -2050,7 +2050,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1='\x00a' /* STRING(2) meta=65026 nullable=1 is_null=0 */
# at #
@@ -2067,7 +2067,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
-### DELETE FROM test.t1
+### DELETE FROM `test`.`t1`
### WHERE
### @1='\x00a' /* STRING(2) meta=65026 nullable=1 is_null=0 */
# at #
@@ -2094,7 +2094,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1='' /* STRING(0) meta=65024 nullable=1 is_null=0 */
# at #
@@ -2111,7 +2111,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
-### DELETE FROM test.t1
+### DELETE FROM `test`.`t1`
### WHERE
### @1='' /* STRING(0) meta=65024 nullable=1 is_null=0 */
# at #
@@ -2138,7 +2138,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1='\x00a' /* STRING(2) meta=65026 nullable=1 is_null=0 */
# at #
@@ -2155,7 +2155,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
-### DELETE FROM test.t1
+### DELETE FROM `test`.`t1`
### WHERE
### @1='\x00a' /* STRING(2) meta=65026 nullable=1 is_null=0 */
# at #
@@ -2182,7 +2182,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1='\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a' /* STRING(510) meta=61182 nullable=1 is_null=0 */
# at #
@@ -2199,7 +2199,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1='\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß' /* STRING(510) meta=61182 nullable=1 is_null=0 */
# at #
@@ -2218,10 +2218,10 @@ BEGIN
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
-### DELETE FROM test.t1
+### DELETE FROM `test`.`t1`
### WHERE
### @1='\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a' /* STRING(510) meta=61182 nullable=1 is_null=0 */
-### DELETE FROM test.t1
+### DELETE FROM `test`.`t1`
### WHERE
### @1='\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß' /* STRING(510) meta=61182 nullable=1 is_null=0 */
# at #
@@ -2248,7 +2248,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1='' /* VARSTRING(0) meta=0 nullable=1 is_null=0 */
# at #
@@ -2265,7 +2265,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
-### DELETE FROM test.t1
+### DELETE FROM `test`.`t1`
### WHERE
### @1='' /* VARSTRING(0) meta=0 nullable=1 is_null=0 */
# at #
@@ -2292,7 +2292,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1='a' /* VARSTRING(1) meta=1 nullable=1 is_null=0 */
# at #
@@ -2309,7 +2309,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
-### DELETE FROM test.t1
+### DELETE FROM `test`.`t1`
### WHERE
### @1='a' /* VARSTRING(1) meta=1 nullable=1 is_null=0 */
# at #
@@ -2336,7 +2336,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
# at #
@@ -2353,7 +2353,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
-### DELETE FROM test.t1
+### DELETE FROM `test`.`t1`
### WHERE
### @1='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
# at #
@@ -2380,7 +2380,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' /* VARSTRING(261) meta=261 nullable=1 is_null=0 */
# at #
@@ -2397,7 +2397,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
-### DELETE FROM test.t1
+### DELETE FROM `test`.`t1`
### WHERE
### @1='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' /* VARSTRING(261) meta=261 nullable=1 is_null=0 */
# at #
@@ -2424,7 +2424,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1='' /* VARSTRING(0) meta=0 nullable=1 is_null=0 */
# at #
@@ -2441,7 +2441,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
-### DELETE FROM test.t1
+### DELETE FROM `test`.`t1`
### WHERE
### @1='' /* VARSTRING(0) meta=0 nullable=1 is_null=0 */
# at #
@@ -2468,7 +2468,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1='a' /* VARSTRING(3) meta=3 nullable=1 is_null=0 */
# at #
@@ -2485,7 +2485,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
-### DELETE FROM test.t1
+### DELETE FROM `test`.`t1`
### WHERE
### @1='a' /* VARSTRING(3) meta=3 nullable=1 is_null=0 */
# at #
@@ -2512,7 +2512,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' /* VARSTRING(765) meta=765 nullable=1 is_null=0 */
# at #
@@ -2529,7 +2529,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1='ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß' /* VARSTRING(765) meta=765 nullable=1 is_null=0 */
# at #
@@ -2546,10 +2546,10 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
-### DELETE FROM test.t1
+### DELETE FROM `test`.`t1`
### WHERE
### @1='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' /* VARSTRING(765) meta=765 nullable=1 is_null=0 */
-### DELETE FROM test.t1
+### DELETE FROM `test`.`t1`
### WHERE
### @1='ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß' /* VARSTRING(765) meta=765 nullable=1 is_null=0 */
# at #
@@ -2576,7 +2576,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' /* VARSTRING(783) meta=783 nullable=1 is_null=0 */
# at #
@@ -2593,7 +2593,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1='ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß' /* VARSTRING(783) meta=783 nullable=1 is_null=0 */
# at #
@@ -2610,10 +2610,10 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
-### DELETE FROM test.t1
+### DELETE FROM `test`.`t1`
### WHERE
### @1='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' /* VARSTRING(783) meta=783 nullable=1 is_null=0 */
-### DELETE FROM test.t1
+### DELETE FROM `test`.`t1`
### WHERE
### @1='ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß' /* VARSTRING(783) meta=783 nullable=1 is_null=0 */
# at #
@@ -2640,7 +2640,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1='' /* VARSTRING(0) meta=0 nullable=1 is_null=0 */
# at #
@@ -2657,7 +2657,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
-### DELETE FROM test.t1
+### DELETE FROM `test`.`t1`
### WHERE
### @1='' /* VARSTRING(0) meta=0 nullable=1 is_null=0 */
# at #
@@ -2684,7 +2684,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1='\x00a' /* VARSTRING(2) meta=2 nullable=1 is_null=0 */
# at #
@@ -2701,7 +2701,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
-### DELETE FROM test.t1
+### DELETE FROM `test`.`t1`
### WHERE
### @1='\x00a' /* VARSTRING(2) meta=2 nullable=1 is_null=0 */
# at #
@@ -2728,7 +2728,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1='\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b' /* VARSTRING(510) meta=510 nullable=1 is_null=0 */
# at #
@@ -2745,7 +2745,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
-### DELETE FROM test.t1
+### DELETE FROM `test`.`t1`
### WHERE
### @1='\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b' /* VARSTRING(510) meta=510 nullable=1 is_null=0 */
# at #
@@ -2772,7 +2772,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1='\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b' /* VARSTRING(522) meta=522 nullable=1 is_null=0 */
# at #
@@ -2789,7 +2789,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
-### DELETE FROM test.t1
+### DELETE FROM `test`.`t1`
### WHERE
### @1='\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b' /* VARSTRING(522) meta=522 nullable=1 is_null=0 */
# at #
@@ -2816,7 +2816,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1='' /* STRING(1) meta=65025 nullable=1 is_null=0 */
# at #
@@ -2833,7 +2833,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1='\x02' /* STRING(1) meta=65025 nullable=1 is_null=0 */
# at #
@@ -2850,7 +2850,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1='a' /* STRING(1) meta=65025 nullable=1 is_null=0 */
# at #
@@ -2867,7 +2867,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
-### DELETE FROM test.t1
+### DELETE FROM `test`.`t1`
### WHERE
### @1='a' /* STRING(1) meta=65025 nullable=1 is_null=0 */
# at #
@@ -2894,7 +2894,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1='' /* STRING(0) meta=65024 nullable=1 is_null=0 */
# at #
@@ -2911,7 +2911,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
-### DELETE FROM test.t1
+### DELETE FROM `test`.`t1`
### WHERE
### @1='' /* STRING(0) meta=65024 nullable=1 is_null=0 */
# at #
@@ -2938,7 +2938,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1='' /* STRING(1) meta=65025 nullable=1 is_null=0 */
# at #
@@ -2955,7 +2955,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1='\x02' /* STRING(1) meta=65025 nullable=1 is_null=0 */
# at #
@@ -2972,7 +2972,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1='a' /* STRING(1) meta=65025 nullable=1 is_null=0 */
# at #
@@ -2989,7 +2989,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
-### DELETE FROM test.t1
+### DELETE FROM `test`.`t1`
### WHERE
### @1='a' /* STRING(1) meta=65025 nullable=1 is_null=0 */
# at #
@@ -3016,7 +3016,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1='' /* STRING(255) meta=65279 nullable=1 is_null=0 */
# at #
@@ -3033,7 +3033,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1='\x02' /* STRING(255) meta=65279 nullable=1 is_null=0 */
# at #
@@ -3050,7 +3050,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1='a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a' /* STRING(255) meta=65279 nullable=1 is_null=0 */
# at #
@@ -3067,7 +3067,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
-### DELETE FROM test.t1
+### DELETE FROM `test`.`t1`
### WHERE
### @1='' /* STRING(255) meta=65279 nullable=1 is_null=0 */
# at #
@@ -3094,7 +3094,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1='' /* VARSTRING(0) meta=0 nullable=1 is_null=0 */
# at #
@@ -3111,7 +3111,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
-### DELETE FROM test.t1
+### DELETE FROM `test`.`t1`
### WHERE
### @1='' /* VARSTRING(0) meta=0 nullable=1 is_null=0 */
# at #
@@ -3138,7 +3138,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1='\x00' /* VARSTRING(1) meta=1 nullable=1 is_null=0 */
# at #
@@ -3155,7 +3155,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1='\x02' /* VARSTRING(1) meta=1 nullable=1 is_null=0 */
# at #
@@ -3172,7 +3172,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1='a' /* VARSTRING(1) meta=1 nullable=1 is_null=0 */
# at #
@@ -3189,7 +3189,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
-### DELETE FROM test.t1
+### DELETE FROM `test`.`t1`
### WHERE
### @1='\x02' /* VARSTRING(1) meta=1 nullable=1 is_null=0 */
# at #
@@ -3216,7 +3216,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1='\x00' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
# at #
@@ -3233,7 +3233,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1='\x02' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
# at #
@@ -3250,7 +3250,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1='a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
# at #
@@ -3267,7 +3267,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
-### DELETE FROM test.t1
+### DELETE FROM `test`.`t1`
### WHERE
### @1='\x02' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
# at #
@@ -3294,7 +3294,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1='tinyblob1' /* TINYBLOB/TINYTEXT meta=1 nullable=1 is_null=0 */
# at #
@@ -3311,7 +3311,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
-### DELETE FROM test.t1
+### DELETE FROM `test`.`t1`
### WHERE
### @1='tinyblob1' /* TINYBLOB/TINYTEXT meta=1 nullable=1 is_null=0 */
# at #
@@ -3338,7 +3338,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1='blob1' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
# at #
@@ -3355,7 +3355,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
-### DELETE FROM test.t1
+### DELETE FROM `test`.`t1`
### WHERE
### @1='blob1' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
# at #
@@ -3382,7 +3382,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1='mediumblob1' /* MEDIUMBLOB/MEDIUMTEXT meta=3 nullable=1 is_null=0 */
# at #
@@ -3399,7 +3399,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
-### DELETE FROM test.t1
+### DELETE FROM `test`.`t1`
### WHERE
### @1='mediumblob1' /* MEDIUMBLOB/MEDIUMTEXT meta=3 nullable=1 is_null=0 */
# at #
@@ -3426,7 +3426,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1='longblob1' /* LONGBLOB/LONGTEXT meta=4 nullable=1 is_null=0 */
# at #
@@ -3443,7 +3443,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
-### DELETE FROM test.t1
+### DELETE FROM `test`.`t1`
### WHERE
### @1='longblob1' /* LONGBLOB/LONGTEXT meta=4 nullable=1 is_null=0 */
# at #
@@ -3470,7 +3470,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1='tinytext1' /* TINYBLOB/TINYTEXT meta=1 nullable=1 is_null=0 */
# at #
@@ -3487,7 +3487,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
-### DELETE FROM test.t1
+### DELETE FROM `test`.`t1`
### WHERE
### @1='tinytext1' /* TINYBLOB/TINYTEXT meta=1 nullable=1 is_null=0 */
# at #
@@ -3514,7 +3514,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1='text1' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
# at #
@@ -3531,7 +3531,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
-### DELETE FROM test.t1
+### DELETE FROM `test`.`t1`
### WHERE
### @1='text1' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
# at #
@@ -3558,7 +3558,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1='mediumtext1' /* MEDIUMBLOB/MEDIUMTEXT meta=3 nullable=1 is_null=0 */
# at #
@@ -3575,7 +3575,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
-### DELETE FROM test.t1
+### DELETE FROM `test`.`t1`
### WHERE
### @1='mediumtext1' /* MEDIUMBLOB/MEDIUMTEXT meta=3 nullable=1 is_null=0 */
# at #
@@ -3602,7 +3602,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1='longtext1' /* LONGBLOB/LONGTEXT meta=4 nullable=1 is_null=0 */
# at #
@@ -3619,7 +3619,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
-### DELETE FROM test.t1
+### DELETE FROM `test`.`t1`
### WHERE
### @1='longtext1' /* LONGBLOB/LONGTEXT meta=4 nullable=1 is_null=0 */
# at #
@@ -3646,7 +3646,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1='\x00t\x00i\x00n\x00y\x00t\x00e\x00x\x00t\x001' /* TINYBLOB/TINYTEXT meta=1 nullable=1 is_null=0 */
# at #
@@ -3663,7 +3663,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
-### DELETE FROM test.t1
+### DELETE FROM `test`.`t1`
### WHERE
### @1='\x00t\x00i\x00n\x00y\x00t\x00e\x00x\x00t\x001' /* TINYBLOB/TINYTEXT meta=1 nullable=1 is_null=0 */
# at #
@@ -3690,7 +3690,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1='\x00t\x00e\x00x\x00t\x001' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
# at #
@@ -3707,7 +3707,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
-### DELETE FROM test.t1
+### DELETE FROM `test`.`t1`
### WHERE
### @1='\x00t\x00e\x00x\x00t\x001' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
# at #
@@ -3734,7 +3734,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1='\x00m\x00e\x00d\x00i\x00u\x00m\x00t\x00e\x00x\x00t\x001' /* MEDIUMBLOB/MEDIUMTEXT meta=3 nullable=1 is_null=0 */
# at #
@@ -3751,7 +3751,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
-### DELETE FROM test.t1
+### DELETE FROM `test`.`t1`
### WHERE
### @1='\x00m\x00e\x00d\x00i\x00u\x00m\x00t\x00e\x00x\x00t\x001' /* MEDIUMBLOB/MEDIUMTEXT meta=3 nullable=1 is_null=0 */
# at #
@@ -3778,7 +3778,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1='\x00l\x00o\x00n\x00g\x00t\x00e\x00x\x00t\x001' /* LONGBLOB/LONGTEXT meta=4 nullable=1 is_null=0 */
# at #
@@ -3795,7 +3795,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
-### DELETE FROM test.t1
+### DELETE FROM `test`.`t1`
### WHERE
### @1='\x00l\x00o\x00n\x00g\x00t\x00e\x00x\x00t\x001' /* LONGBLOB/LONGTEXT meta=4 nullable=1 is_null=0 */
# at #
@@ -3822,7 +3822,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1=2 /* ENUM(1 byte) meta=63233 nullable=1 is_null=0 */
# at #
@@ -3839,7 +3839,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
-### DELETE FROM test.t1
+### DELETE FROM `test`.`t1`
### WHERE
### @1=2 /* ENUM(1 byte) meta=63233 nullable=1 is_null=0 */
# at #
@@ -3866,7 +3866,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1=b'00000011' /* SET(1 bytes) meta=63489 nullable=1 is_null=0 */
# at #
@@ -3883,7 +3883,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1=b'00000101' /* SET(1 bytes) meta=63489 nullable=1 is_null=0 */
# at #
@@ -3900,7 +3900,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1=b'00000110' /* SET(1 bytes) meta=63489 nullable=1 is_null=0 */
# at #
@@ -3917,7 +3917,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1=b'00000111' /* SET(1 bytes) meta=63489 nullable=1 is_null=0 */
# at #
@@ -3934,7 +3934,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1=b'00001111' /* SET(1 bytes) meta=63489 nullable=1 is_null=0 */
# at #
@@ -3951,7 +3951,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1=b'00011111' /* SET(1 bytes) meta=63489 nullable=1 is_null=0 */
# at #
@@ -3968,7 +3968,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1=b'00111111' /* SET(1 bytes) meta=63489 nullable=1 is_null=0 */
# at #
@@ -3985,7 +3985,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
-### DELETE FROM test.t1
+### DELETE FROM `test`.`t1`
### WHERE
### @1=b'00000011' /* SET(1 bytes) meta=63489 nullable=1 is_null=0 */
# at #
@@ -4017,7 +4017,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1=1 /* INT meta=0 nullable=0 is_null=0 */
### @2=0 /* INT meta=0 nullable=0 is_null=0 */
@@ -4035,7 +4035,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1=0 /* INT meta=0 nullable=0 is_null=0 */
### @2=1 /* INT meta=0 nullable=0 is_null=0 */
@@ -4053,7 +4053,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t2` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t2
+### INSERT INTO `test`.`t2`
### SET
### @1=1 /* INT meta=0 nullable=0 is_null=0 */
### @2=0 /* INT meta=0 nullable=0 is_null=0 */
@@ -4071,7 +4071,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t2` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t2
+### INSERT INTO `test`.`t2`
### SET
### @1=0 /* INT meta=0 nullable=0 is_null=0 */
### @2=1 /* INT meta=0 nullable=0 is_null=0 */
@@ -4093,28 +4093,28 @@ BEGIN
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t2` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Update_rows: table id #
#010909 4:46:40 server id 1 end_log_pos # Update_rows: table id # flags: STMT_END_F
-### UPDATE test.t1
+### UPDATE `test`.`t1`
### WHERE
### @1=1 /* INT meta=0 nullable=0 is_null=0 */
### @2=0 /* INT meta=0 nullable=0 is_null=0 */
### SET
### @1=10 /* INT meta=0 nullable=0 is_null=0 */
### @2=0 /* INT meta=0 nullable=0 is_null=0 */
-### UPDATE test.t1
+### UPDATE `test`.`t1`
### WHERE
### @1=0 /* INT meta=0 nullable=0 is_null=0 */
### @2=1 /* INT meta=0 nullable=0 is_null=0 */
### SET
### @1=10 /* INT meta=0 nullable=0 is_null=0 */
### @2=1 /* INT meta=0 nullable=0 is_null=0 */
-### UPDATE test.t2
+### UPDATE `test`.`t2`
### WHERE
### @1=1 /* INT meta=0 nullable=0 is_null=0 */
### @2=0 /* INT meta=0 nullable=0 is_null=0 */
### SET
### @1=20 /* INT meta=0 nullable=0 is_null=0 */
### @2=0 /* INT meta=0 nullable=0 is_null=0 */
-### UPDATE test.t2
+### UPDATE `test`.`t2`
### WHERE
### @1=0 /* INT meta=0 nullable=0 is_null=0 */
### @2=1 /* INT meta=0 nullable=0 is_null=0 */
diff --git a/mysql-test/r/mysqlbinlog_row_innodb.result b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_innodb.result
index 4be266d586c..3227ad3d661 100644
--- a/mysql-test/r/mysqlbinlog_row_innodb.result
+++ b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_innodb.result
@@ -2365,7 +2365,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1=b'0' /* BIT(1) meta=1 nullable=1 is_null=0 */
### @2=b'0000000000000000000000000000000000000000000000000000000000000000' /* BIT(64) meta=2048 nullable=1 is_null=0 */
@@ -2458,7 +2458,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1=b'1' /* BIT(1) meta=1 nullable=1 is_null=0 */
### @2=b'1111111111111111111111111111111111111111111111111111111111111111' /* BIT(64) meta=2048 nullable=1 is_null=0 */
@@ -2553,7 +2553,7 @@ BEGIN
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1=NULL /* type=16 meta=1 nullable=1 is_null=1 */
### @2=NULL /* type=16 meta=2048 nullable=1 is_null=1 */
@@ -2634,7 +2634,7 @@ BEGIN
### @77=NULL /* TIMESTAMP meta=63233 nullable=1 is_null=1 */
### @78=NULL /* TIMESTAMP meta=63489 nullable=1 is_null=1 */
### @79=3 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1=b'1' /* BIT(1) meta=1 nullable=1 is_null=0 */
### @2=b'1111111111111111111111111111111111111111111111111111111111111111' /* BIT(64) meta=2048 nullable=1 is_null=0 */
@@ -2727,7 +2727,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Update_rows: table id # flags: STMT_END_F
-### UPDATE test.t1
+### UPDATE `test`.`t1`
### WHERE
### @1=b'0' /* BIT(1) meta=1 nullable=1 is_null=0 */
### @2=b'0000000000000000000000000000000000000000000000000000000000000000' /* BIT(64) meta=2048 nullable=1 is_null=0 */
@@ -2900,7 +2900,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Update_rows: table id # flags: STMT_END_F
-### UPDATE test.t1
+### UPDATE `test`.`t1`
### WHERE
### @1=b'1' /* BIT(1) meta=1 nullable=1 is_null=0 */
### @2=b'1111111111111111111111111111111111111111111111111111111111111111' /* BIT(64) meta=2048 nullable=1 is_null=0 */
@@ -3073,7 +3073,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Update_rows: table id # flags: STMT_END_F
-### UPDATE test.t1
+### UPDATE `test`.`t1`
### WHERE
### @1=NULL /* type=16 meta=1 nullable=1 is_null=1 */
### @2=NULL /* type=16 meta=2048 nullable=1 is_null=1 */
@@ -3246,7 +3246,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Update_rows: table id # flags: STMT_END_F
-### UPDATE test.t1
+### UPDATE `test`.`t1`
### WHERE
### @1=b'1' /* BIT(1) meta=1 nullable=1 is_null=0 */
### @2=b'1111111111111111111111111111111111111111111111111111111111111111' /* BIT(64) meta=2048 nullable=1 is_null=0 */
@@ -3419,7 +3419,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
-### DELETE FROM test.t1
+### DELETE FROM `test`.`t1`
### WHERE
### @1=b'1' /* BIT(1) meta=1 nullable=1 is_null=0 */
### @2=b'1111111111111111111111111111111111111111111111111111111111111111' /* BIT(64) meta=2048 nullable=1 is_null=0 */
@@ -3512,7 +3512,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
-### DELETE FROM test.t1
+### DELETE FROM `test`.`t1`
### WHERE
### @1=b'0' /* BIT(1) meta=1 nullable=1 is_null=0 */
### @2=b'0000000000000000000000000000000000000000000000000000000000000000' /* BIT(64) meta=2048 nullable=1 is_null=0 */
@@ -3605,7 +3605,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
-### DELETE FROM test.t1
+### DELETE FROM `test`.`t1`
### WHERE
### @1=b'1' /* BIT(1) meta=1 nullable=1 is_null=0 */
### @2=b'1111111111111111111111111111111111111111111111111111111111111111' /* BIT(64) meta=2048 nullable=1 is_null=0 */
@@ -3698,7 +3698,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
-### DELETE FROM test.t1
+### DELETE FROM `test`.`t1`
### WHERE
### @1=NULL /* type=16 meta=1 nullable=1 is_null=1 */
### @2=NULL /* type=16 meta=2048 nullable=1 is_null=1 */
@@ -3905,47 +3905,47 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1='2008:08:01' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-01' /* VARSTRING(24) meta=24 nullable=1 is_null=0 */
### @3=1 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1='2008:08:02' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-02' /* VARSTRING(24) meta=24 nullable=1 is_null=0 */
### @3=2 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1='2008:08:03' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-03' /* VARSTRING(24) meta=24 nullable=1 is_null=0 */
### @3=3 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1='2008:08:04' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-04' /* VARSTRING(24) meta=24 nullable=1 is_null=0 */
### @3=4 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1='2008:08:05' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-05' /* VARSTRING(24) meta=24 nullable=1 is_null=0 */
### @3=5 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1='2008:08:06' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-06' /* VARSTRING(24) meta=24 nullable=1 is_null=0 */
### @3=6 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1='2008:08:07' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-07' /* VARSTRING(24) meta=24 nullable=1 is_null=0 */
### @3=7 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1='2008:08:08' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-08' /* VARSTRING(24) meta=24 nullable=1 is_null=0 */
### @3=8 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1='2008:08:09' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-09' /* VARSTRING(24) meta=24 nullable=1 is_null=0 */
@@ -3962,7 +3962,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Update_rows: table id # flags: STMT_END_F
-### UPDATE test.t1
+### UPDATE `test`.`t1`
### WHERE
### @1='2008:08:01' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-01' /* VARSTRING(24) meta=24 nullable=1 is_null=0 */
@@ -3971,7 +3971,7 @@ BEGIN
### @1='2008:08:11' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-01' /* VARSTRING(24) meta=24 nullable=1 is_null=0 */
### @3=1 /* INT meta=0 nullable=1 is_null=0 */
-### UPDATE test.t1
+### UPDATE `test`.`t1`
### WHERE
### @1='2008:08:02' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-02' /* VARSTRING(24) meta=24 nullable=1 is_null=0 */
@@ -3980,7 +3980,7 @@ BEGIN
### @1='2008:08:12' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-02' /* VARSTRING(24) meta=24 nullable=1 is_null=0 */
### @3=2 /* INT meta=0 nullable=1 is_null=0 */
-### UPDATE test.t1
+### UPDATE `test`.`t1`
### WHERE
### @1='2008:08:03' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-03' /* VARSTRING(24) meta=24 nullable=1 is_null=0 */
@@ -3989,7 +3989,7 @@ BEGIN
### @1='2008:08:13' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-03' /* VARSTRING(24) meta=24 nullable=1 is_null=0 */
### @3=3 /* INT meta=0 nullable=1 is_null=0 */
-### UPDATE test.t1
+### UPDATE `test`.`t1`
### WHERE
### @1='2008:08:04' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-04' /* VARSTRING(24) meta=24 nullable=1 is_null=0 */
@@ -3998,7 +3998,7 @@ BEGIN
### @1='2008:08:14' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-04' /* VARSTRING(24) meta=24 nullable=1 is_null=0 */
### @3=4 /* INT meta=0 nullable=1 is_null=0 */
-### UPDATE test.t1
+### UPDATE `test`.`t1`
### WHERE
### @1='2008:08:05' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-05' /* VARSTRING(24) meta=24 nullable=1 is_null=0 */
@@ -4007,7 +4007,7 @@ BEGIN
### @1='2008:08:15' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-05' /* VARSTRING(24) meta=24 nullable=1 is_null=0 */
### @3=5 /* INT meta=0 nullable=1 is_null=0 */
-### UPDATE test.t1
+### UPDATE `test`.`t1`
### WHERE
### @1='2008:08:06' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-06' /* VARSTRING(24) meta=24 nullable=1 is_null=0 */
@@ -4016,7 +4016,7 @@ BEGIN
### @1='2008:08:16' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-06' /* VARSTRING(24) meta=24 nullable=1 is_null=0 */
### @3=6 /* INT meta=0 nullable=1 is_null=0 */
-### UPDATE test.t1
+### UPDATE `test`.`t1`
### WHERE
### @1='2008:08:07' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-07' /* VARSTRING(24) meta=24 nullable=1 is_null=0 */
@@ -4037,37 +4037,37 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
-### DELETE FROM test.t1
+### DELETE FROM `test`.`t1`
### WHERE
### @1='2008:08:11' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-01' /* VARSTRING(24) meta=24 nullable=1 is_null=0 */
### @3=1 /* INT meta=0 nullable=1 is_null=0 */
-### DELETE FROM test.t1
+### DELETE FROM `test`.`t1`
### WHERE
### @1='2008:08:12' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-02' /* VARSTRING(24) meta=24 nullable=1 is_null=0 */
### @3=2 /* INT meta=0 nullable=1 is_null=0 */
-### DELETE FROM test.t1
+### DELETE FROM `test`.`t1`
### WHERE
### @1='2008:08:13' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-03' /* VARSTRING(24) meta=24 nullable=1 is_null=0 */
### @3=3 /* INT meta=0 nullable=1 is_null=0 */
-### DELETE FROM test.t1
+### DELETE FROM `test`.`t1`
### WHERE
### @1='2008:08:14' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-04' /* VARSTRING(24) meta=24 nullable=1 is_null=0 */
### @3=4 /* INT meta=0 nullable=1 is_null=0 */
-### DELETE FROM test.t1
+### DELETE FROM `test`.`t1`
### WHERE
### @1='2008:08:15' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-05' /* VARSTRING(24) meta=24 nullable=1 is_null=0 */
### @3=5 /* INT meta=0 nullable=1 is_null=0 */
-### DELETE FROM test.t1
+### DELETE FROM `test`.`t1`
### WHERE
### @1='2008:08:16' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-06' /* VARSTRING(24) meta=24 nullable=1 is_null=0 */
### @3=6 /* INT meta=0 nullable=1 is_null=0 */
-### DELETE FROM test.t1
+### DELETE FROM `test`.`t1`
### WHERE
### @1='2008:08:17' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-07' /* VARSTRING(24) meta=24 nullable=1 is_null=0 */
@@ -4292,47 +4292,47 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1='2008:01:01' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-01-01' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=11 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1='2008:01:02' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-01-02' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=2 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1='2008:01:03' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-01-03' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=3 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1='2008:01:04' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-01-04' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=4 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1='2008:01:05' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-01-05' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=5 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1='2008:01:06' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-01-06' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=6 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1='2008:01:07' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-01-07' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=7 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1='2008:01:08' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-01-08' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=18 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1='2008:01:09' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-01-09' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
@@ -4349,47 +4349,47 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t2` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t2
+### INSERT INTO `test`.`t2`
### SET
### @1='2008:02:01' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-02-01' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=21 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test.t2
+### INSERT INTO `test`.`t2`
### SET
### @1='2008:02:02' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-02-02' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=2 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test.t2
+### INSERT INTO `test`.`t2`
### SET
### @1='2008:02:03' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-02-03' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=3 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test.t2
+### INSERT INTO `test`.`t2`
### SET
### @1='2008:02:04' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-02-04' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=4 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test.t2
+### INSERT INTO `test`.`t2`
### SET
### @1='2008:02:05' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-02-05' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=5 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test.t2
+### INSERT INTO `test`.`t2`
### SET
### @1='2008:02:06' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-02-06' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=6 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test.t2
+### INSERT INTO `test`.`t2`
### SET
### @1='2008:02:07' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-02-07' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=7 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test.t2
+### INSERT INTO `test`.`t2`
### SET
### @1='2008:02:08' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-02-08' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=28 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test.t2
+### INSERT INTO `test`.`t2`
### SET
### @1='2008:02:09' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-02-09' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
@@ -4406,47 +4406,47 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t3` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t3
+### INSERT INTO `test`.`t3`
### SET
### @1='2008:03:01' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-03-01' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=31 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test.t3
+### INSERT INTO `test`.`t3`
### SET
### @1='2008:03:02' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-03-02' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=2 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test.t3
+### INSERT INTO `test`.`t3`
### SET
### @1='2008:03:03' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-03-03' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=3 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test.t3
+### INSERT INTO `test`.`t3`
### SET
### @1='2008:03:04' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-03-04' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=4 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test.t3
+### INSERT INTO `test`.`t3`
### SET
### @1='2008:03:05' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-03-05' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=5 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test.t3
+### INSERT INTO `test`.`t3`
### SET
### @1='2008:03:06' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-03-06' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=6 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test.t3
+### INSERT INTO `test`.`t3`
### SET
### @1='2008:03:07' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-03-07' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=7 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test.t3
+### INSERT INTO `test`.`t3`
### SET
### @1='2008:03:08' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-03-08' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=38 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test.t3
+### INSERT INTO `test`.`t3`
### SET
### @1='2008:03:09' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-03-09' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
@@ -4471,7 +4471,7 @@ BEGIN
#010909 4:46:40 server id 1 end_log_pos # Update_rows: table id #
#010909 4:46:40 server id 1 end_log_pos # Update_rows: table id #
#010909 4:46:40 server id 1 end_log_pos # Update_rows: table id # flags: STMT_END_F
-### UPDATE test.t1
+### UPDATE `test`.`t1`
### WHERE
### @1='2008:01:02' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-01-02' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
@@ -4480,7 +4480,7 @@ BEGIN
### @1='2018:01:02' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-01-02' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=2 /* INT meta=0 nullable=1 is_null=0 */
-### UPDATE test.t1
+### UPDATE `test`.`t1`
### WHERE
### @1='2008:01:03' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-01-03' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
@@ -4489,7 +4489,7 @@ BEGIN
### @1='2018:01:03' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-01-03' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=3 /* INT meta=0 nullable=1 is_null=0 */
-### UPDATE test.t1
+### UPDATE `test`.`t1`
### WHERE
### @1='2008:01:04' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-01-04' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
@@ -4498,7 +4498,7 @@ BEGIN
### @1='2018:01:04' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-01-04' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=4 /* INT meta=0 nullable=1 is_null=0 */
-### UPDATE test.t1
+### UPDATE `test`.`t1`
### WHERE
### @1='2008:01:05' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-01-05' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
@@ -4507,7 +4507,7 @@ BEGIN
### @1='2018:01:05' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-01-05' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=5 /* INT meta=0 nullable=1 is_null=0 */
-### UPDATE test.t1
+### UPDATE `test`.`t1`
### WHERE
### @1='2008:01:06' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-01-06' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
@@ -4516,7 +4516,7 @@ BEGIN
### @1='2018:01:06' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-01-06' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=6 /* INT meta=0 nullable=1 is_null=0 */
-### UPDATE test.t1
+### UPDATE `test`.`t1`
### WHERE
### @1='2008:01:07' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-01-07' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
@@ -4525,7 +4525,7 @@ BEGIN
### @1='2018:01:07' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-01-07' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=7 /* INT meta=0 nullable=1 is_null=0 */
-### UPDATE test.t2
+### UPDATE `test`.`t2`
### WHERE
### @1='2008:02:02' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-02-02' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
@@ -4534,7 +4534,7 @@ BEGIN
### @1='2028:02:02' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-02-02' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=2 /* INT meta=0 nullable=1 is_null=0 */
-### UPDATE test.t2
+### UPDATE `test`.`t2`
### WHERE
### @1='2008:02:03' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-02-03' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
@@ -4543,7 +4543,7 @@ BEGIN
### @1='2028:02:03' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-02-03' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=3 /* INT meta=0 nullable=1 is_null=0 */
-### UPDATE test.t2
+### UPDATE `test`.`t2`
### WHERE
### @1='2008:02:04' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-02-04' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
@@ -4552,7 +4552,7 @@ BEGIN
### @1='2028:02:04' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-02-04' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=4 /* INT meta=0 nullable=1 is_null=0 */
-### UPDATE test.t2
+### UPDATE `test`.`t2`
### WHERE
### @1='2008:02:05' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-02-05' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
@@ -4561,7 +4561,7 @@ BEGIN
### @1='2028:02:05' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-02-05' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=5 /* INT meta=0 nullable=1 is_null=0 */
-### UPDATE test.t2
+### UPDATE `test`.`t2`
### WHERE
### @1='2008:02:06' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-02-06' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
@@ -4570,7 +4570,7 @@ BEGIN
### @1='2028:02:06' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-02-06' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=6 /* INT meta=0 nullable=1 is_null=0 */
-### UPDATE test.t2
+### UPDATE `test`.`t2`
### WHERE
### @1='2008:02:07' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-02-07' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
@@ -4579,7 +4579,7 @@ BEGIN
### @1='2028:02:07' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-02-07' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=7 /* INT meta=0 nullable=1 is_null=0 */
-### UPDATE test.t3
+### UPDATE `test`.`t3`
### WHERE
### @1='2008:03:02' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-03-02' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
@@ -4588,7 +4588,7 @@ BEGIN
### @1='2038:03:02' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-03-02' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=2 /* INT meta=0 nullable=1 is_null=0 */
-### UPDATE test.t3
+### UPDATE `test`.`t3`
### WHERE
### @1='2008:03:03' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-03-03' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
@@ -4597,7 +4597,7 @@ BEGIN
### @1='2038:03:03' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-03-03' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=3 /* INT meta=0 nullable=1 is_null=0 */
-### UPDATE test.t3
+### UPDATE `test`.`t3`
### WHERE
### @1='2008:03:04' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-03-04' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
@@ -4606,7 +4606,7 @@ BEGIN
### @1='2038:03:04' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-03-04' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=4 /* INT meta=0 nullable=1 is_null=0 */
-### UPDATE test.t3
+### UPDATE `test`.`t3`
### WHERE
### @1='2008:03:05' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-03-05' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
@@ -4615,7 +4615,7 @@ BEGIN
### @1='2038:03:05' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-03-05' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=5 /* INT meta=0 nullable=1 is_null=0 */
-### UPDATE test.t3
+### UPDATE `test`.`t3`
### WHERE
### @1='2008:03:06' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-03-06' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
@@ -4624,7 +4624,7 @@ BEGIN
### @1='2038:03:06' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-03-06' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=6 /* INT meta=0 nullable=1 is_null=0 */
-### UPDATE test.t3
+### UPDATE `test`.`t3`
### WHERE
### @1='2008:03:07' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-03-07' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
@@ -4653,92 +4653,92 @@ BEGIN
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
-### DELETE FROM test.t1
+### DELETE FROM `test`.`t1`
### WHERE
### @1='2018:01:02' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-01-02' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=2 /* INT meta=0 nullable=1 is_null=0 */
-### DELETE FROM test.t1
+### DELETE FROM `test`.`t1`
### WHERE
### @1='2018:01:03' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-01-03' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=3 /* INT meta=0 nullable=1 is_null=0 */
-### DELETE FROM test.t1
+### DELETE FROM `test`.`t1`
### WHERE
### @1='2018:01:04' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-01-04' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=4 /* INT meta=0 nullable=1 is_null=0 */
-### DELETE FROM test.t1
+### DELETE FROM `test`.`t1`
### WHERE
### @1='2018:01:05' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-01-05' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=5 /* INT meta=0 nullable=1 is_null=0 */
-### DELETE FROM test.t1
+### DELETE FROM `test`.`t1`
### WHERE
### @1='2018:01:06' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-01-06' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=6 /* INT meta=0 nullable=1 is_null=0 */
-### DELETE FROM test.t1
+### DELETE FROM `test`.`t1`
### WHERE
### @1='2018:01:07' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-01-07' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=7 /* INT meta=0 nullable=1 is_null=0 */
-### DELETE FROM test.t2
+### DELETE FROM `test`.`t2`
### WHERE
### @1='2028:02:02' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-02-02' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=2 /* INT meta=0 nullable=1 is_null=0 */
-### DELETE FROM test.t2
+### DELETE FROM `test`.`t2`
### WHERE
### @1='2028:02:03' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-02-03' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=3 /* INT meta=0 nullable=1 is_null=0 */
-### DELETE FROM test.t2
+### DELETE FROM `test`.`t2`
### WHERE
### @1='2028:02:04' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-02-04' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=4 /* INT meta=0 nullable=1 is_null=0 */
-### DELETE FROM test.t2
+### DELETE FROM `test`.`t2`
### WHERE
### @1='2028:02:05' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-02-05' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=5 /* INT meta=0 nullable=1 is_null=0 */
-### DELETE FROM test.t2
+### DELETE FROM `test`.`t2`
### WHERE
### @1='2028:02:06' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-02-06' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=6 /* INT meta=0 nullable=1 is_null=0 */
-### DELETE FROM test.t2
+### DELETE FROM `test`.`t2`
### WHERE
### @1='2028:02:07' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-02-07' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=7 /* INT meta=0 nullable=1 is_null=0 */
-### DELETE FROM test.t3
+### DELETE FROM `test`.`t3`
### WHERE
### @1='2038:03:02' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-03-02' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=2 /* INT meta=0 nullable=1 is_null=0 */
-### DELETE FROM test.t3
+### DELETE FROM `test`.`t3`
### WHERE
### @1='2038:03:03' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-03-03' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=3 /* INT meta=0 nullable=1 is_null=0 */
-### DELETE FROM test.t3
+### DELETE FROM `test`.`t3`
### WHERE
### @1='2038:03:04' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-03-04' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=4 /* INT meta=0 nullable=1 is_null=0 */
-### DELETE FROM test.t3
+### DELETE FROM `test`.`t3`
### WHERE
### @1='2038:03:05' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-03-05' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=5 /* INT meta=0 nullable=1 is_null=0 */
-### DELETE FROM test.t3
+### DELETE FROM `test`.`t3`
### WHERE
### @1='2038:03:06' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-03-06' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=6 /* INT meta=0 nullable=1 is_null=0 */
-### DELETE FROM test.t3
+### DELETE FROM `test`.`t3`
### WHERE
### @1='2038:03:07' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-03-07' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
@@ -4837,17 +4837,17 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1=1 /* INT meta=0 nullable=1 is_null=0 */
### @2=2 /* INT meta=0 nullable=1 is_null=0 */
### @3='Wow' /* VARSTRING(60) meta=60 nullable=1 is_null=0 */
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
### @2=4 /* INT meta=0 nullable=1 is_null=0 */
### @3='Wow' /* VARSTRING(60) meta=60 nullable=1 is_null=0 */
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1=5 /* INT meta=0 nullable=1 is_null=0 */
### @2=6 /* INT meta=0 nullable=1 is_null=0 */
diff --git a/mysql-test/r/mysqlbinlog_row_myisam.result b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_myisam.result
index d4062565320..8338e48459a 100644
--- a/mysql-test/r/mysqlbinlog_row_myisam.result
+++ b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_myisam.result
@@ -2365,7 +2365,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1=b'0' /* BIT(1) meta=1 nullable=1 is_null=0 */
### @2=b'0000000000000000000000000000000000000000000000000000000000000000' /* BIT(64) meta=2048 nullable=1 is_null=0 */
@@ -2460,7 +2460,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1=b'1' /* BIT(1) meta=1 nullable=1 is_null=0 */
### @2=b'1111111111111111111111111111111111111111111111111111111111111111' /* BIT(64) meta=2048 nullable=1 is_null=0 */
@@ -2557,7 +2557,7 @@ BEGIN
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1=NULL /* type=16 meta=1 nullable=1 is_null=1 */
### @2=NULL /* type=16 meta=2048 nullable=1 is_null=1 */
@@ -2638,7 +2638,7 @@ BEGIN
### @77=NULL /* TIMESTAMP meta=63233 nullable=1 is_null=1 */
### @78=NULL /* TIMESTAMP meta=63489 nullable=1 is_null=1 */
### @79=3 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1=b'1' /* BIT(1) meta=1 nullable=1 is_null=0 */
### @2=b'1111111111111111111111111111111111111111111111111111111111111111' /* BIT(64) meta=2048 nullable=1 is_null=0 */
@@ -2733,7 +2733,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Update_rows: table id # flags: STMT_END_F
-### UPDATE test.t1
+### UPDATE `test`.`t1`
### WHERE
### @1=b'0' /* BIT(1) meta=1 nullable=1 is_null=0 */
### @2=b'0000000000000000000000000000000000000000000000000000000000000000' /* BIT(64) meta=2048 nullable=1 is_null=0 */
@@ -2908,7 +2908,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Update_rows: table id # flags: STMT_END_F
-### UPDATE test.t1
+### UPDATE `test`.`t1`
### WHERE
### @1=b'1' /* BIT(1) meta=1 nullable=1 is_null=0 */
### @2=b'1111111111111111111111111111111111111111111111111111111111111111' /* BIT(64) meta=2048 nullable=1 is_null=0 */
@@ -3083,7 +3083,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Update_rows: table id # flags: STMT_END_F
-### UPDATE test.t1
+### UPDATE `test`.`t1`
### WHERE
### @1=NULL /* type=16 meta=1 nullable=1 is_null=1 */
### @2=NULL /* type=16 meta=2048 nullable=1 is_null=1 */
@@ -3258,7 +3258,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Update_rows: table id # flags: STMT_END_F
-### UPDATE test.t1
+### UPDATE `test`.`t1`
### WHERE
### @1=b'1' /* BIT(1) meta=1 nullable=1 is_null=0 */
### @2=b'1111111111111111111111111111111111111111111111111111111111111111' /* BIT(64) meta=2048 nullable=1 is_null=0 */
@@ -3433,7 +3433,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
-### DELETE FROM test.t1
+### DELETE FROM `test`.`t1`
### WHERE
### @1=b'1' /* BIT(1) meta=1 nullable=1 is_null=0 */
### @2=b'1111111111111111111111111111111111111111111111111111111111111111' /* BIT(64) meta=2048 nullable=1 is_null=0 */
@@ -3528,7 +3528,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
-### DELETE FROM test.t1
+### DELETE FROM `test`.`t1`
### WHERE
### @1=b'0' /* BIT(1) meta=1 nullable=1 is_null=0 */
### @2=b'0000000000000000000000000000000000000000000000000000000000000000' /* BIT(64) meta=2048 nullable=1 is_null=0 */
@@ -3623,7 +3623,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
-### DELETE FROM test.t1
+### DELETE FROM `test`.`t1`
### WHERE
### @1=b'1' /* BIT(1) meta=1 nullable=1 is_null=0 */
### @2=b'1111111111111111111111111111111111111111111111111111111111111111' /* BIT(64) meta=2048 nullable=1 is_null=0 */
@@ -3718,7 +3718,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
-### DELETE FROM test.t1
+### DELETE FROM `test`.`t1`
### WHERE
### @1=NULL /* type=16 meta=1 nullable=1 is_null=1 */
### @2=NULL /* type=16 meta=2048 nullable=1 is_null=1 */
@@ -3927,47 +3927,47 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1='2008:08:01' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-01' /* VARSTRING(24) meta=24 nullable=1 is_null=0 */
### @3=1 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1='2008:08:02' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-02' /* VARSTRING(24) meta=24 nullable=1 is_null=0 */
### @3=2 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1='2008:08:03' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-03' /* VARSTRING(24) meta=24 nullable=1 is_null=0 */
### @3=3 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1='2008:08:04' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-04' /* VARSTRING(24) meta=24 nullable=1 is_null=0 */
### @3=4 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1='2008:08:05' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-05' /* VARSTRING(24) meta=24 nullable=1 is_null=0 */
### @3=5 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1='2008:08:06' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-06' /* VARSTRING(24) meta=24 nullable=1 is_null=0 */
### @3=6 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1='2008:08:07' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-07' /* VARSTRING(24) meta=24 nullable=1 is_null=0 */
### @3=7 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1='2008:08:08' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-08' /* VARSTRING(24) meta=24 nullable=1 is_null=0 */
### @3=8 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1='2008:08:09' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-09' /* VARSTRING(24) meta=24 nullable=1 is_null=0 */
@@ -3986,7 +3986,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Update_rows: table id # flags: STMT_END_F
-### UPDATE test.t1
+### UPDATE `test`.`t1`
### WHERE
### @1='2008:08:01' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-01' /* VARSTRING(24) meta=24 nullable=1 is_null=0 */
@@ -3995,7 +3995,7 @@ BEGIN
### @1='2008:08:11' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-01' /* VARSTRING(24) meta=24 nullable=1 is_null=0 */
### @3=1 /* INT meta=0 nullable=1 is_null=0 */
-### UPDATE test.t1
+### UPDATE `test`.`t1`
### WHERE
### @1='2008:08:02' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-02' /* VARSTRING(24) meta=24 nullable=1 is_null=0 */
@@ -4004,7 +4004,7 @@ BEGIN
### @1='2008:08:12' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-02' /* VARSTRING(24) meta=24 nullable=1 is_null=0 */
### @3=2 /* INT meta=0 nullable=1 is_null=0 */
-### UPDATE test.t1
+### UPDATE `test`.`t1`
### WHERE
### @1='2008:08:03' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-03' /* VARSTRING(24) meta=24 nullable=1 is_null=0 */
@@ -4013,7 +4013,7 @@ BEGIN
### @1='2008:08:13' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-03' /* VARSTRING(24) meta=24 nullable=1 is_null=0 */
### @3=3 /* INT meta=0 nullable=1 is_null=0 */
-### UPDATE test.t1
+### UPDATE `test`.`t1`
### WHERE
### @1='2008:08:04' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-04' /* VARSTRING(24) meta=24 nullable=1 is_null=0 */
@@ -4022,7 +4022,7 @@ BEGIN
### @1='2008:08:14' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-04' /* VARSTRING(24) meta=24 nullable=1 is_null=0 */
### @3=4 /* INT meta=0 nullable=1 is_null=0 */
-### UPDATE test.t1
+### UPDATE `test`.`t1`
### WHERE
### @1='2008:08:05' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-05' /* VARSTRING(24) meta=24 nullable=1 is_null=0 */
@@ -4031,7 +4031,7 @@ BEGIN
### @1='2008:08:15' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-05' /* VARSTRING(24) meta=24 nullable=1 is_null=0 */
### @3=5 /* INT meta=0 nullable=1 is_null=0 */
-### UPDATE test.t1
+### UPDATE `test`.`t1`
### WHERE
### @1='2008:08:06' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-06' /* VARSTRING(24) meta=24 nullable=1 is_null=0 */
@@ -4040,7 +4040,7 @@ BEGIN
### @1='2008:08:16' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-06' /* VARSTRING(24) meta=24 nullable=1 is_null=0 */
### @3=6 /* INT meta=0 nullable=1 is_null=0 */
-### UPDATE test.t1
+### UPDATE `test`.`t1`
### WHERE
### @1='2008:08:07' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-07' /* VARSTRING(24) meta=24 nullable=1 is_null=0 */
@@ -4063,37 +4063,37 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
-### DELETE FROM test.t1
+### DELETE FROM `test`.`t1`
### WHERE
### @1='2008:08:11' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-01' /* VARSTRING(24) meta=24 nullable=1 is_null=0 */
### @3=1 /* INT meta=0 nullable=1 is_null=0 */
-### DELETE FROM test.t1
+### DELETE FROM `test`.`t1`
### WHERE
### @1='2008:08:12' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-02' /* VARSTRING(24) meta=24 nullable=1 is_null=0 */
### @3=2 /* INT meta=0 nullable=1 is_null=0 */
-### DELETE FROM test.t1
+### DELETE FROM `test`.`t1`
### WHERE
### @1='2008:08:13' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-03' /* VARSTRING(24) meta=24 nullable=1 is_null=0 */
### @3=3 /* INT meta=0 nullable=1 is_null=0 */
-### DELETE FROM test.t1
+### DELETE FROM `test`.`t1`
### WHERE
### @1='2008:08:14' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-04' /* VARSTRING(24) meta=24 nullable=1 is_null=0 */
### @3=4 /* INT meta=0 nullable=1 is_null=0 */
-### DELETE FROM test.t1
+### DELETE FROM `test`.`t1`
### WHERE
### @1='2008:08:15' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-05' /* VARSTRING(24) meta=24 nullable=1 is_null=0 */
### @3=5 /* INT meta=0 nullable=1 is_null=0 */
-### DELETE FROM test.t1
+### DELETE FROM `test`.`t1`
### WHERE
### @1='2008:08:16' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-06' /* VARSTRING(24) meta=24 nullable=1 is_null=0 */
### @3=6 /* INT meta=0 nullable=1 is_null=0 */
-### DELETE FROM test.t1
+### DELETE FROM `test`.`t1`
### WHERE
### @1='2008:08:17' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-07' /* VARSTRING(24) meta=24 nullable=1 is_null=0 */
@@ -4320,47 +4320,47 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1='2008:01:01' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-01-01' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=11 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1='2008:01:02' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-01-02' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=2 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1='2008:01:03' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-01-03' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=3 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1='2008:01:04' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-01-04' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=4 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1='2008:01:05' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-01-05' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=5 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1='2008:01:06' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-01-06' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=6 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1='2008:01:07' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-01-07' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=7 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1='2008:01:08' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-01-08' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=18 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1='2008:01:09' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-01-09' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
@@ -4379,47 +4379,47 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t2` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t2
+### INSERT INTO `test`.`t2`
### SET
### @1='2008:02:01' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-02-01' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=21 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test.t2
+### INSERT INTO `test`.`t2`
### SET
### @1='2008:02:02' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-02-02' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=2 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test.t2
+### INSERT INTO `test`.`t2`
### SET
### @1='2008:02:03' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-02-03' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=3 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test.t2
+### INSERT INTO `test`.`t2`
### SET
### @1='2008:02:04' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-02-04' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=4 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test.t2
+### INSERT INTO `test`.`t2`
### SET
### @1='2008:02:05' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-02-05' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=5 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test.t2
+### INSERT INTO `test`.`t2`
### SET
### @1='2008:02:06' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-02-06' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=6 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test.t2
+### INSERT INTO `test`.`t2`
### SET
### @1='2008:02:07' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-02-07' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=7 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test.t2
+### INSERT INTO `test`.`t2`
### SET
### @1='2008:02:08' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-02-08' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=28 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test.t2
+### INSERT INTO `test`.`t2`
### SET
### @1='2008:02:09' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-02-09' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
@@ -4438,47 +4438,47 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t3` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t3
+### INSERT INTO `test`.`t3`
### SET
### @1='2008:03:01' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-03-01' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=31 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test.t3
+### INSERT INTO `test`.`t3`
### SET
### @1='2008:03:02' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-03-02' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=2 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test.t3
+### INSERT INTO `test`.`t3`
### SET
### @1='2008:03:03' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-03-03' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=3 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test.t3
+### INSERT INTO `test`.`t3`
### SET
### @1='2008:03:04' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-03-04' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=4 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test.t3
+### INSERT INTO `test`.`t3`
### SET
### @1='2008:03:05' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-03-05' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=5 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test.t3
+### INSERT INTO `test`.`t3`
### SET
### @1='2008:03:06' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-03-06' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=6 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test.t3
+### INSERT INTO `test`.`t3`
### SET
### @1='2008:03:07' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-03-07' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=7 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test.t3
+### INSERT INTO `test`.`t3`
### SET
### @1='2008:03:08' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-03-08' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=38 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test.t3
+### INSERT INTO `test`.`t3`
### SET
### @1='2008:03:09' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-03-09' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
@@ -4505,7 +4505,7 @@ BEGIN
#010909 4:46:40 server id 1 end_log_pos # Update_rows: table id #
#010909 4:46:40 server id 1 end_log_pos # Update_rows: table id #
#010909 4:46:40 server id 1 end_log_pos # Update_rows: table id # flags: STMT_END_F
-### UPDATE test.t1
+### UPDATE `test`.`t1`
### WHERE
### @1='2008:01:02' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-01-02' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
@@ -4514,7 +4514,7 @@ BEGIN
### @1='2018:01:02' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-01-02' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=2 /* INT meta=0 nullable=1 is_null=0 */
-### UPDATE test.t1
+### UPDATE `test`.`t1`
### WHERE
### @1='2008:01:03' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-01-03' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
@@ -4523,7 +4523,7 @@ BEGIN
### @1='2018:01:03' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-01-03' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=3 /* INT meta=0 nullable=1 is_null=0 */
-### UPDATE test.t1
+### UPDATE `test`.`t1`
### WHERE
### @1='2008:01:04' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-01-04' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
@@ -4532,7 +4532,7 @@ BEGIN
### @1='2018:01:04' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-01-04' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=4 /* INT meta=0 nullable=1 is_null=0 */
-### UPDATE test.t1
+### UPDATE `test`.`t1`
### WHERE
### @1='2008:01:05' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-01-05' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
@@ -4541,7 +4541,7 @@ BEGIN
### @1='2018:01:05' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-01-05' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=5 /* INT meta=0 nullable=1 is_null=0 */
-### UPDATE test.t1
+### UPDATE `test`.`t1`
### WHERE
### @1='2008:01:06' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-01-06' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
@@ -4550,7 +4550,7 @@ BEGIN
### @1='2018:01:06' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-01-06' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=6 /* INT meta=0 nullable=1 is_null=0 */
-### UPDATE test.t1
+### UPDATE `test`.`t1`
### WHERE
### @1='2008:01:07' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-01-07' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
@@ -4559,7 +4559,7 @@ BEGIN
### @1='2018:01:07' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-01-07' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=7 /* INT meta=0 nullable=1 is_null=0 */
-### UPDATE test.t2
+### UPDATE `test`.`t2`
### WHERE
### @1='2008:02:02' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-02-02' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
@@ -4568,7 +4568,7 @@ BEGIN
### @1='2028:02:02' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-02-02' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=2 /* INT meta=0 nullable=1 is_null=0 */
-### UPDATE test.t2
+### UPDATE `test`.`t2`
### WHERE
### @1='2008:02:03' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-02-03' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
@@ -4577,7 +4577,7 @@ BEGIN
### @1='2028:02:03' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-02-03' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=3 /* INT meta=0 nullable=1 is_null=0 */
-### UPDATE test.t2
+### UPDATE `test`.`t2`
### WHERE
### @1='2008:02:04' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-02-04' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
@@ -4586,7 +4586,7 @@ BEGIN
### @1='2028:02:04' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-02-04' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=4 /* INT meta=0 nullable=1 is_null=0 */
-### UPDATE test.t2
+### UPDATE `test`.`t2`
### WHERE
### @1='2008:02:05' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-02-05' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
@@ -4595,7 +4595,7 @@ BEGIN
### @1='2028:02:05' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-02-05' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=5 /* INT meta=0 nullable=1 is_null=0 */
-### UPDATE test.t2
+### UPDATE `test`.`t2`
### WHERE
### @1='2008:02:06' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-02-06' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
@@ -4604,7 +4604,7 @@ BEGIN
### @1='2028:02:06' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-02-06' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=6 /* INT meta=0 nullable=1 is_null=0 */
-### UPDATE test.t2
+### UPDATE `test`.`t2`
### WHERE
### @1='2008:02:07' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-02-07' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
@@ -4613,7 +4613,7 @@ BEGIN
### @1='2028:02:07' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-02-07' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=7 /* INT meta=0 nullable=1 is_null=0 */
-### UPDATE test.t3
+### UPDATE `test`.`t3`
### WHERE
### @1='2008:03:02' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-03-02' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
@@ -4622,7 +4622,7 @@ BEGIN
### @1='2038:03:02' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-03-02' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=2 /* INT meta=0 nullable=1 is_null=0 */
-### UPDATE test.t3
+### UPDATE `test`.`t3`
### WHERE
### @1='2008:03:03' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-03-03' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
@@ -4631,7 +4631,7 @@ BEGIN
### @1='2038:03:03' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-03-03' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=3 /* INT meta=0 nullable=1 is_null=0 */
-### UPDATE test.t3
+### UPDATE `test`.`t3`
### WHERE
### @1='2008:03:04' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-03-04' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
@@ -4640,7 +4640,7 @@ BEGIN
### @1='2038:03:04' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-03-04' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=4 /* INT meta=0 nullable=1 is_null=0 */
-### UPDATE test.t3
+### UPDATE `test`.`t3`
### WHERE
### @1='2008:03:05' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-03-05' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
@@ -4649,7 +4649,7 @@ BEGIN
### @1='2038:03:05' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-03-05' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=5 /* INT meta=0 nullable=1 is_null=0 */
-### UPDATE test.t3
+### UPDATE `test`.`t3`
### WHERE
### @1='2008:03:06' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-03-06' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
@@ -4658,7 +4658,7 @@ BEGIN
### @1='2038:03:06' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-03-06' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=6 /* INT meta=0 nullable=1 is_null=0 */
-### UPDATE test.t3
+### UPDATE `test`.`t3`
### WHERE
### @1='2008:03:07' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-03-07' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
@@ -4689,92 +4689,92 @@ BEGIN
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
-### DELETE FROM test.t1
+### DELETE FROM `test`.`t1`
### WHERE
### @1='2018:01:02' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-01-02' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=2 /* INT meta=0 nullable=1 is_null=0 */
-### DELETE FROM test.t1
+### DELETE FROM `test`.`t1`
### WHERE
### @1='2018:01:03' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-01-03' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=3 /* INT meta=0 nullable=1 is_null=0 */
-### DELETE FROM test.t1
+### DELETE FROM `test`.`t1`
### WHERE
### @1='2018:01:04' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-01-04' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=4 /* INT meta=0 nullable=1 is_null=0 */
-### DELETE FROM test.t1
+### DELETE FROM `test`.`t1`
### WHERE
### @1='2018:01:05' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-01-05' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=5 /* INT meta=0 nullable=1 is_null=0 */
-### DELETE FROM test.t1
+### DELETE FROM `test`.`t1`
### WHERE
### @1='2018:01:06' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-01-06' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=6 /* INT meta=0 nullable=1 is_null=0 */
-### DELETE FROM test.t1
+### DELETE FROM `test`.`t1`
### WHERE
### @1='2018:01:07' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-01-07' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=7 /* INT meta=0 nullable=1 is_null=0 */
-### DELETE FROM test.t2
+### DELETE FROM `test`.`t2`
### WHERE
### @1='2028:02:02' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-02-02' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=2 /* INT meta=0 nullable=1 is_null=0 */
-### DELETE FROM test.t2
+### DELETE FROM `test`.`t2`
### WHERE
### @1='2028:02:03' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-02-03' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=3 /* INT meta=0 nullable=1 is_null=0 */
-### DELETE FROM test.t2
+### DELETE FROM `test`.`t2`
### WHERE
### @1='2028:02:04' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-02-04' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=4 /* INT meta=0 nullable=1 is_null=0 */
-### DELETE FROM test.t2
+### DELETE FROM `test`.`t2`
### WHERE
### @1='2028:02:05' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-02-05' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=5 /* INT meta=0 nullable=1 is_null=0 */
-### DELETE FROM test.t2
+### DELETE FROM `test`.`t2`
### WHERE
### @1='2028:02:06' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-02-06' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=6 /* INT meta=0 nullable=1 is_null=0 */
-### DELETE FROM test.t2
+### DELETE FROM `test`.`t2`
### WHERE
### @1='2028:02:07' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-02-07' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=7 /* INT meta=0 nullable=1 is_null=0 */
-### DELETE FROM test.t3
+### DELETE FROM `test`.`t3`
### WHERE
### @1='2038:03:02' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-03-02' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=2 /* INT meta=0 nullable=1 is_null=0 */
-### DELETE FROM test.t3
+### DELETE FROM `test`.`t3`
### WHERE
### @1='2038:03:03' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-03-03' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=3 /* INT meta=0 nullable=1 is_null=0 */
-### DELETE FROM test.t3
+### DELETE FROM `test`.`t3`
### WHERE
### @1='2038:03:04' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-03-04' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=4 /* INT meta=0 nullable=1 is_null=0 */
-### DELETE FROM test.t3
+### DELETE FROM `test`.`t3`
### WHERE
### @1='2038:03:05' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-03-05' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=5 /* INT meta=0 nullable=1 is_null=0 */
-### DELETE FROM test.t3
+### DELETE FROM `test`.`t3`
### WHERE
### @1='2038:03:06' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-03-06' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=6 /* INT meta=0 nullable=1 is_null=0 */
-### DELETE FROM test.t3
+### DELETE FROM `test`.`t3`
### WHERE
### @1='2038:03:07' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-03-07' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
@@ -4875,17 +4875,17 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1=1 /* INT meta=0 nullable=1 is_null=0 */
### @2=2 /* INT meta=0 nullable=1 is_null=0 */
### @3='Wow' /* VARSTRING(60) meta=60 nullable=1 is_null=0 */
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
### @2=4 /* INT meta=0 nullable=1 is_null=0 */
### @3='Wow' /* VARSTRING(60) meta=60 nullable=1 is_null=0 */
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1=5 /* INT meta=0 nullable=1 is_null=0 */
### @2=6 /* INT meta=0 nullable=1 is_null=0 */
diff --git a/mysql-test/r/mysqlbinlog_row_trans.result b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_trans.result
index 85106ab9684..f2f1ed00431 100644
--- a/mysql-test/r/mysqlbinlog_row_trans.result
+++ b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_trans.result
@@ -166,15 +166,15 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1=1 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-1' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1=2 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-2' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-3' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
@@ -182,21 +182,21 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Update_rows: table id # flags: STMT_END_F
-### UPDATE test.t1
+### UPDATE `test`.`t1`
### WHERE
### @1=1 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-1' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
### SET
### @1=11 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-1' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
-### UPDATE test.t1
+### UPDATE `test`.`t1`
### WHERE
### @1=2 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-2' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
### SET
### @1=12 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-2' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
-### UPDATE test.t1
+### UPDATE `test`.`t1`
### WHERE
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-3' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
@@ -207,7 +207,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
-### DELETE FROM test.t1
+### DELETE FROM `test`.`t1`
### WHERE
### @1=12 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-2' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
@@ -233,15 +233,15 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t2` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t2
+### INSERT INTO `test`.`t2`
### SET
### @1=1 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-1' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
-### INSERT INTO test.t2
+### INSERT INTO `test`.`t2`
### SET
### @1=2 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-2' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
-### INSERT INTO test.t2
+### INSERT INTO `test`.`t2`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-3' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
@@ -259,21 +259,21 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t2` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Update_rows: table id # flags: STMT_END_F
-### UPDATE test.t2
+### UPDATE `test`.`t2`
### WHERE
### @1=1 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-1' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
### SET
### @1=11 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-1' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
-### UPDATE test.t2
+### UPDATE `test`.`t2`
### WHERE
### @1=2 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-2' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
### SET
### @1=12 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-2' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
-### UPDATE test.t2
+### UPDATE `test`.`t2`
### WHERE
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-3' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
@@ -294,7 +294,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t2` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
-### DELETE FROM test.t2
+### DELETE FROM `test`.`t2`
### WHERE
### @1=12 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-2' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
@@ -312,15 +312,15 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1=1 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-1' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1=2 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-2' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
-### INSERT INTO test.t1
+### INSERT INTO `test`.`t1`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-3' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
@@ -328,21 +328,21 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Update_rows: table id # flags: STMT_END_F
-### UPDATE test.t1
+### UPDATE `test`.`t1`
### WHERE
### @1=1 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-1' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
### SET
### @1=11 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-1' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
-### UPDATE test.t1
+### UPDATE `test`.`t1`
### WHERE
### @1=2 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-2' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
### SET
### @1=12 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-2' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
-### UPDATE test.t1
+### UPDATE `test`.`t1`
### WHERE
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-3' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
@@ -353,7 +353,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
-### DELETE FROM test.t1
+### DELETE FROM `test`.`t1`
### WHERE
### @1=12 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-2' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
@@ -379,15 +379,15 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t2` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t2
+### INSERT INTO `test`.`t2`
### SET
### @1=1 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-1' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
-### INSERT INTO test.t2
+### INSERT INTO `test`.`t2`
### SET
### @1=2 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-2' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
-### INSERT INTO test.t2
+### INSERT INTO `test`.`t2`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-3' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
@@ -405,21 +405,21 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t2` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Update_rows: table id # flags: STMT_END_F
-### UPDATE test.t2
+### UPDATE `test`.`t2`
### WHERE
### @1=1 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-1' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
### SET
### @1=11 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-1' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
-### UPDATE test.t2
+### UPDATE `test`.`t2`
### WHERE
### @1=2 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-2' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
### SET
### @1=12 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-2' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
-### UPDATE test.t2
+### UPDATE `test`.`t2`
### WHERE
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-3' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
@@ -440,7 +440,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t2` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
-### DELETE FROM test.t2
+### DELETE FROM `test`.`t2`
### WHERE
### @1=12 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-2' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
diff --git a/mysql-test/suite/binlog/r/binlog_row_annotate.result b/mysql-test/suite/binlog/r/binlog_row_annotate.result
index 58cac276c95..8b9ccee7a93 100644
--- a/mysql-test/suite/binlog/r/binlog_row_annotate.result
+++ b/mysql-test/suite/binlog/r/binlog_row_annotate.result
@@ -116,13 +116,13 @@ BEGIN
# at #
#010909 4:46:40 server id # end_log_pos # Table_map: `test1`.`t1` mapped to number #
#010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test1.t1
+### INSERT INTO `test1`.`t1`
### SET
### @1=1 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test1.t1
+### INSERT INTO `test1`.`t1`
### SET
### @1=2 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test1.t1
+### INSERT INTO `test1`.`t1`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
# at #
@@ -142,13 +142,13 @@ BEGIN
#Q> INSERT INTO test2.t2 VALUES (1), (2), (3)
#010909 4:46:40 server id # end_log_pos # Table_map: `test2`.`t2` mapped to number #
#010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test2.t2
+### INSERT INTO `test2`.`t2`
### SET
### @1=1 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test2.t2
+### INSERT INTO `test2`.`t2`
### SET
### @1=2 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test2.t2
+### INSERT INTO `test2`.`t2`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
# at #
@@ -168,13 +168,13 @@ BEGIN
#Q> INSERT INTO test3.t3 VALUES (1), (2), (3)
#010909 4:46:40 server id # end_log_pos # Table_map: `test3`.`t3` mapped to number #
#010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test3.t3
+### INSERT INTO `test3`.`t3`
### SET
### @1=1 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test3.t3
+### INSERT INTO `test3`.`t3`
### SET
### @1=2 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test3.t3
+### INSERT INTO `test3`.`t3`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
# at #
@@ -200,22 +200,22 @@ BEGIN
#010909 4:46:40 server id # end_log_pos # Table_map: `test2`.`t2` mapped to number #
#010909 4:46:40 server id # end_log_pos # Delete_rows: table id #
#010909 4:46:40 server id # end_log_pos # Delete_rows: table id # flags: STMT_END_F
-### DELETE FROM test1.t1
+### DELETE FROM `test1`.`t1`
### WHERE
### @1=1 /* INT meta=0 nullable=1 is_null=0 */
-### DELETE FROM test1.t1
+### DELETE FROM `test1`.`t1`
### WHERE
### @1=2 /* INT meta=0 nullable=1 is_null=0 */
-### DELETE FROM test1.t1
+### DELETE FROM `test1`.`t1`
### WHERE
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
-### DELETE FROM test2.t2
+### DELETE FROM `test2`.`t2`
### WHERE
### @1=1 /* INT meta=0 nullable=1 is_null=0 */
-### DELETE FROM test2.t2
+### DELETE FROM `test2`.`t2`
### WHERE
### @1=2 /* INT meta=0 nullable=1 is_null=0 */
-### DELETE FROM test2.t2
+### DELETE FROM `test2`.`t2`
### WHERE
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
# at #
@@ -235,13 +235,13 @@ BEGIN
#Q> INSERT INTO test2.v2 VALUES (1), (2), (3)
#010909 4:46:40 server id # end_log_pos # Table_map: `test2`.`t2` mapped to number #
#010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test2.t2
+### INSERT INTO `test2`.`t2`
### SET
### @1=1 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test2.t2
+### INSERT INTO `test2`.`t2`
### SET
### @1=2 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test2.t2
+### INSERT INTO `test2`.`t2`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
# at #
@@ -263,13 +263,13 @@ BEGIN
#Q> WHERE xtest1.xt1.a=test2.t2.a AND test2.t2.a=test3.t3
#010909 4:46:40 server id # end_log_pos # Table_map: `test2`.`t2` mapped to number #
#010909 4:46:40 server id # end_log_pos # Delete_rows: table id # flags: STMT_END_F
-### DELETE FROM test2.t2
+### DELETE FROM `test2`.`t2`
### WHERE
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
-### DELETE FROM test2.t2
+### DELETE FROM `test2`.`t2`
### WHERE
### @1=2 /* INT meta=0 nullable=1 is_null=0 */
-### DELETE FROM test2.t2
+### DELETE FROM `test2`.`t2`
### WHERE
### @1=1 /* INT meta=0 nullable=1 is_null=0 */
# at #
@@ -328,13 +328,13 @@ BEGIN
# at #
#010909 4:46:40 server id # end_log_pos # Table_map: `test1`.`t1` mapped to number #
#010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test1.t1
+### INSERT INTO `test1`.`t1`
### SET
### @1=1 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test1.t1
+### INSERT INTO `test1`.`t1`
### SET
### @1=2 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test1.t1
+### INSERT INTO `test1`.`t1`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
# at #
@@ -384,13 +384,13 @@ BEGIN
#Q> WHERE test1.t1.a=test2.t2.a AND test2.t2.a=test3.t3
#010909 4:46:40 server id # end_log_pos # Table_map: `test1`.`t1` mapped to number #
#010909 4:46:40 server id # end_log_pos # Delete_rows: table id #
-### DELETE FROM test1.t1
+### DELETE FROM `test1`.`t1`
### WHERE
### @1=1 /* INT meta=0 nullable=1 is_null=0 */
-### DELETE FROM test1.t1
+### DELETE FROM `test1`.`t1`
### WHERE
### @1=2 /* INT meta=0 nullable=1 is_null=0 */
-### DELETE FROM test1.t1
+### DELETE FROM `test1`.`t1`
### WHERE
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
# at #
@@ -490,13 +490,13 @@ BEGIN
# at #
#010909 4:46:40 server id # end_log_pos # Table_map: `test1`.`t1` mapped to number #
#010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test1.t1
+### INSERT INTO `test1`.`t1`
### SET
### @1=1 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test1.t1
+### INSERT INTO `test1`.`t1`
### SET
### @1=2 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test1.t1
+### INSERT INTO `test1`.`t1`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
# at #
@@ -514,13 +514,13 @@ BEGIN
# at #
#010909 4:46:40 server id # end_log_pos # Table_map: `test2`.`t2` mapped to number #
#010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test2.t2
+### INSERT INTO `test2`.`t2`
### SET
### @1=1 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test2.t2
+### INSERT INTO `test2`.`t2`
### SET
### @1=2 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test2.t2
+### INSERT INTO `test2`.`t2`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
# at #
@@ -538,13 +538,13 @@ BEGIN
# at #
#010909 4:46:40 server id # end_log_pos # Table_map: `test3`.`t3` mapped to number #
#010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test3.t3
+### INSERT INTO `test3`.`t3`
### SET
### @1=1 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test3.t3
+### INSERT INTO `test3`.`t3`
### SET
### @1=2 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test3.t3
+### INSERT INTO `test3`.`t3`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
# at #
@@ -566,22 +566,22 @@ BEGIN
#010909 4:46:40 server id # end_log_pos # Table_map: `test2`.`t2` mapped to number #
#010909 4:46:40 server id # end_log_pos # Delete_rows: table id #
#010909 4:46:40 server id # end_log_pos # Delete_rows: table id # flags: STMT_END_F
-### DELETE FROM test1.t1
+### DELETE FROM `test1`.`t1`
### WHERE
### @1=1 /* INT meta=0 nullable=1 is_null=0 */
-### DELETE FROM test1.t1
+### DELETE FROM `test1`.`t1`
### WHERE
### @1=2 /* INT meta=0 nullable=1 is_null=0 */
-### DELETE FROM test1.t1
+### DELETE FROM `test1`.`t1`
### WHERE
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
-### DELETE FROM test2.t2
+### DELETE FROM `test2`.`t2`
### WHERE
### @1=1 /* INT meta=0 nullable=1 is_null=0 */
-### DELETE FROM test2.t2
+### DELETE FROM `test2`.`t2`
### WHERE
### @1=2 /* INT meta=0 nullable=1 is_null=0 */
-### DELETE FROM test2.t2
+### DELETE FROM `test2`.`t2`
### WHERE
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
# at #
@@ -599,13 +599,13 @@ BEGIN
# at #
#010909 4:46:40 server id # end_log_pos # Table_map: `test2`.`t2` mapped to number #
#010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test2.t2
+### INSERT INTO `test2`.`t2`
### SET
### @1=1 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test2.t2
+### INSERT INTO `test2`.`t2`
### SET
### @1=2 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test2.t2
+### INSERT INTO `test2`.`t2`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
# at #
@@ -623,13 +623,13 @@ BEGIN
# at #
#010909 4:46:40 server id # end_log_pos # Table_map: `test2`.`t2` mapped to number #
#010909 4:46:40 server id # end_log_pos # Delete_rows: table id # flags: STMT_END_F
-### DELETE FROM test2.t2
+### DELETE FROM `test2`.`t2`
### WHERE
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
-### DELETE FROM test2.t2
+### DELETE FROM `test2`.`t2`
### WHERE
### @1=2 /* INT meta=0 nullable=1 is_null=0 */
-### DELETE FROM test2.t2
+### DELETE FROM `test2`.`t2`
### WHERE
### @1=1 /* INT meta=0 nullable=1 is_null=0 */
# at #
@@ -708,13 +708,13 @@ BEGIN
# at #
#010909 4:46:40 server id # end_log_pos # Table_map: `test1`.`t1` mapped to number #
#010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test1.t1
+### INSERT INTO `test1`.`t1`
### SET
### @1=1 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test1.t1
+### INSERT INTO `test1`.`t1`
### SET
### @1=2 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test1.t1
+### INSERT INTO `test1`.`t1`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
# at #
@@ -734,13 +734,13 @@ BEGIN
#Q> INSERT INTO test2.t2 VALUES (1), (2), (3)
#010909 4:46:40 server id # end_log_pos # Table_map: `test2`.`t2` mapped to number #
#010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test2.t2
+### INSERT INTO `test2`.`t2`
### SET
### @1=1 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test2.t2
+### INSERT INTO `test2`.`t2`
### SET
### @1=2 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test2.t2
+### INSERT INTO `test2`.`t2`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
# at #
@@ -760,13 +760,13 @@ BEGIN
#Q> INSERT INTO test3.t3 VALUES (1), (2), (3)
#010909 4:46:40 server id # end_log_pos # Table_map: `test3`.`t3` mapped to number #
#010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test3.t3
+### INSERT INTO `test3`.`t3`
### SET
### @1=1 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test3.t3
+### INSERT INTO `test3`.`t3`
### SET
### @1=2 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test3.t3
+### INSERT INTO `test3`.`t3`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
# at #
@@ -792,22 +792,22 @@ BEGIN
#010909 4:46:40 server id # end_log_pos # Table_map: `test2`.`t2` mapped to number #
#010909 4:46:40 server id # end_log_pos # Delete_rows: table id #
#010909 4:46:40 server id # end_log_pos # Delete_rows: table id # flags: STMT_END_F
-### DELETE FROM test1.t1
+### DELETE FROM `test1`.`t1`
### WHERE
### @1=1 /* INT meta=0 nullable=1 is_null=0 */
-### DELETE FROM test1.t1
+### DELETE FROM `test1`.`t1`
### WHERE
### @1=2 /* INT meta=0 nullable=1 is_null=0 */
-### DELETE FROM test1.t1
+### DELETE FROM `test1`.`t1`
### WHERE
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
-### DELETE FROM test2.t2
+### DELETE FROM `test2`.`t2`
### WHERE
### @1=1 /* INT meta=0 nullable=1 is_null=0 */
-### DELETE FROM test2.t2
+### DELETE FROM `test2`.`t2`
### WHERE
### @1=2 /* INT meta=0 nullable=1 is_null=0 */
-### DELETE FROM test2.t2
+### DELETE FROM `test2`.`t2`
### WHERE
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
# at #
@@ -827,13 +827,13 @@ BEGIN
#Q> INSERT INTO test2.v2 VALUES (1), (2), (3)
#010909 4:46:40 server id # end_log_pos # Table_map: `test2`.`t2` mapped to number #
#010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test2.t2
+### INSERT INTO `test2`.`t2`
### SET
### @1=1 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test2.t2
+### INSERT INTO `test2`.`t2`
### SET
### @1=2 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test2.t2
+### INSERT INTO `test2`.`t2`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
# at #
@@ -855,13 +855,13 @@ BEGIN
#Q> WHERE xtest1.xt1.a=test2.t2.a AND test2.t2.a=test3.t3
#010909 4:46:40 server id # end_log_pos # Table_map: `test2`.`t2` mapped to number #
#010909 4:46:40 server id # end_log_pos # Delete_rows: table id # flags: STMT_END_F
-### DELETE FROM test2.t2
+### DELETE FROM `test2`.`t2`
### WHERE
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
-### DELETE FROM test2.t2
+### DELETE FROM `test2`.`t2`
### WHERE
### @1=2 /* INT meta=0 nullable=1 is_null=0 */
-### DELETE FROM test2.t2
+### DELETE FROM `test2`.`t2`
### WHERE
### @1=1 /* INT meta=0 nullable=1 is_null=0 */
# at #
@@ -920,13 +920,13 @@ BEGIN
# at #
#010909 4:46:40 server id # end_log_pos # Table_map: `test1`.`t1` mapped to number #
#010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test1.t1
+### INSERT INTO `test1`.`t1`
### SET
### @1=1 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test1.t1
+### INSERT INTO `test1`.`t1`
### SET
### @1=2 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test1.t1
+### INSERT INTO `test1`.`t1`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
# at #
@@ -976,13 +976,13 @@ BEGIN
#Q> WHERE test1.t1.a=test2.t2.a AND test2.t2.a=test3.t3
#010909 4:46:40 server id # end_log_pos # Table_map: `test1`.`t1` mapped to number #
#010909 4:46:40 server id # end_log_pos # Delete_rows: table id #
-### DELETE FROM test1.t1
+### DELETE FROM `test1`.`t1`
### WHERE
### @1=1 /* INT meta=0 nullable=1 is_null=0 */
-### DELETE FROM test1.t1
+### DELETE FROM `test1`.`t1`
### WHERE
### @1=2 /* INT meta=0 nullable=1 is_null=0 */
-### DELETE FROM test1.t1
+### DELETE FROM `test1`.`t1`
### WHERE
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
# at #
@@ -1082,13 +1082,13 @@ BEGIN
# at #
#010909 4:46:40 server id # end_log_pos # Table_map: `test1`.`t1` mapped to number #
#010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test1.t1
+### INSERT INTO `test1`.`t1`
### SET
### @1=1 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test1.t1
+### INSERT INTO `test1`.`t1`
### SET
### @1=2 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test1.t1
+### INSERT INTO `test1`.`t1`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
# at #
@@ -1105,13 +1105,13 @@ BEGIN
# at #
#010909 4:46:40 server id # end_log_pos # Table_map: `test2`.`t2` mapped to number #
#010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test2.t2
+### INSERT INTO `test2`.`t2`
### SET
### @1=1 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test2.t2
+### INSERT INTO `test2`.`t2`
### SET
### @1=2 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test2.t2
+### INSERT INTO `test2`.`t2`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
# at #
@@ -1128,13 +1128,13 @@ BEGIN
# at #
#010909 4:46:40 server id # end_log_pos # Table_map: `test3`.`t3` mapped to number #
#010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test3.t3
+### INSERT INTO `test3`.`t3`
### SET
### @1=1 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test3.t3
+### INSERT INTO `test3`.`t3`
### SET
### @1=2 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test3.t3
+### INSERT INTO `test3`.`t3`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
# at #
@@ -1155,22 +1155,22 @@ BEGIN
#010909 4:46:40 server id # end_log_pos # Table_map: `test2`.`t2` mapped to number #
#010909 4:46:40 server id # end_log_pos # Delete_rows: table id #
#010909 4:46:40 server id # end_log_pos # Delete_rows: table id # flags: STMT_END_F
-### DELETE FROM test1.t1
+### DELETE FROM `test1`.`t1`
### WHERE
### @1=1 /* INT meta=0 nullable=1 is_null=0 */
-### DELETE FROM test1.t1
+### DELETE FROM `test1`.`t1`
### WHERE
### @1=2 /* INT meta=0 nullable=1 is_null=0 */
-### DELETE FROM test1.t1
+### DELETE FROM `test1`.`t1`
### WHERE
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
-### DELETE FROM test2.t2
+### DELETE FROM `test2`.`t2`
### WHERE
### @1=1 /* INT meta=0 nullable=1 is_null=0 */
-### DELETE FROM test2.t2
+### DELETE FROM `test2`.`t2`
### WHERE
### @1=2 /* INT meta=0 nullable=1 is_null=0 */
-### DELETE FROM test2.t2
+### DELETE FROM `test2`.`t2`
### WHERE
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
# at #
@@ -1187,13 +1187,13 @@ BEGIN
# at #
#010909 4:46:40 server id # end_log_pos # Table_map: `test2`.`t2` mapped to number #
#010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test2.t2
+### INSERT INTO `test2`.`t2`
### SET
### @1=1 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test2.t2
+### INSERT INTO `test2`.`t2`
### SET
### @1=2 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test2.t2
+### INSERT INTO `test2`.`t2`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
# at #
@@ -1210,13 +1210,13 @@ BEGIN
# at #
#010909 4:46:40 server id # end_log_pos # Table_map: `test2`.`t2` mapped to number #
#010909 4:46:40 server id # end_log_pos # Delete_rows: table id # flags: STMT_END_F
-### DELETE FROM test2.t2
+### DELETE FROM `test2`.`t2`
### WHERE
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
-### DELETE FROM test2.t2
+### DELETE FROM `test2`.`t2`
### WHERE
### @1=2 /* INT meta=0 nullable=1 is_null=0 */
-### DELETE FROM test2.t2
+### DELETE FROM `test2`.`t2`
### WHERE
### @1=1 /* INT meta=0 nullable=1 is_null=0 */
# at #
diff --git a/mysql-test/suite/binlog/r/binlog_row_mysqlbinlog_options.result b/mysql-test/suite/binlog/r/binlog_row_mysqlbinlog_options.result
index 55f4154574b..f2dedaa633a 100644
--- a/mysql-test/suite/binlog/r/binlog_row_mysqlbinlog_options.result
+++ b/mysql-test/suite/binlog/r/binlog_row_mysqlbinlog_options.result
@@ -59,11 +59,11 @@ BEGIN
# at #
#010909 4:46:40 server id # end_log_pos # Table_map: `new_test1`.`t1` mapped to number #
#010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO new_test1.t1
+### INSERT INTO `new_test1`.`t1`
### SET
### @1=1 /* INT meta=0 nullable=1 is_null=0 */
### @2=1 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO new_test1.t1
+### INSERT INTO `new_test1`.`t1`
### SET
### @1=2 /* INT meta=0 nullable=1 is_null=0 */
### @2=2 /* INT meta=0 nullable=1 is_null=0 */
@@ -87,10 +87,10 @@ BEGIN
# at #
#010909 4:46:40 server id # end_log_pos # Table_map: `test2`.`t2` mapped to number #
#010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test2.t2
+### INSERT INTO `test2`.`t2`
### SET
### @1=1 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test2.t2
+### INSERT INTO `test2`.`t2`
### SET
### @1=2 /* INT meta=0 nullable=1 is_null=0 */
# at #
@@ -107,7 +107,7 @@ BEGIN
# at #
#010909 4:46:40 server id # end_log_pos # Table_map: `new_test1`.`t1` mapped to number #
#010909 4:46:40 server id # end_log_pos # Delete_rows: table id # flags: STMT_END_F
-### DELETE FROM new_test1.t1
+### DELETE FROM `new_test1`.`t1`
### WHERE
### @1=1 /* INT meta=0 nullable=1 is_null=0 */
### @2=1 /* INT meta=0 nullable=1 is_null=0 */
@@ -131,10 +131,10 @@ BEGIN
# at #
#010909 4:46:40 server id # end_log_pos # Table_map: `new_test3`.`t3` mapped to number #
#010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO new_test3.t3
+### INSERT INTO `new_test3`.`t3`
### SET
### @1=1 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO new_test3.t3
+### INSERT INTO `new_test3`.`t3`
### SET
### @1=2 /* INT meta=0 nullable=1 is_null=0 */
# at #
@@ -151,7 +151,7 @@ BEGIN
# at #
#010909 4:46:40 server id # end_log_pos # Table_map: `new_test1`.`t1` mapped to number #
#010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO new_test1.t1
+### INSERT INTO `new_test1`.`t1`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
### @2=3 /* INT meta=0 nullable=1 is_null=0 */
@@ -169,23 +169,23 @@ BEGIN
# at #
#010909 4:46:40 server id # end_log_pos # Table_map: `new_test1`.`t1` mapped to number #
#010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO new_test1.t1
+### INSERT INTO `new_test1`.`t1`
### SET
### @1=2 /* INT meta=0 nullable=1 is_null=0 */
### @2=2 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO new_test1.t1
+### INSERT INTO `new_test1`.`t1`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
### @2=3 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO new_test1.t1
+### INSERT INTO `new_test1`.`t1`
### SET
### @1=4 /* INT meta=0 nullable=1 is_null=0 */
### @2=4 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO new_test1.t1
+### INSERT INTO `new_test1`.`t1`
### SET
### @1=5 /* INT meta=0 nullable=1 is_null=0 */
### @2=5 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO new_test1.t1
+### INSERT INTO `new_test1`.`t1`
### SET
### @1=6 /* INT meta=0 nullable=1 is_null=0 */
### @2=6 /* INT meta=0 nullable=1 is_null=0 */
@@ -203,7 +203,7 @@ BEGIN
# at #
#010909 4:46:40 server id # end_log_pos # Table_map: `new_test3`.`t3` mapped to number #
#010909 4:46:40 server id # end_log_pos # Delete_rows: table id # flags: STMT_END_F
-### DELETE FROM new_test3.t3
+### DELETE FROM `new_test3`.`t3`
### WHERE
### @1=1 /* INT meta=0 nullable=1 is_null=0 */
# at #
@@ -255,11 +255,11 @@ BEGIN
# at #
#010909 4:46:40 server id # end_log_pos # Table_map: `new_test1`.`t1` mapped to number #
#010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO new_test1.t1
+### INSERT INTO `new_test1`.`t1`
### SET
### @1=1 /* INT meta=0 nullable=1 is_null=0 */
### @2=1 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO new_test1.t1
+### INSERT INTO `new_test1`.`t1`
### SET
### @1=2 /* INT meta=0 nullable=1 is_null=0 */
### @2=2 /* INT meta=0 nullable=1 is_null=0 */
@@ -283,10 +283,10 @@ BEGIN
# at #
#010909 4:46:40 server id # end_log_pos # Table_map: `test2`.`t2` mapped to number #
#010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test2.t2
+### INSERT INTO `test2`.`t2`
### SET
### @1=1 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO test2.t2
+### INSERT INTO `test2`.`t2`
### SET
### @1=2 /* INT meta=0 nullable=1 is_null=0 */
# at #
@@ -303,7 +303,7 @@ BEGIN
# at #
#010909 4:46:40 server id # end_log_pos # Table_map: `new_test1`.`t1` mapped to number #
#010909 4:46:40 server id # end_log_pos # Delete_rows: table id # flags: STMT_END_F
-### DELETE FROM new_test1.t1
+### DELETE FROM `new_test1`.`t1`
### WHERE
### @1=1 /* INT meta=0 nullable=1 is_null=0 */
### @2=1 /* INT meta=0 nullable=1 is_null=0 */
@@ -327,10 +327,10 @@ BEGIN
# at #
#010909 4:46:40 server id # end_log_pos # Table_map: `new_test3`.`t3` mapped to number #
#010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO new_test3.t3
+### INSERT INTO `new_test3`.`t3`
### SET
### @1=1 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO new_test3.t3
+### INSERT INTO `new_test3`.`t3`
### SET
### @1=2 /* INT meta=0 nullable=1 is_null=0 */
# at #
@@ -347,7 +347,7 @@ BEGIN
# at #
#010909 4:46:40 server id # end_log_pos # Table_map: `new_test1`.`t1` mapped to number #
#010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO new_test1.t1
+### INSERT INTO `new_test1`.`t1`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
### @2=3 /* INT meta=0 nullable=1 is_null=0 */
@@ -365,23 +365,23 @@ BEGIN
# at #
#010909 4:46:40 server id # end_log_pos # Table_map: `new_test1`.`t1` mapped to number #
#010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO new_test1.t1
+### INSERT INTO `new_test1`.`t1`
### SET
### @1=2 /* INT meta=0 nullable=1 is_null=0 */
### @2=2 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO new_test1.t1
+### INSERT INTO `new_test1`.`t1`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
### @2=3 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO new_test1.t1
+### INSERT INTO `new_test1`.`t1`
### SET
### @1=4 /* INT meta=0 nullable=1 is_null=0 */
### @2=4 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO new_test1.t1
+### INSERT INTO `new_test1`.`t1`
### SET
### @1=5 /* INT meta=0 nullable=1 is_null=0 */
### @2=5 /* INT meta=0 nullable=1 is_null=0 */
-### INSERT INTO new_test1.t1
+### INSERT INTO `new_test1`.`t1`
### SET
### @1=6 /* INT meta=0 nullable=1 is_null=0 */
### @2=6 /* INT meta=0 nullable=1 is_null=0 */
@@ -399,7 +399,7 @@ BEGIN
# at #
#010909 4:46:40 server id # end_log_pos # Table_map: `new_test3`.`t3` mapped to number #
#010909 4:46:40 server id # end_log_pos # Delete_rows: table id # flags: STMT_END_F
-### DELETE FROM new_test3.t3
+### DELETE FROM `new_test3`.`t3`
### WHERE
### @1=1 /* INT meta=0 nullable=1 is_null=0 */
# at #
diff --git a/mysql-test/suite/binlog/r/binlog_row_mysqlbinlog_verbose.result b/mysql-test/suite/binlog/r/binlog_row_mysqlbinlog_verbose.result
index 2687b21213a..cbb739a9c48 100644
--- a/mysql-test/suite/binlog/r/binlog_row_mysqlbinlog_verbose.result
+++ b/mysql-test/suite/binlog/r/binlog_row_mysqlbinlog_verbose.result
@@ -1,152 +1,152 @@
Verbose statements from : write-partial-row.binlog
select replace(txt,'\r', '') as stmt from raw_binlog_rows where txt like '###%';
stmt
-### INSERT INTO mysql.ndb_apply_status
+### INSERT INTO `mysql`.`ndb_apply_status`
### SET
### @1=1
### @2=25769803786
### @3=''
### @4=0
### @5=0
-### INSERT INTO test.ba
+### INSERT INTO `test`.`ba`
### SET
### @1=3
### @2=3
### @3=3
-### INSERT INTO test.ba
+### INSERT INTO `test`.`ba`
### SET
### @1=1
### @2=1
### @3=1
-### INSERT INTO test.ba
+### INSERT INTO `test`.`ba`
### SET
### @1=2
### @2=2
### @3=2
-### INSERT INTO test.ba
+### INSERT INTO `test`.`ba`
### SET
### @1=4
### @2=4
### @3=4
-### INSERT INTO test.ba
+### INSERT INTO `test`.`ba`
### SET
### @1=4
### @3=40
-### DELETE FROM test.ba
+### DELETE FROM `test`.`ba`
### WHERE
### @1=2
drop table raw_binlog_rows;
Verbose statements from : write-full-row.binlog
select replace(txt,'\r', '') as stmt from raw_binlog_rows where txt like '###%';
stmt
-### INSERT INTO mysql.ndb_apply_status
+### INSERT INTO `mysql`.`ndb_apply_status`
### SET
### @1=2
### @2=25769803786
### @3=''
### @4=0
### @5=0
-### INSERT INTO test.ba
+### INSERT INTO `test`.`ba`
### SET
### @1=3
### @2=3
### @3=3
-### INSERT INTO test.ba
+### INSERT INTO `test`.`ba`
### SET
### @1=1
### @2=1
### @3=1
-### INSERT INTO test.ba
+### INSERT INTO `test`.`ba`
### SET
### @1=2
### @2=2
### @3=2
-### INSERT INTO test.ba
+### INSERT INTO `test`.`ba`
### SET
### @1=4
### @2=4
### @3=4
-### INSERT INTO test.ba
+### INSERT INTO `test`.`ba`
### SET
### @1=4
### @2=4
### @3=40
-### DELETE FROM test.ba
+### DELETE FROM `test`.`ba`
### WHERE
### @1=2
drop table raw_binlog_rows;
Verbose statements from : update-partial-row.binlog
select replace(txt,'\r', '') as stmt from raw_binlog_rows where txt like '###%';
stmt
-### INSERT INTO mysql.ndb_apply_status
+### INSERT INTO `mysql`.`ndb_apply_status`
### SET
### @1=3
### @2=25769803786
### @3=''
### @4=0
### @5=0
-### INSERT INTO test.ba
+### INSERT INTO `test`.`ba`
### SET
### @1=3
### @2=3
### @3=3
-### INSERT INTO test.ba
+### INSERT INTO `test`.`ba`
### SET
### @1=1
### @2=1
### @3=1
-### INSERT INTO test.ba
+### INSERT INTO `test`.`ba`
### SET
### @1=2
### @2=2
### @3=2
-### INSERT INTO test.ba
+### INSERT INTO `test`.`ba`
### SET
### @1=4
### @2=4
### @3=4
-### UPDATE test.ba
+### UPDATE `test`.`ba`
### WHERE
### @1=4
### @3=4
### SET
### @1=4
### @3=40
-### DELETE FROM test.ba
+### DELETE FROM `test`.`ba`
### WHERE
### @1=2
drop table raw_binlog_rows;
Verbose statements from : update-full-row.binlog
select replace(txt,'\r', '') as stmt from raw_binlog_rows where txt like '###%';
stmt
-### INSERT INTO mysql.ndb_apply_status
+### INSERT INTO `mysql`.`ndb_apply_status`
### SET
### @1=4
### @2=25769803786
### @3=''
### @4=0
### @5=0
-### INSERT INTO test.ba
+### INSERT INTO `test`.`ba`
### SET
### @1=3
### @2=3
### @3=3
-### INSERT INTO test.ba
+### INSERT INTO `test`.`ba`
### SET
### @1=1
### @2=1
### @3=1
-### INSERT INTO test.ba
+### INSERT INTO `test`.`ba`
### SET
### @1=2
### @2=2
### @3=2
-### INSERT INTO test.ba
+### INSERT INTO `test`.`ba`
### SET
### @1=4
### @2=4
### @3=4
-### UPDATE test.ba
+### UPDATE `test`.`ba`
### WHERE
### @1=4
### @2=4
@@ -155,7 +155,7 @@ stmt
### @1=4
### @2=4
### @3=40
-### DELETE FROM test.ba
+### DELETE FROM `test`.`ba`
### WHERE
### @1=2
drop table raw_binlog_rows;
diff --git a/mysql-test/t/mysqlbinlog-cp932-master.opt b/mysql-test/suite/binlog/t/binlog_mysqlbinlog-cp932-master.opt
index bb0cda4519a..bb0cda4519a 100644
--- a/mysql-test/t/mysqlbinlog-cp932-master.opt
+++ b/mysql-test/suite/binlog/t/binlog_mysqlbinlog-cp932-master.opt
diff --git a/mysql-test/t/mysqlbinlog-cp932.test b/mysql-test/suite/binlog/t/binlog_mysqlbinlog-cp932.test
index 2a210bea0e0..2a210bea0e0 100644
--- a/mysql-test/t/mysqlbinlog-cp932.test
+++ b/mysql-test/suite/binlog/t/binlog_mysqlbinlog-cp932.test
diff --git a/mysql-test/t/mysqlbinlog2-master.opt b/mysql-test/suite/binlog/t/binlog_mysqlbinlog2-master.opt
index 4d69f3359db..4d69f3359db 100644
--- a/mysql-test/t/mysqlbinlog2-master.opt
+++ b/mysql-test/suite/binlog/t/binlog_mysqlbinlog2-master.opt
diff --git a/mysql-test/t/mysqlbinlog2.test b/mysql-test/suite/binlog/t/binlog_mysqlbinlog2.test
index 986e180db13..986e180db13 100644
--- a/mysql-test/t/mysqlbinlog2.test
+++ b/mysql-test/suite/binlog/t/binlog_mysqlbinlog2.test
diff --git a/mysql-test/t/mysqlbinlog_base64.test b/mysql-test/suite/binlog/t/binlog_mysqlbinlog_base64.test
index 3d3444cea1c..3d3444cea1c 100644
--- a/mysql-test/t/mysqlbinlog_base64.test
+++ b/mysql-test/suite/binlog/t/binlog_mysqlbinlog_base64.test
diff --git a/mysql-test/t/mysqlbinlog_row-master.opt b/mysql-test/suite/binlog/t/binlog_mysqlbinlog_row-master.opt
index 4d69f3359db..4d69f3359db 100644
--- a/mysql-test/t/mysqlbinlog_row-master.opt
+++ b/mysql-test/suite/binlog/t/binlog_mysqlbinlog_row-master.opt
diff --git a/mysql-test/t/mysqlbinlog_row.test b/mysql-test/suite/binlog/t/binlog_mysqlbinlog_row.test
index 9b41c63d195..9b41c63d195 100644
--- a/mysql-test/t/mysqlbinlog_row.test
+++ b/mysql-test/suite/binlog/t/binlog_mysqlbinlog_row.test
diff --git a/mysql-test/t/mysqlbinlog_row_innodb-master.opt b/mysql-test/suite/binlog/t/binlog_mysqlbinlog_row_innodb-master.opt
index 4d69f3359db..4d69f3359db 100644
--- a/mysql-test/t/mysqlbinlog_row_innodb-master.opt
+++ b/mysql-test/suite/binlog/t/binlog_mysqlbinlog_row_innodb-master.opt
diff --git a/mysql-test/t/mysqlbinlog_row_innodb.test b/mysql-test/suite/binlog/t/binlog_mysqlbinlog_row_innodb.test
index cef1a712f7d..e8ba283807b 100644
--- a/mysql-test/t/mysqlbinlog_row_innodb.test
+++ b/mysql-test/suite/binlog/t/binlog_mysqlbinlog_row_innodb.test
@@ -20,5 +20,5 @@ let $engine_type=InnoDB;
--source include/have_binlog_format_row.inc
--source include/have_ucs2.inc
---source include/mysqlbinlog_row_engine.inc
+--source extra/binlog_tests/mysqlbinlog_row_engine.inc
diff --git a/mysql-test/t/mysqlbinlog_row_myisam-master.opt b/mysql-test/suite/binlog/t/binlog_mysqlbinlog_row_myisam-master.opt
index 4d69f3359db..4d69f3359db 100644
--- a/mysql-test/t/mysqlbinlog_row_myisam-master.opt
+++ b/mysql-test/suite/binlog/t/binlog_mysqlbinlog_row_myisam-master.opt
diff --git a/mysql-test/t/mysqlbinlog_row_myisam.test b/mysql-test/suite/binlog/t/binlog_mysqlbinlog_row_myisam.test
index e7b0335812a..9b941282399 100644
--- a/mysql-test/t/mysqlbinlog_row_myisam.test
+++ b/mysql-test/suite/binlog/t/binlog_mysqlbinlog_row_myisam.test
@@ -20,4 +20,4 @@ let $engine_type=MyISAM;
--source include/have_binlog_format_row.inc
--source include/have_ucs2.inc
---source include/mysqlbinlog_row_engine.inc
+--source extra/binlog_tests/mysqlbinlog_row_engine.inc
diff --git a/mysql-test/t/mysqlbinlog_row_trans-master.opt b/mysql-test/suite/binlog/t/binlog_mysqlbinlog_row_trans-master.opt
index 4d69f3359db..4d69f3359db 100644
--- a/mysql-test/t/mysqlbinlog_row_trans-master.opt
+++ b/mysql-test/suite/binlog/t/binlog_mysqlbinlog_row_trans-master.opt
diff --git a/mysql-test/t/mysqlbinlog_row_trans.test b/mysql-test/suite/binlog/t/binlog_mysqlbinlog_row_trans.test
index 24abc441c4c..24abc441c4c 100644
--- a/mysql-test/t/mysqlbinlog_row_trans.test
+++ b/mysql-test/suite/binlog/t/binlog_mysqlbinlog_row_trans.test
diff --git a/mysql-test/suite/engines/funcs/r/tc_rename_error.result b/mysql-test/suite/engines/funcs/r/tc_rename_error.result
index 1ac32ddf010..bd1c2abc057 100644
--- a/mysql-test/suite/engines/funcs/r/tc_rename_error.result
+++ b/mysql-test/suite/engines/funcs/r/tc_rename_error.result
@@ -15,7 +15,7 @@ ERROR 42S01: Table 't1' already exists
RENAME TABLE t3 TO t1;
ERROR 42S01: Table 't1' already exists
RENAME TABLE t3 TO doesnotexist.t1;
-ERROR HY000: Can't find file: './test/t3.frm' (errno: 2)
+ERROR HY000: Can't find file: './test/t3.frm' (errno: 2 "No such file or directory")
SHOW TABLES;
Tables_in_test
t1
diff --git a/mysql-test/suite/engines/iuds/r/insert_time.result b/mysql-test/suite/engines/iuds/r/insert_time.result
index 0f588274fc1..dceba37ae8e 100644
--- a/mysql-test/suite/engines/iuds/r/insert_time.result
+++ b/mysql-test/suite/engines/iuds/r/insert_time.result
@@ -5167,7 +5167,6 @@ c1 c2 c3
825:23:00 825:23:00 2009-01-05
10:00:00 10:00:00 2009-01-06
00:00:45 00:00:45 2009-01-07
-00:00:00 00:00:00 2009-01-09
838:59:59 838:59:59 2009-01-10
10:11:12 10:11:12 2009-01-11
11:11:12 11:11:12 2009-01-12
@@ -5178,18 +5177,12 @@ c1 c2 c3
11:11:27 11:11:27 2009-01-17
08:03:02 08:03:02 2009-01-18
00:11:12 00:11:12 2009-01-19
-00:00:11 00:00:11 2009-01-20
00:12:30 00:12:30 2009-01-23
09:00:45 09:00:45 2009-01-24
09:36:00 09:36:00 2009-01-25
-00:00:10 00:00:10 2009-01-26
-00:00:00 00:00:00 2009-01-27
-00:00:00 00:00:00 2009-01-28
-00:00:00 00:00:00 2009-01-29
262:22:00 262:22:00 2009-01-30
00:00:12 00:00:12 2009-01-31
08:29:45 NULL 2009-02-01
-00:00:00 07:23:55 NULL
TRUNCATE TABLE t5;
DROP TABLE t5;
DROP TABLE t1,t2,t3,t4;
diff --git a/mysql-test/suite/funcs_1/datadict/processlist_priv.inc b/mysql-test/suite/funcs_1/datadict/processlist_priv.inc
index b863b98d98a..474171d175d 100644
--- a/mysql-test/suite/funcs_1/datadict/processlist_priv.inc
+++ b/mysql-test/suite/funcs_1/datadict/processlist_priv.inc
@@ -66,7 +66,7 @@
let $table= processlist;
#
# columns of the information_schema table e.g. to use in a select.
-let $columns= ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS;
+let $columns= ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS;
#
# Where clause for an update.
let $update_where= WHERE id=1 ;
@@ -159,9 +159,9 @@ WHERE DB = 'information_schema' AND COMMAND = 'Sleep' AND USER = 'ddicttestuser1
eval SHOW CREATE TABLE $table;
--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS
eval SHOW $table;
---replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS
+--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 ROWS
eval SELECT * FROM $table $select_where ORDER BY id;
---replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS
+--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 ROWS
eval SELECT $columns FROM $table $select_where ORDER BY id;
--source suite/funcs_1/datadict/datadict_priv.inc
--real_sleep 0.3
@@ -179,9 +179,9 @@ connection con100;
eval SHOW CREATE TABLE $table;
--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS
eval SHOW $table;
---replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS
+--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 ROWS
eval SELECT * FROM $table $select_where ORDER BY id;
---replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS
+--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 ROWS
eval SELECT $columns FROM $table $select_where ORDER BY id;
--source suite/funcs_1/datadict/datadict_priv.inc
--real_sleep 0.3
@@ -205,7 +205,7 @@ connection con100;
SHOW GRANTS;
--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS
SHOW processlist;
---replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS
+--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 ROWS
SELECT * FROM information_schema.processlist;
--real_sleep 0.3
@@ -217,7 +217,7 @@ connect (con101,localhost,ddicttestuser1,ddictpass,information_schema);
SHOW GRANTS;
--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS
SHOW processlist;
---replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS
+--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 ROWS
SELECT * FROM information_schema.processlist;
--real_sleep 0.3
@@ -239,7 +239,7 @@ connect (anonymous1,localhost,"''",,information_schema);
SHOW GRANTS;
--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS
SHOW processlist;
---replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS
+--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 ROWS
SELECT * FROM information_schema.processlist;
--real_sleep 0.3
@@ -261,7 +261,7 @@ connect (con102,localhost,ddicttestuser1,ddictpass,information_schema);
SHOW GRANTS;
--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS
SHOW processlist;
---replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS
+--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 ROWS
SELECT * FROM information_schema.processlist;
--real_sleep 0.3
@@ -287,7 +287,7 @@ if ($fixed_bug_30395)
--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS
SHOW processlist;
}
---replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS
+--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 ROWS
SELECT * FROM information_schema.processlist;
--real_sleep 0.3
@@ -308,7 +308,7 @@ connect (con103,localhost,ddicttestuser1,ddictpass,information_schema);
SHOW GRANTS FOR 'ddicttestuser1'@'localhost';
--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS
SHOW processlist;
---replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS
+--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 ROWS
SELECT * FROM information_schema.processlist;
--real_sleep 0.3
@@ -330,7 +330,7 @@ connect (con104,localhost,ddicttestuser1,ddictpass,information_schema);
SHOW GRANTS FOR 'ddicttestuser1'@'localhost';
--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS
SHOW processlist;
---replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS
+--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 ROWS
SELECT * FROM information_schema.processlist;
--real_sleep 0.3
@@ -377,7 +377,7 @@ connect (con200,localhost,ddicttestuser2,ddictpass,information_schema);
SHOW GRANTS FOR 'ddicttestuser2'@'localhost';
--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS
SHOW processlist;
---replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS
+--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 ROWS
SELECT * FROM information_schema.processlist;
--real_sleep 0.3
@@ -398,7 +398,7 @@ connect (con201,localhost,ddicttestuser2,ddictpass,information_schema);
SHOW GRANTS;
--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS
SHOW processlist;
---replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS
+--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 ROWS
SELECT * FROM information_schema.processlist;
--real_sleep 0.3
@@ -421,7 +421,7 @@ SHOW GRANTS FOR 'ddicttestuser1'@'localhost';
GRANT PROCESS ON *.* TO 'ddicttestuser2'@'localhost';
--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS
SHOW processlist;
---replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS
+--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 ROWS
SELECT * FROM information_schema.processlist;
--real_sleep 0.3
@@ -445,7 +445,7 @@ connect (con108,localhost,ddicttestuser1,ddictpass,information_schema);
SHOW GRANTS FOR 'ddicttestuser1'@'localhost';
--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS
SHOW processlist;
---replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS
+--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 ROWS
SELECT * FROM information_schema.processlist;
--real_sleep 0.3
diff --git a/mysql-test/suite/funcs_1/datadict/processlist_val.inc b/mysql-test/suite/funcs_1/datadict/processlist_val.inc
index bb6c13a6f4b..d0d2e606152 100644
--- a/mysql-test/suite/funcs_1/datadict/processlist_val.inc
+++ b/mysql-test/suite/funcs_1/datadict/processlist_val.inc
@@ -93,9 +93,9 @@ echo
# - INFO must contain the corresponding SHOW/SELECT PROCESSLIST
#
# 1. Just dump what we get
---replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME> 9 <TIME_MS>
+--replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME> 9 <TIME_MS> 13 <MEMORY> 14 <ROWS>
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
---replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME> 9 <TIME_MS>
+--replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME> 9 <TIME_MS> 13 <MEMORY> 14 <ROWS>
SHOW FULL PROCESSLIST;
#
# Determine the connection id of the current connection (default)
@@ -166,7 +166,7 @@ let $wait_condition= SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST
WHERE COMMAND = 'Sleep' AND USER = 'test_user';
--source include/wait_condition.inc
# 1. Just dump what we get
---replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME> 9 <TIME_MS>
+--replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME> 9 <TIME_MS> 13 <MEMORY> 14 <ROWS>
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
--replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME>
SHOW FULL PROCESSLIST;
@@ -211,7 +211,7 @@ echo
# ----- switch to connection con1 (user = test_user) -----
;
connection con1;
---replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME> 9 <TIME_MS>
+--replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME> 9 <TIME_MS> 13 <MEMORY> 14 <ROWS>
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
--replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME>
SHOW FULL PROCESSLIST;
@@ -245,7 +245,7 @@ echo
;
connection con2;
# Just dump what we get
---replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME> 9 <TIME_MS>
+--replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME> 9 <TIME_MS> 13 <MEMORY> 14 <ROWS>
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
--replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME>
SHOW FULL PROCESSLIST;
@@ -305,7 +305,7 @@ WHERE ID = @test_user_con2_id AND Command IN('Query','Execute')
AND State = 'User sleep' AND INFO IS NOT NULL ;
--source include/wait_condition.inc
# 1. Just dump what we get
---replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME> 9 <TIME_MS>
+--replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME> 9 <TIME_MS> 13 <MEMORY> 14 <ROWS>
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
--replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME>
SHOW FULL PROCESSLIST;
@@ -376,7 +376,7 @@ let $wait_condition= SELECT COUNT(*) FROM INFORMATION_SCHEMA.PROCESSLIST
#
# Expect to see the state 'Waiting for table metadata lock' for the third
# connection because the SELECT collides with the WRITE TABLE LOCK.
---replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME> 9 <TIME_MS>
+--replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME> 9 <TIME_MS> 13 <MEMORY> 14 <ROWS>
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
UNLOCK TABLES;
#
@@ -435,7 +435,7 @@ echo
# SHOW FULL PROCESSLIST Complete statement
# SHOW PROCESSLIST statement truncated after 100 char
;
---replace_column 1 <ID> 3 <HOST_NAME> 5 <COMMAND> 6 <TIME> 7 <STATE> 9 <TIME_MS>
+--replace_column 1 <ID> 3 <HOST_NAME> 5 <COMMAND> 6 <TIME> 7 <STATE> 9 <TIME_MS> 13 <MEMORY> 14 <ROWS>
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
--replace_column 1 <ID> 3 <HOST_NAME> 5 <COMMAND> 6 <TIME> 7 <STATE>
SHOW FULL PROCESSLIST;
diff --git a/mysql-test/suite/funcs_1/r/is_columns_is.result b/mysql-test/suite/funcs_1/r/is_columns_is.result
index 4da7eeb2ada..e161e8ed058 100644
--- a/mysql-test/suite/funcs_1/r/is_columns_is.result
+++ b/mysql-test/suite/funcs_1/r/is_columns_is.result
@@ -221,10 +221,12 @@ def information_schema PLUGINS PLUGIN_TYPE_VERSION 5 NO varchar 20 60 NULL NULL
def information_schema PLUGINS PLUGIN_VERSION 2 NO varchar 20 60 NULL NULL NULL utf8 utf8_general_ci varchar(20) select
def information_schema PROCESSLIST COMMAND 5 NO varchar 16 48 NULL NULL NULL utf8 utf8_general_ci varchar(16) select
def information_schema PROCESSLIST DB 4 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select
+def information_schema PROCESSLIST EXAMINED_ROWS 14 0 NO int NULL NULL 10 0 NULL NULL NULL int(7) select
def information_schema PROCESSLIST HOST 3 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select
def information_schema PROCESSLIST ID 1 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(4) select
def information_schema PROCESSLIST INFO 8 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8 utf8_general_ci longtext select
def information_schema PROCESSLIST MAX_STAGE 11 0 NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(2) select
+def information_schema PROCESSLIST MEMORY_USED 13 0 NO int NULL NULL 10 0 NULL NULL NULL int(7) select
def information_schema PROCESSLIST PROGRESS 12 0.000 NO decimal NULL NULL 7 3 NULL NULL NULL decimal(7,3) select
def information_schema PROCESSLIST STAGE 10 0 NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(2) select
def information_schema PROCESSLIST STATE 7 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select
@@ -699,6 +701,8 @@ NULL information_schema PROCESSLIST TIME_MS decimal NULL NULL NULL NULL decimal(
NULL information_schema PROCESSLIST STAGE tinyint NULL NULL NULL NULL tinyint(2)
NULL information_schema PROCESSLIST MAX_STAGE tinyint NULL NULL NULL NULL tinyint(2)
NULL information_schema PROCESSLIST PROGRESS decimal NULL NULL NULL NULL decimal(7,3)
+NULL information_schema PROCESSLIST MEMORY_USED int NULL NULL NULL NULL int(7)
+NULL information_schema PROCESSLIST EXAMINED_ROWS int NULL NULL NULL NULL int(7)
3.0000 information_schema REFERENTIAL_CONSTRAINTS CONSTRAINT_CATALOG varchar 512 1536 utf8 utf8_general_ci varchar(512)
3.0000 information_schema REFERENTIAL_CONSTRAINTS CONSTRAINT_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64)
3.0000 information_schema REFERENTIAL_CONSTRAINTS CONSTRAINT_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
diff --git a/mysql-test/suite/funcs_1/r/is_columns_is_embedded.result b/mysql-test/suite/funcs_1/r/is_columns_is_embedded.result
index 3fb4d97748c..003f506fee8 100644
--- a/mysql-test/suite/funcs_1/r/is_columns_is_embedded.result
+++ b/mysql-test/suite/funcs_1/r/is_columns_is_embedded.result
@@ -222,10 +222,12 @@ def information_schema PLUGINS PLUGIN_TYPE_VERSION 5 NO varchar 20 60 NULL NULL
def information_schema PLUGINS PLUGIN_VERSION 2 NO varchar 20 60 NULL NULL NULL utf8 utf8_general_ci varchar(20)
def information_schema PROCESSLIST COMMAND 5 NO varchar 16 48 NULL NULL NULL utf8 utf8_general_ci varchar(16)
def information_schema PROCESSLIST DB 4 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema PROCESSLIST EXAMINED_ROWS 14 0 NO int NULL NULL 10 0 NULL NULL NULL int(7)
def information_schema PROCESSLIST HOST 3 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64)
def information_schema PROCESSLIST ID 1 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(4)
def information_schema PROCESSLIST INFO 8 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8 utf8_general_ci longtext
def information_schema PROCESSLIST MAX_STAGE 11 0 NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(2)
+def information_schema PROCESSLIST MEMORY_USED 13 0 NO int NULL NULL 10 0 NULL NULL NULL int(7)
def information_schema PROCESSLIST PROGRESS 12 0.000 NO decimal NULL NULL 7 3 NULL NULL NULL decimal(7,3)
def information_schema PROCESSLIST STAGE 10 0 NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(2)
def information_schema PROCESSLIST STATE 7 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64)
@@ -704,6 +706,8 @@ NULL information_schema PROCESSLIST TIME_MS decimal NULL NULL NULL NULL decimal(
NULL information_schema PROCESSLIST STAGE tinyint NULL NULL NULL NULL tinyint(2)
NULL information_schema PROCESSLIST MAX_STAGE tinyint NULL NULL NULL NULL tinyint(2)
NULL information_schema PROCESSLIST PROGRESS decimal NULL NULL NULL NULL decimal(7,3)
+NULL information_schema PROCESSLIST MEMORY_USED int NULL NULL NULL NULL int(7)
+NULL information_schema PROCESSLIST EXAMINED_ROWS int NULL NULL NULL NULL int(7)
3.0000 information_schema REFERENTIAL_CONSTRAINTS CONSTRAINT_CATALOG varchar 512 1536 utf8 utf8_general_ci varchar(512)
3.0000 information_schema REFERENTIAL_CONSTRAINTS CONSTRAINT_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64)
3.0000 information_schema REFERENTIAL_CONSTRAINTS CONSTRAINT_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
diff --git a/mysql-test/suite/funcs_1/r/processlist_priv_no_prot.result b/mysql-test/suite/funcs_1/r/processlist_priv_no_prot.result
index 24be300fd51..7bd5f9adb54 100644
--- a/mysql-test/suite/funcs_1/r/processlist_priv_no_prot.result
+++ b/mysql-test/suite/funcs_1/r/processlist_priv_no_prot.result
@@ -33,28 +33,30 @@ PROCESSLIST CREATE TEMPORARY TABLE `PROCESSLIST` (
`TIME_MS` decimal(22,3) NOT NULL DEFAULT '0.000',
`STAGE` tinyint(2) NOT NULL DEFAULT '0',
`MAX_STAGE` tinyint(2) NOT NULL DEFAULT '0',
- `PROGRESS` decimal(7,3) NOT NULL DEFAULT '0.000'
+ `PROGRESS` decimal(7,3) NOT NULL DEFAULT '0.000',
+ `MEMORY_USED` int(7) NOT NULL DEFAULT '0',
+ `EXAMINED_ROWS` int(7) NOT NULL DEFAULT '0'
) DEFAULT CHARSET=utf8
SHOW processlist;
Id User Host db Command Time State Info Progress
ID root HOST_NAME information_schema Query TIME init SHOW processlist TIME_MS
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
SELECT * FROM processlist ORDER BY id;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS
-ID root HOST_NAME information_schema Query TIME executing SELECT * FROM processlist ORDER BY id TIME_MS 0 0 0.000
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000
-SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS FROM processlist ORDER BY id;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS
-ID root HOST_NAME information_schema Query TIME executing SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS FROM processlist ORDER BY id TIME_MS 0 0 0.000
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS
+ID root HOST_NAME information_schema Query TIME executing SELECT * FROM processlist ORDER BY id TIME_MS 0 0 0.000 MEMORY ROWS
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS
+SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS FROM processlist ORDER BY id;
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS
+ID root HOST_NAME information_schema Query TIME executing SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS FROM processlist ORDER BY id TIME_MS 0 0 0.000 MEMORY ROWS
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS
CREATE TEMPORARY TABLE test.t_processlist AS SELECT * FROM processlist;
UPDATE test.t_processlist SET user='horst' WHERE id=1 ;
INSERT INTO processlist SELECT * FROM test.t_processlist;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
DROP TABLE test.t_processlist;
-CREATE VIEW test.v_processlist (ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS) AS SELECT * FROM processlist WITH CHECK OPTION;
+CREATE VIEW test.v_processlist (ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS) AS SELECT * FROM processlist WITH CHECK OPTION;
ERROR HY000: CHECK OPTION on non-updatable view 'test.v_processlist'
-CREATE VIEW test.v_processlist (ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS) AS SELECT * FROM processlist;
+CREATE VIEW test.v_processlist (ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS) AS SELECT * FROM processlist;
DROP VIEW test.v_processlist;
UPDATE processlist SET user='any_user' WHERE id=1 ;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
@@ -106,25 +108,27 @@ PROCESSLIST CREATE TEMPORARY TABLE `PROCESSLIST` (
`TIME_MS` decimal(22,3) NOT NULL DEFAULT '0.000',
`STAGE` tinyint(2) NOT NULL DEFAULT '0',
`MAX_STAGE` tinyint(2) NOT NULL DEFAULT '0',
- `PROGRESS` decimal(7,3) NOT NULL DEFAULT '0.000'
+ `PROGRESS` decimal(7,3) NOT NULL DEFAULT '0.000',
+ `MEMORY_USED` int(7) NOT NULL DEFAULT '0',
+ `EXAMINED_ROWS` int(7) NOT NULL DEFAULT '0'
) DEFAULT CHARSET=utf8
SHOW processlist;
Id User Host db Command Time State Info Progress
ID ddicttestuser1 HOST_NAME information_schema Query TIME init SHOW processlist TIME_MS
SELECT * FROM processlist ORDER BY id;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS
-ID ddicttestuser1 HOST_NAME information_schema Query TIME executing SELECT * FROM processlist ORDER BY id TIME_MS 0 0 0.000
-SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS FROM processlist ORDER BY id;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS
-ID ddicttestuser1 HOST_NAME information_schema Query TIME executing SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS FROM processlist ORDER BY id TIME_MS 0 0 0.000
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS
+ID ddicttestuser1 HOST_NAME information_schema Query TIME executing SELECT * FROM processlist ORDER BY id TIME_MS 0 0 0.000 MEMORY ROWS
+SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS FROM processlist ORDER BY id;
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS
+ID ddicttestuser1 HOST_NAME information_schema Query TIME executing SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS FROM processlist ORDER BY id TIME_MS 0 0 0.000 MEMORY ROWS
CREATE TEMPORARY TABLE test.t_processlist AS SELECT * FROM processlist;
UPDATE test.t_processlist SET user='horst' WHERE id=1 ;
INSERT INTO processlist SELECT * FROM test.t_processlist;
ERROR 42000: Access denied for user 'ddicttestuser1'@'localhost' to database 'information_schema'
DROP TABLE test.t_processlist;
-CREATE VIEW test.v_processlist (ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS) AS SELECT * FROM processlist WITH CHECK OPTION;
+CREATE VIEW test.v_processlist (ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS) AS SELECT * FROM processlist WITH CHECK OPTION;
ERROR HY000: CHECK OPTION on non-updatable view 'test.v_processlist'
-CREATE VIEW test.v_processlist (ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS) AS SELECT * FROM processlist;
+CREATE VIEW test.v_processlist (ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS) AS SELECT * FROM processlist;
DROP VIEW test.v_processlist;
UPDATE processlist SET user='any_user' WHERE id=1 ;
ERROR 42000: Access denied for user 'ddicttestuser1'@'localhost' to database 'information_schema'
@@ -175,8 +179,8 @@ SHOW processlist;
Id User Host db Command Time State Info Progress
ID ddicttestuser1 HOST_NAME information_schema Query TIME init SHOW processlist TIME_MS
SELECT * FROM information_schema.processlist;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS
-ID ddicttestuser1 HOST_NAME information_schema Query TIME executing SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS
+ID ddicttestuser1 HOST_NAME information_schema Query TIME executing SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY ROWS
####################################################################################
4.2 New connection con101 (ddicttestuser1 with PROCESS privilege)
SHOW/SELECT shows all processes/threads.
@@ -190,10 +194,10 @@ ID root HOST_NAME information_schema Sleep TIME NULL TIME_MS
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
ID ddicttestuser1 HOST_NAME information_schema Query TIME init SHOW processlist TIME_MS
SELECT * FROM information_schema.processlist;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS
-ID ddicttestuser1 HOST_NAME information_schema Query TIME executing SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000
-ID root HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS
+ID ddicttestuser1 HOST_NAME information_schema Query TIME executing SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY ROWS
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS
+ID root HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS
####################################################################################
5 Grant PROCESS privilege to anonymous user.
connection default (user=root)
@@ -214,11 +218,11 @@ ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
ID HOST_NAME information_schema Query TIME init SHOW processlist TIME_MS
SELECT * FROM information_schema.processlist;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS
-ID HOST_NAME information_schema Query TIME executing SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000
-ID root HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS
+ID HOST_NAME information_schema Query TIME executing SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY ROWS
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS
+ID root HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS
####################################################################################
6 Revoke PROCESS privilege from ddicttestuser1
connection default (user=root)
@@ -238,10 +242,10 @@ ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
ID ddicttestuser1 HOST_NAME information_schema Query TIME init SHOW processlist TIME_MS
SELECT * FROM information_schema.processlist;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS
-ID ddicttestuser1 HOST_NAME information_schema Query TIME executing SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS
+ID ddicttestuser1 HOST_NAME information_schema Query TIME executing SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY ROWS
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS
####################################################################################
7 Revoke PROCESS privilege from anonymous user
connection default (user=root)
@@ -256,9 +260,9 @@ SHOW GRANTS FOR ''@'localhost';
Grants for @localhost
GRANT USAGE ON *.* TO ''@'localhost'
SELECT * FROM information_schema.processlist;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS
-ID HOST_NAME information_schema Query TIME executing SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000
-ID HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS
+ID HOST_NAME information_schema Query TIME executing SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY ROWS
+ID HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS
####################################################################################
8 Grant SUPER (does not imply PROCESS) privilege to ddicttestuser1
connection default (user=root)
@@ -278,11 +282,11 @@ ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
ID ddicttestuser1 HOST_NAME information_schema Query TIME init SHOW processlist TIME_MS
SELECT * FROM information_schema.processlist;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS
-ID ddicttestuser1 HOST_NAME information_schema Query TIME executing SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS
+ID ddicttestuser1 HOST_NAME information_schema Query TIME executing SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY ROWS
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS
####################################################################################
9 Revoke SUPER privilege from user ddicttestuser1
connection default (user=root)
@@ -304,12 +308,12 @@ ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
ID ddicttestuser1 HOST_NAME information_schema Query TIME init SHOW processlist TIME_MS
SELECT * FROM information_schema.processlist;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS
-ID ddicttestuser1 HOST_NAME information_schema Query TIME executing SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS
+ID ddicttestuser1 HOST_NAME information_schema Query TIME executing SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY ROWS
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS
####################################################################################
10 Grant SUPER privilege with grant option to user ddicttestuser1.
connection default (user=root)
@@ -358,18 +362,18 @@ ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
ID ddicttestuser2 HOST_NAME information_schema Query TIME init SHOW processlist TIME_MS
SELECT * FROM information_schema.processlist;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS
-ID ddicttestuser2 HOST_NAME information_schema Query TIME executing SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000
-ID HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000
-ID HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000
-ID root HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS
+ID ddicttestuser2 HOST_NAME information_schema Query TIME executing SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY ROWS
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS
+ID HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS
+ID HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS
+ID root HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS
####################################################################################
11 User ddicttestuser1 revokes PROCESS privilege from user ddicttestuser2
connection ddicttestuser1;
@@ -387,9 +391,9 @@ Id User Host db Command Time State Info Progress
ID ddicttestuser2 HOST_NAME information_schema Sleep TIME NULL TIME_MS
ID ddicttestuser2 HOST_NAME information_schema Query TIME init SHOW processlist TIME_MS
SELECT * FROM information_schema.processlist;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS
-ID ddicttestuser2 HOST_NAME information_schema Query TIME executing SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000
-ID ddicttestuser2 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS
+ID ddicttestuser2 HOST_NAME information_schema Query TIME executing SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY ROWS
+ID ddicttestuser2 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS
####################################################################################
11.2 Revoke SUPER,PROCESS,GRANT OPTION privilege from user ddicttestuser1
connection default (user=root)
@@ -416,15 +420,15 @@ ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
ID ddicttestuser1 HOST_NAME information_schema Query TIME init SHOW processlist TIME_MS
SELECT * FROM information_schema.processlist;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS
-ID ddicttestuser1 HOST_NAME information_schema Query TIME executing SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS
+ID ddicttestuser1 HOST_NAME information_schema Query TIME executing SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY ROWS
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS
####################################################################################
12 Revoke the SELECT privilege from user ddicttestuser1
connection default (user=root)
@@ -452,16 +456,16 @@ ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
ID ddicttestuser1 HOST_NAME information_schema Query TIME init SHOW processlist TIME_MS
SELECT * FROM information_schema.processlist;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS
-ID ddicttestuser1 HOST_NAME information_schema Query TIME executing SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS
+ID ddicttestuser1 HOST_NAME information_schema Query TIME executing SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY ROWS
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS
####################################################################################
12.2 Revoke only the SELECT privilege on the information_schema from ddicttestuser1.
connection default (user=root)
diff --git a/mysql-test/suite/funcs_1/r/processlist_priv_ps.result b/mysql-test/suite/funcs_1/r/processlist_priv_ps.result
index 1afdca9b967..8181901bde7 100644
--- a/mysql-test/suite/funcs_1/r/processlist_priv_ps.result
+++ b/mysql-test/suite/funcs_1/r/processlist_priv_ps.result
@@ -33,28 +33,30 @@ PROCESSLIST CREATE TEMPORARY TABLE `PROCESSLIST` (
`TIME_MS` decimal(22,3) NOT NULL DEFAULT '0.000',
`STAGE` tinyint(2) NOT NULL DEFAULT '0',
`MAX_STAGE` tinyint(2) NOT NULL DEFAULT '0',
- `PROGRESS` decimal(7,3) NOT NULL DEFAULT '0.000'
+ `PROGRESS` decimal(7,3) NOT NULL DEFAULT '0.000',
+ `MEMORY_USED` int(7) NOT NULL DEFAULT '0',
+ `EXAMINED_ROWS` int(7) NOT NULL DEFAULT '0'
) DEFAULT CHARSET=utf8
SHOW processlist;
Id User Host db Command Time State Info Progress
ID root HOST_NAME information_schema Query TIME init SHOW processlist TIME_MS
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
SELECT * FROM processlist ORDER BY id;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS
-ID root HOST_NAME information_schema Execute TIME executing SELECT * FROM processlist ORDER BY id TIME_MS 0 0 0.000
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000
-SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS FROM processlist ORDER BY id;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS
-ID root HOST_NAME information_schema Execute TIME executing SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS FROM processlist ORDER BY id TIME_MS 0 0 0.000
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS
+ID root HOST_NAME information_schema Execute TIME executing SELECT * FROM processlist ORDER BY id TIME_MS 0 0 0.000 MEMORY ROWS
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS
+SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS FROM processlist ORDER BY id;
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS
+ID root HOST_NAME information_schema Execute TIME executing SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS FROM processlist ORDER BY id TIME_MS 0 0 0.000 MEMORY ROWS
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS
CREATE TEMPORARY TABLE test.t_processlist AS SELECT * FROM processlist;
UPDATE test.t_processlist SET user='horst' WHERE id=1 ;
INSERT INTO processlist SELECT * FROM test.t_processlist;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
DROP TABLE test.t_processlist;
-CREATE VIEW test.v_processlist (ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS) AS SELECT * FROM processlist WITH CHECK OPTION;
+CREATE VIEW test.v_processlist (ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS) AS SELECT * FROM processlist WITH CHECK OPTION;
ERROR HY000: CHECK OPTION on non-updatable view 'test.v_processlist'
-CREATE VIEW test.v_processlist (ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS) AS SELECT * FROM processlist;
+CREATE VIEW test.v_processlist (ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS) AS SELECT * FROM processlist;
DROP VIEW test.v_processlist;
UPDATE processlist SET user='any_user' WHERE id=1 ;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
@@ -106,25 +108,27 @@ PROCESSLIST CREATE TEMPORARY TABLE `PROCESSLIST` (
`TIME_MS` decimal(22,3) NOT NULL DEFAULT '0.000',
`STAGE` tinyint(2) NOT NULL DEFAULT '0',
`MAX_STAGE` tinyint(2) NOT NULL DEFAULT '0',
- `PROGRESS` decimal(7,3) NOT NULL DEFAULT '0.000'
+ `PROGRESS` decimal(7,3) NOT NULL DEFAULT '0.000',
+ `MEMORY_USED` int(7) NOT NULL DEFAULT '0',
+ `EXAMINED_ROWS` int(7) NOT NULL DEFAULT '0'
) DEFAULT CHARSET=utf8
SHOW processlist;
Id User Host db Command Time State Info Progress
ID ddicttestuser1 HOST_NAME information_schema Query TIME init SHOW processlist TIME_MS
SELECT * FROM processlist ORDER BY id;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS
-ID ddicttestuser1 HOST_NAME information_schema Execute TIME executing SELECT * FROM processlist ORDER BY id TIME_MS 0 0 0.000
-SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS FROM processlist ORDER BY id;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS
-ID ddicttestuser1 HOST_NAME information_schema Execute TIME executing SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS FROM processlist ORDER BY id TIME_MS 0 0 0.000
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS
+ID ddicttestuser1 HOST_NAME information_schema Execute TIME executing SELECT * FROM processlist ORDER BY id TIME_MS 0 0 0.000 MEMORY ROWS
+SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS FROM processlist ORDER BY id;
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS
+ID ddicttestuser1 HOST_NAME information_schema Execute TIME executing SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS FROM processlist ORDER BY id TIME_MS 0 0 0.000 MEMORY ROWS
CREATE TEMPORARY TABLE test.t_processlist AS SELECT * FROM processlist;
UPDATE test.t_processlist SET user='horst' WHERE id=1 ;
INSERT INTO processlist SELECT * FROM test.t_processlist;
ERROR 42000: Access denied for user 'ddicttestuser1'@'localhost' to database 'information_schema'
DROP TABLE test.t_processlist;
-CREATE VIEW test.v_processlist (ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS) AS SELECT * FROM processlist WITH CHECK OPTION;
+CREATE VIEW test.v_processlist (ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS) AS SELECT * FROM processlist WITH CHECK OPTION;
ERROR HY000: CHECK OPTION on non-updatable view 'test.v_processlist'
-CREATE VIEW test.v_processlist (ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS) AS SELECT * FROM processlist;
+CREATE VIEW test.v_processlist (ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS) AS SELECT * FROM processlist;
DROP VIEW test.v_processlist;
UPDATE processlist SET user='any_user' WHERE id=1 ;
ERROR 42000: Access denied for user 'ddicttestuser1'@'localhost' to database 'information_schema'
@@ -175,8 +179,8 @@ SHOW processlist;
Id User Host db Command Time State Info Progress
ID ddicttestuser1 HOST_NAME information_schema Query TIME init SHOW processlist TIME_MS
SELECT * FROM information_schema.processlist;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS
-ID ddicttestuser1 HOST_NAME information_schema Execute TIME executing SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS
+ID ddicttestuser1 HOST_NAME information_schema Execute TIME executing SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY ROWS
####################################################################################
4.2 New connection con101 (ddicttestuser1 with PROCESS privilege)
SHOW/SELECT shows all processes/threads.
@@ -190,10 +194,10 @@ ID root HOST_NAME information_schema Sleep TIME NULL TIME_MS
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
ID ddicttestuser1 HOST_NAME information_schema Query TIME init SHOW processlist TIME_MS
SELECT * FROM information_schema.processlist;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS
-ID ddicttestuser1 HOST_NAME information_schema Execute TIME executing SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000
-ID root HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS
+ID ddicttestuser1 HOST_NAME information_schema Execute TIME executing SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY ROWS
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS
+ID root HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS
####################################################################################
5 Grant PROCESS privilege to anonymous user.
connection default (user=root)
@@ -214,11 +218,11 @@ ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
ID HOST_NAME information_schema Query TIME init SHOW processlist TIME_MS
SELECT * FROM information_schema.processlist;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS
-ID HOST_NAME information_schema Execute TIME executing SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000
-ID root HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS
+ID HOST_NAME information_schema Execute TIME executing SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY ROWS
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS
+ID root HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS
####################################################################################
6 Revoke PROCESS privilege from ddicttestuser1
connection default (user=root)
@@ -238,10 +242,10 @@ ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
ID ddicttestuser1 HOST_NAME information_schema Query TIME init SHOW processlist TIME_MS
SELECT * FROM information_schema.processlist;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS
-ID ddicttestuser1 HOST_NAME information_schema Execute TIME executing SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS
+ID ddicttestuser1 HOST_NAME information_schema Execute TIME executing SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY ROWS
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS
####################################################################################
7 Revoke PROCESS privilege from anonymous user
connection default (user=root)
@@ -256,9 +260,9 @@ SHOW GRANTS FOR ''@'localhost';
Grants for @localhost
GRANT USAGE ON *.* TO ''@'localhost'
SELECT * FROM information_schema.processlist;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS
-ID HOST_NAME information_schema Execute TIME executing SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000
-ID HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS
+ID HOST_NAME information_schema Execute TIME executing SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY ROWS
+ID HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS
####################################################################################
8 Grant SUPER (does not imply PROCESS) privilege to ddicttestuser1
connection default (user=root)
@@ -278,11 +282,11 @@ ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
ID ddicttestuser1 HOST_NAME information_schema Query TIME init SHOW processlist TIME_MS
SELECT * FROM information_schema.processlist;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS
-ID ddicttestuser1 HOST_NAME information_schema Execute TIME executing SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS
+ID ddicttestuser1 HOST_NAME information_schema Execute TIME executing SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY ROWS
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS
####################################################################################
9 Revoke SUPER privilege from user ddicttestuser1
connection default (user=root)
@@ -304,12 +308,12 @@ ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
ID ddicttestuser1 HOST_NAME information_schema Query TIME init SHOW processlist TIME_MS
SELECT * FROM information_schema.processlist;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS
-ID ddicttestuser1 HOST_NAME information_schema Execute TIME executing SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS
+ID ddicttestuser1 HOST_NAME information_schema Execute TIME executing SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY ROWS
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS
####################################################################################
10 Grant SUPER privilege with grant option to user ddicttestuser1.
connection default (user=root)
@@ -358,18 +362,18 @@ ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
ID ddicttestuser2 HOST_NAME information_schema Query TIME init SHOW processlist TIME_MS
SELECT * FROM information_schema.processlist;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS
-ID ddicttestuser2 HOST_NAME information_schema Execute TIME executing SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000
-ID HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000
-ID HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000
-ID root HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS
+ID ddicttestuser2 HOST_NAME information_schema Execute TIME executing SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY ROWS
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS
+ID HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS
+ID HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS
+ID root HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS
####################################################################################
11 User ddicttestuser1 revokes PROCESS privilege from user ddicttestuser2
connection ddicttestuser1;
@@ -387,9 +391,9 @@ Id User Host db Command Time State Info Progress
ID ddicttestuser2 HOST_NAME information_schema Sleep TIME NULL TIME_MS
ID ddicttestuser2 HOST_NAME information_schema Query TIME init SHOW processlist TIME_MS
SELECT * FROM information_schema.processlist;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS
-ID ddicttestuser2 HOST_NAME information_schema Execute TIME executing SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000
-ID ddicttestuser2 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS
+ID ddicttestuser2 HOST_NAME information_schema Execute TIME executing SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY ROWS
+ID ddicttestuser2 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS
####################################################################################
11.2 Revoke SUPER,PROCESS,GRANT OPTION privilege from user ddicttestuser1
connection default (user=root)
@@ -416,15 +420,15 @@ ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
ID ddicttestuser1 HOST_NAME information_schema Query TIME init SHOW processlist TIME_MS
SELECT * FROM information_schema.processlist;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS
-ID ddicttestuser1 HOST_NAME information_schema Execute TIME executing SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS
+ID ddicttestuser1 HOST_NAME information_schema Execute TIME executing SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY ROWS
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS
####################################################################################
12 Revoke the SELECT privilege from user ddicttestuser1
connection default (user=root)
@@ -452,16 +456,16 @@ ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
ID ddicttestuser1 HOST_NAME information_schema Query TIME init SHOW processlist TIME_MS
SELECT * FROM information_schema.processlist;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS
-ID ddicttestuser1 HOST_NAME information_schema Execute TIME executing SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS
+ID ddicttestuser1 HOST_NAME information_schema Execute TIME executing SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY ROWS
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS
####################################################################################
12.2 Revoke only the SELECT privilege on the information_schema from ddicttestuser1.
connection default (user=root)
diff --git a/mysql-test/suite/funcs_1/r/processlist_val_no_prot.result b/mysql-test/suite/funcs_1/r/processlist_val_no_prot.result
index ee575777b3d..321936cdc1b 100644
--- a/mysql-test/suite/funcs_1/r/processlist_val_no_prot.result
+++ b/mysql-test/suite/funcs_1/r/processlist_val_no_prot.result
@@ -23,14 +23,16 @@ PROCESSLIST CREATE TEMPORARY TABLE `PROCESSLIST` (
`TIME_MS` decimal(22,3) NOT NULL DEFAULT '0.000',
`STAGE` tinyint(2) NOT NULL DEFAULT '0',
`MAX_STAGE` tinyint(2) NOT NULL DEFAULT '0',
- `PROGRESS` decimal(7,3) NOT NULL DEFAULT '0.000'
+ `PROGRESS` decimal(7,3) NOT NULL DEFAULT '0.000',
+ `MEMORY_USED` int(7) NOT NULL DEFAULT '0',
+ `EXAMINED_ROWS` int(7) NOT NULL DEFAULT '0'
) DEFAULT CHARSET=utf8
# Ensure that the information about the own connection is correct.
#--------------------------------------------------------------------------
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS
-<ID> root <HOST_NAME> test Query <TIME> executing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TIME_MS> 0 0 0.000
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS
+<ID> root <HOST_NAME> test Query <TIME> executing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TIME_MS> 0 0 0.000 <MEMORY> <ROWS>
SHOW FULL PROCESSLIST;
Id User Host db Command Time State Info Progress
<ID> root <HOST_NAME> test Query <TIME> init SHOW FULL PROCESSLIST <TIME_MS>
@@ -76,9 +78,9 @@ Has TIME a reasonable value?
# Poll till the connection con1 is in state COMMAND = 'Sleep'.
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS
-<ID> test_user <HOST_NAME> information_schema Sleep <TIME> NULL <TIME_MS> 0 0 0.000
-<ID> root <HOST_NAME> information_schema Query <TIME> executing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TIME_MS> 0 0 0.000
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS
+<ID> test_user <HOST_NAME> information_schema Sleep <TIME> NULL <TIME_MS> 0 0 0.000 <MEMORY> <ROWS>
+<ID> root <HOST_NAME> information_schema Query <TIME> executing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TIME_MS> 0 0 0.000 <MEMORY> <ROWS>
SHOW FULL PROCESSLIST;
Id User Host db Command Time State Info Progress
<ID> root <HOST_NAME> information_schema Query <TIME> init SHOW FULL PROCESSLIST 0.000
@@ -110,8 +112,8 @@ Expect 1
# ----- switch to connection con1 (user = test_user) -----
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS
-<ID> test_user <HOST_NAME> information_schema Query <TIME> executing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TIME_MS> 0 0 0.000
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS
+<ID> test_user <HOST_NAME> information_schema Query <TIME> executing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TIME_MS> 0 0 0.000 <MEMORY> <ROWS>
SHOW FULL PROCESSLIST;
Id User Host db Command Time State Info Progress
<ID> test_user <HOST_NAME> information_schema Query <TIME> init SHOW FULL PROCESSLIST 0.000
@@ -127,9 +129,9 @@ Id User Host db Command Time State Info Progress
# ----- switch to connection con2 (user = test_user) -----
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS
-<ID> test_user <HOST_NAME> information_schema Query <TIME> executing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TIME_MS> 0 0 0.000
-<ID> test_user <HOST_NAME> information_schema Sleep <TIME> NULL <TIME_MS> 0 0 0.000
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS
+<ID> test_user <HOST_NAME> information_schema Query <TIME> executing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TIME_MS> 0 0 0.000 <MEMORY> <ROWS>
+<ID> test_user <HOST_NAME> information_schema Sleep <TIME> NULL <TIME_MS> 0 0 0.000 <MEMORY> <ROWS>
SHOW FULL PROCESSLIST;
Id User Host db Command Time State Info Progress
<ID> test_user <HOST_NAME> information_schema Sleep <TIME> NULL 0.000
@@ -153,10 +155,10 @@ SELECT sleep(10), 17;
# Poll till connection con2 is in state 'User sleep'.
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS
-<ID> test_user <HOST_NAME> information_schema Query <TIME> User sleep SELECT sleep(10), 17 <TIME_MS> 0 0 0.000
-<ID> test_user <HOST_NAME> information_schema Sleep <TIME> NULL <TIME_MS> 0 0 0.000
-<ID> root <HOST_NAME> information_schema Query <TIME> executing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TIME_MS> 0 0 0.000
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS
+<ID> test_user <HOST_NAME> information_schema Query <TIME> User sleep SELECT sleep(10), 17 <TIME_MS> 0 0 0.000 <MEMORY> <ROWS>
+<ID> test_user <HOST_NAME> information_schema Sleep <TIME> NULL <TIME_MS> 0 0 0.000 <MEMORY> <ROWS>
+<ID> root <HOST_NAME> information_schema Query <TIME> executing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TIME_MS> 0 0 0.000 <MEMORY> <ROWS>
SHOW FULL PROCESSLIST;
Id User Host db Command Time State Info Progress
<ID> root <HOST_NAME> information_schema Query <TIME> init SHOW FULL PROCESSLIST 0.000
@@ -200,10 +202,10 @@ SELECT COUNT(*) FROM test.t1;
# Poll till INFO is no more NULL and State = 'Waiting for table metadata lock'.
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS
-<ID> test_user <HOST_NAME> information_schema Query <TIME> Waiting for table metadata lock SELECT COUNT(*) FROM test.t1 <TIME_MS> 0 0 0.000
-<ID> test_user <HOST_NAME> information_schema Sleep <TIME> NULL <TIME_MS> 0 0 0.000
-<ID> root <HOST_NAME> information_schema Query <TIME> executing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TIME_MS> 0 0 0.000
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS
+<ID> test_user <HOST_NAME> information_schema Query <TIME> Waiting for table metadata lock SELECT COUNT(*) FROM test.t1 <TIME_MS> 0 0 0.000 <MEMORY> <ROWS>
+<ID> test_user <HOST_NAME> information_schema Sleep <TIME> NULL <TIME_MS> 0 0 0.000 <MEMORY> <ROWS>
+<ID> root <HOST_NAME> information_schema Query <TIME> executing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TIME_MS> 0 0 0.000 <MEMORY> <ROWS>
UNLOCK TABLES;
# ----- switch to connection con2 (user = test_user) -----
@@ -234,10 +236,10 @@ SELECT count(*),'BEGIN-This is the representative of a very long statement.This
# SHOW PROCESSLIST statement truncated after 100 char
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS
-<ID> test_user <HOST_NAME> information_schema <COMMAND> <TIME> <STATE> SELECT count(*),'BEGIN-This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.-END' AS "Long string" FROM test.t1 <TIME_MS> 0 0 0.000
-<ID> test_user <HOST_NAME> information_schema <COMMAND> <TIME> <STATE> NULL <TIME_MS> 0 0 0.000
-<ID> root <HOST_NAME> information_schema <COMMAND> <TIME> <STATE> SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TIME_MS> 0 0 0.000
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS
+<ID> test_user <HOST_NAME> information_schema <COMMAND> <TIME> <STATE> SELECT count(*),'BEGIN-This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.-END' AS "Long string" FROM test.t1 <TIME_MS> 0 0 0.000 <MEMORY> <ROWS>
+<ID> test_user <HOST_NAME> information_schema <COMMAND> <TIME> <STATE> NULL <TIME_MS> 0 0 0.000 <MEMORY> <ROWS>
+<ID> root <HOST_NAME> information_schema <COMMAND> <TIME> <STATE> SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TIME_MS> 0 0 0.000 <MEMORY> <ROWS>
SHOW FULL PROCESSLIST;
Id User Host db Command Time State Info Progress
<ID> root <HOST_NAME> information_schema <COMMAND> <TIME> <STATE> SHOW FULL PROCESSLIST 0.000
diff --git a/mysql-test/suite/funcs_1/r/processlist_val_ps.result b/mysql-test/suite/funcs_1/r/processlist_val_ps.result
index dbae7494e13..5b7e05c6e1b 100644
--- a/mysql-test/suite/funcs_1/r/processlist_val_ps.result
+++ b/mysql-test/suite/funcs_1/r/processlist_val_ps.result
@@ -23,14 +23,16 @@ PROCESSLIST CREATE TEMPORARY TABLE `PROCESSLIST` (
`TIME_MS` decimal(22,3) NOT NULL DEFAULT '0.000',
`STAGE` tinyint(2) NOT NULL DEFAULT '0',
`MAX_STAGE` tinyint(2) NOT NULL DEFAULT '0',
- `PROGRESS` decimal(7,3) NOT NULL DEFAULT '0.000'
+ `PROGRESS` decimal(7,3) NOT NULL DEFAULT '0.000',
+ `MEMORY_USED` int(7) NOT NULL DEFAULT '0',
+ `EXAMINED_ROWS` int(7) NOT NULL DEFAULT '0'
) DEFAULT CHARSET=utf8
# Ensure that the information about the own connection is correct.
#--------------------------------------------------------------------------
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS
-<ID> root <HOST_NAME> test Execute <TIME> executing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TIME_MS> 0 0 0.000
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS
+<ID> root <HOST_NAME> test Execute <TIME> executing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TIME_MS> 0 0 0.000 <MEMORY> <ROWS>
SHOW FULL PROCESSLIST;
Id User Host db Command Time State Info Progress
<ID> root <HOST_NAME> test Query <TIME> init SHOW FULL PROCESSLIST <TIME_MS>
@@ -76,9 +78,9 @@ Has TIME a reasonable value?
# Poll till the connection con1 is in state COMMAND = 'Sleep'.
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS
-<ID> test_user <HOST_NAME> information_schema Sleep <TIME> NULL <TIME_MS> 0 0 0.000
-<ID> root <HOST_NAME> information_schema Execute <TIME> executing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TIME_MS> 0 0 0.000
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS
+<ID> test_user <HOST_NAME> information_schema Sleep <TIME> NULL <TIME_MS> 0 0 0.000 <MEMORY> <ROWS>
+<ID> root <HOST_NAME> information_schema Execute <TIME> executing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TIME_MS> 0 0 0.000 <MEMORY> <ROWS>
SHOW FULL PROCESSLIST;
Id User Host db Command Time State Info Progress
<ID> root <HOST_NAME> information_schema Query <TIME> init SHOW FULL PROCESSLIST 0.000
@@ -110,8 +112,8 @@ Expect 1
# ----- switch to connection con1 (user = test_user) -----
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS
-<ID> test_user <HOST_NAME> information_schema Execute <TIME> executing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TIME_MS> 0 0 0.000
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS
+<ID> test_user <HOST_NAME> information_schema Execute <TIME> executing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TIME_MS> 0 0 0.000 <MEMORY> <ROWS>
SHOW FULL PROCESSLIST;
Id User Host db Command Time State Info Progress
<ID> test_user <HOST_NAME> information_schema Query <TIME> init SHOW FULL PROCESSLIST 0.000
@@ -127,9 +129,9 @@ Id User Host db Command Time State Info Progress
# ----- switch to connection con2 (user = test_user) -----
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS
-<ID> test_user <HOST_NAME> information_schema Execute <TIME> executing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TIME_MS> 0 0 0.000
-<ID> test_user <HOST_NAME> information_schema Sleep <TIME> NULL <TIME_MS> 0 0 0.000
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS
+<ID> test_user <HOST_NAME> information_schema Execute <TIME> executing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TIME_MS> 0 0 0.000 <MEMORY> <ROWS>
+<ID> test_user <HOST_NAME> information_schema Sleep <TIME> NULL <TIME_MS> 0 0 0.000 <MEMORY> <ROWS>
SHOW FULL PROCESSLIST;
Id User Host db Command Time State Info Progress
<ID> test_user <HOST_NAME> information_schema Sleep <TIME> NULL 0.000
@@ -153,10 +155,10 @@ SELECT sleep(10), 17;
# Poll till connection con2 is in state 'User sleep'.
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS
-<ID> test_user <HOST_NAME> information_schema Query <TIME> User sleep SELECT sleep(10), 17 <TIME_MS> 0 0 0.000
-<ID> test_user <HOST_NAME> information_schema Sleep <TIME> NULL <TIME_MS> 0 0 0.000
-<ID> root <HOST_NAME> information_schema Execute <TIME> executing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TIME_MS> 0 0 0.000
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS
+<ID> test_user <HOST_NAME> information_schema Query <TIME> User sleep SELECT sleep(10), 17 <TIME_MS> 0 0 0.000 <MEMORY> <ROWS>
+<ID> test_user <HOST_NAME> information_schema Sleep <TIME> NULL <TIME_MS> 0 0 0.000 <MEMORY> <ROWS>
+<ID> root <HOST_NAME> information_schema Execute <TIME> executing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TIME_MS> 0 0 0.000 <MEMORY> <ROWS>
SHOW FULL PROCESSLIST;
Id User Host db Command Time State Info Progress
<ID> root <HOST_NAME> information_schema Query <TIME> init SHOW FULL PROCESSLIST 0.000
@@ -200,10 +202,10 @@ SELECT COUNT(*) FROM test.t1;
# Poll till INFO is no more NULL and State = 'Waiting for table metadata lock'.
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS
-<ID> test_user <HOST_NAME> information_schema Query <TIME> Waiting for table metadata lock SELECT COUNT(*) FROM test.t1 <TIME_MS> 0 0 0.000
-<ID> test_user <HOST_NAME> information_schema Sleep <TIME> NULL <TIME_MS> 0 0 0.000
-<ID> root <HOST_NAME> information_schema Execute <TIME> executing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TIME_MS> 0 0 0.000
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS
+<ID> test_user <HOST_NAME> information_schema Query <TIME> Waiting for table metadata lock SELECT COUNT(*) FROM test.t1 <TIME_MS> 0 0 0.000 <MEMORY> <ROWS>
+<ID> test_user <HOST_NAME> information_schema Sleep <TIME> NULL <TIME_MS> 0 0 0.000 <MEMORY> <ROWS>
+<ID> root <HOST_NAME> information_schema Execute <TIME> executing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TIME_MS> 0 0 0.000 <MEMORY> <ROWS>
UNLOCK TABLES;
# ----- switch to connection con2 (user = test_user) -----
@@ -234,10 +236,10 @@ SELECT count(*),'BEGIN-This is the representative of a very long statement.This
# SHOW PROCESSLIST statement truncated after 100 char
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS
-<ID> test_user <HOST_NAME> information_schema <COMMAND> <TIME> <STATE> SELECT count(*),'BEGIN-This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.-END' AS "Long string" FROM test.t1 <TIME_MS> 0 0 0.000
-<ID> test_user <HOST_NAME> information_schema <COMMAND> <TIME> <STATE> NULL <TIME_MS> 0 0 0.000
-<ID> root <HOST_NAME> information_schema <COMMAND> <TIME> <STATE> SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TIME_MS> 0 0 0.000
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS
+<ID> test_user <HOST_NAME> information_schema <COMMAND> <TIME> <STATE> SELECT count(*),'BEGIN-This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.-END' AS "Long string" FROM test.t1 <TIME_MS> 0 0 0.000 <MEMORY> <ROWS>
+<ID> test_user <HOST_NAME> information_schema <COMMAND> <TIME> <STATE> NULL <TIME_MS> 0 0 0.000 <MEMORY> <ROWS>
+<ID> root <HOST_NAME> information_schema <COMMAND> <TIME> <STATE> SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TIME_MS> 0 0 0.000 <MEMORY> <ROWS>
SHOW FULL PROCESSLIST;
Id User Host db Command Time State Info Progress
<ID> root <HOST_NAME> information_schema <COMMAND> <TIME> <STATE> SHOW FULL PROCESSLIST 0.000
diff --git a/mysql-test/suite/innodb/r/binlog_consistent.result b/mysql-test/suite/innodb/r/binlog_consistent.result
index f0b665b5ac9..df22d634339 100644
--- a/mysql-test/suite/innodb/r/binlog_consistent.result
+++ b/mysql-test/suite/innodb/r/binlog_consistent.result
@@ -6,8 +6,8 @@ File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 421
SHOW STATUS LIKE 'binlog_snapshot_%';
Variable_name Value
-binlog_snapshot_file master-bin.000001
-binlog_snapshot_position 421
+Binlog_snapshot_file master-bin.000001
+Binlog_snapshot_position 421
BEGIN;
INSERT INTO t1 VALUES (0, "");
# Connection con1
@@ -37,8 +37,8 @@ a b
0
SHOW STATUS LIKE 'binlog_snapshot_%';
Variable_name Value
-binlog_snapshot_file master-bin.000001
-binlog_snapshot_position 945
+Binlog_snapshot_file master-bin.000001
+Binlog_snapshot_position 945
SHOW MASTER STATUS;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 1357
@@ -59,16 +59,16 @@ a b
0
SHOW STATUS LIKE 'binlog_snapshot_%';
Variable_name Value
-binlog_snapshot_file master-bin.000001
-binlog_snapshot_position 945
+Binlog_snapshot_file master-bin.000001
+Binlog_snapshot_position 945
SHOW MASTER STATUS;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000002 326
COMMIT;
SHOW STATUS LIKE 'binlog_snapshot_%';
Variable_name Value
-binlog_snapshot_file master-bin.000002
-binlog_snapshot_position 326
+Binlog_snapshot_file master-bin.000002
+Binlog_snapshot_position 326
SHOW MASTER STATUS;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000002 326
diff --git a/mysql-test/suite/innodb/r/innodb-autoinc.result b/mysql-test/suite/innodb/r/innodb-autoinc.result
index 8c4c1c20590..c4504f6d348 100644
--- a/mysql-test/suite/innodb/r/innodb-autoinc.result
+++ b/mysql-test/suite/innodb/r/innodb-autoinc.result
@@ -1269,3 +1269,43 @@ SELECT * FROM t1;
c1 c2
1 NULL
DROP TABLE t1;
+SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
+SHOW VARIABLES LIKE "%auto_inc%";
+Variable_name Value
+auto_increment_increment 1
+auto_increment_offset 1
+CREATE TABLE t1 (c1 INT UNSIGNED PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (2147483648, 'a');
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(10) unsigned NOT NULL AUTO_INCREMENT,
+ `c2` varchar(10) DEFAULT NULL,
+ PRIMARY KEY (`c1`)
+) ENGINE=InnoDB AUTO_INCREMENT=2147483649 DEFAULT CHARSET=latin1
+SELECT * FROM t1;
+c1 c2
+2147483648 a
+ALTER TABLE t1 CHANGE c1 c1 INT;
+Warnings:
+Warning 1264 Out of range value for column 'c1' at row 1
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL DEFAULT '0',
+ `c2` varchar(10) DEFAULT NULL,
+ PRIMARY KEY (`c1`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+INSERT INTO t1(c2) VALUES('b');
+SELECT * FROM t1;
+c1 c2
+0 b
+2147483647 a
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL DEFAULT '0',
+ `c2` varchar(10) DEFAULT NULL,
+ PRIMARY KEY (`c1`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/r/innodb-zip.result b/mysql-test/suite/innodb/r/innodb-zip.result
index 910e2e6f42a..8f920b9212e 100644
--- a/mysql-test/suite/innodb/r/innodb-zip.result
+++ b/mysql-test/suite/innodb/r/innodb-zip.result
@@ -136,12 +136,12 @@ CREATE TABLE t1(
c TEXT NOT NULL, d TEXT NOT NULL,
PRIMARY KEY (c(767),d(767)))
ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1 CHARSET=ASCII;
-ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs
+ERROR 42000: Row size too large (> 8126). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline.
CREATE TABLE t1(
c TEXT NOT NULL, d TEXT NOT NULL,
PRIMARY KEY (c(767),d(767)))
ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2 CHARSET=ASCII;
-ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs
+ERROR 42000: Row size too large (> 8126). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline.
CREATE TABLE t1(
c TEXT NOT NULL, d TEXT NOT NULL,
PRIMARY KEY (c(767),d(767)))
@@ -149,7 +149,7 @@ ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4 CHARSET=ASCII;
drop table t1;
CREATE TABLE t1(c TEXT, PRIMARY KEY (c(440)))
ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1 CHARSET=ASCII;
-ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs
+ERROR 42000: Row size too large (> 8126). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline.
CREATE TABLE t1(c TEXT, PRIMARY KEY (c(438)))
ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1 CHARSET=ASCII;
INSERT INTO t1 VALUES(REPEAT('A',512)),(REPEAT('B',512));
diff --git a/mysql-test/suite/innodb/r/innodb.result b/mysql-test/suite/innodb/r/innodb.result
index 2f2f81db204..934311adcaf 100644
--- a/mysql-test/suite/innodb/r/innodb.result
+++ b/mysql-test/suite/innodb/r/innodb.result
@@ -3026,7 +3026,7 @@ c21 CHAR(255), c22 CHAR(255), c23 CHAR(255), c24 CHAR(255),
c25 CHAR(255), c26 CHAR(255), c27 CHAR(255), c28 CHAR(255),
c29 CHAR(255), c30 CHAR(255), c31 CHAR(255), c32 CHAR(255)
) ENGINE = InnoDB;
-ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs
+ERROR 42000: Row size too large (> 8126). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help. In current row format, BLOB prefix of 768 bytes is stored inline.
DROP TABLE IF EXISTS t1;
Warnings:
Note 1051 Unknown table 't1'
diff --git a/mysql-test/suite/innodb/r/innodb_bug14704286.result b/mysql-test/suite/innodb/r/innodb_bug14704286.result
new file mode 100644
index 00000000000..9de42cb01c8
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb_bug14704286.result
@@ -0,0 +1,53 @@
+use test;
+drop table if exists t1;
+create table t1 (id int primary key, value int, value2 int,
+value3 int, index(value,value2)) engine=innodb;
+insert into t1 values
+(10,10,10,10),(11,11,11,11),(12,12,12,12),(13,13,13,13),(14,14,14,14),
+(15,15,15,15),(16,16,16,16),(17,17,17,17),(18,18,18,18),(19,19,19,19),
+(20,20,20,20);
+use test;
+start transaction with consistent snapshot;
+use test;
+CREATE PROCEDURE update_t1()
+BEGIN
+DECLARE i INT DEFAULT 1;
+while (i <= 5000) DO
+update test.t1 set value2=value2+1, value3=value3+1 where id=12;
+SET i = i + 1;
+END WHILE;
+END|
+set autocommit=0;
+CALL update_t1();
+select * from t1;
+id value value2 value3
+10 10 10 10
+11 11 11 11
+12 12 5012 5012
+13 13 13 13
+14 14 14 14
+15 15 15 15
+16 16 16 16
+17 17 17 17
+18 18 18 18
+19 19 19 19
+20 20 20 20
+set autocommit=1;
+select * from t1;
+id value value2 value3
+10 10 10 10
+11 11 11 11
+12 12 5012 5012
+13 13 13 13
+14 14 14 14
+15 15 15 15
+16 16 16 16
+17 17 17 17
+18 18 18 18
+19 19 19 19
+20 20 20 20
+select * from t1 force index(value) where value=12;
+kill query @id;
+ERROR 70100: Query execution was interrupted
+drop procedure if exists update_t1;
+drop table if exists t1;
diff --git a/mysql-test/suite/innodb/r/innodb_bug53591.result b/mysql-test/suite/innodb/r/innodb_bug53591.result
index 993497e0579..b0196318801 100644
--- a/mysql-test/suite/innodb/r/innodb_bug53591.result
+++ b/mysql-test/suite/innodb/r/innodb_bug53591.result
@@ -8,7 +8,7 @@ ERROR HY000: Too big row
SHOW WARNINGS;
Level Code Message
Error 139 Too big row
-Error 1118 Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs
+Error 1118 Row size too large (> 8126). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline.
DROP TABLE bug53591;
SET GLOBAL innodb_file_format=Antelope;
SET GLOBAL innodb_file_per_table=0;
diff --git a/mysql-test/suite/innodb/r/innodb_prefix_index_liftedlimit.result b/mysql-test/suite/innodb/r/innodb_prefix_index_liftedlimit.result
index 507d8e66117..0c68c8a6975 100644
--- a/mysql-test/suite/innodb/r/innodb_prefix_index_liftedlimit.result
+++ b/mysql-test/suite/innodb/r/innodb_prefix_index_liftedlimit.result
@@ -649,7 +649,7 @@ CREATE TABLE worklog5743 (col_1_varchar VARCHAR (4000) CHARACTER SET 'utf8',
col_2_varchar VARCHAR (4000) CHARACTER SET 'utf8' ,
PRIMARY KEY (col_1_varchar(1024))
) ROW_FORMAT=DYNAMIC, engine = innodb;
-ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs
+ERROR 42000: Row size too large (> max_row_size). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline.
CREATE TABLE worklog5743 (
col_1_varbinary VARBINARY (4000) ,
col_2_varchar VARCHAR (4000) CHARACTER SET 'utf8',
diff --git a/mysql-test/suite/innodb/t/innodb-autoinc-master.opt b/mysql-test/suite/innodb/t/innodb-autoinc.opt
index 303ec1be1d0..303ec1be1d0 100644
--- a/mysql-test/suite/innodb/t/innodb-autoinc-master.opt
+++ b/mysql-test/suite/innodb/t/innodb-autoinc.opt
diff --git a/mysql-test/suite/innodb/t/innodb-autoinc.test b/mysql-test/suite/innodb/t/innodb-autoinc.test
index 888c73bacdf..17df8877ad4 100644
--- a/mysql-test/suite/innodb/t/innodb-autoinc.test
+++ b/mysql-test/suite/innodb/t/innodb-autoinc.test
@@ -139,7 +139,7 @@ DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (c1 INT AUTO_INCREMENT, c2 INT, PRIMARY KEY(c1)) ENGINE=InnoDB;
INSERT INTO t1 VALUES (NULL, 1);
DELETE FROM t1 WHERE c1 = 1;
-INSERT INTO t1 VALUES (2,1);
+INSERT INTO t1 VALUES (2,1);
INSERT INTO t1 VALUES (NULL,8);
SELECT * FROM t1;
DROP TABLE t1;
@@ -639,7 +639,7 @@ SHOW CREATE TABLE t1;
DROP TABLE t1;
-# Check if we handl offset > column max value properly
+# Check if we handle offset > column max value properly
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=256;
SHOW VARIABLES LIKE "%auto_inc%";
# TINYINT
@@ -648,3 +648,21 @@ INSERT INTO t1 VALUES (1, NULL);
SHOW CREATE TABLE t1;
SELECT * FROM t1;
DROP TABLE t1;
+
+# Check if we handle the case where a current value is greater than the max
+# of the column. IMO, this should not be allowed and the assertion that fails
+# is actually an invariant.
+SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
+SHOW VARIABLES LIKE "%auto_inc%";
+# TINYINT
+CREATE TABLE t1 (c1 INT UNSIGNED PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (2147483648, 'a');
+SHOW CREATE TABLE t1;
+SELECT * FROM t1;
+ALTER TABLE t1 CHANGE c1 c1 INT;
+SHOW CREATE TABLE t1;
+INSERT INTO t1(c2) VALUES('b');
+SELECT * FROM t1;
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
diff --git a/mysql-test/suite/innodb/t/innodb-zip.test b/mysql-test/suite/innodb/t/innodb-zip.test
index e0ddfab38b0..7e2e2d1d3c9 100644
--- a/mysql-test/suite/innodb/t/innodb-zip.test
+++ b/mysql-test/suite/innodb/t/innodb-zip.test
@@ -1,5 +1,10 @@
-- source include/have_innodb.inc
+if (`select plugin_auth_version <= "1.1.8-29.3" from information_schema.plugins where plugin_name='innodb'`)
+{
+ --skip Not fixed in XtraDB 1.1.8-29.3 or earlier
+}
+
let $per_table=`select @@innodb_file_per_table`;
let $format=`select @@innodb_file_format`;
let $innodb_strict_mode_orig=`select @@session.innodb_strict_mode`;
diff --git a/mysql-test/suite/innodb/t/innodb.test b/mysql-test/suite/innodb/t/innodb.test
index 532870fd29c..4e5d6d7ce90 100644
--- a/mysql-test/suite/innodb/t/innodb.test
+++ b/mysql-test/suite/innodb/t/innodb.test
@@ -4,6 +4,11 @@
# .\sync\sync0sync.c line 324
# is fixed
+if (`select plugin_auth_version <= "1.1.8-29.3" from information_schema.plugins where plugin_name='innodb'`)
+{
+ --skip Not fixed in XtraDB 1.1.8-29.3 or earlier
+}
+
#######################################################################
# #
# Please, DO NOT TOUCH this file as well as the innodb.result file. #
diff --git a/mysql-test/suite/innodb/t/innodb_bug14704286.test b/mysql-test/suite/innodb/t/innodb_bug14704286.test
new file mode 100644
index 00000000000..fb5e6b829a1
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb_bug14704286.test
@@ -0,0 +1,95 @@
+--source include/have_innodb.inc
+
+#
+# create test-bed to run test
+#
+use test;
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+create table t1 (id int primary key, value int, value2 int,
+value3 int, index(value,value2)) engine=innodb;
+
+insert into t1 values
+(10,10,10,10),(11,11,11,11),(12,12,12,12),(13,13,13,13),(14,14,14,14),
+(15,15,15,15),(16,16,16,16),(17,17,17,17),(18,18,18,18),(19,19,19,19),
+(20,20,20,20);
+let $ID= `SELECT @id := CONNECTION_ID()`;
+
+#
+# we need multiple connections as we need to keep one connection
+# active with trx requesting consistent read.
+#
+connect (conn1, localhost, root,,);
+connect (conn2, localhost, root,,);
+connect (conn3, localhost, root,,);
+
+#
+# start trx with consistent read
+#
+connection conn1;
+use test;
+
+start transaction with consistent snapshot;
+
+#
+# update table such that secondary index is updated.
+#
+connection conn2;
+use test;
+delimiter |;
+CREATE PROCEDURE update_t1()
+BEGIN
+ DECLARE i INT DEFAULT 1;
+ while (i <= 5000) DO
+ update test.t1 set value2=value2+1, value3=value3+1 where id=12;
+ SET i = i + 1;
+ END WHILE;
+END|
+
+delimiter ;|
+set autocommit=0;
+CALL update_t1();
+select * from t1;
+set autocommit=1;
+select * from t1;
+
+#
+# Now try to fire select query from connection-1 enforcing
+# use of secondary index.
+#
+connection conn1;
+let $ID= `SELECT @id := CONNECTION_ID()`;
+#--error ER_QUERY_INTERRUPTED
+--send
+select * from t1 force index(value) where value=12;
+
+#
+# select is going to take good time so let's kill query.
+#
+connection conn3;
+let $wait_condition=
+ select * from information_schema.processlist where state = 'Sending data' and
+ info = 'select * from t1 force index(value) where value=12';
+--source include/wait_condition.inc
+let $ignore= `SELECT @id := $ID`;
+kill query @id;
+
+#
+# reap the value of connection-1
+#
+connection conn1;
+--error ER_QUERY_INTERRUPTED
+reap;
+
+#
+# clean test-bed.
+#
+connection default;
+disconnect conn1;
+disconnect conn2;
+disconnect conn3;
+drop procedure if exists update_t1;
+drop table if exists t1;
+
+
diff --git a/mysql-test/suite/innodb/t/innodb_bug53591.test b/mysql-test/suite/innodb/t/innodb_bug53591.test
index 9a1c2afbccb..f0ed4b93c32 100644
--- a/mysql-test/suite/innodb/t/innodb_bug53591.test
+++ b/mysql-test/suite/innodb/t/innodb_bug53591.test
@@ -1,5 +1,9 @@
--source include/have_innodb.inc
+if (`select plugin_auth_version <= "1.1.8-29.3" from information_schema.plugins where plugin_name='innodb'`)
+{
+ --skip Not fixed in XtraDB 1.1.8-29.3 or earlier
+}
let $file_format=`select @@innodb_file_format`;
let $file_per_table=`select @@innodb_file_per_table`;
diff --git a/mysql-test/suite/innodb/t/innodb_prefix_index_liftedlimit.test b/mysql-test/suite/innodb/t/innodb_prefix_index_liftedlimit.test
index ecd34d00c4d..776f5dae517 100644
--- a/mysql-test/suite/innodb/t/innodb_prefix_index_liftedlimit.test
+++ b/mysql-test/suite/innodb/t/innodb_prefix_index_liftedlimit.test
@@ -14,6 +14,10 @@
# #
######################################################################
+if (`select plugin_auth_version <= "1.1.8-29.3" from information_schema.plugins where plugin_name='innodb'`)
+{
+ --skip Not fixed in XtraDB 1.1.8-29.3 or earlier
+}
# Save innodb variables
let $innodb_file_format_orig=`select @@innodb_file_format`;
@@ -601,6 +605,7 @@ DROP TABLE worklog5743;
# Prefix index with utf8 charset + varchar.
# For varchar we also log the column itself as oppose of TEXT so it error
# with limit 1024 due to overhead.
+--replace_regex /> [0-9]*/> max_row_size/
-- error 1118
CREATE TABLE worklog5743 (col_1_varchar VARCHAR (4000) CHARACTER SET 'utf8',
col_2_varchar VARCHAR (4000) CHARACTER SET 'utf8' ,
diff --git a/mysql-test/suite/maria/truncate.result b/mysql-test/suite/maria/truncate.result
index 467e0f915dd..a9adcb9ae87 100644
--- a/mysql-test/suite/maria/truncate.result
+++ b/mysql-test/suite/maria/truncate.result
@@ -35,3 +35,15 @@ select count(*) from t1;
count(*)
0
drop table t1,t2;
+CREATE TEMPORARY TABLE t1 ( i int) ENGINE=aria;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TEMPORARY TABLE `t1` (
+ `i` int(11) DEFAULT NULL
+) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=0
+TRUNCATE TABLE t1;
+INSERT INTO t1 (i) VALUES (1);
+lock table t1 write;
+truncate table t1;
+unlock tables;
+drop table t1;
diff --git a/mysql-test/suite/maria/truncate.test b/mysql-test/suite/maria/truncate.test
index 3d6e70d9db6..11d42dc3879 100644
--- a/mysql-test/suite/maria/truncate.test
+++ b/mysql-test/suite/maria/truncate.test
@@ -45,3 +45,16 @@ select * from t1;
truncate t1;
select count(*) from t1;
drop table t1,t2;
+
+#
+# MDEV-3890
+# Server crash inserting record on a temporary table after truncating it
+#
+CREATE TEMPORARY TABLE t1 ( i int) ENGINE=aria;
+SHOW CREATE TABLE t1;
+TRUNCATE TABLE t1;
+INSERT INTO t1 (i) VALUES (1);
+lock table t1 write;
+truncate table t1;
+unlock tables;
+drop table t1;
diff --git a/mysql-test/suite/multi_source/multisource.result b/mysql-test/suite/multi_source/multisource.result
index b190a0b525d..37993dcf75f 100644
--- a/mysql-test/suite/multi_source/multisource.result
+++ b/mysql-test/suite/multi_source/multisource.result
@@ -1,3 +1,7 @@
+change master 'abc' to relay_log_file='';
+ERROR HY000: Failed initializing relay log position: Could not find target log during relay log initialization
+change master 'abc2' to master_host='';
+ERROR HY000: Incorrect arguments to MASTER_HOST
change master 'master1' to
master_port=MYPORT_1,
master_host='127.0.0.1',
diff --git a/mysql-test/suite/multi_source/multisource.test b/mysql-test/suite/multi_source/multisource.test
index 7a9ee166ec2..4938a0142d1 100644
--- a/mysql-test/suite/multi_source/multisource.test
+++ b/mysql-test/suite/multi_source/multisource.test
@@ -8,6 +8,15 @@
--connect (slave,127.0.0.1,root,,,$SERVER_MYPORT_3)
+# MDEV-3984: crash/read of freed memory when changing master with named connection
+# This fails after adding the new master 'abc', check we do not free twice.
+--error ER_RELAY_LOG_INIT
+change master 'abc' to relay_log_file='';
+# This fails before adding the new master, check that we do free it.
+--error ER_WRONG_ARGUMENTS
+change master 'abc2' to master_host='';
+
+
# Start replication from the first master
--replace_result $SERVER_MYPORT_1 MYPORT_1
diff --git a/mysql-test/suite/perfschema/include/upgrade_check.inc b/mysql-test/suite/perfschema/include/upgrade_check.inc
index 440eb8f7123..52d4cfd1e63 100644
--- a/mysql-test/suite/perfschema/include/upgrade_check.inc
+++ b/mysql-test/suite/perfschema/include/upgrade_check.inc
@@ -8,6 +8,8 @@
--source include/wait_until_count_sessions.inc
# Verify that mysql_upgrade complained about the performance_schema
+
+--replace_regex /at line [0-9]+/at line ###/
--cat_file $err_file
--error 0,1
--remove_file $out_file
diff --git a/mysql-test/suite/perfschema/r/digest_table_full.result b/mysql-test/suite/perfschema/r/digest_table_full.result
index dcc62e0d5c4..a1e2ec0bd6a 100644
--- a/mysql-test/suite/perfschema/r/digest_table_full.result
+++ b/mysql-test/suite/perfschema/r/digest_table_full.result
@@ -76,7 +76,7 @@ SELECT DIGEST, DIGEST_TEXT, COUNT_STAR, SUM_ROWS_AFFECTED, SUM_WARNINGS,
SUM_ERRORS FROM performance_schema.events_statements_summary_by_digest;
DIGEST DIGEST_TEXT COUNT_STAR SUM_ROWS_AFFECTED SUM_WARNINGS SUM_ERRORS
NULL NULL 29 21 1 2
-b94bc8f50c92e01784d3148b3d2086c8 TRUNCATE TABLE performance_schema . events_statements_summary_by_digest 1 0 0 0
+169378b8f621f69e494b409cac921a8a TRUNCATE TABLE performance_schema . events_statements_summary_by_digest 1 0 0 0
SHOW VARIABLES LIKE "performance_schema_digests_size";
Variable_name Value
performance_schema_digests_size 2
diff --git a/mysql-test/suite/perfschema/r/func_file_io.result b/mysql-test/suite/perfschema/r/func_file_io.result
index 2b39c4c1ab9..d925463a8c2 100644
--- a/mysql-test/suite/perfschema/r/func_file_io.result
+++ b/mysql-test/suite/perfschema/r/func_file_io.result
@@ -3,6 +3,7 @@ UPDATE performance_schema.setup_instruments SET enabled = 'YES'
WHERE name LIKE 'wait/io/file/%';
update performance_schema.threads SET instrumented = 'YES'
WHERE PROCESSLIST_ID=connection_id();
+flush status;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (id INT PRIMARY KEY, b CHAR(100) DEFAULT 'initial value')
ENGINE=MyISAM;
@@ -128,3 +129,27 @@ GROUP BY p.processlist_user, h.operation
HAVING BYTES > 0
ORDER BY p.processlist_user, h.operation;
UPDATE performance_schema.setup_instruments SET enabled = 'YES', timed = 'YES';
+show status like "performance_schema%";
+Variable_name Value
+Performance_schema_accounts_lost 0
+Performance_schema_cond_classes_lost 0
+Performance_schema_cond_instances_lost 0
+Performance_schema_digest_lost 0
+Performance_schema_file_classes_lost 0
+Performance_schema_file_handles_lost 0
+Performance_schema_file_instances_lost 0
+Performance_schema_hosts_lost 0
+Performance_schema_locker_lost 0
+Performance_schema_mutex_classes_lost 0
+Performance_schema_mutex_instances_lost 0
+Performance_schema_rwlock_classes_lost 0
+Performance_schema_rwlock_instances_lost 0
+Performance_schema_socket_classes_lost 0
+Performance_schema_socket_instances_lost 0
+Performance_schema_stage_classes_lost 0
+Performance_schema_statement_classes_lost 0
+Performance_schema_table_handles_lost 0
+Performance_schema_table_instances_lost 0
+Performance_schema_thread_classes_lost 0
+Performance_schema_thread_instances_lost 0
+Performance_schema_users_lost 0
diff --git a/mysql-test/suite/perfschema/r/func_mutex.result b/mysql-test/suite/perfschema/r/func_mutex.result
index 462e9c046c3..1c9d0b8a254 100644
--- a/mysql-test/suite/perfschema/r/func_mutex.result
+++ b/mysql-test/suite/perfschema/r/func_mutex.result
@@ -2,6 +2,15 @@ UPDATE performance_schema.setup_instruments SET enabled = 'NO', timed = 'YES';
UPDATE performance_schema.setup_instruments SET enabled = 'YES'
WHERE name LIKE 'wait/synch/mutex/%'
OR name LIKE 'wait/synch/rwlock/%';
+flush status;
+select NAME from performance_schema.mutex_instances
+where NAME = 'wait/synch/mutex/sql/LOCK_open';
+NAME
+wait/synch/mutex/sql/LOCK_open
+select NAME from performance_schema.rwlock_instances
+where NAME = 'wait/synch/rwlock/sql/LOCK_grant';
+NAME
+wait/synch/rwlock/sql/LOCK_grant
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (id INT PRIMARY KEY, b CHAR(100) DEFAULT 'initial value')
ENGINE=MyISAM;
@@ -113,3 +122,27 @@ Success
UPDATE performance_schema.setup_instruments SET enabled = 'YES';
DROP TABLE t1;
UPDATE performance_schema.setup_instruments SET enabled = 'YES', timed = 'YES';
+show status like "performance_schema%";
+Variable_name Value
+Performance_schema_accounts_lost 0
+Performance_schema_cond_classes_lost 0
+Performance_schema_cond_instances_lost 0
+Performance_schema_digest_lost 0
+Performance_schema_file_classes_lost 0
+Performance_schema_file_handles_lost 0
+Performance_schema_file_instances_lost 0
+Performance_schema_hosts_lost 0
+Performance_schema_locker_lost 0
+Performance_schema_mutex_classes_lost 0
+Performance_schema_mutex_instances_lost 0
+Performance_schema_rwlock_classes_lost 0
+Performance_schema_rwlock_instances_lost 0
+Performance_schema_socket_classes_lost 0
+Performance_schema_socket_instances_lost 0
+Performance_schema_stage_classes_lost 0
+Performance_schema_statement_classes_lost 0
+Performance_schema_table_handles_lost 0
+Performance_schema_table_instances_lost 0
+Performance_schema_thread_classes_lost 0
+Performance_schema_thread_instances_lost 0
+Performance_schema_users_lost 0
diff --git a/mysql-test/suite/perfschema/r/pfs_upgrade.result b/mysql-test/suite/perfschema/r/pfs_upgrade.result
index 17a45d4fe45..9a2b6524c83 100644
--- a/mysql-test/suite/perfschema/r/pfs_upgrade.result
+++ b/mysql-test/suite/perfschema/r/pfs_upgrade.result
@@ -8,56 +8,55 @@ use performance_schema;
show tables like "user_table";
Tables_in_performance_schema (user_table)
user_table
-ERROR 1050 (42S01) at line 97: Table 'cond_instances' already exists
-ERROR 1050 (42S01) at line 122: Table 'events_waits_current' already exists
-ERROR 1050 (42S01) at line 147: Table 'events_waits_history' already exists
-ERROR 1050 (42S01) at line 172: Table 'events_waits_history_long' already exists
-ERROR 1050 (42S01) at line 185: Table 'events_waits_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 198: Table 'events_waits_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line 211: Table 'events_waits_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line 225: Table 'events_waits_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line 238: Table 'events_waits_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 250: Table 'events_waits_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 259: Table 'file_instances' already exists
-ERROR 1050 (42S01) at line 288: Table 'file_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line 319: Table 'file_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 332: Table 'socket_instances' already exists
-ERROR 1050 (42S01) at line 362: Table 'socket_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 391: Table 'socket_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line 432: Table 'mutex_instances' already exists
-ERROR 1050 (42S01) at line 446: Table 'objects_summary_global_by_type' already exists
-ERROR 1050 (42S01) at line 456: Table 'performance_timers' already exists
-ERROR 1050 (42S01) at line 466: Table 'rwlock_instances' already exists
-ERROR 1050 (42S01) at line 475: Table 'setup_actors' already exists
-ERROR 1050 (42S01) at line 483: Table 'setup_consumers' already exists
-ERROR 1050 (42S01) at line 492: Table 'setup_instruments' already exists
-ERROR 1050 (42S01) at line 503: Table 'setup_objects' already exists
-ERROR 1050 (42S01) at line 511: Table 'setup_timers' already exists
-ERROR 1050 (42S01) at line 556: Table 'table_io_waits_summary_by_index_usage' already exists
-ERROR 1050 (42S01) at line 600: Table 'table_io_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line 679: Table 'table_lock_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line 699: Table 'threads' already exists
-ERROR 1050 (42S01) at line 715: Table 'events_stages_current' already exists
-ERROR 1050 (42S01) at line 731: Table 'events_stages_history' already exists
-ERROR 1050 (42S01) at line 747: Table 'events_stages_history_long' already exists
-ERROR 1050 (42S01) at line 760: Table 'events_stages_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 773: Table 'events_stages_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line 786: Table 'events_stages_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line 800: Table 'events_stages_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line 812: Table 'events_stages_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 858: Table 'events_statements_current' already exists
-ERROR 1050 (42S01) at line 904: Table 'events_statements_history' already exists
-ERROR 1050 (42S01) at line 950: Table 'events_statements_history_long' already exists
-ERROR 1050 (42S01) at line 982: Table 'events_statements_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 1014: Table 'events_statements_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line 1046: Table 'events_statements_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line 1079: Table 'events_statements_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line 1110: Table 'events_statements_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 1119: Table 'hosts' already exists
-ERROR 1050 (42S01) at line 1128: Table 'users' already exists
-ERROR 1050 (42S01) at line 1138: Table 'accounts' already exists
-ERROR 1050 (42S01) at line 1172: Table 'events_statements_summary_by_digest' already exists
-ERROR 1644 (HY000) at line 1594: Unexpected content found in the performance_schema database.
+ERROR 1050 (42S01) at line ###: Table 'cond_instances' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_waits_current' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_waits_history' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_waits_history_long' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_waits_summary_by_instance' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_waits_summary_by_host_by_event_name' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_waits_summary_by_user_by_event_name' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_waits_summary_by_account_by_event_name' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_waits_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_waits_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line ###: Table 'file_instances' already exists
+ERROR 1050 (42S01) at line ###: Table 'file_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line ###: Table 'file_summary_by_instance' already exists
+ERROR 1050 (42S01) at line ###: Table 'socket_instances' already exists
+ERROR 1050 (42S01) at line ###: Table 'socket_summary_by_instance' already exists
+ERROR 1050 (42S01) at line ###: Table 'socket_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line ###: Table 'mutex_instances' already exists
+ERROR 1050 (42S01) at line ###: Table 'objects_summary_global_by_type' already exists
+ERROR 1050 (42S01) at line ###: Table 'performance_timers' already exists
+ERROR 1050 (42S01) at line ###: Table 'rwlock_instances' already exists
+ERROR 1050 (42S01) at line ###: Table 'setup_actors' already exists
+ERROR 1050 (42S01) at line ###: Table 'setup_consumers' already exists
+ERROR 1050 (42S01) at line ###: Table 'setup_instruments' already exists
+ERROR 1050 (42S01) at line ###: Table 'setup_objects' already exists
+ERROR 1050 (42S01) at line ###: Table 'setup_timers' already exists
+ERROR 1050 (42S01) at line ###: Table 'table_io_waits_summary_by_index_usage' already exists
+ERROR 1050 (42S01) at line ###: Table 'table_io_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line ###: Table 'table_lock_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line ###: Table 'threads' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_stages_current' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_stages_history' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_stages_history_long' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_stages_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_stages_summary_by_host_by_event_name' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_stages_summary_by_user_by_event_name' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_stages_summary_by_account_by_event_name' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_stages_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_statements_current' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_statements_history' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_statements_history_long' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_statements_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_statements_summary_by_host_by_event_name' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_statements_summary_by_user_by_event_name' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_statements_summary_by_account_by_event_name' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_statements_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line ###: Table 'hosts' already exists
+ERROR 1050 (42S01) at line ###: Table 'users' already exists
+ERROR 1050 (42S01) at line ###: Table 'accounts' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_statements_summary_by_digest' already exists
FATAL ERROR: Upgrade failed
show tables like "user_table";
Tables_in_performance_schema (user_table)
@@ -70,56 +69,55 @@ use performance_schema;
show tables like "user_view";
Tables_in_performance_schema (user_view)
user_view
-ERROR 1050 (42S01) at line 97: Table 'cond_instances' already exists
-ERROR 1050 (42S01) at line 122: Table 'events_waits_current' already exists
-ERROR 1050 (42S01) at line 147: Table 'events_waits_history' already exists
-ERROR 1050 (42S01) at line 172: Table 'events_waits_history_long' already exists
-ERROR 1050 (42S01) at line 185: Table 'events_waits_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 198: Table 'events_waits_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line 211: Table 'events_waits_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line 225: Table 'events_waits_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line 238: Table 'events_waits_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 250: Table 'events_waits_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 259: Table 'file_instances' already exists
-ERROR 1050 (42S01) at line 288: Table 'file_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line 319: Table 'file_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 332: Table 'socket_instances' already exists
-ERROR 1050 (42S01) at line 362: Table 'socket_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 391: Table 'socket_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line 432: Table 'mutex_instances' already exists
-ERROR 1050 (42S01) at line 446: Table 'objects_summary_global_by_type' already exists
-ERROR 1050 (42S01) at line 456: Table 'performance_timers' already exists
-ERROR 1050 (42S01) at line 466: Table 'rwlock_instances' already exists
-ERROR 1050 (42S01) at line 475: Table 'setup_actors' already exists
-ERROR 1050 (42S01) at line 483: Table 'setup_consumers' already exists
-ERROR 1050 (42S01) at line 492: Table 'setup_instruments' already exists
-ERROR 1050 (42S01) at line 503: Table 'setup_objects' already exists
-ERROR 1050 (42S01) at line 511: Table 'setup_timers' already exists
-ERROR 1050 (42S01) at line 556: Table 'table_io_waits_summary_by_index_usage' already exists
-ERROR 1050 (42S01) at line 600: Table 'table_io_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line 679: Table 'table_lock_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line 699: Table 'threads' already exists
-ERROR 1050 (42S01) at line 715: Table 'events_stages_current' already exists
-ERROR 1050 (42S01) at line 731: Table 'events_stages_history' already exists
-ERROR 1050 (42S01) at line 747: Table 'events_stages_history_long' already exists
-ERROR 1050 (42S01) at line 760: Table 'events_stages_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 773: Table 'events_stages_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line 786: Table 'events_stages_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line 800: Table 'events_stages_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line 812: Table 'events_stages_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 858: Table 'events_statements_current' already exists
-ERROR 1050 (42S01) at line 904: Table 'events_statements_history' already exists
-ERROR 1050 (42S01) at line 950: Table 'events_statements_history_long' already exists
-ERROR 1050 (42S01) at line 982: Table 'events_statements_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 1014: Table 'events_statements_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line 1046: Table 'events_statements_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line 1079: Table 'events_statements_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line 1110: Table 'events_statements_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 1119: Table 'hosts' already exists
-ERROR 1050 (42S01) at line 1128: Table 'users' already exists
-ERROR 1050 (42S01) at line 1138: Table 'accounts' already exists
-ERROR 1050 (42S01) at line 1172: Table 'events_statements_summary_by_digest' already exists
-ERROR 1644 (HY000) at line 1594: Unexpected content found in the performance_schema database.
+ERROR 1050 (42S01) at line ###: Table 'cond_instances' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_waits_current' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_waits_history' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_waits_history_long' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_waits_summary_by_instance' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_waits_summary_by_host_by_event_name' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_waits_summary_by_user_by_event_name' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_waits_summary_by_account_by_event_name' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_waits_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_waits_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line ###: Table 'file_instances' already exists
+ERROR 1050 (42S01) at line ###: Table 'file_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line ###: Table 'file_summary_by_instance' already exists
+ERROR 1050 (42S01) at line ###: Table 'socket_instances' already exists
+ERROR 1050 (42S01) at line ###: Table 'socket_summary_by_instance' already exists
+ERROR 1050 (42S01) at line ###: Table 'socket_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line ###: Table 'mutex_instances' already exists
+ERROR 1050 (42S01) at line ###: Table 'objects_summary_global_by_type' already exists
+ERROR 1050 (42S01) at line ###: Table 'performance_timers' already exists
+ERROR 1050 (42S01) at line ###: Table 'rwlock_instances' already exists
+ERROR 1050 (42S01) at line ###: Table 'setup_actors' already exists
+ERROR 1050 (42S01) at line ###: Table 'setup_consumers' already exists
+ERROR 1050 (42S01) at line ###: Table 'setup_instruments' already exists
+ERROR 1050 (42S01) at line ###: Table 'setup_objects' already exists
+ERROR 1050 (42S01) at line ###: Table 'setup_timers' already exists
+ERROR 1050 (42S01) at line ###: Table 'table_io_waits_summary_by_index_usage' already exists
+ERROR 1050 (42S01) at line ###: Table 'table_io_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line ###: Table 'table_lock_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line ###: Table 'threads' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_stages_current' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_stages_history' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_stages_history_long' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_stages_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_stages_summary_by_host_by_event_name' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_stages_summary_by_user_by_event_name' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_stages_summary_by_account_by_event_name' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_stages_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_statements_current' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_statements_history' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_statements_history_long' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_statements_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_statements_summary_by_host_by_event_name' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_statements_summary_by_user_by_event_name' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_statements_summary_by_account_by_event_name' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_statements_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line ###: Table 'hosts' already exists
+ERROR 1050 (42S01) at line ###: Table 'users' already exists
+ERROR 1050 (42S01) at line ###: Table 'accounts' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_statements_summary_by_digest' already exists
FATAL ERROR: Upgrade failed
show tables like "user_view";
Tables_in_performance_schema (user_view)
@@ -130,56 +128,55 @@ drop view test.user_view;
create procedure test.user_proc()
select "Not supposed to be here";
update mysql.proc set db='performance_schema' where name='user_proc';
-ERROR 1050 (42S01) at line 97: Table 'cond_instances' already exists
-ERROR 1050 (42S01) at line 122: Table 'events_waits_current' already exists
-ERROR 1050 (42S01) at line 147: Table 'events_waits_history' already exists
-ERROR 1050 (42S01) at line 172: Table 'events_waits_history_long' already exists
-ERROR 1050 (42S01) at line 185: Table 'events_waits_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 198: Table 'events_waits_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line 211: Table 'events_waits_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line 225: Table 'events_waits_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line 238: Table 'events_waits_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 250: Table 'events_waits_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 259: Table 'file_instances' already exists
-ERROR 1050 (42S01) at line 288: Table 'file_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line 319: Table 'file_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 332: Table 'socket_instances' already exists
-ERROR 1050 (42S01) at line 362: Table 'socket_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 391: Table 'socket_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line 432: Table 'mutex_instances' already exists
-ERROR 1050 (42S01) at line 446: Table 'objects_summary_global_by_type' already exists
-ERROR 1050 (42S01) at line 456: Table 'performance_timers' already exists
-ERROR 1050 (42S01) at line 466: Table 'rwlock_instances' already exists
-ERROR 1050 (42S01) at line 475: Table 'setup_actors' already exists
-ERROR 1050 (42S01) at line 483: Table 'setup_consumers' already exists
-ERROR 1050 (42S01) at line 492: Table 'setup_instruments' already exists
-ERROR 1050 (42S01) at line 503: Table 'setup_objects' already exists
-ERROR 1050 (42S01) at line 511: Table 'setup_timers' already exists
-ERROR 1050 (42S01) at line 556: Table 'table_io_waits_summary_by_index_usage' already exists
-ERROR 1050 (42S01) at line 600: Table 'table_io_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line 679: Table 'table_lock_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line 699: Table 'threads' already exists
-ERROR 1050 (42S01) at line 715: Table 'events_stages_current' already exists
-ERROR 1050 (42S01) at line 731: Table 'events_stages_history' already exists
-ERROR 1050 (42S01) at line 747: Table 'events_stages_history_long' already exists
-ERROR 1050 (42S01) at line 760: Table 'events_stages_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 773: Table 'events_stages_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line 786: Table 'events_stages_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line 800: Table 'events_stages_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line 812: Table 'events_stages_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 858: Table 'events_statements_current' already exists
-ERROR 1050 (42S01) at line 904: Table 'events_statements_history' already exists
-ERROR 1050 (42S01) at line 950: Table 'events_statements_history_long' already exists
-ERROR 1050 (42S01) at line 982: Table 'events_statements_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 1014: Table 'events_statements_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line 1046: Table 'events_statements_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line 1079: Table 'events_statements_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line 1110: Table 'events_statements_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 1119: Table 'hosts' already exists
-ERROR 1050 (42S01) at line 1128: Table 'users' already exists
-ERROR 1050 (42S01) at line 1138: Table 'accounts' already exists
-ERROR 1050 (42S01) at line 1172: Table 'events_statements_summary_by_digest' already exists
-ERROR 1644 (HY000) at line 1594: Unexpected content found in the performance_schema database.
+ERROR 1050 (42S01) at line ###: Table 'cond_instances' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_waits_current' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_waits_history' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_waits_history_long' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_waits_summary_by_instance' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_waits_summary_by_host_by_event_name' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_waits_summary_by_user_by_event_name' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_waits_summary_by_account_by_event_name' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_waits_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_waits_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line ###: Table 'file_instances' already exists
+ERROR 1050 (42S01) at line ###: Table 'file_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line ###: Table 'file_summary_by_instance' already exists
+ERROR 1050 (42S01) at line ###: Table 'socket_instances' already exists
+ERROR 1050 (42S01) at line ###: Table 'socket_summary_by_instance' already exists
+ERROR 1050 (42S01) at line ###: Table 'socket_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line ###: Table 'mutex_instances' already exists
+ERROR 1050 (42S01) at line ###: Table 'objects_summary_global_by_type' already exists
+ERROR 1050 (42S01) at line ###: Table 'performance_timers' already exists
+ERROR 1050 (42S01) at line ###: Table 'rwlock_instances' already exists
+ERROR 1050 (42S01) at line ###: Table 'setup_actors' already exists
+ERROR 1050 (42S01) at line ###: Table 'setup_consumers' already exists
+ERROR 1050 (42S01) at line ###: Table 'setup_instruments' already exists
+ERROR 1050 (42S01) at line ###: Table 'setup_objects' already exists
+ERROR 1050 (42S01) at line ###: Table 'setup_timers' already exists
+ERROR 1050 (42S01) at line ###: Table 'table_io_waits_summary_by_index_usage' already exists
+ERROR 1050 (42S01) at line ###: Table 'table_io_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line ###: Table 'table_lock_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line ###: Table 'threads' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_stages_current' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_stages_history' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_stages_history_long' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_stages_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_stages_summary_by_host_by_event_name' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_stages_summary_by_user_by_event_name' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_stages_summary_by_account_by_event_name' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_stages_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_statements_current' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_statements_history' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_statements_history_long' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_statements_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_statements_summary_by_host_by_event_name' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_statements_summary_by_user_by_event_name' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_statements_summary_by_account_by_event_name' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_statements_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line ###: Table 'hosts' already exists
+ERROR 1050 (42S01) at line ###: Table 'users' already exists
+ERROR 1050 (42S01) at line ###: Table 'accounts' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_statements_summary_by_digest' already exists
FATAL ERROR: Upgrade failed
select name from mysql.proc where db='performance_schema';
name
@@ -190,56 +187,55 @@ drop procedure test.user_proc;
create function test.user_func() returns integer
return 0;
update mysql.proc set db='performance_schema' where name='user_func';
-ERROR 1050 (42S01) at line 97: Table 'cond_instances' already exists
-ERROR 1050 (42S01) at line 122: Table 'events_waits_current' already exists
-ERROR 1050 (42S01) at line 147: Table 'events_waits_history' already exists
-ERROR 1050 (42S01) at line 172: Table 'events_waits_history_long' already exists
-ERROR 1050 (42S01) at line 185: Table 'events_waits_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 198: Table 'events_waits_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line 211: Table 'events_waits_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line 225: Table 'events_waits_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line 238: Table 'events_waits_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 250: Table 'events_waits_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 259: Table 'file_instances' already exists
-ERROR 1050 (42S01) at line 288: Table 'file_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line 319: Table 'file_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 332: Table 'socket_instances' already exists
-ERROR 1050 (42S01) at line 362: Table 'socket_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 391: Table 'socket_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line 432: Table 'mutex_instances' already exists
-ERROR 1050 (42S01) at line 446: Table 'objects_summary_global_by_type' already exists
-ERROR 1050 (42S01) at line 456: Table 'performance_timers' already exists
-ERROR 1050 (42S01) at line 466: Table 'rwlock_instances' already exists
-ERROR 1050 (42S01) at line 475: Table 'setup_actors' already exists
-ERROR 1050 (42S01) at line 483: Table 'setup_consumers' already exists
-ERROR 1050 (42S01) at line 492: Table 'setup_instruments' already exists
-ERROR 1050 (42S01) at line 503: Table 'setup_objects' already exists
-ERROR 1050 (42S01) at line 511: Table 'setup_timers' already exists
-ERROR 1050 (42S01) at line 556: Table 'table_io_waits_summary_by_index_usage' already exists
-ERROR 1050 (42S01) at line 600: Table 'table_io_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line 679: Table 'table_lock_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line 699: Table 'threads' already exists
-ERROR 1050 (42S01) at line 715: Table 'events_stages_current' already exists
-ERROR 1050 (42S01) at line 731: Table 'events_stages_history' already exists
-ERROR 1050 (42S01) at line 747: Table 'events_stages_history_long' already exists
-ERROR 1050 (42S01) at line 760: Table 'events_stages_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 773: Table 'events_stages_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line 786: Table 'events_stages_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line 800: Table 'events_stages_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line 812: Table 'events_stages_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 858: Table 'events_statements_current' already exists
-ERROR 1050 (42S01) at line 904: Table 'events_statements_history' already exists
-ERROR 1050 (42S01) at line 950: Table 'events_statements_history_long' already exists
-ERROR 1050 (42S01) at line 982: Table 'events_statements_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 1014: Table 'events_statements_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line 1046: Table 'events_statements_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line 1079: Table 'events_statements_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line 1110: Table 'events_statements_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 1119: Table 'hosts' already exists
-ERROR 1050 (42S01) at line 1128: Table 'users' already exists
-ERROR 1050 (42S01) at line 1138: Table 'accounts' already exists
-ERROR 1050 (42S01) at line 1172: Table 'events_statements_summary_by_digest' already exists
-ERROR 1644 (HY000) at line 1594: Unexpected content found in the performance_schema database.
+ERROR 1050 (42S01) at line ###: Table 'cond_instances' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_waits_current' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_waits_history' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_waits_history_long' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_waits_summary_by_instance' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_waits_summary_by_host_by_event_name' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_waits_summary_by_user_by_event_name' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_waits_summary_by_account_by_event_name' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_waits_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_waits_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line ###: Table 'file_instances' already exists
+ERROR 1050 (42S01) at line ###: Table 'file_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line ###: Table 'file_summary_by_instance' already exists
+ERROR 1050 (42S01) at line ###: Table 'socket_instances' already exists
+ERROR 1050 (42S01) at line ###: Table 'socket_summary_by_instance' already exists
+ERROR 1050 (42S01) at line ###: Table 'socket_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line ###: Table 'mutex_instances' already exists
+ERROR 1050 (42S01) at line ###: Table 'objects_summary_global_by_type' already exists
+ERROR 1050 (42S01) at line ###: Table 'performance_timers' already exists
+ERROR 1050 (42S01) at line ###: Table 'rwlock_instances' already exists
+ERROR 1050 (42S01) at line ###: Table 'setup_actors' already exists
+ERROR 1050 (42S01) at line ###: Table 'setup_consumers' already exists
+ERROR 1050 (42S01) at line ###: Table 'setup_instruments' already exists
+ERROR 1050 (42S01) at line ###: Table 'setup_objects' already exists
+ERROR 1050 (42S01) at line ###: Table 'setup_timers' already exists
+ERROR 1050 (42S01) at line ###: Table 'table_io_waits_summary_by_index_usage' already exists
+ERROR 1050 (42S01) at line ###: Table 'table_io_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line ###: Table 'table_lock_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line ###: Table 'threads' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_stages_current' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_stages_history' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_stages_history_long' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_stages_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_stages_summary_by_host_by_event_name' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_stages_summary_by_user_by_event_name' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_stages_summary_by_account_by_event_name' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_stages_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_statements_current' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_statements_history' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_statements_history_long' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_statements_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_statements_summary_by_host_by_event_name' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_statements_summary_by_user_by_event_name' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_statements_summary_by_account_by_event_name' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_statements_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line ###: Table 'hosts' already exists
+ERROR 1050 (42S01) at line ###: Table 'users' already exists
+ERROR 1050 (42S01) at line ###: Table 'accounts' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_statements_summary_by_digest' already exists
FATAL ERROR: Upgrade failed
select name from mysql.proc where db='performance_schema';
name
@@ -250,56 +246,55 @@ drop function test.user_func;
create event test.user_event on schedule every 1 day do
select "not supposed to be here";
update mysql.event set db='performance_schema' where name='user_event';
-ERROR 1050 (42S01) at line 97: Table 'cond_instances' already exists
-ERROR 1050 (42S01) at line 122: Table 'events_waits_current' already exists
-ERROR 1050 (42S01) at line 147: Table 'events_waits_history' already exists
-ERROR 1050 (42S01) at line 172: Table 'events_waits_history_long' already exists
-ERROR 1050 (42S01) at line 185: Table 'events_waits_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 198: Table 'events_waits_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line 211: Table 'events_waits_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line 225: Table 'events_waits_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line 238: Table 'events_waits_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 250: Table 'events_waits_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 259: Table 'file_instances' already exists
-ERROR 1050 (42S01) at line 288: Table 'file_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line 319: Table 'file_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 332: Table 'socket_instances' already exists
-ERROR 1050 (42S01) at line 362: Table 'socket_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 391: Table 'socket_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line 432: Table 'mutex_instances' already exists
-ERROR 1050 (42S01) at line 446: Table 'objects_summary_global_by_type' already exists
-ERROR 1050 (42S01) at line 456: Table 'performance_timers' already exists
-ERROR 1050 (42S01) at line 466: Table 'rwlock_instances' already exists
-ERROR 1050 (42S01) at line 475: Table 'setup_actors' already exists
-ERROR 1050 (42S01) at line 483: Table 'setup_consumers' already exists
-ERROR 1050 (42S01) at line 492: Table 'setup_instruments' already exists
-ERROR 1050 (42S01) at line 503: Table 'setup_objects' already exists
-ERROR 1050 (42S01) at line 511: Table 'setup_timers' already exists
-ERROR 1050 (42S01) at line 556: Table 'table_io_waits_summary_by_index_usage' already exists
-ERROR 1050 (42S01) at line 600: Table 'table_io_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line 679: Table 'table_lock_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line 699: Table 'threads' already exists
-ERROR 1050 (42S01) at line 715: Table 'events_stages_current' already exists
-ERROR 1050 (42S01) at line 731: Table 'events_stages_history' already exists
-ERROR 1050 (42S01) at line 747: Table 'events_stages_history_long' already exists
-ERROR 1050 (42S01) at line 760: Table 'events_stages_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 773: Table 'events_stages_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line 786: Table 'events_stages_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line 800: Table 'events_stages_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line 812: Table 'events_stages_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 858: Table 'events_statements_current' already exists
-ERROR 1050 (42S01) at line 904: Table 'events_statements_history' already exists
-ERROR 1050 (42S01) at line 950: Table 'events_statements_history_long' already exists
-ERROR 1050 (42S01) at line 982: Table 'events_statements_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 1014: Table 'events_statements_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line 1046: Table 'events_statements_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line 1079: Table 'events_statements_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line 1110: Table 'events_statements_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 1119: Table 'hosts' already exists
-ERROR 1050 (42S01) at line 1128: Table 'users' already exists
-ERROR 1050 (42S01) at line 1138: Table 'accounts' already exists
-ERROR 1050 (42S01) at line 1172: Table 'events_statements_summary_by_digest' already exists
-ERROR 1644 (HY000) at line 1594: Unexpected content found in the performance_schema database.
+ERROR 1050 (42S01) at line ###: Table 'cond_instances' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_waits_current' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_waits_history' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_waits_history_long' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_waits_summary_by_instance' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_waits_summary_by_host_by_event_name' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_waits_summary_by_user_by_event_name' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_waits_summary_by_account_by_event_name' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_waits_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_waits_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line ###: Table 'file_instances' already exists
+ERROR 1050 (42S01) at line ###: Table 'file_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line ###: Table 'file_summary_by_instance' already exists
+ERROR 1050 (42S01) at line ###: Table 'socket_instances' already exists
+ERROR 1050 (42S01) at line ###: Table 'socket_summary_by_instance' already exists
+ERROR 1050 (42S01) at line ###: Table 'socket_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line ###: Table 'mutex_instances' already exists
+ERROR 1050 (42S01) at line ###: Table 'objects_summary_global_by_type' already exists
+ERROR 1050 (42S01) at line ###: Table 'performance_timers' already exists
+ERROR 1050 (42S01) at line ###: Table 'rwlock_instances' already exists
+ERROR 1050 (42S01) at line ###: Table 'setup_actors' already exists
+ERROR 1050 (42S01) at line ###: Table 'setup_consumers' already exists
+ERROR 1050 (42S01) at line ###: Table 'setup_instruments' already exists
+ERROR 1050 (42S01) at line ###: Table 'setup_objects' already exists
+ERROR 1050 (42S01) at line ###: Table 'setup_timers' already exists
+ERROR 1050 (42S01) at line ###: Table 'table_io_waits_summary_by_index_usage' already exists
+ERROR 1050 (42S01) at line ###: Table 'table_io_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line ###: Table 'table_lock_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line ###: Table 'threads' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_stages_current' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_stages_history' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_stages_history_long' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_stages_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_stages_summary_by_host_by_event_name' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_stages_summary_by_user_by_event_name' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_stages_summary_by_account_by_event_name' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_stages_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_statements_current' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_statements_history' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_statements_history_long' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_statements_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_statements_summary_by_host_by_event_name' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_statements_summary_by_user_by_event_name' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_statements_summary_by_account_by_event_name' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_statements_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line ###: Table 'hosts' already exists
+ERROR 1050 (42S01) at line ###: Table 'users' already exists
+ERROR 1050 (42S01) at line ###: Table 'accounts' already exists
+ERROR 1050 (42S01) at line ###: Table 'events_statements_summary_by_digest' already exists
FATAL ERROR: Upgrade failed
select name from mysql.event where db='performance_schema';
name
diff --git a/mysql-test/suite/perfschema/r/statement_digest.result b/mysql-test/suite/perfschema/r/statement_digest.result
index 00476d957f6..48cdc22bd21 100644
--- a/mysql-test/suite/perfschema/r/statement_digest.result
+++ b/mysql-test/suite/perfschema/r/statement_digest.result
@@ -75,28 +75,28 @@ Warning 1265 Data truncated for column 'c' at row 1
SELECT DIGEST, DIGEST_TEXT, COUNT_STAR, SUM_ROWS_AFFECTED, SUM_WARNINGS,
SUM_ERRORS FROM performance_schema.events_statements_summary_by_digest;
DIGEST DIGEST_TEXT COUNT_STAR SUM_ROWS_AFFECTED SUM_WARNINGS SUM_ERRORS
-b94bc8f50c92e01784d3148b3d2086c8 TRUNCATE TABLE performance_schema . events_statements_summary_by_digest 1 0 0 0
-ea6492426a33544a059bc12766c5ba3d SELECT ? FROM t1 1 0 0 0
-692668ddf608983c586aef1c575ee9c6 SELECT ? FROM `t1` 1 0 0 0
-f630f3ea22832be48798c5e51bb88189 SELECT ?, ... FROM t1 2 0 0 0
-a98062477bd693dacfc0df96c68c5585 SELECT ? FROM t2 1 0 0 0
-12cd65a2242b7643f9ad4418c389677a SELECT ?, ... FROM t2 2 0 0 0
-32d8fa3c3ed3b6c26ac792495188f4a4 INSERT INTO t1 VALUES (?) 1 1 0 0
-8bf0b320418673ba7d23f11f61bae318 INSERT INTO t2 VALUES (?) 1 1 0 0
-a411b3681f67af51cddca60a3d5c260f INSERT INTO t3 VALUES (...) 1 1 0 0
-23d0399fcd03fabcc9eeadb387121a44 INSERT INTO t4 VALUES (...) 1 1 0 0
-c0ec9a3fd081147370256fb6b64e2f67 INSERT INTO t5 VALUES (...) 1 1 0 0
-ba58da885d020e31d8c38b67e0f6da4c INSERT INTO t1 VALUES (?) /* , ... */ 2 7 0 0
-9c272a31286b15643b38fecc33599eea INSERT INTO t3 VALUES (...) /* , ... */ 1 3 0 0
-a7d009150c5da8b925776dea63ed77d7 INSERT INTO t5 VALUES (...) /* , ... */ 1 3 0 0
-b695dab1504c4e588a91af231b9c9e26 SELECT ? + ? 3 0 0 0
-a2635fa56a271bdf473419620249f7ef SELECT ? 1 0 0 0
-bce3f7384ae2ab78354b031184fde12d CREATE SCHEMA statements_digest_temp 2 2 0 0
-2a0e36afeaac85dc117c3856388a4fae DROP SCHEMA statements_digest_temp 2 0 0 0
-bb607bee73d602560af915aa4514eac4 SELECT ? FROM t11 1 0 0 1
-4cd9bc5a9ed1ac12cd380187dab2921a CREATE TABLE t11 ( c CHARACTER (?) ) 2 0 0 1
-bd53dcd5e36e77d74df5358baf658cee INSERT INTO t11 VALUES (?) 1 1 1 0
-f62dd76b64fad47e6558f3d1b03ff215 SHOW WARNINGS 1 0 0 0
+169378b8f621f69e494b409cac921a8a TRUNCATE TABLE performance_schema . events_statements_summary_by_digest 1 0 0 0
+e4be9763aa1ac0b1240df516b56c87f7 SELECT ? FROM t1 1 0 0 0
+4b427080de408a9901110476b8d89294 SELECT ? FROM `t1` 1 0 0 0
+40f18ff66269a8b98e55adddd015b34e SELECT ?, ... FROM t1 2 0 0 0
+e987e8bf850f505f6f77eb07a7bbe04a SELECT ? FROM t2 1 0 0 0
+607f77cb3413947bd5dbd63f76612f8a SELECT ?, ... FROM t2 2 0 0 0
+f42737acdd47cab2d221cd39090bbded INSERT INTO t1 VALUES (?) 1 1 0 0
+7370fb00cd852c6997143c4d2fdbd195 INSERT INTO t2 VALUES (?) 1 1 0 0
+d081782e520e5b728af90727126d4e29 INSERT INTO t3 VALUES (...) 1 1 0 0
+523f7d6062fa7d22b4d52aff8d86822a INSERT INTO t4 VALUES (...) 1 1 0 0
+b5ca6eebd080515a634701700781f06a INSERT INTO t5 VALUES (...) 1 1 0 0
+89b024c9cb432b7d8a5bb8c2d669681b INSERT INTO t1 VALUES (?) /* , ... */ 2 7 0 0
+77ecbf7f22a1336af595d5d5a3289e3b INSERT INTO t3 VALUES (...) /* , ... */ 1 3 0 0
+239f41ec764182041ee7fdd8d949cc5c INSERT INTO t5 VALUES (...) /* , ... */ 1 3 0 0
+e0d2d03f8bb2fd3d349ddd73a950a9e9 SELECT ? + ? 3 0 0 0
+c5bd0023064662b510b51696f1156a4b SELECT ? 1 0 0 0
+4ffe9781212ce310328413c9177c433f CREATE SCHEMA statements_digest_temp 2 2 0 0
+3080b4ad1ab930bea0de4df1a4e28545 DROP SCHEMA statements_digest_temp 2 0 0 0
+6f670a13be2183ac28f11ff5264c24b5 SELECT ? FROM t11 1 0 0 1
+7721a3a30656deccf166c8706c87aca5 CREATE TABLE t11 ( c CHARACTER (?) ) 2 0 0 1
+e563777e3c11d2b111f1dd6ca27da9d7 INSERT INTO t11 VALUES (?) 1 1 1 0
+f4a01378d55fccee18a4d359d3aa49c0 SHOW WARNINGS 1 0 0 0
####################################
# CLEANUP
####################################
diff --git a/mysql-test/suite/perfschema/r/statement_digest_consumers.result b/mysql-test/suite/perfschema/r/statement_digest_consumers.result
index 722a9e4bf2b..8c9388497d8 100644
--- a/mysql-test/suite/perfschema/r/statement_digest_consumers.result
+++ b/mysql-test/suite/perfschema/r/statement_digest_consumers.result
@@ -88,28 +88,28 @@ Warning 1265 Data truncated for column 'c' at row 1
####################################
SELECT digest, digest_text, count_star FROM performance_schema.events_statements_summary_by_digest;
digest digest_text count_star
-b94bc8f50c92e01784d3148b3d2086c8 TRUNCATE TABLE performance_schema . events_statements_summary_by_digest 1
-ea6492426a33544a059bc12766c5ba3d SELECT ? FROM t1 1
-692668ddf608983c586aef1c575ee9c6 SELECT ? FROM `t1` 1
-f630f3ea22832be48798c5e51bb88189 SELECT ?, ... FROM t1 2
-a98062477bd693dacfc0df96c68c5585 SELECT ? FROM t2 1
-12cd65a2242b7643f9ad4418c389677a SELECT ?, ... FROM t2 2
-32d8fa3c3ed3b6c26ac792495188f4a4 INSERT INTO t1 VALUES (?) 1
-8bf0b320418673ba7d23f11f61bae318 INSERT INTO t2 VALUES (?) 1
-a411b3681f67af51cddca60a3d5c260f INSERT INTO t3 VALUES (...) 1
-23d0399fcd03fabcc9eeadb387121a44 INSERT INTO t4 VALUES (...) 1
-c0ec9a3fd081147370256fb6b64e2f67 INSERT INTO t5 VALUES (...) 1
-ba58da885d020e31d8c38b67e0f6da4c INSERT INTO t1 VALUES (?) /* , ... */ 2
-9c272a31286b15643b38fecc33599eea INSERT INTO t3 VALUES (...) /* , ... */ 1
-a7d009150c5da8b925776dea63ed77d7 INSERT INTO t5 VALUES (...) /* , ... */ 1
-b695dab1504c4e588a91af231b9c9e26 SELECT ? + ? 3
-a2635fa56a271bdf473419620249f7ef SELECT ? 1
-bce3f7384ae2ab78354b031184fde12d CREATE SCHEMA statements_digest_temp 2
-2a0e36afeaac85dc117c3856388a4fae DROP SCHEMA statements_digest_temp 2
-bb607bee73d602560af915aa4514eac4 SELECT ? FROM t11 1
-4cd9bc5a9ed1ac12cd380187dab2921a CREATE TABLE t11 ( c CHARACTER (?) ) 2
-bd53dcd5e36e77d74df5358baf658cee INSERT INTO t11 VALUES (?) 1
-f62dd76b64fad47e6558f3d1b03ff215 SHOW WARNINGS 1
+169378b8f621f69e494b409cac921a8a TRUNCATE TABLE performance_schema . events_statements_summary_by_digest 1
+e4be9763aa1ac0b1240df516b56c87f7 SELECT ? FROM t1 1
+4b427080de408a9901110476b8d89294 SELECT ? FROM `t1` 1
+40f18ff66269a8b98e55adddd015b34e SELECT ?, ... FROM t1 2
+e987e8bf850f505f6f77eb07a7bbe04a SELECT ? FROM t2 1
+607f77cb3413947bd5dbd63f76612f8a SELECT ?, ... FROM t2 2
+f42737acdd47cab2d221cd39090bbded INSERT INTO t1 VALUES (?) 1
+7370fb00cd852c6997143c4d2fdbd195 INSERT INTO t2 VALUES (?) 1
+d081782e520e5b728af90727126d4e29 INSERT INTO t3 VALUES (...) 1
+523f7d6062fa7d22b4d52aff8d86822a INSERT INTO t4 VALUES (...) 1
+b5ca6eebd080515a634701700781f06a INSERT INTO t5 VALUES (...) 1
+89b024c9cb432b7d8a5bb8c2d669681b INSERT INTO t1 VALUES (?) /* , ... */ 2
+77ecbf7f22a1336af595d5d5a3289e3b INSERT INTO t3 VALUES (...) /* , ... */ 1
+239f41ec764182041ee7fdd8d949cc5c INSERT INTO t5 VALUES (...) /* , ... */ 1
+e0d2d03f8bb2fd3d349ddd73a950a9e9 SELECT ? + ? 3
+c5bd0023064662b510b51696f1156a4b SELECT ? 1
+4ffe9781212ce310328413c9177c433f CREATE SCHEMA statements_digest_temp 2
+3080b4ad1ab930bea0de4df1a4e28545 DROP SCHEMA statements_digest_temp 2
+6f670a13be2183ac28f11ff5264c24b5 SELECT ? FROM t11 1
+7721a3a30656deccf166c8706c87aca5 CREATE TABLE t11 ( c CHARACTER (?) ) 2
+e563777e3c11d2b111f1dd6ca27da9d7 INSERT INTO t11 VALUES (?) 1
+f4a01378d55fccee18a4d359d3aa49c0 SHOW WARNINGS 1
SELECT digest, digest_text FROM performance_schema.events_statements_current;
digest digest_text
####################################
diff --git a/mysql-test/suite/perfschema/r/statement_digest_long_query.result b/mysql-test/suite/perfschema/r/statement_digest_long_query.result
index 580bf1ef627..df35fd23418 100644
--- a/mysql-test/suite/perfschema/r/statement_digest_long_query.result
+++ b/mysql-test/suite/perfschema/r/statement_digest_long_query.result
@@ -8,5 +8,5 @@ SELECT 1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1
####################################
SELECT digest, digest_text, count_star FROM events_statements_summary_by_digest;
digest digest_text count_star
-551139187583b3dff117e28b5935406c TRUNCATE TABLE events_statements_summary_by_digest 1
-6b577979631439bd015b7675abcd91fe SELECT ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ... 1
+2b59f75dae5f99499a30ee9d7dad331c TRUNCATE TABLE events_statements_summary_by_digest 1
+2aa8806683d087e099c1e389ccf1b5a8 SELECT ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ... 1
diff --git a/mysql-test/suite/perfschema/t/func_file_io.test b/mysql-test/suite/perfschema/t/func_file_io.test
index 25e84292c97..014ab5e0731 100644
--- a/mysql-test/suite/perfschema/t/func_file_io.test
+++ b/mysql-test/suite/perfschema/t/func_file_io.test
@@ -15,6 +15,9 @@ WHERE name LIKE 'wait/io/file/%';
update performance_schema.threads SET instrumented = 'YES'
WHERE PROCESSLIST_ID=connection_id();
+# reset lost counters
+flush status;
+
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings
@@ -183,3 +186,7 @@ ORDER BY p.processlist_user, h.operation;
# Clean-up.
UPDATE performance_schema.setup_instruments SET enabled = 'YES', timed = 'YES';
+
+# In case of failure, will indicate the root cause
+show status like "performance_schema%";
+
diff --git a/mysql-test/suite/perfschema/t/func_mutex.test b/mysql-test/suite/perfschema/t/func_mutex.test
index 652d53bf17e..a6940710626 100644
--- a/mysql-test/suite/perfschema/t/func_mutex.test
+++ b/mysql-test/suite/perfschema/t/func_mutex.test
@@ -13,6 +13,15 @@ UPDATE performance_schema.setup_instruments SET enabled = 'YES'
WHERE name LIKE 'wait/synch/mutex/%'
OR name LIKE 'wait/synch/rwlock/%';
+# reset lost counters
+flush status;
+
+# Make sure objects are instrumented
+select NAME from performance_schema.mutex_instances
+ where NAME = 'wait/synch/mutex/sql/LOCK_open';
+select NAME from performance_schema.rwlock_instances
+ where NAME = 'wait/synch/rwlock/sql/LOCK_grant';
+
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings
@@ -119,3 +128,6 @@ DROP TABLE t1;
UPDATE performance_schema.setup_instruments SET enabled = 'YES', timed = 'YES';
+# In case of failure, will indicate the root cause
+show status like "performance_schema%";
+
diff --git a/mysql-test/suite/plugins/r/audit_null_debug.result b/mysql-test/suite/plugins/r/audit_null_debug.result
new file mode 100644
index 00000000000..2b5fa291f24
--- /dev/null
+++ b/mysql-test/suite/plugins/r/audit_null_debug.result
@@ -0,0 +1,12 @@
+call mtr.add_suppression("mysql/plugin.MYI");
+SET debug_dbug='+d,myisam_pretend_crashed_table_on_usage';
+install plugin audit_null soname 'adt_null';
+ERROR HY000: Incorrect key file for table './mysql/plugin.MYI'; try to repair it
+SET debug_dbug='-d,myisam_pretend_crashed_table_on_usage';
+install plugin audit_null soname 'adt_null';
+SET debug_dbug='+d,myisam_pretend_crashed_table_on_usage';
+uninstall plugin audit_null;
+ERROR HY000: Incorrect key file for table './mysql/plugin.MYI'; try to repair it
+SET debug_dbug='-d,myisam_pretend_crashed_table_on_usage';
+uninstall plugin audit_null;
+ERROR 42000: PLUGIN audit_null does not exist
diff --git a/mysql-test/suite/plugins/t/audit_null_debug.test b/mysql-test/suite/plugins/t/audit_null_debug.test
new file mode 100644
index 00000000000..d9e6cad5524
--- /dev/null
+++ b/mysql-test/suite/plugins/t/audit_null_debug.test
@@ -0,0 +1,27 @@
+--source include/have_debug.inc
+--source include/not_embedded.inc
+
+if (!$ADT_NULL_SO) {
+ skip No NULL_AUDIT plugin;
+}
+
+call mtr.add_suppression("mysql/plugin.MYI");
+
+#
+# MySQL BUG#14485479 - INSTALL AUDIT PLUGIN HANGS IF WE TRY TO DISABLE AND ENABLED DURING DDL OPERATION
+# (a.k.a. audit event caused by the table access during audit plugin initialization)
+#
+SET debug_dbug='+d,myisam_pretend_crashed_table_on_usage';
+--error 126
+install plugin audit_null soname 'adt_null';
+SET debug_dbug='-d,myisam_pretend_crashed_table_on_usage';
+
+install plugin audit_null soname 'adt_null';
+SET debug_dbug='+d,myisam_pretend_crashed_table_on_usage';
+--error 126
+uninstall plugin audit_null;
+SET debug_dbug='-d,myisam_pretend_crashed_table_on_usage';
+
+--error 1305
+uninstall plugin audit_null;
+
diff --git a/mysql-test/suite/rpl/r/rpl_password_boundaries.result b/mysql-test/suite/rpl/r/rpl_password_boundaries.result
new file mode 100644
index 00000000000..71f32f492a2
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_password_boundaries.result
@@ -0,0 +1,59 @@
+include/master-slave.inc
+[connection master]
+include/rpl_reset.inc
+[ on master ]
+set sql_log_bin=0;
+grant replication slave on *.* to rpl32@127.0.0.1 identified by '0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef';
+set sql_log_bin=1;
+[ on slave ]
+include/stop_slave.inc
+change master to master_user='rpl32',master_password='0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef';
+include/start_slave.inc
+[ on master ]
+drop table if exists t1;
+Warnings:
+Note 1051 Unknown table 't1'
+create table t1 (i int);
+insert into t1 values (1);
+[ on slave: synchronized ]
+[ on master ]
+set sql_log_bin=0;
+grant replication slave on *.* to rpl33@127.0.0.1 identified by '0123456789abcdef0123456789abcdef!';
+set sql_log_bin=1;
+[ on slave ]
+include/stop_slave.inc
+change master to master_user='rpl33',master_password='0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef!';
+ERROR HY000: String '0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef012345' is too long for MASTER_PASSWORD (should be no longer than 96)
+change master to master_user='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa';
+ERROR HY000: String 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' is too long for MASTER_USER (should be no longer than 47)
+change master to master_host='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc';
+ERROR HY000: String 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbb' is too long for MASTER_HOST (should be no longer than 180)
+[ on master ]
+set sql_log_bin=0;
+grant replication slave on *.* to rpl16cyr@127.0.0.1 identified by 'воттакойужпарольвоттакойужпарольвоттакойужпароль';
+set sql_log_bin=1;
+[ on slave ]
+SET NAMES utf8;
+change master to master_user='rpl16cyr',master_password='воттакойужпарольвоттакойужпарольвоттакойужпароль';
+include/start_slave.inc
+[ on master ]
+drop table if exists t1;
+create table t1 (i int);
+insert into t1 values (1);
+[ on slave: synchronized ]
+[ on master ]
+set sql_log_bin=0;
+grant replication slave on *.* to rpl17mix@127.0.0.1 identified by 'воттакойужпарольвоттакойужпарольвоттакойужпароль!';
+set sql_log_bin=1;
+[ on slave ]
+include/stop_slave.inc
+change master to master_user='rpl17mix',master_password='воттакойужпарольвоттакойужпарольвоттакойужпароль!';
+ERROR HY000: String 'воттакойужпарольвоттакойужпарольвот' is too long for MASTER_PASSWORD (should be no longer than 96)
+[ on master ]
+set sql_log_bin=0;
+drop user rpl32@127.0.0.1, rpl33@127.0.0.1, rpl16cyr@127.0.0.1, rpl17mix@127.0.0.1;
+set sql_log_bin=1;
+change master to master_user='root',master_password='';
+include/start_slave.inc
+drop table if exists t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_semi_sync.result b/mysql-test/suite/rpl/r/rpl_semi_sync.result
index bb037de4e6d..51859b5b49b 100644
--- a/mysql-test/suite/rpl/r/rpl_semi_sync.result
+++ b/mysql-test/suite/rpl/r/rpl_semi_sync.result
@@ -93,7 +93,7 @@ Variable_name Value
Rpl_semi_sync_master_no_tx 0
show status like 'Rpl_semi_sync_master_yes_tx';
Variable_name Value
-Rpl_semi_sync_master_yes_tx 301
+Rpl_semi_sync_master_yes_tx 11
[ on slave ]
[ slave status after replicated inserts ]
show status like 'Rpl_semi_sync_slave_status';
@@ -101,13 +101,13 @@ Variable_name Value
Rpl_semi_sync_slave_status ON
select count(distinct a) from t1;
count(distinct a)
-300
+10
select min(a) from t1;
min(a)
1
select max(a) from t1;
max(a)
-300
+10
# BUG#50157
# semi-sync replication crashes when replicating a transaction which
@@ -133,6 +133,7 @@ SET SESSION AUTOCOMMIT= 1;
#
include/stop_slave.inc
[ on master ]
+set global rpl_semi_sync_master_timeout= 5000;
[ master status should be ON ]
show status like 'Rpl_semi_sync_master_status';
Variable_name Value
@@ -142,7 +143,7 @@ Variable_name Value
Rpl_semi_sync_master_no_tx 0
show status like 'Rpl_semi_sync_master_yes_tx';
Variable_name Value
-Rpl_semi_sync_master_yes_tx 304
+Rpl_semi_sync_master_yes_tx 14
show status like 'Rpl_semi_sync_master_clients';
Variable_name Value
Rpl_semi_sync_master_clients 1
@@ -157,7 +158,7 @@ Variable_name Value
Rpl_semi_sync_master_no_tx 1
show status like 'Rpl_semi_sync_master_yes_tx';
Variable_name Value
-Rpl_semi_sync_master_yes_tx 304
+Rpl_semi_sync_master_yes_tx 14
insert into t1 values (100);
[ master status should be OFF ]
show status like 'Rpl_semi_sync_master_status';
@@ -165,10 +166,10 @@ Variable_name Value
Rpl_semi_sync_master_status OFF
show status like 'Rpl_semi_sync_master_no_tx';
Variable_name Value
-Rpl_semi_sync_master_no_tx 302
+Rpl_semi_sync_master_no_tx 12
show status like 'Rpl_semi_sync_master_yes_tx';
Variable_name Value
-Rpl_semi_sync_master_yes_tx 304
+Rpl_semi_sync_master_yes_tx 14
#
# Test semi-sync status on master will be ON again when slave catches up
#
@@ -198,10 +199,10 @@ Variable_name Value
Rpl_semi_sync_master_status ON
show status like 'Rpl_semi_sync_master_no_tx';
Variable_name Value
-Rpl_semi_sync_master_no_tx 302
+Rpl_semi_sync_master_no_tx 12
show status like 'Rpl_semi_sync_master_yes_tx';
Variable_name Value
-Rpl_semi_sync_master_yes_tx 304
+Rpl_semi_sync_master_yes_tx 14
show status like 'Rpl_semi_sync_master_clients';
Variable_name Value
Rpl_semi_sync_master_clients 1
@@ -217,10 +218,10 @@ include/stop_slave.inc
[ Semi-sync master status variables before FLUSH STATUS ]
SHOW STATUS LIKE 'Rpl_semi_sync_master_no_tx';
Variable_name Value
-Rpl_semi_sync_master_no_tx 302
+Rpl_semi_sync_master_no_tx 12
SHOW STATUS LIKE 'Rpl_semi_sync_master_yes_tx';
Variable_name Value
-Rpl_semi_sync_master_yes_tx 305
+Rpl_semi_sync_master_yes_tx 15
FLUSH NO_WRITE_TO_BINLOG STATUS;
[ Semi-sync master status variables after FLUSH STATUS ]
SHOW STATUS LIKE 'Rpl_semi_sync_master_no_tx';
@@ -307,13 +308,13 @@ reset slave;
[ on master ]
reset master;
set sql_log_bin=0;
-grant replication slave on *.* to rpl@127.0.0.1 identified by 'rpl';
+grant replication slave on *.* to rpl@127.0.0.1 identified by 'rpl_password';
flush privileges;
set sql_log_bin=1;
[ on slave ]
-grant replication slave on *.* to rpl@127.0.0.1 identified by 'rpl';
+grant replication slave on *.* to rpl@127.0.0.1 identified by 'rpl_password';
flush privileges;
-change master to master_user='rpl',master_password='rpl';
+change master to master_user='rpl',master_password='rpl_password';
include/start_slave.inc
show status like 'Rpl_semi_sync_slave_status';
Variable_name Value
diff --git a/mysql-test/suite/rpl/t/rpl_password_boundaries.test b/mysql-test/suite/rpl/t/rpl_password_boundaries.test
new file mode 100644
index 00000000000..cf8abfbda11
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_password_boundaries.test
@@ -0,0 +1,112 @@
+source include/not_embedded.inc;
+source include/master-slave.inc;
+source include/rpl_reset.inc;
+
+# Suppress warnings that might be generated during the test
+disable_query_log;
+connection master;
+call mtr.add_suppression("Timeout waiting for reply of binlog");
+connection slave;
+call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group");
+enable_query_log;
+
+connection master;
+echo [ on master ];
+
+# wait for dying connections (if any) to disappear
+let $wait_condition= select count(*) = 0 from information_schema.processlist where command='killed';
+--source include/wait_condition.inc
+
+# 32*3-character ASCII password should work all right
+
+set sql_log_bin=0;
+grant replication slave on *.* to rpl32@127.0.0.1 identified by '0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef';
+set sql_log_bin=1;
+
+connection slave;
+echo [ on slave ];
+source include/stop_slave.inc;
+change master to master_user='rpl32',master_password='0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef';
+source include/start_slave.inc;
+
+connection master;
+echo [ on master ];
+drop table if exists t1;
+create table t1 (i int);
+insert into t1 values (1);
+sync_slave_with_master;
+echo [ on slave: synchronized ];
+
+connection master;
+echo [ on master ];
+
+# 32*3+1 -character ASCII password expected to fail
+set sql_log_bin=0;
+grant replication slave on *.* to rpl33@127.0.0.1 identified by '0123456789abcdef0123456789abcdef!';
+set sql_log_bin=1;
+
+connection slave;
+echo [ on slave ];
+source include/stop_slave.inc;
+--error ER_WRONG_STRING_LENGTH
+change master to master_user='rpl33',master_password='0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef!';
+
+# Check also master_user and master_host
+--error ER_WRONG_STRING_LENGTH
+change master to master_user='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa';
+--error ER_WRONG_STRING_LENGTH
+change master to master_host='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc';
+
+# 48-character cyrillic password should work all right
+connection master;
+echo [ on master ];
+set sql_log_bin=0;
+grant replication slave on *.* to rpl16cyr@127.0.0.1 identified by 'воттакойужпарольвоттакойужпарольвоттакойужпароль';
+set sql_log_bin=1;
+
+connection slave;
+echo [ on slave ];
+SET NAMES utf8;
+change master to master_user='rpl16cyr',master_password='воттакойужпарольвоттакойужпарольвоттакойужпароль';
+source include/start_slave.inc;
+
+connection master;
+echo [ on master ];
+drop table if exists t1;
+create table t1 (i int);
+insert into t1 values (1);
+sync_slave_with_master;
+echo [ on slave: synchronized ];
+
+# 48+1-character cyrillic password should fail
+
+connection master;
+echo [ on master ];
+set sql_log_bin=0;
+grant replication slave on *.* to rpl17mix@127.0.0.1 identified by 'воттакойужпарольвоттакойужпарольвоттакойужпароль!';
+set sql_log_bin=1;
+
+connection slave;
+echo [ on slave ];
+source include/stop_slave.inc;
+--error ER_WRONG_STRING_LENGTH
+change master to master_user='rpl17mix',master_password='воттакойужпарольвоттакойужпарольвоттакойужпароль!';
+
+# Cleanup
+
+connection master;
+echo [ on master ];
+set sql_log_bin=0;
+drop user rpl32@127.0.0.1, rpl33@127.0.0.1, rpl16cyr@127.0.0.1, rpl17mix@127.0.0.1;
+set sql_log_bin=1;
+
+connection slave;
+change master to master_user='root',master_password='';
+source include/start_slave.inc;
+
+connection master;
+drop table if exists t1;
+sync_slave_with_master;
+
+connection master;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_semi_sync.test b/mysql-test/suite/rpl/t/rpl_semi_sync.test
index 61ba6714095..ac5511e28a3 100644
--- a/mysql-test/suite/rpl/t/rpl_semi_sync.test
+++ b/mysql-test/suite/rpl/t/rpl_semi_sync.test
@@ -67,7 +67,7 @@ if ($value == No such row)
{
set sql_log_bin=0;
eval INSTALL PLUGIN rpl_semi_sync_master SONAME '$SEMISYNC_MASTER_SO';
- set global rpl_semi_sync_master_timeout= 5000; /* 5s */
+ set global rpl_semi_sync_master_timeout= 60000; /* 60s */
set sql_log_bin=1;
}
enable_query_log;
@@ -177,7 +177,7 @@ let $_connections_semisync_slave= query_get_value(SHOW STATUS LIKE 'Threads_conn
replace_result $_connections_normal_slave CONNECTIONS_NORMAL_SLAVE $_connections_semisync_slave CONNECTIONS_SEMISYNC_SLAVE;
eval select $_connections_semisync_slave - $_connections_normal_slave as 'Should be 0';
-let $i=300;
+let $i=10;
echo [ insert records to table ];
disable_query_log;
while ($i)
@@ -242,6 +242,7 @@ source include/stop_slave.inc;
connection master;
echo [ on master ];
+set global rpl_semi_sync_master_timeout= 5000;
# The first semi-sync check should be on because after slave stop,
# there are no transactions on the master.
@@ -270,7 +271,7 @@ show status like 'Rpl_semi_sync_master_yes_tx';
# Semi-sync status on master is now OFF, so all these transactions
# will be replicated asynchronously.
-let $i=300;
+let $i=10;
disable_query_log;
while ($i)
{
@@ -475,14 +476,14 @@ if ($_tid)
# Do not binlog the following statement because it will generate
# different events for ROW and STATEMENT format
set sql_log_bin=0;
-grant replication slave on *.* to rpl@127.0.0.1 identified by 'rpl';
+grant replication slave on *.* to rpl@127.0.0.1 identified by 'rpl_password';
flush privileges;
set sql_log_bin=1;
connection slave;
echo [ on slave ];
-grant replication slave on *.* to rpl@127.0.0.1 identified by 'rpl';
+grant replication slave on *.* to rpl@127.0.0.1 identified by 'rpl_password';
flush privileges;
-change master to master_user='rpl',master_password='rpl';
+change master to master_user='rpl',master_password='rpl_password';
source include/start_slave.inc;
show status like 'Rpl_semi_sync_slave_status';
connection master;
diff --git a/mysql-test/suite/sphinx/sphinx.result b/mysql-test/suite/sphinx/sphinx.result
index a671028bbe2..82c76335e0b 100644
--- a/mysql-test/suite/sphinx/sphinx.result
+++ b/mysql-test/suite/sphinx/sphinx.result
@@ -48,15 +48,12 @@ SET optimizer_switch=@save_optimizer_switch;
drop table ts;
show status like "sphinx_error%";
Variable_name Value
-sphinx_error_commits 0
-sphinx_error_group_commits 0
-sphinx_error_snapshot_file
-sphinx_error_snapshot_position 0
+Sphinx_error OFF
show status like "sphinx_total%";
Variable_name Value
-sphinx_total 2
-sphinx_total_found 2
+Sphinx_total 2
+Sphinx_total_found 2
show status like "sphinx_word%";
Variable_name Value
-sphinx_word_count 0
-sphinx_words
+Sphinx_word_count 0
+Sphinx_words
diff --git a/mysql-test/suite/storage_engine/misc.result b/mysql-test/suite/storage_engine/misc.result
index 591f172d796..b79c78172ed 100644
--- a/mysql-test/suite/storage_engine/misc.result
+++ b/mysql-test/suite/storage_engine/misc.result
@@ -28,6 +28,9 @@ DROP EVENT ev1;
SELECT TABLE_NAME, COLUMN_NAME, REFERENCED_TABLE_NAME, REFERENCED_COLUMN_NAME
FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE ORDER BY TABLE_NAME;
TABLE_NAME COLUMN_NAME REFERENCED_TABLE_NAME REFERENCED_COLUMN_NAME
+column_stats column_name NULL NULL
+column_stats db_name NULL NULL
+column_stats table_name NULL NULL
columns_priv Column_name NULL NULL
columns_priv Db NULL NULL
columns_priv Host NULL NULL
@@ -49,6 +52,10 @@ help_topic help_topic_id NULL NULL
help_topic name NULL NULL
host Db NULL NULL
host Host NULL NULL
+index_stats db_name NULL NULL
+index_stats index_name NULL NULL
+index_stats prefix_arity NULL NULL
+index_stats table_name NULL NULL
ndb_binlog_index epoch NULL NULL
plugin name NULL NULL
proc db NULL NULL
@@ -64,6 +71,8 @@ proxies_priv Proxied_host NULL NULL
proxies_priv Proxied_user NULL NULL
proxies_priv User NULL NULL
servers Server_name NULL NULL
+table_stats db_name NULL NULL
+table_stats table_name NULL NULL
tables_priv Db NULL NULL
tables_priv Host NULL NULL
tables_priv Table_name NULL NULL
diff --git a/mysql-test/suite/sys_vars/r/innodb_change_buffering_debug_basic.result b/mysql-test/suite/sys_vars/r/innodb_change_buffering_debug_basic.result
index 2b74f891050..fc0078581fb 100644
--- a/mysql-test/suite/sys_vars/r/innodb_change_buffering_debug_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_change_buffering_debug_basic.result
@@ -55,9 +55,6 @@ Warnings:
Warning 1292 Truncated incorrect innodb_change_buffering_debug value: '-2'
set global innodb_change_buffering_debug=1e1;
ERROR 42000: Incorrect argument type to variable 'innodb_change_buffering_debug'
-set global innodb_change_buffering_debug=2;
-Warnings:
-Warning 1292 Truncated incorrect innodb_change_buffering_debug value: '2'
SET @@global.innodb_change_buffering_debug = @start_global_value;
SELECT @@global.innodb_change_buffering_debug;
@@global.innodb_change_buffering_debug
diff --git a/mysql-test/suite/sys_vars/r/innodb_changed_pages_limit_basic.result b/mysql-test/suite/sys_vars/r/innodb_changed_pages_limit_basic.result
index e69de29bb2d..d9d067c2cf9 100644
--- a/mysql-test/suite/sys_vars/r/innodb_changed_pages_limit_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_changed_pages_limit_basic.result
@@ -0,0 +1 @@
+XtraDB extension
diff --git a/mysql-test/suite/sys_vars/r/innodb_locking_fake_changes_basic.result b/mysql-test/suite/sys_vars/r/innodb_locking_fake_changes_basic.result
new file mode 100644
index 00000000000..d9d067c2cf9
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_locking_fake_changes_basic.result
@@ -0,0 +1 @@
+XtraDB extension
diff --git a/mysql-test/suite/sys_vars/r/innodb_max_bitmap_file_size_basic.result b/mysql-test/suite/sys_vars/r/innodb_max_bitmap_file_size_basic.result
new file mode 100644
index 00000000000..d9d067c2cf9
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_max_bitmap_file_size_basic.result
@@ -0,0 +1 @@
+XtraDB extension
diff --git a/mysql-test/suite/sys_vars/r/pseudo_thread_id_basic.result b/mysql-test/suite/sys_vars/r/pseudo_thread_id_basic.result
index ee6169a9e35..4192f6b2444 100644
--- a/mysql-test/suite/sys_vars/r/pseudo_thread_id_basic.result
+++ b/mysql-test/suite/sys_vars/r/pseudo_thread_id_basic.result
@@ -1,8 +1,5 @@
select @@global.pseudo_thread_id;
ERROR HY000: Variable 'pseudo_thread_id' is a SESSION variable
-select @@session.pseudo_thread_id between 1 and 10000;
-@@session.pseudo_thread_id between 1 and 10000
-1
should be empty
show global variables like 'pseudo_thread_id';
Variable_name Value
diff --git a/mysql-test/suite/sys_vars/t/innodb_change_buffering_debug_basic.test b/mysql-test/suite/sys_vars/t/innodb_change_buffering_debug_basic.test
index ec1065a538e..893d1cb42e3 100644
--- a/mysql-test/suite/sys_vars/t/innodb_change_buffering_debug_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_change_buffering_debug_basic.test
@@ -42,7 +42,9 @@ set global innodb_change_buffering_debug='foo';
set global innodb_change_buffering_debug=-2;
--error ER_WRONG_TYPE_FOR_VAR
set global innodb_change_buffering_debug=1e1;
-set global innodb_change_buffering_debug=2;
+# The value 2 is supposed to kill the server if there are unmerged changes.
+# Do not try to set the value to 2 or anything that can be clamped to 2.
+#set global innodb_change_buffering_debug=2;
#
# Cleanup
diff --git a/mysql-test/suite/sys_vars/t/innodb_changed_pages_limit_basic.test b/mysql-test/suite/sys_vars/t/innodb_changed_pages_limit_basic.test
index e69de29bb2d..00aa476e8d2 100644
--- a/mysql-test/suite/sys_vars/t/innodb_changed_pages_limit_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_changed_pages_limit_basic.test
@@ -0,0 +1 @@
+--echo XtraDB extension
diff --git a/mysql-test/suite/sys_vars/t/innodb_locking_fake_changes_basic.test b/mysql-test/suite/sys_vars/t/innodb_locking_fake_changes_basic.test
new file mode 100644
index 00000000000..00aa476e8d2
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_locking_fake_changes_basic.test
@@ -0,0 +1 @@
+--echo XtraDB extension
diff --git a/mysql-test/suite/sys_vars/t/innodb_max_bitmap_file_size_basic.test b/mysql-test/suite/sys_vars/t/innodb_max_bitmap_file_size_basic.test
new file mode 100644
index 00000000000..00aa476e8d2
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_max_bitmap_file_size_basic.test
@@ -0,0 +1 @@
+--echo XtraDB extension
diff --git a/mysql-test/suite/sys_vars/t/pseudo_thread_id_basic.test b/mysql-test/suite/sys_vars/t/pseudo_thread_id_basic.test
index fef3e906869..aaf87912213 100644
--- a/mysql-test/suite/sys_vars/t/pseudo_thread_id_basic.test
+++ b/mysql-test/suite/sys_vars/t/pseudo_thread_id_basic.test
@@ -9,9 +9,6 @@
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
select @@global.pseudo_thread_id;
-# Check the variable has a valid numeric value (assumed to be less then 10000)
-select @@session.pseudo_thread_id between 1 and 10000;
-
--echo should be empty
show global variables like 'pseudo_thread_id';
diff --git a/mysql-test/suite/vcol/r/vcol_misc.result b/mysql-test/suite/vcol/r/vcol_misc.result
index 17b38b7d7af..14467b2d630 100644
--- a/mysql-test/suite/vcol/r/vcol_misc.result
+++ b/mysql-test/suite/vcol/r/vcol_misc.result
@@ -182,6 +182,17 @@ a b c
2 3 y
0 1 y,n
drop table t1,t2;
+CREATE TABLE t1 (
+ts TIMESTAMP,
+tsv TIMESTAMP AS (ADDDATE(ts, INTERVAL 1 DAY)) VIRTUAL
+) ENGINE=MyISAM;
+INSERT INTO t1 (tsv) VALUES (DEFAULT);
+INSERT DELAYED INTO t1 (tsv) VALUES (DEFAULT);
+FLUSH TABLES;
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+2
+DROP TABLE t1;
create table t1 (a int, b int);
insert into t1 values (3, 30), (4, 20), (1, 20);
create table t2 (c int, d int, v int as (d+1), index idx(c));
diff --git a/mysql-test/suite/vcol/t/vcol_misc.test b/mysql-test/suite/vcol/t/vcol_misc.test
index 01404046cde..3c51ee4b685 100644
--- a/mysql-test/suite/vcol/t/vcol_misc.test
+++ b/mysql-test/suite/vcol/t/vcol_misc.test
@@ -179,6 +179,25 @@ select * from t2;
drop table t1,t2;
#
+# Bug mdev-3938: INSERT DELAYED for a table with virtual columns
+#
+
+CREATE TABLE t1 (
+ ts TIMESTAMP,
+ tsv TIMESTAMP AS (ADDDATE(ts, INTERVAL 1 DAY)) VIRTUAL
+) ENGINE=MyISAM;
+
+INSERT INTO t1 (tsv) VALUES (DEFAULT);
+
+INSERT DELAYED INTO t1 (tsv) VALUES (DEFAULT);
+
+FLUSH TABLES;
+
+SELECT COUNT(*) FROM t1;
+
+DROP TABLE t1;
+
+#
# SELECT that uses a virtual column and executed with BKA
#
diff --git a/mysql-test/t/alias.test b/mysql-test/t/alias.test
index 0e2d57598e2..c02ebe2f5ff 100644
--- a/mysql-test/t/alias.test
+++ b/mysql-test/t/alias.test
@@ -215,3 +215,14 @@ drop table t4;
drop table t1,t2,t3;
# End of 5.2 tests
+
+#
+# MDEV-3908 crash in multi-table delete and mdl
+#
+connect (c1,localhost,root,,);
+connection c1;
+# this used to crash on disconnect
+--error ER_PARSE_ERROR
+DELETE ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZROM t1 WHERE 1=1;
+connection default;
+disconnect c1;
diff --git a/mysql-test/t/cassandra.test b/mysql-test/t/cassandra.test
new file mode 100644
index 00000000000..2b92956d974
--- /dev/null
+++ b/mysql-test/t/cassandra.test
@@ -0,0 +1,719 @@
+#
+# Tests for cassandra storage engine
+#
+--source include/have_cassandra.inc
+
+--disable_warnings
+drop table if exists t0, t1;
+--enable_warnings
+
+# Test various errors on table creation.
+--error ER_REQUIRES_PRIMARY_KEY
+create table t1 (a int) engine=cassandra
+ thrift_host='localhost' keyspace='foo' column_family='colfam';
+
+--error ER_CONNECT_TO_FOREIGN_DATA_SOURCE
+create table t1 (a int primary key, b int) engine=cassandra
+ thrift_host='localhost' keyspace='foo' column_family='colfam';
+
+--error ER_CONNECT_TO_FOREIGN_DATA_SOURCE
+create table t1 (rowkey char(10) primary key, column1 char(10)) engine=cassandra
+ thrift_host='127.0.0.2' keyspace='foo' column_family='colfam';
+
+--error ER_CONNECT_TO_FOREIGN_DATA_SOURCE
+create table t1 (rowkey char(10) primary key, column1 char(10)) engine=cassandra
+ thrift_host='localhost' keyspace='no_such_keyspace' column_family='colfam';
+
+# No column family specified
+--error ER_CONNECT_TO_FOREIGN_DATA_SOURCE
+create table t1 (rowkey char(10) primary key, column1 char(10)) engine=cassandra
+ thrift_host='localhost' keyspace='no_such_keyspace';
+
+############################################################################
+## Cassandra initialization
+############################################################################
+
+# Step 1: remove the keyspace that could be left over from the previous test
+--remove_files_wildcard $MYSQLTEST_VARDIR cassandra_test_cleanup.cql
+--write_file $MYSQLTEST_VARDIR/cassandra_test_cleanup.cql
+drop keyspace mariadbtest2;
+EOF
+--error 0,1,2
+--system cqlsh -3 -f $MYSQLTEST_VARDIR/cassandra_test_cleanup.cql
+
+# Step 2: create new keyspace and test column families
+--remove_files_wildcard $MYSQLTEST_VARDIR cassandra_test_init.cql
+--write_file $MYSQLTEST_VARDIR/cassandra_test_init.cql
+
+CREATE KEYSPACE mariadbtest2
+ WITH strategy_class = 'org.apache.cassandra.locator.SimpleStrategy'
+ AND strategy_options:replication_factor='1';
+
+USE mariadbtest2;
+create columnfamily cf1 ( pk varchar primary key, data1 varchar, data2 bigint);
+
+create columnfamily cf2 (rowkey bigint primary key, a bigint);
+
+create columnfamily cf3 (rowkey bigint primary key, intcol int);
+
+create columnfamily cf4 (rowkey bigint primary key, datecol timestamp);
+
+create columnfamily cf5 (rowkey bigint primary key, uuidcol uuid);
+
+create columnfamily cf6 (rowkey uuid primary key, col1 int);
+
+create columnfamily cf7 (rowkey int primary key, boolcol boolean);
+
+create columnfamily cf8 (rowkey varchar primary key, countercol counter);
+update cf8 set countercol=countercol+1 where rowkey='cnt1';
+update cf8 set countercol=countercol+100 where rowkey='cnt2';
+
+create columnfamily cf9 (rowkey varchar primary key, varint_col varint);
+insert into cf9 (rowkey, varint_col) values ('val-01', 1);
+insert into cf9 (rowkey, varint_col) values ('val-0x123456', 1193046);
+insert into cf9 (rowkey, varint_col) values ('val-0x12345678', 305419896);
+
+create columnfamily cf11 (rowkey varchar primary key, decimal_col decimal);
+insert into cf11 (rowkey, decimal_col) values ('val_0.5', 0.5);
+insert into cf11 (rowkey, decimal_col) values ('val_1.5', 1.5);
+insert into cf11 (rowkey, decimal_col) values ('val_1234', 1234);
+
+create columnfamily cf12 (rowkey varchar primary key, decimal_col decimal);
+
+EOF
+--error 0,1,2
+--system cqlsh -3 -f $MYSQLTEST_VARDIR/cassandra_test_init.cql
+
+
+# Step 3: Cassandra's CQL doesn't allow certain kinds of queries. Run them in
+# CLI
+--remove_files_wildcard $MYSQLTEST_VARDIR cassandra_test_init.cli
+--write_file $MYSQLTEST_VARDIR/cassandra_test_init.cli
+use mariadbtest2;
+CREATE COLUMN FAMILY cf10
+ WITH comparator = UTF8Type
+ AND key_validation_class=UTF8Type
+ AND default_validation_class = UTF8Type;
+
+CREATE COLUMN FAMILY cfd1
+ WITH comparator = UTF8Type
+ AND key_validation_class=UTF8Type
+ AND default_validation_class = UTF8Type;
+SET cfd1['1']['very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_long_name']='1';
+
+CREATE COLUMN FAMILY cfd2
+ WITH comparator = UTF8Type
+ AND key_validation_class=Int32Type
+ AND default_validation_class = UTF8Type;
+
+EOF
+
+--error 0,1,2
+--system cassandra-cli -f $MYSQLTEST_VARDIR/cassandra_test_init.cli
+
+############################################################################
+## Cassandra initialization ends
+############################################################################
+
+--echo # Now, create a table for real and insert data
+create table t1 (pk varchar(36) primary key, data1 varchar(60), data2 bigint) engine=cassandra
+ thrift_host='localhost' keyspace='mariadbtest2' column_family='cf1';
+
+--echo # Just in case there were left-overs from previous:
+delete from t1;
+select * from t1;
+
+insert into t1 values ('rowkey10', 'data1-value', 123456);
+insert into t1 values ('rowkey11', 'data1-value2', 34543);
+insert into t1 values ('rowkey12', 'data1-value3', 454);
+select * from t1;
+
+explain
+select * from t1 where pk='rowkey11';
+select * from t1 where pk='rowkey11';
+
+# Deletion functions weirdly: it sets all columns to NULL
+# but when If I do this in cassandra-cli:
+#
+# del cf1[ascii('rowkey10')]
+#
+# Subsequent 'list cf1' command also gives
+#
+# RowKey: rowkey10
+#
+# without any columns.
+#
+# CQL seems to simply ignore all "incomplete" records.
+
+delete from t1 where pk='rowkey11';
+select * from t1;
+
+delete from t1;
+select * from t1;
+
+--echo #
+--echo # A query with filesort (check that table_flags() & HA_REC_NOT_IN_SEQ,
+--echo # also check ::rnd_pos()
+--echo #
+insert into t1 values ('rowkey10', 'data1-value', 123456);
+insert into t1 values ('rowkey11', 'data1-value2', 34543);
+insert into t1 values ('rowkey12', 'data1-value3', 454);
+select * from t1 order by data2;
+
+delete from t1;
+drop table t1;
+
+--echo #
+--echo # MDEV-476: Cassandra: Server crashes in calculate_key_len on DELETE with ORDER BY
+--echo #
+CREATE TABLE t1 (rowkey BIGINT PRIMARY KEY, a BIGINT) ENGINE=CASSANDRA
+ thrift_host='localhost' keyspace='mariadbtest2' column_family = 'cf2';
+
+INSERT INTO t1 VALUES (1,1),(2,2);
+DELETE FROM t1 ORDER BY a LIMIT 1;
+
+DROP TABLE t1;
+
+--echo #
+--echo # Batched INSERT
+--echo #
+show variables like 'cassandra_insert_batch_size';
+show status like 'cassandra_row_insert%';
+CREATE TABLE t1 (rowkey BIGINT PRIMARY KEY, a BIGINT) ENGINE=CASSANDRA
+ thrift_host='localhost' keyspace='mariadbtest2' column_family = 'cf2';
+
+delete from t1;
+INSERT INTO t1 VALUES (1,1),(2,2);
+DELETE FROM t1 ORDER BY a LIMIT 1;
+
+DROP TABLE t1;
+show status like 'cassandra_row_insert%';
+
+--echo # FLUSH STATUS doesn't work for our variables, just like with InnoDB.
+flush status;
+show status like 'cassandra_row_insert%';
+
+--echo #
+--echo # Batched Key Access
+--echo #
+
+--echo # Control variable (we are not yet able to make use of MRR's buffer)
+show variables like 'cassandra_multi%';
+
+--echo # MRR-related status variables:
+show status like 'cassandra_multi%';
+
+CREATE TABLE t1 (rowkey BIGINT PRIMARY KEY, a BIGINT) ENGINE=CASSANDRA
+ thrift_host='localhost' keyspace='mariadbtest2' column_family = 'cf2';
+delete from t1;
+INSERT INTO t1 VALUES (0,0),(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9);
+
+set @tmp_jcl=@@join_cache_level;
+set join_cache_level=8;
+explain select * from t1 A, t1 B where B.rowkey=A.a;
+
+select * from t1 A, t1 B where B.rowkey=A.a;
+show status like 'cassandra_multi%';
+
+# The following INSERTs are really UPDATEs
+insert into t1 values(1, 8);
+insert into t1 values(3, 8);
+insert into t1 values(5, 8);
+insert into t1 values(7, 8);
+
+select * from t1 A, t1 B where B.rowkey=A.a;
+show status like 'cassandra_multi%';
+
+delete from t1;
+drop table t1;
+
+--echo #
+--echo # MDEV-480: TRUNCATE TABLE on a Cassandra table does not remove rows
+--echo #
+CREATE TABLE t1 (rowkey BIGINT PRIMARY KEY, a BIGINT) ENGINE=CASSANDRA
+ thrift_host='localhost' keyspace='mariadbtest2' column_family = 'cf2';
+INSERT INTO t1 VALUES (0,0),(1,1),(2,2);
+truncate table t1;
+select * from t1;
+drop table t1;
+
+--echo #
+--echo # MDEV-494, part #1: phantom row for big full-scan selects
+--echo #
+create table t0 (a int);
+insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+
+CREATE TABLE t1 (rowkey BIGINT PRIMARY KEY, a BIGINT) ENGINE=CASSANDRA
+ thrift_host='localhost' keyspace='mariadbtest2' column_family = 'cf2';
+
+insert into t1 select A.a + 10 * B.a + 100*C.a, 12345 from t0 A, t0 B, t0 C;
+
+select count(*) from t1;
+select count(*) from t1 where a=12345;
+
+delete from t1;
+drop table t1;
+drop table t0;
+
+--echo # 32-bit INT type support
+CREATE TABLE t1 (rowkey BIGINT PRIMARY KEY, intcol INT) ENGINE=CASSANDRA
+ thrift_host='localhost' keyspace='mariadbtest2' column_family = 'cf3';
+insert into t1 values (10,10);
+insert into t1 values (12,12);
+delete from t1;
+drop table t1;
+
+--echo #
+--echo # Try accessing column family w/o explicitly defined columns
+--echo #
+--error ER_INTERNAL_ERROR
+CREATE TABLE t1 (my_primary_key varchar(10) PRIMARY KEY) ENGINE=CASSANDRA
+ thrift_host='localhost' keyspace='mariadbtest2' column_family = 'cf10';
+
+CREATE TABLE t1 (rowkey varchar(10) PRIMARY KEY) ENGINE=CASSANDRA
+ thrift_host='localhost' keyspace='mariadbtest2' column_family = 'cf10';
+
+DROP TABLE t1;
+
+--echo #
+--echo # Timestamp datatype support
+--echo #
+CREATE TABLE t2 (rowkey bigint PRIMARY KEY, datecol timestamp) ENGINE=CASSANDRA
+ thrift_host='localhost' keyspace='mariadbtest2' column_family = 'cf4';
+
+delete from t2;
+insert into t2 values (1, '2012-08-29 01:23:45');
+select * from t2;
+delete from t2;
+
+--echo # MDEV-498: Cassandra: Inserting a timestamp does not work on a 32-bit system
+INSERT INTO t2 VALUES (10,'2012-12-12 12:12:12');
+SELECT * FROM t2;
+delete from t2;
+
+--echo #
+--echo # (no MDEV#) Check that insert counters work correctly
+--echo #
+create table t0 (a int);
+insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+let $start_inserts=`select variable_value from information_schema.SESSION_STATUS
+ where variable_name ='Cassandra_row_inserts'`;
+let $start_insert_batches=`select variable_value from information_schema.SESSION_STATUS
+ where variable_name ='Cassandra_row_insert_batches'`;
+
+set cassandra_insert_batch_size=10;
+insert into t2 select A.a+10*B.a, now() from t0 A, t0 B;
+
+--disable_query_log
+eval select
+ (select variable_value - $start_inserts from information_schema.SESSION_STATUS
+ where variable_name ='Cassandra_row_inserts')
+ AS 'inserts',
+ (select variable_value - $start_insert_batches from information_schema.SESSION_STATUS
+ where variable_name ='Cassandra_row_insert_batches')
+ AS 'insert_batches';
+--enable_query_log
+
+let $start_inserts=`select variable_value from information_schema.SESSION_STATUS
+ where variable_name ='Cassandra_row_inserts'`;
+let $start_insert_batches=`select variable_value from information_schema.SESSION_STATUS
+ where variable_name ='Cassandra_row_insert_batches'`;
+
+set cassandra_insert_batch_size=1;
+insert into t2 select A.a+10*B.a+100, now() from t0 A, t0 B;
+
+--disable_query_log
+eval select
+ (select variable_value - $start_inserts from information_schema.SESSION_STATUS
+ where variable_name ='Cassandra_row_inserts')
+ AS 'inserts',
+ (select variable_value - $start_insert_batches from information_schema.SESSION_STATUS
+ where variable_name ='Cassandra_row_insert_batches')
+ AS 'insert_batches';
+--enable_query_log
+
+delete from t2;
+drop table t2;
+drop table t0;
+
+--echo #
+--echo # UUID datatype support
+--echo #
+#create columnfamily cf5 (rowkey bigint primary key, uuidcol uuid);
+CREATE TABLE t2 (rowkey bigint PRIMARY KEY, uuidcol char(36)) ENGINE=CASSANDRA
+ thrift_host='localhost' keyspace='mariadbtest2' column_family = 'cf5';
+delete from t2;
+
+insert into t2 values(1,'9b5658dc-f32f-11e1-94cd-f46d046e9f09');
+
+--error ER_WARN_DATA_OUT_OF_RANGE
+insert into t2 values(2,'not-an-uuid');
+
+--error ER_WARN_DATA_OUT_OF_RANGE
+insert into t2 values(3,'9b5658dc-f32f-11e1=94cd-f46d046e9f09');
+
+--error ER_WARN_DATA_OUT_OF_RANGE
+insert into t2 values(4,'9b5658dc-fzzf-11e1-94cd-f46d046e9f09');
+
+--error ER_WARN_DATA_OUT_OF_RANGE
+insert into t2 values
+ (5,'9b5658dc-f11f-11e1-94cd-f46d046e9f09'),
+ (6,'9b5658dc-f11f011e1-94cd-f46d046e9f09');
+
+select * from t2;
+
+delete from t2;
+drop table t2;
+
+# create columnfamily cf6 (rowkey uuid primary key, col1 int);
+CREATE TABLE t2 (rowkey char(36) PRIMARY KEY, col1 int) ENGINE=CASSANDRA
+ thrift_host='localhost' keyspace='mariadbtest2' column_family = 'cf6';
+delete from t2;
+
+insert into t2 values('9b5658dc-f32f-11e1-94cd-f46d046e9f09', 1234);
+
+--error ER_WARN_DATA_OUT_OF_RANGE
+insert into t2 values('not-an-uuid', 563);
+
+select * from t2;
+delete from t2;
+drop table t2;
+
+
+--echo #
+--echo # boolean datatype support
+--echo #
+# create columnfamily cf7 (rowkey int primary key, boolcol boolean);
+CREATE TABLE t2 (rowkey int PRIMARY KEY, boolcol bool) ENGINE=CASSANDRA
+ thrift_host='localhost' keyspace='mariadbtest2' column_family = 'cf7';
+insert into t2 values (0, 0);
+insert into t2 values (1, 1);
+select * from t2;
+delete from t2;
+drop table t2;
+
+
+--echo #
+--echo # Counter datatype support (read-only)
+--echo #
+# create columnfamily cf8 (rowkey int primary key, countercol counter);
+CREATE TABLE t2 (rowkey varchar(32) PRIMARY KEY, countercol bigint) ENGINE=CASSANDRA
+ thrift_host='localhost' keyspace='mariadbtest2' column_family = 'cf8';
+select * from t2;
+drop table t2;
+
+--echo #
+--echo # Check that @@cassandra_default_thrift_host works
+--echo #
+show variables like 'cassandra_default_thrift_host';
+set @tmp=@@cassandra_default_thrift_host;
+--error ER_GLOBAL_VARIABLE
+set cassandra_default_thrift_host='localhost';
+set global cassandra_default_thrift_host='localhost';
+
+--echo # Try creating a table without specifying thrift_host:
+CREATE TABLE t2 (rowkey varchar(32) PRIMARY KEY, countercol bigint) ENGINE=CASSANDRA
+ keyspace='mariadbtest2' column_family = 'cf8';
+select * from t2;
+drop table t2;
+
+set global cassandra_default_thrift_host=@tmp;
+
+--echo #
+--echo # Consistency settings
+--echo #
+show variables like 'cassandra_%consistency';
+set @tmp=@@cassandra_write_consistency;
+
+--echo # Unfortunately, there is no easy way to check if setting have the effect..
+set cassandra_write_consistency='ONE';
+set cassandra_write_consistency='QUORUM';
+set cassandra_write_consistency='LOCAL_QUORUM';
+set cassandra_write_consistency='EACH_QUORUM';
+set cassandra_write_consistency='ALL';
+set cassandra_write_consistency='ANY';
+set cassandra_write_consistency='TWO';
+set cassandra_write_consistency='THREE';
+
+set cassandra_write_consistency=@tmp;
+
+--echo #
+--echo # varint datatype support
+--echo #
+# create columnfamily cf9 (rowkey varchar primary key, varint_col varint);
+CREATE TABLE t2 (rowkey varchar(32) PRIMARY KEY, varint_col varbinary(32)) ENGINE=CASSANDRA
+ thrift_host='localhost' keyspace='mariadbtest2' column_family = 'cf9';
+--sorted_result
+select rowkey, hex(varint_col) from t2;
+drop table t2;
+
+--echo # now, let's check what happens when MariaDB's column is not wide enough:
+CREATE TABLE t2 (rowkey varchar(32) PRIMARY KEY, varint_col varbinary(2)) ENGINE=CASSANDRA
+ thrift_host='localhost' keyspace='mariadbtest2' column_family = 'cf9';
+--sorted_result
+--error ER_INTERNAL_ERROR
+select rowkey, hex(varint_col) from t2;
+drop table t2;
+
+--echo #
+--echo # Decimal datatype support
+--echo #
+CREATE TABLE t2 (rowkey varchar(32) PRIMARY KEY, decimal_col varbinary(32)) ENGINE=CASSANDRA
+ thrift_host='localhost' keyspace='mariadbtest2' column_family = 'cf11';
+select rowkey, hex(decimal_col) from t2;
+drop table t2;
+
+--echo #
+--echo # Mapping TIMESTAMP -> int64
+--echo #
+set @save_tz= @@time_zone;
+set time_zone='UTC';
+CREATE TABLE t2 (rowkey bigint PRIMARY KEY, datecol timestamp) ENGINE=CASSANDRA
+ thrift_host='localhost' keyspace='mariadbtest2' column_family = 'cf4';
+insert into t2 values (1, '2012-08-29 01:23:45');
+INSERT INTO t2 VALUES (10,'2012-08-29 01:23:46');
+drop table t2;
+
+CREATE TABLE t2 (rowkey bigint PRIMARY KEY, datecol bigint) ENGINE=CASSANDRA
+ thrift_host='localhost' keyspace='mariadbtest2' column_family = 'cf4';
+select * from t2;
+delete from t2;
+drop table t2;
+set time_zone=@save_tz;
+
+--echo #
+--echo # Check whether changing parameters with ALTER TABLE works.
+--echo #
+CREATE TABLE t2 (rowkey varchar(32) PRIMARY KEY, decimal_col varbinary(32)) ENGINE=CASSANDRA
+ thrift_host='localhost' keyspace='mariadbtest2' column_family = 'cf11';
+
+#--error ER_INTERNAL_ERROR
+#alter table t2 column_family='cf9';
+
+drop table t2;
+
+CREATE TABLE t2 (rowkey varchar(32) PRIMARY KEY, decimal_col varbinary(32)) ENGINE=CASSANDRA
+ thrift_host='localhost' keyspace='mariadbtest2' column_family = 'cf11';
+
+let $c1= `select variable_value from information_schema.global_status
+ where variable_name like 'cassandra_row_inserts'`;
+alter table t2 column_family='cf12';
+let $c2= `select variable_value from information_schema.global_status
+ where variable_name like 'cassandra_row_inserts'`;
+
+--disable_query_log
+eval select ($c2 - $c1) as 'Writes made during ALTER TABLE';
+--enable_query_log
+
+drop table t2;
+
+--echo #
+--echo # UPDATE command support
+--echo #
+create table t1 (pk varchar(36) primary key, data1 varchar(60), data2 bigint) engine=cassandra
+ thrift_host='localhost' keyspace='mariadbtest2' column_family='cf1';
+
+insert into t1 values ('rowkey10', 'data1-value', 123456);
+insert into t1 values ('rowkey11', 'data1-value2', 34543);
+insert into t1 values ('rowkey12', 'data1-value3', 454);
+select * from t1;
+
+update t1 set data1='updated-1' where pk='rowkey11';
+select * from t1;
+update t1 set pk='new-rowkey12' where pk='rowkey12';
+select * from t1;
+
+delete from t1;
+drop table t1;
+
+--echo #
+--echo # Dynamic columns support
+--echo #
+CREATE TABLE t2 (rowkey bigint PRIMARY KEY, uuidcol blob DYNAMIC_COLUMN_STORAGE=1) ENGINE=CASSANDRA thrift_host='localhost' keyspace='mariadbtest2' column_family = 'cf5';
+drop table t2;
+
+--echo #error: dynamic column is not a blob
+--error ER_WRONG_FIELD_SPEC
+CREATE TABLE t2 (rowkey bigint PRIMARY KEY, uuidcol char(36) DYNAMIC_COLUMN_STORAGE=1) ENGINE=CASSANDRA thrift_host='localhost' keyspace='mariadbtest2' column_family = 'cf5';
+
+--echo #error: double dynamic column
+--error ER_WRONG_FIELD_SPEC
+CREATE TABLE t2 (rowkey bigint PRIMARY KEY, uuidcol blob DYNAMIC_COLUMN_STORAGE=1, textcol blob DYNAMIC_COLUMN_STORAGE=1) ENGINE=CASSANDRA thrift_host='localhost' keyspace='mariadbtest2' column_family = 'cf5';
+
+--echo #
+--echo # Dynamic column read
+--echo #
+#prepare data
+CREATE TABLE t2 (rowkey bigint PRIMARY KEY, uuidcol char(36)) ENGINE=CASSANDRA
+ thrift_host='localhost' keyspace='mariadbtest2' column_family = 'cf5';
+delete from t2;
+insert into t2 values(1,'9b5658dc-f32f-11e1-94cd-f46d046e9f09');
+insert into t2 values(2,'9b5658dc-f32f-11e1-94cd-f46d046e9f0a');
+drop table t2;
+
+#test dynamic column read
+CREATE TABLE t2 (rowkey bigint PRIMARY KEY, dyn blob DYNAMIC_COLUMN_STORAGE=yes) ENGINE=CASSANDRA thrift_host='localhost' keyspace='mariadbtest2' column_family = 'cf5';
+select rowkey, column_list(dyn), column_get(dyn, 'uuidcol' as char) from t2;
+drop table t2;
+
+#cleanup data
+CREATE TABLE t2 (rowkey bigint PRIMARY KEY, uuidcol char(36)) ENGINE=CASSANDRA
+ thrift_host='localhost' keyspace='mariadbtest2' column_family = 'cf5';
+delete from t2;
+drop table t2;
+
+--echo #
+--echo # Dynamic column insert
+--echo #
+CREATE TABLE t2 (rowkey bigint PRIMARY KEY, dyn blob DYNAMIC_COLUMN_STORAGE=yes) ENGINE=CASSANDRA thrift_host='localhost' keyspace='mariadbtest2' column_family = 'cf5';
+insert into t2 values (1, column_create("dyn1", 1, "dyn2", "two"));
+select rowkey, column_json(dyn) from t2;
+delete from t2;
+drop table t2;
+--echo # bigint
+CREATE TABLE t1 (rowkey bigint PRIMARY KEY, dyn blob DYNAMIC_COLUMN_STORAGE=yes) ENGINE=CASSANDRA thrift_host='localhost' keyspace='mariadbtest2' column_family = 'cf2';
+insert into t1 values (1, column_create("dyn1", 1, "dyn2", "two", 'a', 254324));
+insert into t1 values (2, column_create("dyn1", 1, "dyn2", "two", 'a', 2543));
+select rowkey, column_json(dyn) from t1;
+delete from t1;
+drop table t1;
+--echo # int
+CREATE TABLE t1 (rowkey bigint PRIMARY KEY, dyn blob DYNAMIC_COLUMN_STORAGE=yes) ENGINE=CASSANDRA thrift_host='localhost' keyspace='mariadbtest2' column_family = 'cf3';
+insert into t1 values (1, column_create("dyn1", 1, "dyn2", "two", 'intcol', 254324));
+insert into t1 values (2, column_create("dyn1", 1, "dyn2", "two", 'intcol', 2543));
+select rowkey, column_json(dyn) from t1;
+delete from t1;
+drop table t1;
+--echo # timestamp
+CREATE TABLE t1 (rowkey bigint PRIMARY KEY, dyn blob DYNAMIC_COLUMN_STORAGE=yes) ENGINE=CASSANDRA thrift_host='localhost' keyspace='mariadbtest2' column_family = 'cf4';
+insert into t1 values (1, column_create("dyn1", 1, "dyn2", "two", 'datecol', 254324));
+insert into t1 values (2, column_create("dyn1", 1, "dyn2", "two", 'datecol', 2543));
+select rowkey, column_json(dyn) from t1;
+delete from t1;
+drop table t1;
+--echo # boolean
+CREATE TABLE t1 (rowkey int PRIMARY KEY, dyn blob DYNAMIC_COLUMN_STORAGE=yes) ENGINE=CASSANDRA thrift_host='localhost' keyspace='mariadbtest2' column_family = 'cf7';
+insert into t1 values (1, column_create("dyn1", 1, "dyn2", "two", 'boolcol', 254324));
+insert into t1 values (2, column_create("dyn1", 1, "dyn2", "two", 'boolcol', 0));
+select rowkey, column_json(dyn) from t1;
+select rowkey, column_json(dyn) from t1;
+update t1 set dyn=column_add(dyn, "dyn2", null, "dyn3", "3");
+select rowkey, column_json(dyn) from t1;
+update t1 set dyn=column_add(dyn, "dyn1", null) where rowkey= 1;
+select rowkey, column_json(dyn) from t1;
+update t1 set dyn=column_add(dyn, "dyn3", null, "a", "ddd");
+select rowkey, column_json(dyn) from t1;
+update t1 set dyn=column_add(dyn, "12345678901234", "ddd");
+select rowkey, column_json(dyn) from t1;
+update t1 set dyn=column_add(dyn, "12345678901234", null);
+select rowkey, column_json(dyn) from t1;
+update t1 set dyn=column_add(dyn, 'boolcol', null) where rowkey= 2;
+select rowkey, column_json(dyn) from t1;
+update t1 set rowkey= 3, dyn=column_add(dyn, "dyn1", null, 'boolcol', 0) where rowkey= 2;
+select rowkey, column_json(dyn) from t1;
+delete from t1;
+drop table t1;
+
+CREATE TABLE t1 (rowkey varchar(10) PRIMARY KEY, dyn blob DYNAMIC_COLUMN_STORAGE=yes) ENGINE=CASSANDRA thrift_host='localhost' keyspace='mariadbtest2' column_family = 'cfd1';
+--error ER_INTERNAL_ERROR
+select * from t1;
+drop table t1;
+
+# MDEV-560
+CREATE TABLE t1 (rowkey int PRIMARY KEY, dyn blob DYNAMIC_COLUMN_STORAGE=yes)
+ENGINE=CASSANDRA thrift_host='localhost' keyspace='mariadbtest2' column_family = 'cfd2';
+DELETE FROM t1;
+insert into t1 values (1, column_create("dyn", 1));
+select rowkey, column_list(dyn) from t1;
+# Cleanup
+delete from t1;
+DROP TABLE t1;
+
+# MDEV-561 (incorrect format data to dynamic column)
+CREATE TABLE t1 (rowkey int PRIMARY KEY, dyn blob DYNAMIC_COLUMN_STORAGE=yes)
+ENGINE=CASSANDRA thrift_host='localhost' keyspace='mariadbtest2' column_family = 'cfd2';
+--error ER_DYN_COL_WRONG_FORMAT
+insert into t1 values (1,'9b5658dc-f32f-11e1-94cd-f46d046e9f0a');
+delete from t1;
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-565: Server crashes in ha_cassandra::write_row on
+--echo # inserting NULL into a dynamic column
+--echo #
+CREATE TABLE t1 (rowkey int PRIMARY KEY, dyn blob DYNAMIC_COLUMN_STORAGE=yes)
+ENGINE=CASSANDRA thrift_host='localhost' keyspace='mariadbtest2' column_family = 'cfd2';
+insert into t1 values (1, NULL);
+delete from t1;
+DROP TABLE t1;
+
+--echo #
+--echo # strange side effect of Cassandra - remiving all columns of primary
+--echo # key removes all row.
+--echo #
+CREATE TABLE t1 (rowkey int PRIMARY KEY, dyn blob DYNAMIC_COLUMN_STORAGE=yes)
+ENGINE=CASSANDRA thrift_host='localhost' keyspace='mariadbtest2' column_family = 'cfd2';
+INSERT INTO t1 VALUES(2,column_create("ab","ab"));
+select rowkey, column_json(dyn) from t1;
+UPDATE t1 set dyn=NULL;
+select rowkey, column_json(dyn) from t1;
+INSERT INTO t1 VALUES(2,column_create("ab","ab"));
+select rowkey, column_json(dyn) from t1;
+UPDATE t1 set dyn="";
+select rowkey, column_json(dyn) from t1;
+delete from t1;
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-4005 #Server crashes on creating a Cassandra table
+--echo # with a mix of static and dynamic columns
+--echo #
+--disable_warnings
+DROP TABLE IF EXISTS t1, t2;
+--enable_warnings
+
+--remove_files_wildcard $MYSQLTEST_VARDIR cassandra_test_cleanup.cql
+--write_file $MYSQLTEST_VARDIR/cassandra_test_cleanup.cql
+drop keyspace bug;
+EOF
+--error 0,1,2
+--system cqlsh -3 -f $MYSQLTEST_VARDIR/cassandra_test_cleanup.cql
+
+--remove_files_wildcard $MYSQLTEST_VARDIR cassandra_test_init.cql
+--write_file $MYSQLTEST_VARDIR/cassandra_test_init.cql
+
+CREATE KEYSPACE bug
+ WITH strategy_class = 'org.apache.cassandra.locator.SimpleStrategy'
+ AND strategy_options:replication_factor='1';
+
+USE bug;
+create columnfamily cf1 ( pk int primary key, col_int int, a bigint );
+EOF
+
+--system cqlsh -3 -f $MYSQLTEST_VARDIR/cassandra_test_init.cql
+
+
+CREATE TABLE t1 (
+ pk int primary key,
+ col_int int,
+ dyncol blob DYNAMIC_COLUMN_STORAGE=yes
+) ENGINE=cassandra keyspace='bug' thrift_host = '127.0.0.1' column_family='cf1';
+
+drop table t1;
+
+############################################################################
+## Cassandra cleanup
+############################################################################
+--disable_parsing
+drop columnfamily cf1;
+drop columnfamily cf2;
+drop columnfamily cf3;
+drop columnfamily cf4;
+drop columnfamily cf5;
+drop columnfamily cf6;
+drop columnfamily cf7;
+--enable_parsing
+############################################################################
+## Cassandra cleanup ends
+############################################################################
+
diff --git a/mysql-test/t/change_user_notembedded.test b/mysql-test/t/change_user_notembedded.test
new file mode 100644
index 00000000000..bf5d1956cd5
--- /dev/null
+++ b/mysql-test/t/change_user_notembedded.test
@@ -0,0 +1,24 @@
+source include/not_embedded.inc;
+
+#
+# MDEV-3915 COM_CHANGE_USER allows fast password brute-forcing
+#
+# only three failed change_user per connection.
+# successful change_user do NOT reset the counter
+#
+connect (test,localhost,root,,);
+connection test;
+--error 1045
+change_user foo,bar;
+--error 1045
+change_user foo;
+change_user;
+--error 1045
+change_user foo,bar;
+--error 1047
+change_user foo,bar;
+--error 1047
+change_user;
+disconnect test;
+connection default;
+
diff --git a/mysql-test/t/create_delayed.test b/mysql-test/t/create_delayed.test
new file mode 100644
index 00000000000..e99886d97d1
--- /dev/null
+++ b/mysql-test/t/create_delayed.test
@@ -0,0 +1,34 @@
+#
+# Ensure that INSERT DELAYED works with CREATE TABLE on existing table
+#
+
+-- source include/big_test.inc
+
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+
+--disable_query_log
+--disable_result_log
+
+--let $run=1000
+
+--echo Starting test
+
+while ($run)
+{
+# --echo # $run attempts left...
+ CREATE TABLE t1 ( f1 INTEGER AUTO_INCREMENT, PRIMARY KEY (f1)) ENGINE=MyISAM;
+ INSERT DELAYED t1 VALUES (4);
+--error ER_TABLE_EXISTS_ERROR
+ CREATE TABLE t1 AS SELECT 1 AS f1;
+
+ REPLACE DELAYED t1 VALUES (5);
+ DROP TABLE t1;
+--dec $run
+}
+
+--enable_query_log
+--enable_result_log
+
+--echo # All done
diff --git a/mysql-test/t/ctype_ucs.test b/mysql-test/t/ctype_ucs.test
index f3557e36a58..9f5b4153bce 100644
--- a/mysql-test/t/ctype_ucs.test
+++ b/mysql-test/t/ctype_ucs.test
@@ -68,6 +68,38 @@ RPAD(_ucs2 X'0420',10,_ucs2 X'0421') r;
SHOW CREATE TABLE t1;
DROP TABLE t1;
+--echo #
+--echo # Bug #51876 : crash/memory underrun when loading data with ucs2
+--echo # and reverse() function
+--echo #
+
+--echo # Problem # 1 (original report): wrong parsing of ucs2 data
+SELECT '00' UNION SELECT '10' INTO OUTFILE 'tmpp.txt';
+CREATE TABLE t1(a INT);
+LOAD DATA INFILE 'tmpp.txt' INTO TABLE t1 CHARACTER SET ucs2
+(@b) SET a=REVERSE(@b);
+--echo # should return 2 zeroes (as the value is truncated)
+SELECT * FROM t1;
+
+DROP TABLE t1;
+let $MYSQLD_DATADIR= `select @@datadir`;
+remove_file $MYSQLD_DATADIR/test/tmpp.txt;
+
+
+--echo # Problem # 2 : if you write and read ucs2 data to a file they're lost
+SELECT '00' UNION SELECT '10' INTO OUTFILE 'tmpp2.txt' CHARACTER SET ucs2;
+CREATE TABLE t1(a INT);
+LOAD DATA INFILE 'tmpp2.txt' INTO TABLE t1 CHARACTER SET ucs2
+(@b) SET a=REVERSE(@b);
+--echo # should return 0 and 1 (10 reversed)
+SELECT * FROM t1;
+
+DROP TABLE t1;
+let $MYSQLD_DATADIR= `select @@datadir`;
+remove_file $MYSQLD_DATADIR/test/tmpp2.txt;
+
+
+
#
# BUG3946
#
diff --git a/mysql-test/t/ctype_utf16.test b/mysql-test/t/ctype_utf16.test
index 847e302e615..f42d30e1f00 100644
--- a/mysql-test/t/ctype_utf16.test
+++ b/mysql-test/t/ctype_utf16.test
@@ -777,6 +777,10 @@ SELECT 'a' AS id, REPEAT('bla bla', 100) AS body) t1
GROUP BY id
ORDER BY l DESC;
+SELECT id, CHAR_LENGTH(GROUP_CONCAT(body)) AS l
+FROM (SELECT 'a' AS id, REPEAT('foo bar', 100) AS body
+UNION ALL
+SELECT 'a' AS id, REPEAT('bla bla', 100) AS body) t1;
#
## TODO: add tests for all engines
diff --git a/mysql-test/t/ctype_utf8.test b/mysql-test/t/ctype_utf8.test
index 210589adc81..0b90f222593 100644
--- a/mysql-test/t/ctype_utf8.test
+++ b/mysql-test/t/ctype_utf8.test
@@ -1590,6 +1590,11 @@ SELECT 'a' AS id, REPEAT('bla bla', 100) AS body) t1
GROUP BY id
ORDER BY l DESC;
+SELECT id, CHAR_LENGTH(GROUP_CONCAT(body)) AS l
+FROM (SELECT 'a' AS id, REPEAT('foo bar', 100) AS body
+UNION ALL
+SELECT 'a' AS id, REPEAT('bla bla', 100) AS body) t1;
+
--echo #
--echo # End of 5.5 tests
--echo #
diff --git a/mysql-test/t/derived_view.test b/mysql-test/t/derived_view.test
index 30811be2934..c7705294ef2 100644
--- a/mysql-test/t/derived_view.test
+++ b/mysql-test/t/derived_view.test
@@ -1451,6 +1451,67 @@ select * from t1;
drop table t1,t2;
--echo #
+--echo # MDEV-3873: Wrong result (extra rows) with NOT IN and
+--echo # a subquery from a MERGE view
+--echo #
+
+CREATE TABLE t1 (a INT NOT NULL) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (4),(7),(0);
+
+CREATE TABLE t2 (b INT NOT NULL) ENGINE=MyISAM;
+INSERT INTO t2 VALUES (1),(2);
+
+CREATE TABLE t3 (c INT NOT NULL) ENGINE=MyISAM;
+INSERT INTO t3 VALUES (4),(6),(3);
+
+CREATE TABLE t4 (d INT NOT NULL) ENGINE=MyISAM;
+INSERT INTO t4 VALUES (4),(5),(3);
+
+CREATE TABLE tv (e INT NOT NULL) ENGINE=MyISAM;
+INSERT INTO tv VALUES (1),(3);
+
+CREATE ALGORITHM=TEMPTABLE VIEW v_temptable AS SELECT * FROM tv;
+CREATE ALGORITHM=MERGE VIEW v_merge AS SELECT * FROM tv;
+
+SELECT * FROM t1, t2
+WHERE a NOT IN ( SELECT e FROM t3 LEFT JOIN v_temptable ON (c = e) WHERE c <> b ) AND a < b;
+
+SELECT * FROM t1, t2
+WHERE a NOT IN ( SELECT e FROM t3 LEFT JOIN v_merge ON (c = e) WHERE c <> b ) AND a < b;
+
+SELECT * FROM t1, t2
+WHERE a NOT IN ( SELECT e FROM t3 LEFT JOIN (SELECT * FROM tv) as derived ON (c = e) WHERE c <> b ) AND a < b;
+
+drop view v_temptable, v_merge;
+drop table t1,t2,t3,t4,tv;
+
+--echo #
+--echo # MDEV-3912: Wrong result (extra rows) with FROM subquery inside
+--echo # ALL subquery, LEFT JOIN, derived_merge.
+--echo # (duplicate of MDEV-3873 (above))
+--echo #
+
+SET @save3912_optimizer_switch=@@optimizer_switch;
+SET optimizer_switch = 'derived_merge=on,in_to_exists=on';
+
+CREATE TABLE t1 (a INT) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (4),(8);
+
+CREATE TABLE t2 (b INT) ENGINE=MyISAM;
+INSERT INTO t2 VALUES (7),(0);
+
+CREATE TABLE t3 (c INT, d INT NOT NULL) ENGINE=MyISAM;
+INSERT INTO t3 VALUES (0,4),(8,6);
+
+SELECT * FROM t1
+WHERE a >= ALL (
+SELECT d FROM t2 LEFT JOIN ( SELECT * FROM t3 ) AS alias ON ( c = b )
+WHERE b >= a
+);
+set optimizer_switch=@save3912_optimizer_switch;
+drop table t1, t2, t3;
+
+--echo #
--echo # end of 5.3 tests
--echo #
diff --git a/mysql-test/t/distinct.test b/mysql-test/t/distinct.test
index 051499f465b..f1c120a313d 100644
--- a/mysql-test/t/distinct.test
+++ b/mysql-test/t/distinct.test
@@ -658,6 +658,31 @@ select time(f1) from t1 ;
select distinct time(f1) from t1 ;
drop table t1;
+#
+# MDEV-3875 Wrong result (missing row) on a DISTINCT query with the same subquery in the SELECT list and GROUP BY
+# MySQL Bug#66896 Distinct not distinguishing 0 from NULL when GROUP BY is used
+#
+create table t1(i int, g int); # remove_dup_with_hash_index
+insert into t1 values (null, 1), (0, 2);
+select distinct i from t1 group by g;
+drop table t1;
+
+create table t1(i int, g blob); # remove_dup_with_compare
+insert into t1 values (null, 1), (0, 2);
+select distinct i from t1 group by g;
+drop table t1;
+
+create table t1 (a int) engine=myisam;
+insert into t1 values (0),(7);
+create table t2 (b int) engine=myisam;
+insert into t2 values (7),(0),(3);
+create algorithm=temptable view v as
+select distinct (select max(a) from t1 where alias.b = a) as field1 from t2 as alias group by field1;
+select * from v;
+select distinct (select max(a) from t1 where alias.b = a) as field1 from t2 as alias group by field1;
+drop view v;
+drop table t1, t2;
+
--echo #
--echo # Bug #11744875: 4082: integer lengths cause truncation with distinct concat and innodb
--echo #
diff --git a/mysql-test/t/dyncol.test b/mysql-test/t/dyncol.test
index 66e308540f4..de30cac610a 100644
--- a/mysql-test/t/dyncol.test
+++ b/mysql-test/t/dyncol.test
@@ -550,3 +550,164 @@ select hex(COLUMN_CREATE(0, COLUMN_GET(@a, 9 AS DECIMAL(19,0))));
select hex(COLUMN_CREATE(0, COLUMN_GET(COLUMN_CREATE(0, 0.0 as decimal), 0 as decimal)));
select hex(COLUMN_CREATE(0, 0.0 as decimal));
+
+--echo #
+--echo # test of symbolic names
+--echo #
+--echo # creation test (names)
+set names utf8;
+select hex(column_create("адын", 1212));
+select hex(column_create("1212", 1212));
+select hex(column_create(1212, 2, "www", 3));
+select hex(column_create("1212", 2, "www", 3));
+select hex(column_create("1212", 2, 3, 3));
+select hex(column_create("1212", 2, "адын", 1, 3, 3));
+set names default;
+
+--echo # fetching column test (names)
+set names utf8;
+select column_get(column_create("адын", 1212), "адын" as int);
+select column_get(column_create("1212", 2, "адын", 1, 3, 3), "адын" as int);
+select column_get(column_create("1212", 2, "адын", 1, 3, 3), 1212 as int);
+select column_get(column_create("1212", 2, "адын", 1, 3, 3), "3" as int);
+select column_get(column_create("1212", 2, "адын", 1, 3, 3), 3 as int);
+select column_get(column_create("1212", 2, "адын", 1, 3, 3), 4 as int);
+select column_get(column_create("1212", 2, "адын", 1, 3, 3), "4" as int);
+set names default;
+
+--echo # column existance test (names)
+set names utf8;
+select column_exists(column_create("адын", 1212), "адын");
+select column_exists(column_create("адын", 1212), "aады");
+select column_exists(column_create("1212", 2, "адын", 1, 3, 3), "адын");
+select column_exists(column_create("1212", 2, "адын", 1, 3, 3), 1212);
+select column_exists(column_create("1212", 2, "адын", 1, 3, 3), "3");
+select column_exists(column_create("1212", 2, "адын", 1, 3, 3), 3);
+select column_exists(column_create("1212", 2, "адын", 1, 3, 3), 4);
+select column_exists(column_create("1212", 2, "адын", 1, 3, 3), "4");
+set names default;
+
+--echo # column changing test (names)
+select hex(column_add(column_create(1, "AAA"), "b", "BBB"));
+select hex(column_add(column_create("1", "AAA"), "b", "BBB"));
+select column_get(column_add(column_create(1, "AAA"), "b", "BBB"), 1 as char);
+select column_get(column_add(column_create(1, "AAA"), "b", "BBB"), "b" as char);
+select hex(column_add(column_create("a", "AAA"), 1, "BBB"));
+select hex(column_add(column_create("a", "AAA"), "1", "BBB"));
+select hex(column_add(column_create("a", 1212 as integer), "b", "1212" as integer));
+select hex(column_add(column_create("a", 1212 as integer), "a", "1212" as integer));
+select hex(column_add(column_create("a", 1212 as integer), "a", NULL as integer));
+select hex(column_add(column_create("a", 1212 as integer), "b", NULL as integer));
+select hex(column_add(column_create("a", 1212 as integer), "b", 1212 as integer, "a", 11 as integer));
+select column_get(column_add(column_create("a", 1212 as integer), "b", 1212 as integer, "a", 11 as integer), "a" as integer);
+select column_get(column_add(column_create("a", 1212 as integer), "b", 1212 as integer, "a", 11 as integer), "b" as integer);
+select hex(column_add(column_create("a", 1212 as integer), "a", 1212 as integer, "b", 11 as integer));
+select hex(column_add(column_create("a", NULL as integer), "a", 1212 as integer, "b", 11 as integer));
+select hex(column_add(column_create("a", 1212 as integer, "b", 1212 as integer), "a", 11 as integer));
+select hex(column_add(column_create("a", 1), "a", null));
+select column_list(column_add(column_create("a", 1), "a", null));
+select column_list(column_add(column_create("a", 1), "a", ""));
+select hex(column_add("", "a", 1));
+
+-- echo # column delete (names)
+select hex(column_delete(column_create("a", 1212 as integer, "b", 1212 as integer), "a"));
+select hex(column_delete(column_create("a", 1 as integer, "b", 2 as integer, "c", 3 as integer), "b"));
+select hex(column_create("a", 1 as integer, "b", 2 as integer, "c", 3 as integer));
+select hex(column_delete(column_create("a", 1 as integer, "b", 2 as integer, "c", 3 as integer), "c"));
+select hex(column_delete(column_create("a", 1 as integer, "b", 2 as integer, "c", 3 as integer), "d"));
+select hex(column_delete(column_create("a", 1 as integer, "b", 2 as integer, "c", 3 as integer), "b", "a"));
+select hex(column_delete(column_create("a", 1 as integer, "b", 2 as integer, "c", 3 as integer), "b", "c"));
+select hex(column_delete(column_create("a", 1 as integer, "b", 2 as integer, "c", 3 as integer), "a", "b", "c"));
+select hex(column_delete(column_create("a", 1 as integer, "b", 2 as integer, "c", 3 as integer), "a", "b", "c", "e"));
+select hex(column_delete(column_create("a", 1), "a"));
+select hex(column_delete("", "a"));
+
+--echo #
+--echo # MDEV-458 DNAMES: Server crashes on using an unquoted string
+--echo # as a dynamic column name
+--echo #
+--error ER_BAD_FIELD_ERROR
+select COLUMN_CREATE(color, "black");
+
+--echo #
+--echo # MDEV-489 Assertion `offset < 0x1f' failed in
+--echo # type_and_offset_store on COLUMN_ADD
+--echo #
+CREATE TABLE t1 (f1 tinyblob);
+
+INSERT INTO t1 VALUES (COLUMN_CREATE('col1', REPEAT('a',30)));
+select column_check(f1) from t1;
+UPDATE t1 SET f1 = COLUMN_ADD( f1, REPEAT('b',211), 'val2' );
+# we can't detect last string cut with 100% probability,
+# because we detect it by string end
+select column_check(f1) from t1;
+UPDATE t1 SET f1 = COLUMN_ADD( f1, REPEAT('c',211), 'val3' );
+select column_check(f1) from t1;
+
+drop table t1;
+
+--echo #
+--echo # MDEV-490/MDEV-491 null as arguments
+--echo #
+SELECT COLUMN_GET( COLUMN_CREATE( 'col', 'val' ), NULL AS CHAR );
+SELECT COLUMN_GET( NULL, 'col' as char );
+SELECT COLUMN_EXISTS( COLUMN_CREATE( 'col', 'val' ), NULL);
+SELECT COLUMN_EXISTS( NULL, 'col');
+SELECT COLUMN_CREATE( NULL, 'val' );
+SELECT COLUMN_ADD( NULL, 'val', 'col');
+
+--echo #
+--echo # MDEV-488: Assertion `column_name->length < 255' failed on a
+--echo # column name with length 255 (precisely)
+--echo #
+SELECT hex(COLUMN_CREATE(REPEAT('a',255),1));
+--error ER_DYN_COL_DATA
+SELECT hex(COLUMN_CREATE(REPEAT('a',65536),1));
+
+--echo #
+--echo # JSON conversion
+--echo #
+select column_json(column_create("int", -1212 as int, "uint", 12334 as unsigned int, "decimal", "23.344" as decimal, "double", 1.23444e50 as double, "string", 'gdgd\\dhdjh"dhdhd' as char, "time", "0:45:49.000001" AS time, "datetime", "2011-04-05 0:45:49.000001" AS datetime, "date", "2011-04-05" AS date));
+select column_json(column_create(1, -1212 as int, 2, 12334 as unsigned int, 3, "23.344" as decimal, 4, 1.23444e50 as double, 5, 'gdgd\\dhdjh"dhdhd' as char, 6, "0:45:49.000001" AS time, 7, "2011-04-05 0:45:49.000001" AS datetime, 8, "2011-04-05" AS date));
+
+--echo #
+--echo # CHECK test
+--echo #
+SELECT COLUMN_CHECK(COLUMN_CREATE(1,'a'));
+SELECT COLUMN_CHECK('abracadabra');
+SELECT COLUMN_CHECK('');
+SELECT COLUMN_CHECK(NULL);
+
+--echo #
+--echo # escaping check
+--echo #
+select column_json(column_create("string", "'\"/\\`.,whatever")),hex(column_create("string", "'\"/\\`.,whatever"));
+
+--echo #
+--echo # embedding test
+--echo #
+select column_json(column_create("val", "val", "emb", column_create("val2", "val2")));
+select column_json(column_create(1, "val", 2, column_create(3, "val2")));
+
+--echo #
+--echo # Time encoding
+--echo #
+select hex(column_create("t", "800:46:06.23434" AS time)) as hex,
+ column_json(column_create("t", "800:46:06.23434" AS time)) as json;
+select hex(column_create(1, "800:46:06.23434" AS time)) as hex,
+ column_json(column_create(1, "800:46:06.23434" AS time)) as json;
+
+select hex(column_create("t", "800:46:06" AS time)) as hex,
+ column_json(column_create("t", "800:46:06" AS time)) as json;
+select hex(column_create(1, "800:46:06" AS time)) as hex,
+ column_json(column_create(1, "800:46:06" AS time)) as json;
+
+select hex(column_create("t", "2012-12-21 10:46:06.23434" AS datetime)) as hex,
+ column_json(column_create("t", "2012-12-21 10:46:06.23434" AS datetime)) as json;
+select hex(column_create(1, "2012-12-21 10:46:06.23434" AS datetime)) as hex,
+ column_json(column_create(1, "2012-12-21 10:46:06.23434" AS datetime)) as json;
+
+select hex(column_create("t", "2012-12-21 10:46:06" AS datetime)) as hex,
+ column_json(column_create("t", "2012-12-21 10:46:06" AS datetime)) as json;
+select hex(column_create(1, "2012-12-21 10:46:06" AS datetime)) as hex,
+ column_json(column_create(1, "2012-12-21 10:46:06" AS datetime)) as json;
diff --git a/mysql-test/t/failed_auth_3909.test b/mysql-test/t/failed_auth_3909.test
new file mode 100644
index 00000000000..3179794d155
--- /dev/null
+++ b/mysql-test/t/failed_auth_3909.test
@@ -0,0 +1,37 @@
+source include/not_embedded.inc;
+
+#
+# MDEV-3909 remote user enumeration
+#
+# verify that for some failed login attemps (with wrong user names)
+# the server requests a plugin
+#
+optimize table mysql.user;
+insert mysql.user (user,plugin) values ('foo','bar'),('bar','bar'),('baz','bar');
+flush privileges;
+
+--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
+--error ER_PLUGIN_IS_NOT_LOADED
+connect (fail,localhost,u1);
+
+--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
+--error ER_ACCESS_DENIED_ERROR
+connect (fail,localhost,u2);
+
+--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
+--error ER_ACCESS_DENIED_ERROR
+connect (fail,localhost,u2,password);
+
+--error ER_PLUGIN_IS_NOT_LOADED
+change_user u1;
+
+--error ER_ACCESS_DENIED_ERROR
+change_user u2;
+
+--error ER_ACCESS_DENIED_ERROR
+change_user u2,password;
+
+delete from mysql.user where plugin = 'bar';
+flush privileges;
+
+
diff --git a/mysql-test/t/file_contents.test b/mysql-test/t/file_contents.test
index 835ea563c7b..d54a60e62a3 100644
--- a/mysql-test/t/file_contents.test
+++ b/mysql-test/t/file_contents.test
@@ -42,8 +42,8 @@ if ($dir_bin eq '/usr/') {
$dir_docs = "$dir_docs/Docs"; # development tree
}
}
-$found_version = "No line 'MySQL source #.#.#'";
-$found_revision = "No line 'revision-id: .....'";
+$found_version = "No line 'MySQL source #.#.#' in $dir_docs/INFO_SRC";
+$found_revision = "No line 'revision-id: .....' in $dir_docs/INFO_SRC";
open(I_SRC,"<","$dir_docs/INFO_SRC") or print "Cannot open 'INFO_SRC' in '$dir_docs' (starting from bindir '$dir_bin')\n";
while(defined ($line = <I_SRC>)) {
if ($line =~ m|^MySQL source \d+\.\d\.\d+|) {$found_version = "Found MySQL version number";}
diff --git a/mysql-test/t/func_gconcat.test b/mysql-test/t/func_gconcat.test
index e4a1206fa9c..936b93b49c9 100644
--- a/mysql-test/t/func_gconcat.test
+++ b/mysql-test/t/func_gconcat.test
@@ -375,7 +375,7 @@ select group_concat('x') UNION ALL select 1;
drop table t1;
#
-# Bug #12863 : missing separators after first empty cancatanated elements
+# Bug #12863 : missing separators after first empty concatenated elements
#
CREATE TABLE t1 (id int, a varchar(9));
@@ -795,3 +795,11 @@ INSERT INTO t2 SELECT GROUP_CONCAT(a), b FROM t1 GROUP BY b;
SET group_concat_max_len = DEFAULT;
SET @@sql_mode = @old_sql_mode;
DROP TABLE t1, t2;
+
+#
+# MDEV-3987 uninitialized read in Item_cond::fix_fields leads to crash: select .. where .. in ( select ... )
+#
+create table t1 (a char(1) character set utf8);
+insert into t1 values ('a'),('b');
+select 1 from t1 where a in (select group_concat(a) from t1);
+drop table t1;
diff --git a/mysql-test/t/func_misc.test b/mysql-test/t/func_misc.test
index 1f221ce9878..292db69a6e3 100644
--- a/mysql-test/t/func_misc.test
+++ b/mysql-test/t/func_misc.test
@@ -348,6 +348,25 @@ SELECT 1 from t1 HAVING NAME_CONST('', a);
DROP TABLE t1;
+--echo #
+--echo # Test or correct maybe_null of last_value
+--echo #
+CREATE TABLE t1 (a char(2) not null );
+INSERT INTO t1 VALUES (4),(7),(1);
+set @optimizer_switch_save= @@optimizer_switch;
+set optimizer_switch='materialization=off';
+CREATE TABLE tv (e char(2) not null ) engine=mysql;
+INSERT INTO tv VALUES (1);
+CREATE ALGORITHM=MERGE VIEW v_merge AS SELECT * FROM tv;
+CREATE ALGORITHM=MERGE VIEW vm AS SELECT * FROM tv;
+explain extended
+select a from t1 left join v_merge on (a=e) where last_value(NULL,e) not in (select last_value(NULL,e) from vm);
+explain extended
+select a from t1 left join v_merge on (a=e) where e not in (select last_value(NULL,e) from vm);
+set optimizer_switch=@optimizer_switch_save;
+drop view v_merge, vm;
+drop table t1,tv;
+
--echo #
--echo # End of 5.5 tests
diff --git a/mysql-test/t/gis2.test b/mysql-test/t/gis2.test
new file mode 100644
index 00000000000..b734ab19ecd
--- /dev/null
+++ b/mysql-test/t/gis2.test
@@ -0,0 +1,17 @@
+#
+# MDEV-3934 Assertion `((keypart_map+1) & keypart_map) == 0' failed in _mi_pack_key with an index on a POINT column
+#
+
+CREATE TABLE t1 (
+ id INT UNSIGNED NOT NULL AUTO_INCREMENT,
+ point_data POINT NOT NULL,
+ PRIMARY KEY (id),
+ KEY idx_point_data(point_data)
+) ENGINE=MyISAM;
+INSERT t1 (point_data) VALUES
+ (GeomFromText('Point(37.0248492 23.8512726)')),
+ (GeomFromText('Point(38.0248492 23.8512726)'));
+SELECT id FROM t1
+WHERE ST_Contains(point_data, GeomFromText('Point(38.0248492 23.8512726)'));
+DROP TABLE t1;
+
diff --git a/mysql-test/t/grant_lowercase.opt b/mysql-test/t/grant_lowercase.opt
new file mode 100644
index 00000000000..5b0a3d41b41
--- /dev/null
+++ b/mysql-test/t/grant_lowercase.opt
@@ -0,0 +1 @@
+--lower-case-table-names=1
diff --git a/mysql-test/t/grant_lowercase.test b/mysql-test/t/grant_lowercase.test
new file mode 100644
index 00000000000..b07cb88afd6
--- /dev/null
+++ b/mysql-test/t/grant_lowercase.test
@@ -0,0 +1,31 @@
+# test cases for strmov(tmp_db, db) -> strnmov replacement in sql_acl.cc
+--source include/not_embedded.inc
+
+#
+# http://seclists.org/fulldisclosure/2012/Dec/4
+#
+
+# in acl_get(), check_grant_db(), mysql_grant()
+grant file on *.* to user1@localhost with grant option;
+grant select on `a%`.* to user1@localhost with grant option;
+connect (conn1,localhost,user1,,);
+connection conn1;
+--error ER_WRONG_DB_NAME
+grant file on aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.* to 'user'@'%' identified by 'secret';
+connection default;
+disconnect conn1;
+drop user user1@localhost;
+
+# in acl_load()
+call mtr.add_suppression("Incorrect database name");
+alter table mysql.host modify Db varchar(200);
+alter table mysql.db modify Db varchar(200);
+insert mysql.host set db=concat('=>', repeat(_utf8 'й', 200));
+insert mysql.db set db=concat('=>', repeat(_utf8 'й', 200));
+flush privileges; # shouldn't crash here
+delete from mysql.host where db like '=>%';
+delete from mysql.db where db like '=>%';
+alter table mysql.host modify Db char(64);
+alter table mysql.db modify Db char(64);
+flush privileges;
+
diff --git a/mysql-test/t/group_by.test b/mysql-test/t/group_by.test
index 854023052cf..b2dd84f63c7 100644
--- a/mysql-test/t/group_by.test
+++ b/mysql-test/t/group_by.test
@@ -1,3 +1,4 @@
+--source include/have_innodb.inc
# Initialise
--disable_warnings
@@ -1483,6 +1484,41 @@ DROP TABLE t1;
--echo the value below *must* be 1
show status like 'Created_tmp_disk_tables';
+--echo #
+--echo # Bug #1002146: Unneeded filesort if usage of join buffer is not allowed
+--echo # (bug mdev-645)
+--echo #
+
+CREATE TABLE t1 (pk int PRIMARY KEY, a int, INDEX idx(a));
+INSERT INTO t1 VALUES (3,2), (2,3), (5,3), (6,4);
+
+CREATE TABLE t2 (pk int PRIMARY KEY, a int, INDEX idx(a));
+INSERT INTO t2 VALUES (9,0), (10,3), (6,4), (1,6), (3,100), (5,200);
+
+set join_cache_level=0;
+
+EXPLAIN
+SELECT t2.a FROM t2 STRAIGHT_JOIN t1 ON t2.a <> 0 WHERE t2.a <> 6
+ GROUP BY t2.a;
+SELECT t2.a FROM t2 STRAIGHT_JOIN t1 ON t2.a <> 0 WHERE t2.a <> 6
+ GROUP BY t2.a;
+
+set join_cache_level=default;
+
+set @save_optimizer_switch=@@optimizer_switch;
+set optimizer_switch='outer_join_with_cache=off';
+
+EXPLAIN
+SELECT t2.a FROM t2 LEFT JOIN t1 ON t2.a <> 0 WHERE t2.a <> 6
+ GROUP BY t2.a;
+SELECT t2.a FROM t2 LEFT JOIN t1 ON t2.a <> 0 WHERE t2.a <> 6
+ GROUP BY t2.a;
+
+set optimizer_switch=@save_optimizer_switch;
+
+
+DROP TABLE t1,t2;
+
--echo # End of 5.3 tests
--echo #
@@ -1509,6 +1545,48 @@ DROP TABLE t1;
--echo #End of test#49771
--echo #
+--echo # Test of bug in GROUP_CONCAT with ROLLUP
+--echo #
+
+CREATE TABLE t1 ( b VARCHAR(8) NOT NULL, a INT NOT NULL ) ENGINE=MyISAM;
+INSERT INTO t1 (a,b) VALUES (1,'c'),(2,'v');
+
+CREATE TABLE t2 ( c VARCHAR(8), d INT, KEY (c, d) ) ENGINE=MyISAM;
+INSERT INTO t2 VALUES ('v',6),('c',4),('v',3);
+
+SELECT b, GROUP_CONCAT( a, b ORDER BY a, b )
+FROM t1 JOIN t2 ON c = b GROUP BY b;
+
+SELECT b, GROUP_CONCAT( a, b ORDER BY a, b )
+FROM t1 JOIN t2 ON c = b GROUP BY b WITH ROLLUP;
+
+DROP TABLE t1,t2;
+
+--echo #
+--echo # Test of MDEV-4002
+--echo #
+
+CREATE TABLE t1 (
+ pk INT NOT NULL PRIMARY KEY,
+ d1 DOUBLE,
+ d2 DOUBLE,
+ i INT NOT NULL DEFAULT '0',
+ KEY (i)
+) ENGINE=InnoDB;
+
+INSERT INTO t1 VALUES (1,1.0,1.1,1),(2,2.0,2.2,2);
+
+PREPARE stmt FROM "
+SELECT DISTINCT i, GROUP_CONCAT( d1, d2 ORDER BY d1, d2 )
+FROM t1 a1 NATURAL JOIN t1 a2 GROUP BY i WITH ROLLUP
+";
+
+EXECUTE stmt;
+EXECUTE stmt;
+
+DROP TABLE t1;
+
+--echo #
--echo # Bug #58782
--echo # Missing rows with SELECT .. WHERE .. IN subquery
--echo # with full GROUP BY and no aggr
diff --git a/mysql-test/t/group_by_innodb.test b/mysql-test/t/group_by_innodb.test
new file mode 100644
index 00000000000..0d5e5e9ae30
--- /dev/null
+++ b/mysql-test/t/group_by_innodb.test
@@ -0,0 +1,38 @@
+#
+# Test GROUP BY queries that utilize InnoDB extended keys
+#
+
+--source include/have_innodb.inc
+
+--echo #
+--echo # MDEV-3992 Server crash or valgrind errors in test_if_skip_sort_order/test_if_cheaper_ordering
+--echo # on GROUP BY with indexes on InnoDB table
+--echo #
+
+CREATE TABLE t1 (
+ pk INT PRIMARY KEY,
+ a VARCHAR(1) NOT NULL,
+ KEY (pk)
+) ENGINE=InnoDB;
+
+INSERT INTO t1 VALUES (1,'a'),(2,'b');
+
+EXPLAIN
+SELECT COUNT(*), pk field1, pk AS field2
+FROM t1 WHERE a = 'r' OR pk = 183
+GROUP BY field1, field2;
+
+SELECT COUNT(*), pk field1, pk AS field2
+FROM t1 WHERE a = 'r' OR pk = 183
+GROUP BY field1, field2;
+
+EXPLAIN
+SELECT COUNT(*), pk field1 FROM t1
+WHERE a = 'r' OR pk = 183 GROUP BY field1, field1;
+
+SELECT COUNT(*), pk field1 FROM t1
+WHERE a = 'r' OR pk = 183 GROUP BY field1, field1;
+
+drop table t1;
+
+--echo End of 5.5 tests
diff --git a/mysql-test/t/group_min_max.test b/mysql-test/t/group_min_max.test
index b984acc78ea..19f7cbe40a1 100644
--- a/mysql-test/t/group_min_max.test
+++ b/mysql-test/t/group_min_max.test
@@ -1155,6 +1155,15 @@ ORDER BY min_a;
DROP TABLE t1;
+#
+# MDEV-729 lp:998028 - Server crashes on normal shutdown in closefrm after executing a query from MyISAM table
+#
+create table t1 (a int, b varchar(1), key(b,a)) engine=myisam;
+insert t1 values (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'),(6,'f'),(7,'g'),(8,'h'),(null,'i');
+select min(a), b from t1 where a=7 or b='z' group by b;
+flush tables;
+drop table t1;
+
--echo #
--echo # LP BUG#888456 Wrong result with DISTINCT , ANY , subquery_cache=off , NOT NULL
--echo #
diff --git a/mysql-test/t/information_schema2.test b/mysql-test/t/information_schema2.test
new file mode 100644
index 00000000000..c2479087f47
--- /dev/null
+++ b/mysql-test/t/information_schema2.test
@@ -0,0 +1,9 @@
+
+#
+# MDEV-4029 SELECT on information_schema using a subquery locks up the information_schema table due to incorrect mutexes handling
+#
+select variable_name from information_schema.session_status where variable_name =
+(select variable_name from information_schema.session_status where variable_name = 'uptime');
+select variable_name from information_schema.session_variables where variable_name =
+(select variable_name from information_schema.session_variables where variable_name = 'basedir');
+
diff --git a/mysql-test/t/loaddata.test b/mysql-test/t/loaddata.test
index f9181f91a89..bf84bdf9194 100644
--- a/mysql-test/t/loaddata.test
+++ b/mysql-test/t/loaddata.test
@@ -572,36 +572,40 @@ DROP TABLE t1;
connection default;
disconnect con1;
+#############################################################################
+# The below protion is moved to ctype_ucs.test #
+#############################################################################
+#--echo #
+#--echo # Bug #51876 : crash/memory underrun when loading data with ucs2
+#--echo # and reverse() function
+#--echo #
+
+#--echo # Problem # 1 (original report): wrong parsing of ucs2 data
+#SELECT '00' UNION SELECT '10' INTO OUTFILE 'tmpp.txt';
+#CREATE TABLE t1(a INT);
+#LOAD DATA INFILE 'tmpp.txt' INTO TABLE t1 CHARACTER SET ucs2
+#(@b) SET a=REVERSE(@b);
+#--echo # should return 2 zeroes (as the value is truncated)
+#SELECT * FROM t1;
+
+#DROP TABLE t1;
+#let $MYSQLD_DATADIR= `select @@datadir`;
+#remove_file $MYSQLD_DATADIR/test/tmpp.txt;
+
+
+#--echo # Problem # 2 : if you write and read ucs2 data to a file they're lost
+#SELECT '00' UNION SELECT '10' INTO OUTFILE 'tmpp2.txt' CHARACTER SET ucs2;
+#CREATE TABLE t1(a INT);
+#LOAD DATA INFILE 'tmpp2.txt' INTO TABLE t1 CHARACTER SET ucs2
+#(@b) SET a=REVERSE(@b);
+#--echo # should return 0 and 1 (10 reversed)
+#SELECT * FROM t1;
+
+#DROP TABLE t1;
+#let $MYSQLD_DATADIR= `select @@datadir`;
+#remove_file $MYSQLD_DATADIR/test/tmpp2.txt;
+######################################################################################
---echo #
---echo # Bug #51876 : crash/memory underrun when loading data with ucs2
---echo # and reverse() function
---echo #
-
---echo # Problem # 1 (original report): wrong parsing of ucs2 data
-SELECT '00' UNION SELECT '10' INTO OUTFILE 'tmpp.txt';
-CREATE TABLE t1(a INT);
-LOAD DATA INFILE 'tmpp.txt' INTO TABLE t1 CHARACTER SET ucs2
-(@b) SET a=REVERSE(@b);
---echo # should return 2 zeroes (as the value is truncated)
-SELECT * FROM t1;
-
-DROP TABLE t1;
-let $MYSQLD_DATADIR= `select @@datadir`;
-remove_file $MYSQLD_DATADIR/test/tmpp.txt;
-
-
---echo # Problem # 2 : if you write and read ucs2 data to a file they're lost
-SELECT '00' UNION SELECT '10' INTO OUTFILE 'tmpp2.txt' CHARACTER SET ucs2;
-CREATE TABLE t1(a INT);
-LOAD DATA INFILE 'tmpp2.txt' INTO TABLE t1 CHARACTER SET ucs2
-(@b) SET a=REVERSE(@b);
---echo # should return 0 and 1 (10 reversed)
-SELECT * FROM t1;
-
-DROP TABLE t1;
-let $MYSQLD_DATADIR= `select @@datadir`;
-remove_file $MYSQLD_DATADIR/test/tmpp2.txt;
--echo #
--echo # Bug#11765139 58069: LOAD DATA INFILE: VALGRIND REPORTS INVALID MEMORY READS AND WRITES WITH U
diff --git a/mysql-test/t/mysql.test b/mysql-test/t/mysql.test
index 3269b88ca04..71a985654ef 100644
--- a/mysql-test/t/mysql.test
+++ b/mysql-test/t/mysql.test
@@ -582,5 +582,17 @@ DROP DATABASE connected_db;
--remove_file $MYSQLTEST_VARDIR/tmp/one_db_1.sql
--remove_file $MYSQLTEST_VARDIR/tmp/one_db_2.sql
+#
+# USE and names with backticks
+#
+--write_file $MYSQLTEST_VARDIR/tmp/backticks.sql
+USE aa`bb``cc
+SELECT DATABASE();
+EOF
+create database `aa``bb````cc`;
+--exec $MYSQL < $MYSQLTEST_VARDIR/tmp/backticks.sql
+drop database `aa``bb````cc`;
+
+
--echo
--echo End of tests
diff --git a/mysql-test/t/plugin.test b/mysql-test/t/plugin.test
index 2b234b64047..4412383f837 100644
--- a/mysql-test/t/plugin.test
+++ b/mysql-test/t/plugin.test
@@ -4,14 +4,14 @@
CREATE TABLE t1(a int) ENGINE=EXAMPLE;
DROP TABLE t1;
-eval INSTALL PLUGIN example SONAME 'ha_example';
+INSTALL PLUGIN example SONAME 'ha_example';
--replace_regex /\.dll/.so/
--error 1125
-eval INSTALL PLUGIN EXAMPLE SONAME 'ha_example';
+INSTALL PLUGIN EXAMPLE SONAME 'ha_example';
UNINSTALL PLUGIN example;
-eval INSTALL SONAME 'ha_example';
+INSTALL SONAME 'ha_example';
--replace_column 5 #
--replace_regex /\.dll/.so/
--query_vertical select * from information_schema.plugins where plugin_library like 'ha_example%'
@@ -28,7 +28,7 @@ set global example_enum_var= e1;
show status like 'example%';
show variables like 'example%';
-eval UNINSTALL SONAME 'ha_example';
+UNINSTALL SONAME 'ha_example';
--replace_column 5 #
--replace_regex /\.dll/.so/
--query_vertical select * from information_schema.plugins where plugin_library like 'ha_example%'
@@ -41,12 +41,18 @@ UNINSTALL PLUGIN EXAMPLE;
--error 1305
UNINSTALL PLUGIN non_exist;
+#
+# MDEV-3985 crash: uninstall soname 'a'
+#
+--replace_regex /\.dll/.so/
+--error 1305
+UNINSTALL SONAME 'non_exist';
--echo #
--echo # Bug#32034: check_func_enum() does not check correct values but set it
--echo # to impossible int val
--echo #
-eval INSTALL PLUGIN example SONAME 'ha_example';
+INSTALL PLUGIN example SONAME 'ha_example';
SET GLOBAL example_enum_var= e1;
SET GLOBAL example_enum_var= e2;
@@ -60,7 +66,7 @@ UNINSTALL PLUGIN example;
#
# Bug #32757 hang with sql_mode set when setting some global variables
#
-eval INSTALL PLUGIN example SONAME 'ha_example';
+INSTALL PLUGIN example SONAME 'ha_example';
select @@session.sql_mode into @old_sql_mode;
diff --git a/mysql-test/t/plugin_auth.test b/mysql-test/t/plugin_auth.test
index 6b121762354..366dc75c425 100644
--- a/mysql-test/t/plugin_auth.test
+++ b/mysql-test/t/plugin_auth.test
@@ -175,21 +175,35 @@ GRANT PROXY ON ''@'' TO grant_plug;
--error ER_ACCESS_DENIED_NO_PASSWORD_ERROR
GRANT PROXY ON grant_plug TO grant_plug_dest;
---echo this should fail : same user, but on a different host
---error ER_ACCESS_DENIED_NO_PASSWORD_ERROR
+# Security context in THD contains two pairs of (user,host)
+# 1. (user,host) pair referring to inbound connection
+# 2. (priv_user,priv_host) pair obtained from mysql.user table after doing
+# authnetication of incoming connection.
+# Granting/revoking proxy privileges, privileges should be checked wrt
+# (priv_user, priv_host) tuple that is obtained from mysql.user table
+# Following is a valid grant because effective user of connection is
+# grant_plug_dest@% and statement is trying to grant proxy on the same
+# user.
+--echo This is a valid grant
GRANT PROXY ON grant_plug_dest TO grant_plug;
+REVOKE PROXY ON grant_plug_dest FROM grant_plug;
--echo this should work : same user
-GRANT PROXY ON grant_plug_dest@localhost TO grant_plug_dest2;
-REVOKE PROXY ON grant_plug_dest@localhost FROM grant_plug_dest2;
+GRANT PROXY ON grant_plug_dest TO grant_plug_dest2;
+REVOKE PROXY ON grant_plug_dest FROM grant_plug_dest2;
---echo this should work : same user
+# grant_plug_dest@localhost is not the same as grant_plug_dest@%
+# so following grant/revoke should fail
+--echo this should fail : not the same user
+--error ER_ACCESS_DENIED_NO_PASSWORD_ERROR
GRANT PROXY ON grant_plug_dest@localhost TO grant_plug WITH GRANT OPTION;
+--echo this should fail : not the same user
+--error ER_ACCESS_DENIED_NO_PASSWORD_ERROR
REVOKE PROXY ON grant_plug_dest@localhost FROM grant_plug;
--echo this should fail : can't create users
--error ER_CANT_CREATE_USER_WITH_GRANT
-GRANT PROXY ON grant_plug_dest@localhost TO grant_plug@localhost;
+GRANT PROXY ON grant_plug_dest TO grant_plug@localhost;
connection default;
--echo in default connection
diff --git a/mysql-test/t/show_check.test b/mysql-test/t/show_check.test
index 3a38b85f1ae..c2edef87d41 100644
--- a/mysql-test/t/show_check.test
+++ b/mysql-test/t/show_check.test
@@ -1371,3 +1371,17 @@ SELECT RELEASE_LOCK('t');
--connection default
SET NAMES latin1;
+
+--echo #
+--echo # WL#6454: Deprecate SHOW AUTHORS and SHOW CONTRIBUTORS
+--echo #
+
+--disable_result_log
+SHOW AUTHORS;
+--enable_result_log
+SHOW WARNINGS;
+
+--disable_result_log
+SHOW CONTRIBUTORS;
+--enable_result_log
+SHOW WARNINGS;
diff --git a/mysql-test/t/show_explain.test b/mysql-test/t/show_explain.test
index 36274a27edf..051d4b8b5fc 100644
--- a/mysql-test/t/show_explain.test
+++ b/mysql-test/t/show_explain.test
@@ -8,6 +8,7 @@
drop table if exists t0, t1, t2, t3, t4;
drop view if exists v1;
--enable_warnings
+SET @old_debug= @@session.debug;
#
# Testcases in this file do not work with embedded server. The reason for this
@@ -56,6 +57,7 @@ let $thr1=`select connection_id()`;
connect (con1, localhost, root,,);
connection con1;
let $thr2=`select connection_id()`;
+SET @old_debug= @@session.debug;
connection default;
# SHOW EXPLAIN FOR <idle thread>
@@ -73,7 +75,7 @@ let $wait_condition= select State='show_explain_trap' from information_schema.pr
#
connection con1;
set @show_explain_probe_select_id=1;
-set debug_dbug='d,show_explain_probe_join_exec_start';
+set debug_dbug='+d,show_explain_probe_join_exec_start';
send select count(*) from t1 where a < 100000;
connection default;
@@ -101,95 +103,102 @@ evalp show explain for $thr2;
connection con1;
reap;
set optimizer_switch= @show_expl_tmp;
-
+set debug_dbug=@old_debug;
--echo # UNION, first branch
set @show_explain_probe_select_id=1;
-set debug_dbug='d,show_explain_probe_join_exec_start';
+set debug_dbug='+d,show_explain_probe_join_exec_start';
send explain select a from t0 A union select a+1 from t0 B;
connection default;
--source include/wait_condition.inc
evalp show explain for $thr2;
connection con1;
reap;
+set debug_dbug=@old_debug;
--echo # UNION, second branch
set @show_explain_probe_select_id=1;
-set debug_dbug='d,show_explain_probe_join_exec_start';
+set debug_dbug='+d,show_explain_probe_join_exec_start';
send explain select a from t0 A union select a+1 from t0 B;
connection default;
--source include/wait_condition.inc
evalp show explain for $thr2;
connection con1;
reap;
+set debug_dbug=@old_debug;
--echo # Uncorrelated subquery, select
set @show_explain_probe_select_id=1;
-set debug_dbug='d,show_explain_probe_join_exec_start';
+set debug_dbug='+d,show_explain_probe_join_exec_start';
send select a, (select max(a) from t0 B) from t0 A where a<1;
connection default;
--source include/wait_condition.inc
evalp show explain for $thr2;
connection con1;
reap;
+set debug_dbug=@old_debug;
--echo # Uncorrelated subquery, explain
set @show_explain_probe_select_id=1;
-set debug_dbug='d,show_explain_probe_join_exec_start';
+set debug_dbug='+d,show_explain_probe_join_exec_start';
send explain select a, (select max(a) from t0 B) from t0 A where a<1;
connection default;
--source include/wait_condition.inc
evalp show explain for $thr2;
connection con1;
reap;
+set debug_dbug=@old_debug;
--echo # correlated subquery, select
set @show_explain_probe_select_id=1;
-set debug_dbug='d,show_explain_probe_join_exec_start';
+set debug_dbug='+d,show_explain_probe_join_exec_start';
send select a, (select max(a) from t0 b where b.a+a.a<10) from t0 a where a<1;
connection default;
--source include/wait_condition.inc
evalp show explain for $thr2;
connection con1;
reap;
+set debug_dbug=@old_debug;
--echo # correlated subquery, explain
set @show_explain_probe_select_id=1;
-set debug_dbug='d,show_explain_probe_join_exec_start';
+set debug_dbug='+d,show_explain_probe_join_exec_start';
send select a, (select max(a) from t0 b where b.a+a.a<10) from t0 a where a<1;
connection default;
--source include/wait_condition.inc
evalp show explain for $thr2;
connection con1;
reap;
+set debug_dbug=@old_debug;
--echo # correlated subquery, select, while inside the subquery
set @show_explain_probe_select_id=2; # <---
-set debug_dbug='d,show_explain_probe_join_exec_start';
+set debug_dbug='+d,show_explain_probe_join_exec_start';
send select a, (select max(a) from t0 b where b.a+a.a<10) from t0 a where a<1;
connection default;
--source include/wait_condition.inc
evalp show explain for $thr2;
connection con1;
reap;
+set debug_dbug=@old_debug;
--echo # correlated subquery, explain, while inside the subquery
set @show_explain_probe_select_id=2;
-set debug_dbug='d,show_explain_probe_join_exec_start';
+set debug_dbug='+d,show_explain_probe_join_exec_start';
send select a, (select max(a) from t0 b where b.a+a.a<10) from t0 a where a<1;
connection default;
--source include/wait_condition.inc
evalp show explain for $thr2;
connection con1;
reap;
-
+set debug_dbug=@old_debug;
--echo # correlated subquery, explain, while inside the subquery
set @show_explain_probe_select_id=1;
-set debug_dbug='d,show_explain_probe_join_exec_end';
+set debug_dbug='+d,show_explain_probe_join_exec_end';
send select a, (select max(a) from t0 b where b.a+a.a<10) from t0 a where a<1;
connection default;
--source include/wait_condition.inc
@@ -197,6 +206,7 @@ connection default;
evalp show explain for $thr2;
connection con1;
reap;
+set debug_dbug=@old_debug;
# TODO: explain in the parent subuqery when the un-correlated child has been
# run (and have done irreversible cleanups)
@@ -209,7 +219,7 @@ reap;
--echo # I've found experimentally that select_id==2 here...
--echo #
set @show_explain_probe_select_id=2;
-set debug_dbug='d,show_explain_probe_join_exec_start';
+set debug_dbug='+d,show_explain_probe_join_exec_start';
send set @foo= (select max(a) from t0 where sin(a) >0);
connection default;
--source include/wait_condition.inc
@@ -217,64 +227,71 @@ connection default;
evalp show explain for $thr2;
connection con1;
reap;
+set debug_dbug=@old_debug;
--echo #
--echo # Attempt SHOW EXPLAIN for an UPDATE
--echo #
create table t2 as select a as a, a as dummy from t0 limit 2;
set @show_explain_probe_select_id=2;
-set debug_dbug='d,show_explain_probe_join_exec_start';
+set debug_dbug='+d,show_explain_probe_join_exec_start';
send update t2 set dummy=0 where (select max(a) from t0 where t2.a + t0.a <3) >3 ;
connection default;
--source include/wait_condition.inc
--error ER_TARGET_NOT_EXPLAINABLE
evalp show explain for $thr2;
+--source include/wait_condition.inc
--error ER_TARGET_NOT_EXPLAINABLE
evalp show explain for $thr2;
connection con1;
reap;
drop table t2;
+set debug_dbug=@old_debug;
--echo #
--echo # Attempt SHOW EXPLAIN for a DELETE
--echo #
create table t2 as select a as a, a as dummy from t0 limit 2;
set @show_explain_probe_select_id=2;
-set debug_dbug='d,show_explain_probe_join_exec_start';
+set debug_dbug='+d,show_explain_probe_join_exec_start';
send delete from t2 where (select max(a) from t0 where t2.a + t0.a <3) >3 ;
connection default;
--source include/wait_condition.inc
--error ER_TARGET_NOT_EXPLAINABLE
evalp show explain for $thr2;
+--source include/wait_condition.inc
--error ER_TARGET_NOT_EXPLAINABLE
evalp show explain for $thr2;
connection con1;
reap;
drop table t2;
-
+set debug_dbug=@old_debug;
--echo #
--echo # Multiple SHOW EXPLAIN calls for one select
--echo #
create table t2 as select a as a, a as dummy from t0 limit 3;
set @show_explain_probe_select_id=2;
-set debug_dbug='d,show_explain_probe_join_exec_start';
+set debug_dbug='+d,show_explain_probe_join_exec_start';
send select t2.a, ((select max(a) from t0 where t2.a + t0.a <3) >3) as SUBQ from t2;
connection default;
--source include/wait_condition.inc
evalp show explain for $thr2;
+--source include/wait_condition.inc
evalp show explain for $thr2;
+--source include/wait_condition.inc
evalp show explain for $thr2;
connection con1;
reap;
drop table t2;
+set debug_dbug=@old_debug;
--echo #
--echo # SHOW EXPLAIN for SELECT ... ORDER BY with "Using filesort"
--echo #
explain select * from t0 order by a;
-set debug_dbug='d,show_explain_probe_join_exec_start';
+set debug_dbug='+d,show_explain_probe_join_exec_start';
set @show_explain_probe_select_id=1;
send select * from t0 order by a;
connection default;
@@ -282,6 +299,7 @@ connection default;
evalp show explain for $thr2;
connection con1;
reap;
+set debug_dbug=@old_debug;
--echo #
--echo # SHOW EXPLAIN for SELECT ... with "Using temporary"
@@ -290,7 +308,7 @@ connection default;
explain select distinct a from t0;
connection con1;
-set debug_dbug='d,show_explain_probe_join_exec_start';
+set debug_dbug='+d,show_explain_probe_join_exec_start';
set @show_explain_probe_select_id=1;
send select distinct a from t0;
connection default;
@@ -298,6 +316,7 @@ connection default;
evalp show explain for $thr2;
connection con1;
reap;
+set debug_dbug=@old_debug;
--echo #
--echo # SHOW EXPLAIN for SELECT ... with "Using temporary; Using filesort"
@@ -306,7 +325,7 @@ connection default;
explain select distinct a from t0;
connection con1;
-set debug_dbug='d,show_explain_probe_join_exec_start';
+set debug_dbug='+d,show_explain_probe_join_exec_start';
set @show_explain_probe_select_id=1;
send select distinct a from t0;
connection default;
@@ -314,7 +333,7 @@ connection default;
evalp show explain for $thr2;
connection con1;
reap;
-set debug_dbug='';
+set debug_dbug=@old_debug;
--echo #
--echo # MDEV-238: SHOW EXPLAIN: Server crashes in JOIN::print_explain with FROM subquery and GROUP BY
@@ -323,7 +342,7 @@ CREATE TABLE t2 ( a INT );
INSERT INTO t2 VALUES (1),(2),(1),(4),(2);
explain SELECT alias.a FROM t2, ( SELECT * FROM t2 ) AS alias GROUP BY alias.a;
-set debug_dbug='d,show_explain_in_find_all_keys';
+set debug_dbug='+d,show_explain_in_find_all_keys';
send SELECT alias.a FROM t2, ( SELECT * FROM t2 ) AS alias GROUP BY alias.a;
connection default;
@@ -334,7 +353,7 @@ connection default;
evalp show explain for $thr2;
connection con1;
reap;
-set debug_dbug='';
+set debug_dbug=@old_debug;
DROP TABLE t2;
@@ -350,7 +369,7 @@ INSERT INTO t2 VALUES (1),(2),(1),(4),(2);
EXPLAIN EXTENDED SELECT alias.a FROM t2, ( SELECT * FROM t2 ) AS alias GROUP BY alias.a ;
set @show_explain_probe_select_id=1;
-set debug_dbug='d,show_explain_probe_join_exec_end';
+set debug_dbug='+d,show_explain_probe_join_exec_end';
send EXPLAIN EXTENDED SELECT alias.a FROM t2, ( SELECT * FROM t2 ) AS alias GROUP BY alias.a ;
connection default;
@@ -358,7 +377,7 @@ connection default;
evalp show explain for $thr2;
connection con1;
reap;
-set debug_dbug='';
+set debug_dbug=@old_debug;
DROP TABLE t2;
@@ -374,7 +393,7 @@ INSERT INTO t2 VALUES (4),(5),(6),(7),(8),(9);
explain SELECT * FROM v1, t2;
set @show_explain_probe_select_id=2;
-set debug_dbug='d,show_explain_probe_join_exec_end';
+set debug_dbug='+d,show_explain_probe_join_exec_end';
send SELECT * FROM v1, t2;
connection default;
@@ -383,7 +402,7 @@ connection default;
evalp show explain for $thr2;
connection con1;
reap;
-set debug_dbug='';
+set debug_dbug=@old_debug;
DROP VIEW v1;
DROP TABLE t2, t3;
@@ -391,21 +410,21 @@ DROP TABLE t2, t3;
--echo # MDEV-267: SHOW EXPLAIN: Server crashes in JOIN::print_explain on most of queries
--echo #
set @show_explain_probe_select_id=1;
-set debug_dbug='d,show_explain_probe_join_exec_end';
+set debug_dbug='+d,show_explain_probe_join_exec_end';
send select sleep(1);
connection default;
--source include/wait_condition.inc
evalp show explain for $thr2;
connection con1;
reap;
-set debug_dbug='';
+set debug_dbug=@old_debug;
--echo #
--echo # Same as above, but try another reason for JOIN to be degenerate
--echo #
set @show_explain_probe_select_id=1;
-set debug_dbug='d,show_explain_probe_join_exec_end';
+set debug_dbug='+d,show_explain_probe_join_exec_end';
send select * from t0 where 1>10;
connection default;
--source include/wait_condition.inc
@@ -413,7 +432,7 @@ connection default;
evalp show explain for $thr2;
connection con1;
reap;
-set debug_dbug='';
+set debug_dbug=@old_debug;
--echo #
--echo # Same as above, but try another reason for JOIN to be degenerate (2)
@@ -421,7 +440,7 @@ set debug_dbug='';
create table t3(a int primary key);
insert into t3 select a from t0;
set @show_explain_probe_select_id=1;
-set debug_dbug='d,show_explain_probe_join_exec_end';
+set debug_dbug='+d,show_explain_probe_join_exec_end';
send select * from t0,t3 where t3.a=112233;
connection default;
--source include/wait_condition.inc
@@ -429,7 +448,7 @@ connection default;
evalp show explain for $thr2;
connection con1;
reap;
-set debug_dbug='';
+set debug_dbug=@old_debug;
drop table t3;
--echo #
@@ -448,7 +467,7 @@ explain SELECT * FROM t2 WHERE a =
);
set @show_explain_probe_select_id=2;
-set debug_dbug='d,show_explain_probe_do_select';
+set debug_dbug='+d,show_explain_probe_do_select';
send SELECT * FROM t2 WHERE a =
(SELECT MAX(a) FROM t2
WHERE pk= (SELECT MAX(pk) FROM t2 WHERE pk = 3)
@@ -458,7 +477,7 @@ connection default;
evalp show explain for $thr2;
connection con1;
reap;
-set debug_dbug='';
+set debug_dbug=@old_debug;
drop table t2;
@@ -491,7 +510,7 @@ WHERE a1 < ALL (
);
set @show_explain_probe_select_id=1;
-set debug_dbug='d,show_explain_probe_do_select';
+set debug_dbug='+d,show_explain_probe_do_select';
send
SELECT count(*) FROM t2, t3
WHERE a1 < ALL (
@@ -504,7 +523,7 @@ connection default;
evalp show explain for $thr2;
connection con1;
reap;
-set debug_dbug='';
+set debug_dbug=@old_debug;
drop table t2, t3, t4;
--echo #
@@ -516,7 +535,7 @@ INSERT INTO t2 VALUES
(11,23),(12,3),(13,45),(14,16),(15,2),(16,33),(17,2),(18,5),(19,9),(20,2);
set @show_explain_probe_select_id=1;
-set debug_dbug='d,show_explain_probe_join_exec_end';
+set debug_dbug='+d,show_explain_probe_join_exec_end';
send
SELECT * FROM t2 WHERE (5, 78) IN (SELECT `a1`, MAX(`a1`) FROM t2 GROUP BY `a1`);
connection default;
@@ -525,10 +544,9 @@ connection default;
evalp show explain for $thr2;
connection con1;
reap;
-set debug_dbug='';
+set debug_dbug=@old_debug;
DROP TABLE t2;
-
DROP TABLE t1;
--echo #
@@ -538,7 +556,7 @@ CREATE TABLE t1(a INT, KEY(a));
INSERT INTO t1 VALUES (3),(1),(5),(1);
set @show_explain_probe_select_id=1;
-set debug_dbug='d,show_explain_probe_join_exec_start';
+set debug_dbug='+d,show_explain_probe_join_exec_start';
send SELECT 'test' FROM t1 WHERE a=1;
connection default;
@@ -546,7 +564,7 @@ connection default;
evalp show explain for $thr2;
connection con1;
reap;
-set debug_dbug='';
+set debug_dbug=@old_debug;
DROP TABLE t1;
@@ -570,7 +588,7 @@ set join_cache_level=0;
explain select count(*) from t1 A, t1 B where B.key1 < A.col2 and A.col1=3 AND B.col2 + 1 < 100;
set @show_explain_probe_select_id=1;
-set debug_dbug='d,show_explain_probe_test_if_quick_select';
+set debug_dbug='+d,show_explain_probe_test_if_quick_select';
send
select count(*) from t1 A, t1 B where B.key1 < A.col2 and A.col1=3 AND B.col2 + 1 < 100;
@@ -587,7 +605,7 @@ evalp show explain for $thr2;
connection con1;
reap;
-set debug_dbug='';
+set debug_dbug=@old_debug;
drop table t1;
--echo #
@@ -598,7 +616,7 @@ CREATE TABLE t1(a INT, b INT, c INT, KEY(a), KEY(b), KEY(c));
INSERT INTO t1 (a) VALUES (3),(1),(5),(1);
set @show_explain_probe_select_id=1;
-set debug_dbug='d,show_explain_probe_join_exec_start';
+set debug_dbug='+d,show_explain_probe_join_exec_start';
send SHOW INDEX FROM t1;
connection default;
@@ -606,7 +624,7 @@ connection default;
evalp show explain for $thr2;
connection con1;
reap;
-set debug_dbug='';
+set debug_dbug=@old_debug;
DROP TABLE t1;
@@ -620,7 +638,7 @@ CREATE ALGORITHM=TEMPTABLE VIEW v1 AS SELECT * FROM t1;
EXPLAIN SELECT a + 1 FROM v1;
-set debug_dbug='d,show_explain_probe_join_tab_preread';
+set debug_dbug='+d,show_explain_probe_join_tab_preread';
set @show_explain_probe_select_id=1;
send
@@ -630,7 +648,7 @@ connection default;
evalp show explain for $thr2;
connection con1;
reap;
-set debug_dbug='';
+set debug_dbug=@old_debug;
DROP VIEW v1;
DROP TABLE t1;
@@ -646,7 +664,7 @@ INSERT INTO t1 VALUES (4),(6);
EXPLAIN
SELECT a FROM t1 WHERE a IN ( SELECT 1+SLEEP(0.01) UNION SELECT 2 );
-set debug_dbug='d,show_explain_probe_union_read';
+set debug_dbug='+d,show_explain_probe_union_read';
send
SELECT a FROM t1 WHERE a IN ( SELECT 1+SLEEP(0.01) UNION SELECT 2 );
@@ -660,8 +678,7 @@ evalp show explain for $thr2;
connection con1;
reap;
-set debug_dbug='';
-
+set debug_dbug=@old_debug;
DROP TABLE t1;
--echo #
@@ -683,7 +700,7 @@ SELECT * FROM t1, ( SELECT * FROM t2 ) AS alias
WHERE a < ALL ( SELECT b FROM t1, t2 WHERE a = b );
set @show_explain_probe_select_id=1;
-set debug_dbug='d,show_explain_probe_join_exec_start';
+set debug_dbug='+d,show_explain_probe_join_exec_start';
--send
SELECT * FROM t1, ( SELECT * FROM t2 ) AS alias
WHERE a < ALL ( SELECT b FROM t1, t2 WHERE a = b );
@@ -694,7 +711,7 @@ evalp show explain for $thr2;
connection con1;
reap;
-set debug_dbug='';
+set debug_dbug=@old_debug;
DROP TABLE t1, t2;
--echo #
@@ -717,7 +734,7 @@ insert into t3 select * from t4;
explain select distinct t1.a from t1,t3 where t1.a=t3.a;
set @show_explain_probe_select_id=1;
-set debug_dbug='d,show_explain_probe_join_exec_start';
+set debug_dbug='+d,show_explain_probe_join_exec_start';
--send
select distinct t1.a from t1,t3 where t1.a=t3.a;
connection default;
@@ -726,7 +743,7 @@ evalp show explain for $thr2;
connection con1;
reap;
-set debug_dbug='';
+set debug_dbug=@old_debug;
drop table t1,t3,t4;
@@ -744,7 +761,7 @@ connection con1;
--echo # First, make sure that user 'test2' cannot do SHOW EXPLAIN on us
--echo #
set @show_explain_probe_select_id=1;
-set debug_dbug='d,show_explain_probe_join_exec_start';
+set debug_dbug='+d,show_explain_probe_join_exec_start';
send
select * from t0 where a < 3;
@@ -760,7 +777,7 @@ evalp show explain for $thr2;
connection con1;
reap;
-set debug_dbug='';
+set debug_dbug=@old_debug;
--echo #
--echo # Check that user test2 can do SHOW EXPLAIN on its own queries
@@ -770,7 +787,7 @@ connect (con3, localhost, test2,,);
connection con2;
let $thr_con2=`select connection_id()`;
set @show_explain_probe_select_id=1;
-set debug_dbug='d,show_explain_probe_join_exec_start';
+set debug_dbug='+d,show_explain_probe_join_exec_start';
send
select * from t0 where a < 3;
@@ -796,9 +813,10 @@ disconnect con2;
grant process on *.* to test2@localhost;
connect (con2, localhost, test2,,);
connection con1;
+set debug_dbug=@old_debug;
set @show_explain_probe_select_id=1;
-set debug_dbug='d,show_explain_probe_join_exec_start';
+set debug_dbug='+d,show_explain_probe_join_exec_start';
send
select * from t0 where a < 3;
@@ -810,7 +828,7 @@ evalp show explain for $thr2;
connection con1;
reap;
-set debug_dbug='';
+set debug_dbug=@old_debug;
revoke all privileges on test.* from test2@localhost;
drop user test2@localhost;
@@ -890,7 +908,7 @@ WHERE a IN ( 255, 0 ) OR b BETWEEN 6 AND 129
ORDER BY b;
set @show_explain_probe_select_id=1;
-set debug_dbug='d,show_explain_probe_join_exec_start';
+set debug_dbug='+d,show_explain_probe_join_exec_start';
--send
SELECT a+SLEEP(0.01) FROM t1
WHERE a IN ( 255, 0 ) OR b BETWEEN 6 AND 129
@@ -902,9 +920,10 @@ evalp show explain for $thr2;
connection con1;
reap;
+set debug_dbug=@old_debug;
set @show_explain_probe_select_id=1;
-set debug_dbug='d,show_explain_probe_do_select';
+set debug_dbug='+d,show_explain_probe_do_select';
--send
SELECT a+SLEEP(0.01) FROM t1
WHERE a IN ( 255, 0 ) OR b BETWEEN 6 AND 129
@@ -917,7 +936,7 @@ evalp show explain for $thr2;
connection con1;
reap;
-set debug_dbug='';
+set debug_dbug=@old_debug;
drop table t1;
@@ -933,7 +952,7 @@ INSERT INTO t1 SELECT t11.a FROM t1 t11, t1 t12, t1 t13;
EXPLAIN SELECT a FROM t1 GROUP BY a;
set @show_explain_probe_select_id=1;
-set debug_dbug='d,show_explain_probe_join_exec_start';
+set debug_dbug='+d,show_explain_probe_join_exec_start';
--send
SELECT a FROM t1 GROUP BY a;
@@ -944,7 +963,7 @@ evalp show explain for $thr2;
connection con1;
reap;
-set debug_dbug='';
+set debug_dbug=@old_debug;
drop table t1;
@@ -960,7 +979,7 @@ INSERT INTO t2 VALUES (86,'English'),(87,'Russian');
explain SELECT SUM(a + SLEEP(0.1)) FROM t1 WHERE a IN ( SELECT c FROM t2 WHERE d < b ) OR b < 's';
set @show_explain_probe_select_id=1;
-set debug_dbug='d,show_explain_probe_join_exec_start';
+set debug_dbug='+d,show_explain_probe_join_exec_start';
--send
SELECT SUM(a + SLEEP(0.1)) FROM t1 WHERE a IN ( SELECT c FROM t2 WHERE d < b ) OR b < 's';
@@ -971,8 +990,7 @@ evalp show explain for $thr2;
connection con1;
reap;
-set debug_dbug='';
-
+set debug_dbug=@old_debug;
drop table t1, t2;
--echo #
@@ -1011,7 +1029,7 @@ explain
SELECT b AS field1, b AS field2 FROM t1, t2, t3 WHERE d = b ORDER BY field1, field2;
set @show_explain_probe_select_id=1;
-set debug_dbug='d,show_explain_probe_do_select';
+set debug_dbug='+d,show_explain_probe_do_select';
send
SELECT b AS field1, b AS field2 FROM t1, t2, t3 WHERE d = b ORDER BY field1, field2;
@@ -1023,7 +1041,7 @@ evalp show explain for $thr2;
connection con1;
reap;
-set debug_dbug='';
+set debug_dbug=@old_debug;
DROP TABLE t1,t2,t3;
@@ -1047,7 +1065,7 @@ SELECT max(a+b+c) FROM t1 AS alias1, ( SELECT * FROM t2 ) AS alias
WHERE EXISTS ( SELECT * FROM t3 WHERE b = c ) OR a <= 10;
set @show_explain_probe_select_id=1;
-set debug_dbug='d,show_explain_probe_join_exec_start';
+set debug_dbug='+d,show_explain_probe_join_exec_start';
send
SELECT max(a+b+c) FROM t1 AS alias1, ( SELECT * FROM t2 ) AS alias
@@ -1060,8 +1078,7 @@ evalp show explain for $thr2;
connection con1;
reap;
-set debug_dbug='';
-
+set debug_dbug=@old_debug;
DROP TABLE t1,t2,t3;
--echo #
@@ -1088,7 +1105,7 @@ select charset('ãû');
select hex('ãû');
set @show_explain_probe_select_id=1;
-set debug_dbug='d,show_explain_probe_join_exec_start';
+set debug_dbug='+d,show_explain_probe_join_exec_start';
send
select * from t0 where length('ãû') = a;
@@ -1103,7 +1120,7 @@ connection con1;
# The constant should be two letters, the last looking like 'bl'
reap;
-set debug_dbug='';
+set debug_dbug=@old_debug;
set names default;
--echo #
diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test
index 7fc8dad3bb9..9db6709a8d2 100644
--- a/mysql-test/t/sp.test
+++ b/mysql-test/t/sp.test
@@ -9151,6 +9151,26 @@ CALL p1(1);
DROP PROCEDURE p1;
+--echo
+--echo MDEV-3900 Optimizer difference between MySQL and MariaDB with stored functions in WHERE clause of UPDATE or DELETE statements
+--echo
+
+CREATE FUNCTION tdn() RETURNS int(7) DETERMINISTIC RETURN to_days(now());
+
+CREATE TABLE t1 (pk INT NOT NULL AUTO_INCREMENT PRIMARY KEY, daynum INT, a CHAR(1), INDEX(daynum), INDEX(a)) ENGINE=MyISAM;
+INSERT INTO t1 (daynum) VALUES (1),(2),(3),(4),(5),(TO_DAYS(NOW())),(7),(8);
+INSERT INTO t1 (daynum) SELECT a1.daynum FROM t1 a1, t1 a2, t1 a3, t1 a4, t1 a5;
+
+FLUSH TABLES;
+FLUSH STATUS;
+
+SHOW STATUS LIKE '%Handler_read%';
+UPDATE t1 SET a = '+' WHERE daynum=tdn();
+SHOW STATUS LIKE '%Handler_read%';
+
+drop function tdn;
+drop table t1;
+
--echo #
--echo # lp:1002157 : testing stored function
--echo # bug#62125 result for null incorrectly yields 1292 warning.
diff --git a/mysql-test/t/sp_notembedded.test b/mysql-test/t/sp_notembedded.test
index 39e7102079c..447a1db762e 100644
--- a/mysql-test/t/sp_notembedded.test
+++ b/mysql-test/t/sp_notembedded.test
@@ -429,14 +429,6 @@ disconnect addcon;
DROP DATABASE `my.db`;
USE test;
-#
-# Restore global concurrent_insert value. Keep in the end of the test file.
-#
-
-set @@global.concurrent_insert= @old_concurrent_insert;
-
-# Wait till all disconnects are completed
---source include/wait_until_count_sessions.inc
--echo #
--echo # Bug#11763507 - 56224: FUNCTION NAME IS CASE-SENSITIVE
@@ -461,3 +453,16 @@ SHOW CREATE EVENT TESTE_bug11763507;
DROP EVENT teste_bug11763507;
--echo #END OF BUG#11763507 test.
+
+--echo # ------------------------------------------------------------------
+--echo # -- End of 5.1 tests
+--echo # ------------------------------------------------------------------
+
+#
+# Restore global concurrent_insert value. Keep in the end of the test file.
+#
+
+set @@global.concurrent_insert= @old_concurrent_insert;
+
+# Wait till all disconnects are completed
+--source include/wait_until_count_sessions.inc
diff --git a/mysql-test/t/stat_tables_par.test b/mysql-test/t/stat_tables_par.test
index 57b57e3ebba..6c4e1be6e48 100644
--- a/mysql-test/t/stat_tables_par.test
+++ b/mysql-test/t/stat_tables_par.test
@@ -242,4 +242,37 @@ DROP DATABASE dbt3_s001;
use test;
+#
+# Bug mdev-4019: crash when executing in parallel ANALYZE and
+# SELECT * FROM information_schema.statistics
+#
+
+set @save_global_use_stat_tables=@@global.use_stat_tables;
+set global use_stat_tables='preferably';
+set debug_sync='RESET';
+
+create table t1 (a int, b int, key(a));
+insert t1 values (1,1),(2,2);
+
+analyze table t1;
+
+SET debug_sync='after_open_table_ignore_flush WAIT_FOR go';
+send select * from information_schema.statistics where table_schema='test';
+
+connect(con1, localhost, root);
+connection con1;
+select * from t1;
+SET DEBUG_SYNC= "now SIGNAL go";
+
+connection default;
+reap;
+
+connection default;
+disconnect con1;
+set debug_sync='RESET';
+
+drop table t1;
+set global use_stat_tables=@save_global_use_stat_tables;
+
+
set use_stat_tables=@save_use_stat_tables;
diff --git a/mysql-test/t/subselect4.test b/mysql-test/t/subselect4.test
index 14b62bfd2f7..37f660d6682 100644
--- a/mysql-test/t/subselect4.test
+++ b/mysql-test/t/subselect4.test
@@ -1778,6 +1778,57 @@ drop table t1, t2;
set optimizer_switch=@subselect4_tmp;
--echo #
+--echo # MDEV-3928 Assertion `example' failed in Item_cache::is_expensive_processor with a 2-level IN subquery
+--echo #
+
+CREATE TABLE t1 (a1 INT, b1 TIME) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (4,'21:22:34'),(6,'10:50:38');
+
+CREATE TABLE t2 (a2 INT, b2 TIME) ENGINE=MyISAM;
+INSERT INTO t2 VALUES (8, '06:17:39');
+
+CREATE TABLE t3 (a3 INT, b3 TIME) ENGINE=MyISAM;
+INSERT INTO t3 VALUES (1,'00:00:01'),(7,'00:00:02');
+
+EXPLAIN
+SELECT * FROM t1 WHERE a1 IN (
+ SELECT a2 FROM t2 WHERE a2 IN (
+ SELECT a3 FROM t3 WHERE b2 = b1 AND b2 <= b1 ORDER BY b3
+ )
+);
+
+SELECT * FROM t1 WHERE a1 IN (
+ SELECT a2 FROM t2 WHERE a2 IN (
+ SELECT a3 FROM t3 WHERE b2 = b1 AND b2 <= b1 ORDER BY b3
+ )
+);
+drop table t1, t2, t3;
+
+--echo #
+--echo # MDEV-4056:Server crashes in Item_func_trig_cond::val_int
+--echo # with FROM and NOT IN subqueries, LEFT JOIN, derived_merge+in_to_exists
+--echo #
+
+set @optimizer_switch_MDEV4056 = @@optimizer_switch;
+SET optimizer_switch = 'derived_merge=on,in_to_exists=on';
+
+CREATE TABLE t1 (a VARCHAR(1)) ENGINE=MyISAM;
+INSERT INTO t1 VALUES ('x'),('d');
+
+CREATE TABLE t2 (pk INT PRIMARY KEY, b INT, c VARCHAR(1)) ENGINE=MyISAM;
+INSERT INTO t2 VALUES (1,2,'v'),(2,150,'v');
+
+SELECT * FROM t1 LEFT JOIN (
+ SELECT * FROM t2 WHERE ( pk, pk ) NOT IN (
+ SELECT MIN(b), SUM(pk) FROM t1
+ )
+) AS alias1 ON (a = c)
+WHERE b IS NULL OR a < 'u';
+
+drop table t1,t2;
+set @@optimizer_switch = @optimizer_switch_MDEV4056;
+
+--echo #
--echo # MDEV-3899 Valgrind warnings (blocks are definitely lost) in filesort on IN subquery with SUM and DISTINCT
--echo #
diff --git a/mysql-test/t/subselect_innodb.test b/mysql-test/t/subselect_innodb.test
index 523e1774a9c..fc07a088a15 100644
--- a/mysql-test/t/subselect_innodb.test
+++ b/mysql-test/t/subselect_innodb.test
@@ -425,4 +425,18 @@ select 1 from t1 where 1 like (select 1 from t1 where 1 <=> (select 1 from t1 gr
drop table t1;
+--echo #
+--echo # MDEV-3988 crash in create_tmp_table
+--echo #
+
+drop table if exists `t1`,`t2`;
+create table `t1`(`a` char(1) character set utf8)engine=innodb;
+create table `t2`(`b` char(1) character set utf8)engine=memory;
+select distinct (select 1 from `t2` where `a`) `d2` from `t1`;
+select distinct (select 1 from `t2` where `a`) `d2`, a from `t1`;
+select distinct a, (select 1 from `t2` where `a`) `d2` from `t1`;
+select distinct (1 + (select 1 from `t2` where `a`)) `d2` from `t1`;
+
+drop table t1,t2;
+
set optimizer_switch=@subselect_innodb_tmp;
diff --git a/mysql-test/t/subselect_sj.test b/mysql-test/t/subselect_sj.test
index 2facb089718..efbd2b00f24 100644
--- a/mysql-test/t/subselect_sj.test
+++ b/mysql-test/t/subselect_sj.test
@@ -2462,5 +2462,74 @@ HAVING t1sum <> 1;
DROP TABLE t1, t2;
+--echo #
+--echo # MDEV-3911: Assertion `fixed == 0' failed in Item_field::fix_fields
+--echo # on 2nd execution of PS with semijoin=on and IN subquery
+--echo #
+
+CREATE TABLE t1 (a INT, b INT) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (0,4),(8,6);
+
+CREATE TABLE t2 (c INT, d INT) ENGINE=MyISAM;
+INSERT INTO t2 VALUES (7,1),(0,7);
+
+eval PREPARE stmt FROM ' SELECT * FROM t1 WHERE ( a, b ) IN ( SELECT c, d FROM t2 ) ';
+
+execute stmt;
+execute stmt;
+
+deallocate prepare stmt;
+drop table t1,t2;
+
+--echo #
+--echo # MySQL Bug#13340270: assertion table->sort.record_pointers == __null
+--echo #
+
+CREATE TABLE t1 (
+ pk int NOT NULL,
+ col_int_key int DEFAULT NULL,
+ col_varchar_key varchar(1) DEFAULT NULL,
+ col_varchar_nokey varchar(1) DEFAULT NULL,
+ PRIMARY KEY (pk),
+ KEY col_int_key (col_int_key),
+ KEY col_varchar_key (col_varchar_key, col_int_key)
+) ENGINE=InnoDB;
+
+INSERT INTO t1 VALUES
+(10,8,'x','x'),
+(11,7,'d','d'),
+(12,1,'r','r'),
+(13,7,'f','f'),
+(14,9,'y','y'),
+(15,NULL,'u','u'),
+(16,1,'m','m'),
+(17,9,NULL,NULL),
+(18,2,'o','o'),
+(19,9,'w','w'),
+(20,2,'m','m'),
+(21,4,'q','q');
+
+let $query=
+ SELECT alias1.col_varchar_nokey AS field1
+ FROM t1 AS alias1 JOIN t1 AS alias2
+ ON alias2.col_int_key = alias1.pk OR
+ alias2.col_int_key = alias1.col_int_key
+ WHERE alias1.pk = 58 OR alias1.col_varchar_key = 'o'
+;
+
+eval CREATE TABLE t2
+ $query
+;
+
+eval EXPLAIN SELECT *
+FROM t2
+WHERE (field1) IN ($query);
+
+eval SELECT *
+FROM t2
+WHERE (field1) IN ($query);
+
+DROP TABLE t1, t2;
+
# The following command must be the last one the file
set optimizer_switch=@subselect_sj_tmp;
diff --git a/mysql-test/t/sum_distinct-big.test b/mysql-test/t/sum_distinct-big.test
index 0859f4b3d89..d3710056c9a 100644
--- a/mysql-test/t/sum_distinct-big.test
+++ b/mysql-test/t/sum_distinct-big.test
@@ -63,5 +63,22 @@ SELECT SUM(DISTINCT id) sm FROM t1;
SELECT SUM(DISTINCT id) sm FROM t2;
SELECT SUM(DISTINCT id) sm FROM t1 GROUP BY id % 13;
+--echo #
+--echo # Bug mdev-4063: SUM(DISTINCT...) with small'max_heap_table_size
+--echo # (bug #56927)
+--echo #
+
+SET max_heap_table_size=default;
+
+INSERT INTO t1 SELECT id+16384 FROM t1;
+DELETE FROM t2;
+INSERT INTO t2 SELECT id FROM t1 ORDER BY id*rand();
+
+SELECT SUM(DISTINCT id) sm FROM t2;
+
+SET max_heap_table_size=16384;
+
+SELECT SUM(DISTINCT id) sm FROM t2;
+
DROP TABLE t1;
DROP TABLE t2;
diff --git a/mysql-test/t/user_var.test b/mysql-test/t/user_var.test
index c6c4e4d9d2f..c6930a7e468 100644
--- a/mysql-test/t/user_var.test
+++ b/mysql-test/t/user_var.test
@@ -452,4 +452,18 @@ SELECT DISTINCT POW(COUNT(distinct a), @a:=(SELECT 1 FROM t1 LEFT JOIN t1 AS t2
SELECT @a;
DROP TABLE t1;
+--echo #
+--echo # Check that used memory extends if we set a variable
+--echo #
+
+# Execute twice so number stablizes a bit
+let $tmp= `select memory_used from information_schema.processlist`;
+set @var= repeat('a',20000);
+let $tmp2= `select memory_used from information_schema.processlist`;
+--disable_query_log
+--disable_column_names
+eval select $tmp < $tmp2;
+--enable_column_names
+--enable_query_log
+
--echo End of 5.5 tests
diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test
index 072a179e822..4569443dbac 100644
--- a/mysql-test/t/view.test
+++ b/mysql-test/t/view.test
@@ -4703,6 +4703,32 @@ drop view v2;
drop table t1,t2;
--echo #
+--echo # MDEV-3914: Wrong result (NULLs instead of real values)
+--echo # with INNER and RIGHT JOIN in a FROM subquery, derived_merge=on
+--echo # (fix of above MDEV-486 fix)
+--echo #
+SET @save_optimizer_switch_MDEV_3914=@@optimizer_switch;
+SET optimizer_switch = 'derived_merge=on';
+
+CREATE TABLE t1 (a INT) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (1),(2);
+
+CREATE TABLE t2 (b INT) ENGINE=MyISAM;
+INSERT INTO t2 VALUES (3),(4);
+
+CREATE TABLE t3 (c INT) ENGINE=MyISAM;
+INSERT INTO t3 VALUES (5),(6);
+
+SELECT * FROM ( SELECT c FROM ( t1 INNER JOIN t2 ) RIGHT JOIN t3 ON a = c ) AS alias;
+
+SET optimizer_switch = 'derived_merge=off';
+
+SELECT * FROM ( SELECT c FROM ( t1 INNER JOIN t2 ) RIGHT JOIN t3 ON a = c ) AS alias;
+
+SET optimizer_switch=@save_optimizer_switch_MDEV_3914;
+drop table t1,t2,t3;
+
+--echo #
--echo # MDEV-589 (LP BUG#1007647) :
--echo # Assertion `vcol_table == 0 || vcol_table == table' failed in
--echo # fill_record(THD*, List<Item>&, List<Item>&, bool)
@@ -4747,6 +4773,27 @@ SELECT * FROM (
drop tables t1,t2;
+--echo #
+--echo # MDEV-3876 Wrong result (extra rows) with ALL subquery
+--echo # from a MERGE view (duplicate of MDEV-3873)
+--echo #
+
+CREATE TABLE t1 (a INT NOT NULL) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (1),(2);
+
+CREATE TABLE t2 (b INT NOT NULL) ENGINE=MyISAM;
+INSERT INTO t2 VALUES (1),(3);
+
+CREATE OR REPLACE ALGORITHM=MERGE VIEW v1 AS SELECT * FROM t2;
+
+SELECT a FROM t1 AS alias
+WHERE a >= ALL (
+SELECT b FROM t1 LEFT JOIN v1 ON (a = b)
+WHERE a = alias.a );
+
+drop view v1;
+drop table t1,t2;
+
--echo # -----------------------------------------------------------------
--echo # -- End of 5.3 tests.
--echo # -----------------------------------------------------------------
diff --git a/mysql-test/valgrind.supp b/mysql-test/valgrind.supp
index 800a5a90b39..39748edd476 100644
--- a/mysql-test/valgrind.supp
+++ b/mysql-test/valgrind.supp
@@ -637,6 +637,14 @@
fun:kill_server
}
+{
+ Aria checkpoint background thread not dying fast enough
+ Memcheck:Leak
+ fun:calloc
+ fun:my_thread_init
+ fun:ma_checkpoint_background
+}
+
#
# Warning caused by small memory leak in threaded dlopen
#
diff --git a/mysys/array.c b/mysys/array.c
index 94f1cb8de34..60f2202f5b3 100644
--- a/mysys/array.c
+++ b/mysys/array.c
@@ -22,15 +22,16 @@
Initiate dynamic array
SYNOPSIS
- init_dynamic_array2()
+ my_init_dynamic_array2()
array Pointer to an array
element_size Size of element
init_buffer Initial buffer pointer
init_alloc Number of initial elements
alloc_increment Increment for adding new elements
+ my_flags Flags to my_malloc
DESCRIPTION
- init_dynamic_array() initiates array and allocate space for
+ my_init_dynamic_array2() initiates array and allocate space for
init_alloc eilements.
Array is usable even if space allocation failed, hence, the
function never returns TRUE.
@@ -40,11 +41,11 @@
FALSE Ok
*/
-my_bool init_dynamic_array2(DYNAMIC_ARRAY *array, uint element_size,
+my_bool my_init_dynamic_array2(DYNAMIC_ARRAY *array, uint element_size,
void *init_buffer, uint init_alloc,
- uint alloc_increment)
+ uint alloc_increment, myf my_flags)
{
- DBUG_ENTER("init_dynamic_array2");
+ DBUG_ENTER("my_init_dynamic_array2");
if (!alloc_increment)
{
alloc_increment=max((8192-MALLOC_OVERHEAD)/element_size,16);
@@ -55,6 +56,7 @@ my_bool init_dynamic_array2(DYNAMIC_ARRAY *array, uint element_size,
array->max_element=init_alloc;
array->alloc_increment=alloc_increment;
array->size_of_element=element_size;
+ array->malloc_flags= my_flags;
if ((array->buffer= init_buffer))
DBUG_RETURN(FALSE);
/*
@@ -62,18 +64,12 @@ my_bool init_dynamic_array2(DYNAMIC_ARRAY *array, uint element_size,
should not throw an error
*/
if (init_alloc &&
- !(array->buffer= (uchar*) my_malloc(element_size*init_alloc, MYF(0))))
+ !(array->buffer= (uchar*) my_malloc(element_size*init_alloc,
+ MYF(my_flags))))
array->max_element=0;
DBUG_RETURN(FALSE);
}
-my_bool init_dynamic_array(DYNAMIC_ARRAY *array, uint element_size,
- uint init_alloc, uint alloc_increment)
-{
- /* placeholder to preserve ABI */
- return my_init_dynamic_array_ci(array, element_size, init_alloc,
- alloc_increment);
-}
/*
Insert element at the end of array. Allocate memory if needed.
@@ -137,7 +133,7 @@ void *alloc_dynamic(DYNAMIC_ARRAY *array)
if (!(new_ptr= (char *) my_malloc((array->max_element+
array->alloc_increment) *
array->size_of_element,
- MYF(MY_WME))))
+ MYF(array->malloc_flags | MY_WME))))
DBUG_RETURN(0);
memcpy(new_ptr, array->buffer,
array->elements * array->size_of_element);
@@ -146,7 +142,8 @@ void *alloc_dynamic(DYNAMIC_ARRAY *array)
my_realloc(array->buffer,(array->max_element+
array->alloc_increment)*
array->size_of_element,
- MYF(MY_WME | MY_ALLOW_ZERO_PTR))))
+ MYF(MY_WME | MY_ALLOW_ZERO_PTR |
+ array->malloc_flags))))
DBUG_RETURN(0);
array->buffer= (uchar*) new_ptr;
array->max_element+=array->alloc_increment;
@@ -242,14 +239,15 @@ my_bool allocate_dynamic(DYNAMIC_ARRAY *array, uint max_elements)
*/
if (!(new_ptr= (uchar *) my_malloc(size *
array->size_of_element,
- MYF(MY_WME))))
+ MYF(array->malloc_flags | MY_WME))))
DBUG_RETURN(0);
memcpy(new_ptr, array->buffer,
array->elements * array->size_of_element);
}
else if (!(new_ptr= (uchar*) my_realloc(array->buffer,size*
array->size_of_element,
- MYF(MY_WME | MY_ALLOW_ZERO_PTR))))
+ MYF(MY_WME | MY_ALLOW_ZERO_PTR |
+ array->malloc_flags))))
DBUG_RETURN(TRUE);
array->buffer= new_ptr;
array->max_element= size;
@@ -347,7 +345,7 @@ void freeze_size(DYNAMIC_ARRAY *array)
{
array->buffer=(uchar*) my_realloc(array->buffer,
elements*array->size_of_element,
- MYF(MY_WME));
+ MYF(MY_WME | array->malloc_flags));
array->max_element=elements;
}
}
diff --git a/mysys/default.c b/mysys/default.c
index c7ac0d89462..a90f428eca5 100644
--- a/mysys/default.c
+++ b/mysys/default.c
@@ -520,7 +520,7 @@ int my_load_defaults(const char *conf_file, const char **groups,
uint args_sep= my_getopt_use_args_separator ? 1 : 0;
DBUG_ENTER("load_defaults");
- init_alloc_root(&alloc,512,0);
+ init_alloc_root(&alloc, 512, 0, MYF(0));
if ((dirs= init_default_directories(&alloc)) == NULL)
goto err;
/*
@@ -566,7 +566,7 @@ int my_load_defaults(const char *conf_file, const char **groups,
for (; *groups ; groups++)
group.count++;
- if (my_init_dynamic_array(&args, sizeof(char*),*argc, 32))
+ if (my_init_dynamic_array(&args, sizeof(char*),*argc, 32, MYF(0)))
goto err;
ctx.alloc= &alloc;
@@ -1043,7 +1043,7 @@ void my_print_default_files(const char *conf_file)
{
const char **dirs;
MEM_ROOT alloc;
- init_alloc_root(&alloc,512,0);
+ init_alloc_root(&alloc, 512, 0, MYF(0));
if ((dirs= init_default_directories(&alloc)) == NULL)
{
diff --git a/mysys/hash.c b/mysys/hash.c
index b93f6b666d6..0a830d8e3f4 100644
--- a/mysys/hash.c
+++ b/mysys/hash.c
@@ -89,8 +89,10 @@ _my_hash_init(HASH *hash, uint growth_size, CHARSET_INFO *charset,
hash->free=free_element;
hash->flags=flags;
hash->charset=charset;
- res= my_init_dynamic_array_ci(&hash->array,
- sizeof(HASH_LINK), size, growth_size);
+ res= my_init_dynamic_array2(&hash->array,
+ sizeof(HASH_LINK), NULL, size, growth_size,
+ MYF((flags & HASH_THREAD_SPECIFIC ?
+ MY_THREAD_SPECIFIC : 0)));
DBUG_RETURN(res);
}
diff --git a/mysys/ma_dyncol.c b/mysys/ma_dyncol.c
index c717f69c3e5..8a224f1c5e8 100644
--- a/mysys/ma_dyncol.c
+++ b/mysys/ma_dyncol.c
@@ -1,5 +1,5 @@
-/* Copyright (c) 2011, Monty Program Ab
- Copyright (c) 2011, Oleksandr Byelkin
+/* Copyright (c) 2011,2012 Monty Program Ab;
+ Copyright (c) 2011,2012 Oleksandr Byelkin
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
@@ -26,33 +26,103 @@
SUCH DAMAGE.
*/
+/*
+ Numeric format:
+ ===============
+ * Fixed header part
+ 1 byte flags:
+ 0,1 bits - <offset size> - 1
+ 2-7 bits - 0
+ 2 bytes column counter
+ * Columns directory sorted by column number, each entry contains of:
+ 2 bytes column number
+ <offset size> bytes (1-4) combined offset from beginning of
+ the data segment + 3 bit type
+ * Data of above columns size of data and length depend on type
+
+ Columns with names:
+ ===================
+ * Fixed header part
+ 1 byte flags:
+ 0,1 bits - <offset size> - 2
+ 2 bit - 1 (means format with names)
+ 3,4 bits - 00 (means <names offset size> - 2,
+ now 2 is the only supported size)
+ 5-7 bits - 0
+ 2 bytes column counter
+ * Variable header part (now it is actually fixed part)
+ <names offset size> (2) bytes size of stored names pool
+ * Column directory sorted by names, each consists of
+ <names offset size> (2) bytes offset of name
+ <offset size> bytes (2-5)bytes combined offset from beginning of
+ the data segment + 4 bit type
+ * Names stored one after another
+ * Data of above columns size of data and length depend on type
+*/
+
#include "mysys_priv.h"
#include <m_string.h>
#include <ma_dyncol.h>
+#include <my_time.h>
+uint32 copy_and_convert(char *to, uint32 to_length, CHARSET_INFO *to_cs,
+ const char *from, uint32 from_length,
+ CHARSET_INFO *from_cs, uint *errors);
/*
Flag byte bits
2 bits which determinate size of offset in the header -1
*/
/* mask to get above bits */
-#define DYNCOL_FLG_OFFSET 3
-/* All known flags mask */
-#define DYNCOL_FLG_KNOWN 3
+#define DYNCOL_FLG_OFFSET (1|2)
+#define DYNCOL_FLG_NAMES 4
+#define DYNCOL_FLG_NMOFFSET (8|16)
+/**
+ All known flags mask that could be set.
+
+ @note DYNCOL_FLG_NMOFFSET should be 0 for now.
+*/
+#define DYNCOL_FLG_KNOWN (1|2|4)
+
+/* formats */
+enum enum_dyncol_format
+{
+ dyncol_fmt_num= 0,
+ dyncol_fmt_str= 1
+};
/* dynamic column size reserve */
#define DYNCOL_SYZERESERVE 80
+#define DYNCOL_OFFSET_ERROR 0xffffffff
+
/* length of fixed string header 1 byte - flags, 2 bytes - columns counter */
#define FIXED_HEADER_SIZE 3
+/*
+ length of fixed string header with names
+ 1 byte - flags, 2 bytes - columns counter, 2 bytes - name pool size
+*/
+#define FIXED_HEADER_SIZE_NM 5
#define COLUMN_NUMBER_SIZE 2
+/* 2 bytes offset from the name pool */
+#define COLUMN_NAMEPTR_SIZE 2
+
+#define MAX_OFFSET_LENGTH 4
+#define MAX_OFFSET_LENGTH_NM 5
+
+#define DYNCOL_NUM_CHAR 6
-#define MAX_OFFSET_LENGTH 5
+my_bool mariadb_dyncol_has_names(DYNAMIC_COLUMN *str)
+{
+ if (str->length < 1)
+ return FALSE;
+ return test(str->str[0] & DYNCOL_FLG_NAMES);
+}
static enum enum_dyncol_func_result
dynamic_column_time_store(DYNAMIC_COLUMN *str,
- MYSQL_TIME *value);
+ MYSQL_TIME *value, enum enum_dyncol_format format);
static enum enum_dyncol_func_result
dynamic_column_date_store(DYNAMIC_COLUMN *str,
MYSQL_TIME *value);
@@ -62,6 +132,546 @@ dynamic_column_time_read_internal(DYNAMIC_COLUMN_VALUE *store_it_here,
static enum enum_dyncol_func_result
dynamic_column_date_read_internal(DYNAMIC_COLUMN_VALUE *store_it_here,
uchar *data, size_t length);
+static enum enum_dyncol_func_result
+dynamic_column_get_internal(DYNAMIC_COLUMN *str,
+ DYNAMIC_COLUMN_VALUE *store_it_here,
+ uint num_key, LEX_STRING *str_key);
+static enum enum_dyncol_func_result
+dynamic_column_exists_internal(DYNAMIC_COLUMN *str, uint num_key,
+ LEX_STRING *str_key);
+static enum enum_dyncol_func_result
+dynamic_column_update_many_fmt(DYNAMIC_COLUMN *str,
+ uint add_column_count,
+ void *column_keys,
+ DYNAMIC_COLUMN_VALUE *values,
+ my_bool string_keys);
+static int plan_sort_num(const void *a, const void *b);
+static int plan_sort_named(const void *a, const void *b);
+
+/*
+ Structure to hold information about dynamic columns record and
+ iterate through it.
+*/
+
+struct st_dyn_header
+{
+ uchar *header, *nmpool, *dtpool, *data_end;
+ size_t offset_size;
+ size_t entry_size;
+ size_t header_size;
+ size_t nmpool_size;
+ size_t data_size;
+ /* dyncol_fmt_num - numeric columns, dyncol_fmt_str - column names */
+ enum enum_dyncol_format format;
+ uint column_count;
+
+ uchar *entry, *data, *name;
+ size_t offset;
+ size_t length;
+ enum enum_dynamic_column_type type;
+};
+
+typedef struct st_dyn_header DYN_HEADER;
+
+static inline my_bool read_fixed_header(DYN_HEADER *hdr,
+ DYNAMIC_COLUMN *str);
+static void set_fixed_header(DYNAMIC_COLUMN *str,
+ uint offset_size,
+ uint column_count);
+
+/*
+ Calculate entry size (E) and header size (H) by offset size (O) and column
+ count (C) and fixed part of entry size (F).
+*/
+
+#define calc_param(E,H,F,O,C) do { \
+ (*(E))= (O) + F; \
+ (*(H))= (*(E)) * (C); \
+}while(0);
+
+
+/**
+ Name pool size functions, for numeric format it is 0
+*/
+
+static size_t name_size_num(void *keys __attribute__((unused)),
+ uint i __attribute__((unused)))
+{
+ return 0;
+}
+
+
+/**
+ Name pool size functions.
+*/
+static size_t name_size_named(void *keys, uint i)
+{
+ return ((LEX_STRING *) keys)[i].length;
+}
+
+
+/**
+ Comparator function for references on column numbers for qsort
+ (numeric format)
+*/
+
+static int column_sort_num(const void *a, const void *b)
+{
+ return **((uint **)a) - **((uint **)b);
+}
+
+/**
+ Comparator function for references on column numbers for qsort
+ (names format)
+*/
+
+int mariadb_dyncol_column_cmp_named(const LEX_STRING *s1, const LEX_STRING *s2)
+{
+ /*
+ We compare instead of subtraction to avoid data loss in case of huge
+ length difference (more then fit in int).
+ */
+ int rc= (s1->length > s2->length ? 1 :
+ (s1->length < s2->length ? -1 : 0));
+ if (rc == 0)
+ rc= memcmp((void *)s1->str, (void *)s2->str,
+ (size_t) s1->length);
+ return rc;
+}
+
+
+/**
+ Comparator function for references on column numbers for qsort
+ (names format)
+*/
+
+static int column_sort_named(const void *a, const void *b)
+{
+ return mariadb_dyncol_column_cmp_named(*((LEX_STRING **)a),
+ *((LEX_STRING **)b));
+}
+
+
+/**
+ Check limit function (numeric format)
+*/
+
+static my_bool check_limit_num(const void *val)
+{
+ return **((uint **)val) > UINT_MAX16;
+}
+
+
+/**
+ Check limit function (names format)
+*/
+
+static my_bool check_limit_named(const void *val)
+{
+ return (*((LEX_STRING **)val))->length > MAX_NAME_LENGTH;
+}
+
+
+/**
+ Write numeric format static header part.
+*/
+
+static void set_fixed_header_num(DYNAMIC_COLUMN *str, DYN_HEADER *hdr)
+{
+ set_fixed_header(str, (uint)hdr->offset_size, hdr->column_count);
+ hdr->header= (uchar *)str->str + FIXED_HEADER_SIZE;
+ hdr->nmpool= hdr->dtpool= hdr->header + hdr->header_size;
+}
+
+
+/**
+ Write names format static header part.
+*/
+
+static void set_fixed_header_named(DYNAMIC_COLUMN *str, DYN_HEADER *hdr)
+{
+ DBUG_ASSERT(hdr->column_count <= 0xffff);
+ DBUG_ASSERT(hdr->offset_size <= MAX_OFFSET_LENGTH_NM);
+ /* size of data offset, named format flag, size of names offset (0 means 2) */
+ str->str[0]=
+ (char) ((str->str[0] & ~(DYNCOL_FLG_OFFSET | DYNCOL_FLG_NMOFFSET)) |
+ (hdr->offset_size - 2) | DYNCOL_FLG_NAMES);
+ int2store(str->str + 1, hdr->column_count); /* columns number */
+ int2store(str->str + 3, hdr->nmpool_size);
+ hdr->header= (uchar *)str->str + FIXED_HEADER_SIZE_NM;
+ hdr->nmpool= hdr->header + hdr->header_size;
+ hdr->dtpool= hdr->nmpool + hdr->nmpool_size;
+}
+
+
+/**
+ Store offset and type information in the given place
+
+ @param place Beginning of the index entry
+ @param offset_size Size of offset field in bytes
+ @param type Type to be written
+ @param offset Offset to be written
+*/
+
+static my_bool type_and_offset_store_num(uchar *place, size_t offset_size,
+ DYNAMIC_COLUMN_TYPE type,
+ size_t offset)
+{
+ ulong val = (((ulong) offset) << 3) | (type - 1);
+ DBUG_ASSERT(type != DYN_COL_NULL);
+ DBUG_ASSERT(((type - 1) & (~7)) == 0); /* fit in 3 bits */
+ DBUG_ASSERT(offset_size >= 1 && offset_size <= 4);
+
+ /* Index entry starts with column number; jump over it */
+ place+= COLUMN_NUMBER_SIZE;
+
+ switch (offset_size) {
+ case 1:
+ if (offset >= 0x1f) /* all 1 value is reserved */
+ return TRUE;
+ place[0]= (uchar)val;
+ break;
+ case 2:
+ if (offset >= 0x1fff) /* all 1 value is reserved */
+ return TRUE;
+ int2store(place, val);
+ break;
+ case 3:
+ if (offset >= 0x1fffff) /* all 1 value is reserved */
+ return TRUE;
+ int3store(place, val);
+ break;
+ case 4:
+ if (offset >= 0x1fffffff) /* all 1 value is reserved */
+ return TRUE;
+ int4store(place, val);
+ break;
+ default:
+ return TRUE;
+ }
+ return FALSE;
+}
+
+
+static my_bool type_and_offset_store_named(uchar *place, size_t offset_size,
+ DYNAMIC_COLUMN_TYPE type,
+ size_t offset)
+{
+ ulonglong val = (((ulong) offset) << 4) | (type - 1);
+ DBUG_ASSERT(type != DYN_COL_NULL);
+ DBUG_ASSERT(((type - 1) & (~0xf)) == 0); /* fit in 4 bits */
+ DBUG_ASSERT(offset_size >= 2 && offset_size <= 5);
+
+ /* Index entry starts with name offset; jump over it */
+ place+= COLUMN_NAMEPTR_SIZE;
+ switch (offset_size) {
+ case 2:
+ if (offset >= 0xfff) /* all 1 value is reserved */
+ return TRUE;
+ int2store(place, val);
+ break;
+ case 3:
+ if (offset >= 0xfffff) /* all 1 value is reserved */
+ return TRUE;
+ int3store(place, val);
+ break;
+ case 4:
+ if (offset >= 0xfffffff) /* all 1 value is reserved */
+ return TRUE;
+ int4store(place, val);
+ break;
+ case 5:
+#if SIZEOF_SIZE_T > 4
+ if (offset >= 0xfffffffffull) /* all 1 value is reserved */
+ return TRUE;
+#endif
+ int5store(place, val);
+ break;
+ case 1:
+ default:
+ return TRUE;
+ }
+ return FALSE;
+}
+
+/**
+ Write numeric format header entry
+ 2 bytes - column number
+ 1-4 bytes - data offset combined with type
+
+ @param hdr descriptor of dynamic column record
+ @param column_key pointer to uint (column number)
+ @param value value which will be written (only type used)
+ @param offset offset of the data
+*/
+
+static my_bool put_header_entry_num(DYN_HEADER *hdr,
+ void *column_key,
+ DYNAMIC_COLUMN_VALUE *value,
+ size_t offset)
+{
+ uint *column_number= (uint *)column_key;
+ int2store(hdr->entry, *column_number);
+ DBUG_ASSERT(hdr->nmpool_size == 0);
+ if (type_and_offset_store_num(hdr->entry, hdr->offset_size,
+ value->type,
+ offset))
+ return TRUE;
+ hdr->entry= hdr->entry + hdr->entry_size;
+ return FALSE;
+}
+
+
+/**
+ Write names format header entry
+ 1 byte - name length
+ 2 bytes - name offset in the name pool
+ 1-4 bytes - data offset combined with type
+
+ @param hdr descriptor of dynamic column record
+ @param column_key pointer to LEX_STRING (column name)
+ @param value value which will be written (only type used)
+ @param offset offset of the data
+*/
+
+static my_bool put_header_entry_named(DYN_HEADER *hdr,
+ void *column_key,
+ DYNAMIC_COLUMN_VALUE *value,
+ size_t offset)
+{
+ LEX_STRING *column_name= (LEX_STRING *)column_key;
+ DBUG_ASSERT(column_name->length <= MAX_NAME_LENGTH);
+ DBUG_ASSERT(hdr->name - hdr->nmpool < (long) 0x10000L);
+ int2store(hdr->entry, hdr->name - hdr->nmpool);
+ memcpy(hdr->name, column_name->str, column_name->length);
+ DBUG_ASSERT(hdr->nmpool_size != 0 || column_name->length == 0);
+ if (type_and_offset_store_named(hdr->entry, hdr->offset_size,
+ value->type,
+ offset))
+ return TRUE;
+ hdr->entry+= hdr->entry_size;
+ hdr->name+= column_name->length;
+ return FALSE;
+}
+
+
+/**
+ Calculate length of offset field for given data length
+
+ @param data_length Length of the data segment
+
+ @return number of bytes
+*/
+
+static size_t dynamic_column_offset_bytes_num(size_t data_length)
+{
+ if (data_length < 0x1f) /* all 1 value is reserved */
+ return 1;
+ if (data_length < 0x1fff) /* all 1 value is reserved */
+ return 2;
+ if (data_length < 0x1fffff) /* all 1 value is reserved */
+ return 3;
+ if (data_length < 0x1fffffff) /* all 1 value is reserved */
+ return 4;
+ return MAX_OFFSET_LENGTH + 1; /* For an error generation*/
+}
+
+static size_t dynamic_column_offset_bytes_named(size_t data_length)
+{
+ if (data_length < 0xfff) /* all 1 value is reserved */
+ return 2;
+ if (data_length < 0xfffff) /* all 1 value is reserved */
+ return 3;
+ if (data_length < 0xfffffff) /* all 1 value is reserved */
+ return 4;
+#if SIZEOF_SIZE_T > 4
+ if (data_length < 0xfffffffffull) /* all 1 value is reserved */
+#endif
+ return 5;
+ return MAX_OFFSET_LENGTH_NM + 1; /* For an error generation */
+}
+
+/**
+ Read offset and type information from index entry
+
+ @param type Where to put type info
+ @param offset Where to put offset info
+ @param place beginning of the type and offset
+ @param offset_size Size of offset field in bytes
+*/
+
+static my_bool type_and_offset_read_num(DYNAMIC_COLUMN_TYPE *type,
+ size_t *offset,
+ uchar *place, size_t offset_size)
+{
+ ulong UNINIT_VAR(val);
+ ulong UNINIT_VAR(lim);
+
+ DBUG_ASSERT(offset_size >= 1 && offset_size <= 4);
+
+ switch (offset_size) {
+ case 1:
+ val= (ulong)place[0];
+ lim= 0x1f;
+ break;
+ case 2:
+ val= uint2korr(place);
+ lim= 0x1fff;
+ break;
+ case 3:
+ val= uint3korr(place);
+ lim= 0x1fffff;
+ break;
+ case 4:
+ val= uint4korr(place);
+ lim= 0x1fffffff;
+ break;
+ default:
+ DBUG_ASSERT(0); /* impossible */
+ return 1;
+ }
+ *type= (val & 0x7) + 1;
+ *offset= val >> 3;
+ return (*offset >= lim);
+}
+
+static my_bool type_and_offset_read_named(DYNAMIC_COLUMN_TYPE *type,
+ size_t *offset,
+ uchar *place, size_t offset_size)
+{
+ ulonglong UNINIT_VAR(val);
+ ulonglong UNINIT_VAR(lim);
+ DBUG_ASSERT(offset_size >= 2 && offset_size <= 5);
+
+ switch (offset_size) {
+ case 2:
+ val= uint2korr(place);
+ lim= 0xfff;
+ break;
+ case 3:
+ val= uint3korr(place);
+ lim= 0xfffff;
+ break;
+ case 4:
+ val= uint4korr(place);
+ lim= 0xfffffff;
+ break;
+ case 5:
+ val= uint5korr(place);
+ lim= 0xfffffffffull;
+ break;
+ case 1:
+ default:
+ DBUG_ASSERT(0); /* impossible */
+ return 1;
+ }
+ *type= (val & 0xf) + 1;
+ *offset= val >> 4;
+ return (*offset >= lim);
+}
+
+/**
+ Format descriptor, contain constants and function references for
+ format processing
+*/
+
+struct st_service_funcs
+{
+ /* size of fixed header */
+ uint fixed_hdr;
+ /* size of fixed part of header entry */
+ uint fixed_hdr_entry;
+
+ /*size of array element which stores keys */
+ uint key_size_in_array;
+
+ /* Maximum data offset size in bytes */
+ size_t max_offset_size;
+
+ size_t (*name_size)
+ (void *, uint);
+ int (*column_sort)
+ (const void *a, const void *b);
+ my_bool (*check_limit)
+ (const void *val);
+ void (*set_fixed_hdr)
+ (DYNAMIC_COLUMN *str, DYN_HEADER *hdr);
+ my_bool (*put_header_entry)(DYN_HEADER *hdr,
+ void *column_key,
+ DYNAMIC_COLUMN_VALUE *value,
+ size_t offset);
+ int (*plan_sort)(const void *a, const void *b);
+ size_t (*dynamic_column_offset_bytes)(size_t data_length);
+ my_bool (*type_and_offset_read)(DYNAMIC_COLUMN_TYPE *type,
+ size_t *offset,
+ uchar *place, size_t offset_size);
+
+};
+
+
+/**
+ Actual our 2 format descriptors
+*/
+
+static struct st_service_funcs fmt_data[2]=
+{
+ {
+ FIXED_HEADER_SIZE,
+ COLUMN_NUMBER_SIZE,
+ sizeof(uint),
+ MAX_OFFSET_LENGTH,
+ &name_size_num,
+ &column_sort_num,
+ &check_limit_num,
+ &set_fixed_header_num,
+ &put_header_entry_num,
+ &plan_sort_num,
+ &dynamic_column_offset_bytes_num,
+ &type_and_offset_read_num
+ },
+ {
+ FIXED_HEADER_SIZE_NM,
+ COLUMN_NAMEPTR_SIZE,
+ sizeof(LEX_STRING),
+ MAX_OFFSET_LENGTH_NM,
+ &name_size_named,
+ &column_sort_named,
+ &check_limit_named,
+ &set_fixed_header_named,
+ &put_header_entry_named,
+ &plan_sort_named,
+ &dynamic_column_offset_bytes_named,
+ &type_and_offset_read_named
+ }
+};
+
+
+/**
+ Read dynamic column record header and fill the descriptor
+
+ @param hdr dynamic columns record descriptor to fill
+ @param str dynamic columns record
+
+ @return ER_DYNCOL_* return code
+*/
+
+static enum enum_dyncol_func_result
+init_read_hdr(DYN_HEADER *hdr, DYNAMIC_COLUMN *str)
+{
+ if (read_fixed_header(hdr, str))
+ return ER_DYNCOL_FORMAT;
+ hdr->header= (uchar*)str->str + fmt_data[hdr->format].fixed_hdr;
+ calc_param(&hdr->entry_size, &hdr->header_size,
+ fmt_data[hdr->format].fixed_hdr_entry, hdr->offset_size,
+ hdr->column_count);
+ hdr->nmpool= hdr->header + hdr->header_size;
+ hdr->dtpool= hdr->nmpool + hdr->nmpool_size;
+ hdr->data_size= str->length - fmt_data[hdr->format].fixed_hdr -
+ hdr->header_size - hdr->nmpool_size;
+ hdr->data_end= (uchar*)str->str + str->length;
+ return ER_DYNCOL_OK;
+}
+
/**
Initialize dynamic column string with (make it empty but correct format)
@@ -73,7 +683,7 @@ dynamic_column_date_read_internal(DYNAMIC_COLUMN_VALUE *store_it_here,
@retval TRUE error
*/
-static my_bool dynamic_column_init_str(DYNAMIC_COLUMN *str, size_t size)
+static my_bool dynamic_column_init_named(DYNAMIC_COLUMN *str, size_t size)
{
DBUG_ASSERT(size != 0);
@@ -82,11 +692,8 @@ static my_bool dynamic_column_init_str(DYNAMIC_COLUMN *str, size_t size)
- First \0 is flags
- other 2 \0 is number of fields
*/
- if (init_dynamic_string(str, NULL,
- size + FIXED_HEADER_SIZE, DYNCOL_SYZERESERVE))
+ if (init_dynamic_string(str, NULL, size, DYNCOL_SYZERESERVE))
return TRUE;
- bzero(str->str, FIXED_HEADER_SIZE);
- str->length= FIXED_HEADER_SIZE;
return FALSE;
}
@@ -318,7 +925,8 @@ dynamic_column_sint_read(DYNAMIC_COLUMN_VALUE *store_it_here,
*/
static size_t
-dynamic_column_value_len(DYNAMIC_COLUMN_VALUE *value)
+dynamic_column_value_len(DYNAMIC_COLUMN_VALUE *value,
+ enum enum_dyncol_format format)
{
switch (value->type) {
case DYN_COL_NULL:
@@ -360,14 +968,22 @@ dynamic_column_value_len(DYNAMIC_COLUMN_VALUE *value)
decimal_bin_size(precision, scale));
}
case DYN_COL_DATETIME:
- /* date+time in bits: 14 + 4 + 5 + 10 + 6 + 6 + 20 + 1 66bits ~= 9 bytes */
- return 9;
+ if (format == dyncol_fmt_num || value->x.time_value.second_part)
+ /* date+time in bits: 14 + 4 + 5 + 10 + 6 + 6 + 20 + 1 66bits ~= 9 bytes*/
+ return 9;
+ else
+ return 6;
case DYN_COL_DATE:
/* date in dits: 14 + 4 + 5 = 23bits ~= 3bytes*/
return 3;
case DYN_COL_TIME:
- /* time in bits: 10 + 6 + 6 + 20 + 1 = 43bits ~= 6bytes*/
- return 6;
+ if (format == dyncol_fmt_num || value->x.time_value.second_part)
+ /* time in bits: 10 + 6 + 6 + 20 + 1 = 43bits ~= 6bytes*/
+ return 6;
+ else
+ return 3;
+ case DYN_COL_DYNCOL:
+ return value->x.string.value.length;
}
DBUG_ASSERT(0);
return 0;
@@ -436,6 +1052,22 @@ dynamic_column_string_store(DYNAMIC_COLUMN *str, LEX_STRING *string,
return ER_DYNCOL_OK;
}
+/**
+ Append the string with given string value.
+
+ @param str the string where to put the value
+ @param val the value to put in the string
+
+ @return ER_DYNCOL_* return code
+*/
+
+static enum enum_dyncol_func_result
+dynamic_column_dyncol_store(DYNAMIC_COLUMN *str, LEX_STRING *string)
+{
+ if (dynstr_append_mem(str, string->str, string->length))
+ return ER_DYNCOL_RESOURCE;
+ return ER_DYNCOL_OK;
+}
/**
Read string value of given length from the packed string
@@ -464,6 +1096,26 @@ dynamic_column_string_read(DYNAMIC_COLUMN_VALUE *store_it_here,
return ER_DYNCOL_OK;
}
+/**
+ Read Dynamic columns packet string value of given length
+ from the packed string
+
+ @param store_it_here The structure to store the value
+ @param data The packed string which should be read
+ @param length The length (in bytes) of the value in nthe string
+
+ @return ER_DYNCOL_* return code
+*/
+
+static enum enum_dyncol_func_result
+dynamic_column_dyncol_read(DYNAMIC_COLUMN_VALUE *store_it_here,
+ uchar *data, size_t length)
+{
+ store_it_here->x.string.charset= &my_charset_bin;
+ store_it_here->x.string.value.length= length;
+ store_it_here->x.string.value.str= (char*) data;
+ return ER_DYNCOL_OK;
+}
/**
Append the string with given decimal value.
@@ -506,7 +1158,7 @@ dynamic_column_decimal_store(DYNAMIC_COLUMN *str,
@param value The value structure which sould be setup.
*/
-void dynamic_column_prepare_decimal(DYNAMIC_COLUMN_VALUE *value)
+void mariadb_dyncol_prepare_decimal(DYNAMIC_COLUMN_VALUE *value)
{
value->x.decimal.value.buf= value->x.decimal.buffer;
value->x.decimal.value.len= DECIMAL_BUFF_LENGTH;
@@ -515,6 +1167,12 @@ void dynamic_column_prepare_decimal(DYNAMIC_COLUMN_VALUE *value)
decimal_make_zero(&value->x.decimal.value);
}
+void dynamic_column_prepare_decimal(DYNAMIC_COLUMN_VALUE *value)
+{
+ mariadb_dyncol_prepare_decimal(value);
+}
+
+
/**
Read decimal value of given length from the string
@@ -570,7 +1228,8 @@ dynamic_column_decimal_read(DYNAMIC_COLUMN_VALUE *store_it_here,
*/
static enum enum_dyncol_func_result
-dynamic_column_date_time_store(DYNAMIC_COLUMN *str, MYSQL_TIME *value)
+dynamic_column_date_time_store(DYNAMIC_COLUMN *str, MYSQL_TIME *value,
+ enum enum_dyncol_format format)
{
enum enum_dyncol_func_result rc;
/*
@@ -579,7 +1238,7 @@ dynamic_column_date_time_store(DYNAMIC_COLUMN *str, MYSQL_TIME *value)
<123456><123456><123456><123456><123456><123456><123456><123456><123456>
*/
if ((rc= dynamic_column_date_store(str, value)) ||
- (rc= dynamic_column_time_store(str, value)))
+ (rc= dynamic_column_time_store(str, value, format)))
return rc;
return ER_DYNCOL_OK;
}
@@ -605,11 +1264,12 @@ dynamic_column_date_time_read(DYNAMIC_COLUMN_VALUE *store_it_here,
12345678901234123412345 1123456789012345612345612345678901234567890
<123456><123456><123456><123456><123456><123456><123456><123456><123456>
*/
- if (length != 9)
+ if (length != 9 && length != 6)
goto err;
store_it_here->x.time_value.time_type= MYSQL_TIMESTAMP_DATETIME;
if ((rc= dynamic_column_date_read_internal(store_it_here, data, 3)) ||
- (rc= dynamic_column_time_read_internal(store_it_here, data + 3, 6)))
+ (rc= dynamic_column_time_read_internal(store_it_here, data + 3,
+ length - 3)))
goto err;
return ER_DYNCOL_OK;
@@ -629,7 +1289,8 @@ err:
*/
static enum enum_dyncol_func_result
-dynamic_column_time_store(DYNAMIC_COLUMN *str, MYSQL_TIME *value)
+dynamic_column_time_store(DYNAMIC_COLUMN *str, MYSQL_TIME *value,
+ enum enum_dyncol_format format)
{
uchar *buf;
if (dynstr_realloc(str, 6))
@@ -651,19 +1312,35 @@ dynamic_column_time_store(DYNAMIC_COLUMN *str, MYSQL_TIME *value)
DBUG_ASSERT(value->minute <= 59);
DBUG_ASSERT(value->second <= 59);
DBUG_ASSERT(value->second_part <= 999999);
+ if (format == dyncol_fmt_num || value->second_part)
+ {
/*
00000!<-hours--><min-><sec-><---microseconds--->
1123456789012345612345612345678901234567890
<123456><123456><123456><123456><123456><123456>
*/
- buf[0]= (value->second_part & 0xff);
- buf[1]= ((value->second_part & 0xff00) >> 8);
- buf[2]= (uchar)(((value->second & 0xf) << 4) |
- ((value->second_part & 0xf0000) >> 16));
- buf[3]= ((value->minute << 2) | ((value->second & 0x30) >> 4));
- buf[4]= (value->hour & 0xff);
- buf[5]= ((value->neg ? 0x4 : 0) | (value->hour >> 8));
- str->length+= 6;
+ buf[0]= (value->second_part & 0xff);
+ buf[1]= ((value->second_part & 0xff00) >> 8);
+ buf[2]= (uchar)(((value->second & 0xf) << 4) |
+ ((value->second_part & 0xf0000) >> 16));
+ buf[3]= ((value->minute << 2) | ((value->second & 0x30) >> 4));
+ buf[4]= (value->hour & 0xff);
+ buf[5]= ((value->neg ? 0x4 : 0) | (value->hour >> 8));
+ str->length+= 6;
+ }
+ else
+ {
+ /*
+ !<-hours--><min-><sec->
+ 11234567890123456123456
+ <123456><123456><123456>
+ */
+ buf[0]= (value->second) | ((value->minute & 0x3) << 6);
+ buf[1]= (value->minute >> 2) | ((value->hour & 0xf) << 4);
+ buf[2]= (value->hour >> 4) | (value->neg ? 0x80 : 0);
+ str->length+= 3;
+ }
+
return ER_DYNCOL_OK;
}
@@ -702,21 +1379,37 @@ static enum enum_dyncol_func_result
dynamic_column_time_read_internal(DYNAMIC_COLUMN_VALUE *store_it_here,
uchar *data, size_t length)
{
- if (length != 6)
+ if (length != 6 && length != 3)
goto err;
- /*
- 00000!<-hours--><min-><sec-><---microseconds--->
- 1123456789012345612345612345678901234567890
- <123456><123456><123456><123456><123456><123456>
- */
- store_it_here->x.time_value.second_part= (data[0] |
- (data[1] << 8) |
- ((data[2] & 0xf) << 16));
- store_it_here->x.time_value.second= ((data[2] >> 4) |
- ((data[3] & 0x3) << 4));
- store_it_here->x.time_value.minute= (data[3] >> 2);
- store_it_here->x.time_value.hour= (((((uint)data[5]) & 0x3 ) << 8) | data[4]);
- store_it_here->x.time_value.neg= ((data[5] & 0x4) ? 1 : 0);
+ if (length == 6)
+ {
+ /*
+ 00000!<-hours--><min-><sec-><---microseconds--->
+ 1123456789012345612345612345678901234567890
+ <123456><123456><123456><123456><123456><123456>
+ */
+ store_it_here->x.time_value.second_part= (data[0] |
+ (data[1] << 8) |
+ ((data[2] & 0xf) << 16));
+ store_it_here->x.time_value.second= ((data[2] >> 4) |
+ ((data[3] & 0x3) << 4));
+ store_it_here->x.time_value.minute= (data[3] >> 2);
+ store_it_here->x.time_value.hour= (((((uint)data[5]) & 0x3 ) << 8) | data[4]);
+ store_it_here->x.time_value.neg= ((data[5] & 0x4) ? 1 : 0);
+ }
+ else
+ {
+ /*
+ !<-hours--><min-><sec->
+ 11234567890123456123456
+ <123456><123456><123456>
+ */
+ store_it_here->x.time_value.second_part= 0;
+ store_it_here->x.time_value.second= (data[0] & 0x3f);
+ store_it_here->x.time_value.minute= (data[0] >> 6) | ((data[1] & 0xf) << 2);
+ store_it_here->x.time_value.hour= (data[1] >> 4) | ((data[2] & 0x3f) << 4);
+ store_it_here->x.time_value.neg= ((data[2] & 0x80) ? 1 : 0);
+ }
if (store_it_here->x.time_value.second > 59 ||
store_it_here->x.time_value.minute > 59 ||
store_it_here->x.time_value.hour > 838 ||
@@ -841,7 +1534,8 @@ err:
*/
static enum enum_dyncol_func_result
-data_store(DYNAMIC_COLUMN *str, DYNAMIC_COLUMN_VALUE *value)
+data_store(DYNAMIC_COLUMN *str, DYNAMIC_COLUMN_VALUE *value,
+ enum enum_dyncol_format format)
{
switch (value->type) {
case DYN_COL_INT:
@@ -857,13 +1551,15 @@ data_store(DYNAMIC_COLUMN *str, DYNAMIC_COLUMN_VALUE *value)
return dynamic_column_decimal_store(str, &value->x.decimal.value);
case DYN_COL_DATETIME:
/* date+time in bits: 14 + 4 + 5 + 5 + 6 + 6 40bits = 5 bytes */
- return dynamic_column_date_time_store(str, &value->x.time_value);
+ return dynamic_column_date_time_store(str, &value->x.time_value, format);
case DYN_COL_DATE:
/* date in dits: 14 + 4 + 5 = 23bits ~= 3bytes*/
return dynamic_column_date_store(str, &value->x.time_value);
case DYN_COL_TIME:
/* time in bits: 5 + 6 + 6 = 17bits ~= 3bytes*/
- return dynamic_column_time_store(str, &value->x.time_value);
+ return dynamic_column_time_store(str, &value->x.time_value, format);
+ case DYN_COL_DYNCOL:
+ return dynamic_column_dyncol_store(str, &value->x.string.value);
case DYN_COL_NULL:
break; /* Impossible */
}
@@ -873,117 +1569,6 @@ data_store(DYNAMIC_COLUMN *str, DYNAMIC_COLUMN_VALUE *value)
/**
- Calculate length of offset field for given data length
-
- @param data_length Length of the data segment
-
- @return number of bytes
-*/
-
-static size_t dynamic_column_offset_bytes(size_t data_length)
-{
- if (data_length < 0x1f) /* all 1 value is reserved */
- return 1;
- if (data_length < 0x1fff) /* all 1 value is reserved */
- return 2;
- if (data_length < 0x1fffff) /* all 1 value is reserved */
- return 3;
- if (data_length < 0x1fffffff) /* all 1 value is reserved */
- return 4;
- return MAX_OFFSET_LENGTH; /* For future */
-}
-
-/**
- Store offset and type information in the given place
-
- @param place Beginning of the index entry
- @param offset_size Size of offset field in bytes
- @param type Type to be written
- @param offset Offset to be written
-*/
-
-static void type_and_offset_store(uchar *place, size_t offset_size,
- DYNAMIC_COLUMN_TYPE type,
- size_t offset)
-{
- ulong val = (((ulong) offset) << 3) | (type - 1);
- DBUG_ASSERT(type != DYN_COL_NULL);
- DBUG_ASSERT(((type - 1) & (~7)) == 0); /* fit in 3 bits */
-
- /* Index entry starts with column number; Jump over it */
- place+= COLUMN_NUMBER_SIZE;
-
- switch (offset_size) {
- case 1:
- DBUG_ASSERT(offset < 0x1f); /* all 1 value is reserved */
- place[0]= (uchar)val;
- break;
- case 2:
- DBUG_ASSERT(offset < 0x1fff); /* all 1 value is reserved */
- int2store(place, val);
- break;
- case 3:
- DBUG_ASSERT(offset < 0x1fffff); /* all 1 value is reserved */
- int3store(place, val);
- break;
- case 4:
- DBUG_ASSERT(offset < 0x1fffffff); /* all 1 value is reserved */
- int4store(place, val);
- break;
- default:
- DBUG_ASSERT(0); /* impossible */
- }
-}
-
-
-/**
- Read offset and type information from index entry
-
- @param type Where to put type info
- @param offset Where to put offset info
- @param place Beginning of the index entry
- @param offset_size Size of offset field in bytes
-*/
-
-static void type_and_offset_read(DYNAMIC_COLUMN_TYPE *type,
- size_t *offset,
- uchar *place, size_t offset_size)
-{
- ulong UNINIT_VAR(val);
-
- place+= COLUMN_NUMBER_SIZE; /* skip column number */
- switch (offset_size) {
- case 1:
- val= (ulong)place[0];
- break;
- case 2:
- val= uint2korr(place);
- break;
- case 3:
- val= uint3korr(place);
- break;
- case 4:
- val= uint4korr(place);
- break;
- default:
- DBUG_ASSERT(0); /* impossible */
- }
- *type= (val & 0x7) + 1;
- *offset= val >> 3;
-}
-
-
-/**
- Comparator function for references on column numbers for qsort
-*/
-
-static int column_sort(const void *a, const void *b)
-{
- return **((uint **)a) - **((uint **)b);
-}
-
-
-/**
Write information to the fixed header
@param str String where to write the header
@@ -996,34 +1581,20 @@ static void set_fixed_header(DYNAMIC_COLUMN *str,
uint column_count)
{
DBUG_ASSERT(column_count <= 0xffff);
- DBUG_ASSERT(offset_size <= 4);
+ DBUG_ASSERT(offset_size <= MAX_OFFSET_LENGTH);
str->str[0]= ((str->str[0] & ~DYNCOL_FLG_OFFSET) |
(offset_size - 1)); /* size of offset */
int2store(str->str + 1, column_count); /* columns number */
DBUG_ASSERT((str->str[0] & (~DYNCOL_FLG_KNOWN)) == 0);
}
-/*
- Calculate entry size (E) and header size (H) by offset size (O) and column
- count (C).
-*/
-
-#define calc_param(E,H,O,C) do { \
- (*(E))= (O) + COLUMN_NUMBER_SIZE; \
- (*(H))= (*(E)) * (C); \
-}while(0);
-
-
/**
Adds columns into the empty string
- @param str String where to write the data
- @param header_size Size of the header without fixed part
- @param offset_size Size of offset field in bytes
+ @param str String where to write the data (the record)
+ @param hdr Dynamic columns record descriptor
@param column_count Number of columns in the arrays
- @parem not_null_count Number of non-null columns in the arrays
- @param data_size Size of the data segment
- @param column_numbers Array of columns numbers
+ @param column_keys Array of columns keys (uint or LEX_STRING)
@param values Array of columns values
@param new_str True if we need to allocate new string
@@ -1032,42 +1603,54 @@ static void set_fixed_header(DYNAMIC_COLUMN *str,
static enum enum_dyncol_func_result
dynamic_new_column_store(DYNAMIC_COLUMN *str,
- size_t header_size,
- size_t offset_size,
+ DYN_HEADER *hdr,
uint column_count,
- uint not_null_count,
- size_t data_size,
- uint *column_numbers,
+ void *column_keys,
DYNAMIC_COLUMN_VALUE *values,
my_bool new_str)
{
- uchar *header_end;
- uint **columns_order;
+ struct st_service_funcs *fmt= fmt_data + hdr->format;
+ void **columns_order;
+ uchar *element;
uint i;
- uint entry_size= COLUMN_NUMBER_SIZE + offset_size;
enum enum_dyncol_func_result rc= ER_DYNCOL_RESOURCE;
+ size_t all_headers_size;
- if (!(columns_order= malloc(sizeof(uint*)*column_count)))
+ if (!(columns_order= malloc(sizeof(void*)*column_count)))
return ER_DYNCOL_RESOURCE;
if (new_str)
{
- if (dynamic_column_init_str(str,
- data_size + header_size + DYNCOL_SYZERESERVE))
+ if (dynamic_column_init_named(str,
+ fmt->fixed_hdr +
+ hdr->header_size +
+ hdr->nmpool_size +
+ hdr->data_size +
+ DYNCOL_SYZERESERVE))
goto err;
}
else
{
str->length= 0;
- if (dynstr_realloc(str, data_size + header_size + DYNCOL_SYZERESERVE))
+ if (dynstr_realloc(str,
+ fmt->fixed_hdr +
+ hdr->header_size +
+ hdr->nmpool_size +
+ hdr->data_size +
+ DYNCOL_SYZERESERVE))
goto err;
- bzero(str->str, FIXED_HEADER_SIZE);
- str->length= FIXED_HEADER_SIZE;
}
+ if (!column_count)
+ return ER_DYNCOL_OK;
+
+ bzero(str->str, fmt->fixed_hdr);
+ str->length= fmt->fixed_hdr;
/* sort columns for the header */
- for (i= 0; i < column_count; i++)
- columns_order[i]= column_numbers + i;
- qsort(columns_order, (size_t)column_count, sizeof(uint*), &column_sort);
+ for (i= 0, element= (uchar *) column_keys;
+ i < column_count;
+ i++, element+= fmt->key_size_in_array)
+ columns_order[i]= (void *)element;
+ qsort(columns_order, (size_t)column_count, sizeof(void*), fmt->column_sort);
/*
For now we don't allow creating two columns with the same number
@@ -1076,38 +1659,43 @@ dynamic_new_column_store(DYNAMIC_COLUMN *str,
*/
for (i= 0; i < column_count - 1; i++)
{
- if (columns_order[i][0] > UINT_MAX16 ||
- columns_order[i][0] == columns_order[i + 1][0])
+ if ((*fmt->check_limit)(&columns_order[i]) ||
+ (*fmt->column_sort)(&columns_order[i], &columns_order[i + 1]) == 0)
{
rc= ER_DYNCOL_DATA;
goto err;
}
}
- if (columns_order[i][0] > UINT_MAX16)
+ if ((*fmt->check_limit)(&columns_order[i]))
{
rc= ER_DYNCOL_DATA;
goto err;
}
- DBUG_ASSERT(str->max_length >= str->length + header_size);
- set_fixed_header(str, offset_size, not_null_count);
- str->length+= header_size; /* reserve place for header */
- header_end= (uchar *)str->str + FIXED_HEADER_SIZE;
+ (*fmt->set_fixed_hdr)(str, hdr);
+ /* reserve place for header and name pool */
+ str->length+= hdr->header_size + hdr->nmpool_size;
+
+ hdr->entry= hdr->header;
+ hdr->name= hdr->nmpool;
+ all_headers_size= fmt->fixed_hdr + hdr->header_size + hdr->nmpool_size;
for (i= 0; i < column_count; i++)
{
- uint ord= columns_order[i] - column_numbers;
+ uint ord= (uint)(((uchar*)columns_order[i] - (uchar*)column_keys) /
+ fmt->key_size_in_array);
if (values[ord].type != DYN_COL_NULL)
{
/* Store header first in the str */
- int2store(header_end, column_numbers[ord]);
- type_and_offset_store(header_end, offset_size,
- values[ord].type,
- str->length - header_size - FIXED_HEADER_SIZE);
+ if ((*fmt->put_header_entry)(hdr, columns_order[i], values + ord,
+ str->length - all_headers_size))
+ {
+ rc= ER_DYNCOL_FORMAT;
+ goto err;
+ }
/* Store value in 'str + str->length' and increase str->length */
- if ((rc= data_store(str, values + ord)))
+ if ((rc= data_store(str, values + ord, hdr->format)))
goto err;
- header_end+= entry_size;
}
}
rc= ER_DYNCOL_OK;
@@ -1117,61 +1705,92 @@ err:
}
/**
- Create packed string which contains given columns (internal)
+ Calculate size of header, name pool and data pool
- @param str String where to write the data
+ @param hdr descriptor of dynamic column record
+ @param column_count number of elements in arrays
@param column_count Number of columns in the arrays
- @param column_numbers Array of columns numbers
+ @param column_keys Array of columns keys (uint or LEX_STRING)
@param values Array of columns values
- @param new_str True if we need allocate new string
@return ER_DYNCOL_* return code
*/
static enum enum_dyncol_func_result
-dynamic_column_create_many_internal(DYNAMIC_COLUMN *str,
- uint column_count,
- uint *column_numbers,
- DYNAMIC_COLUMN_VALUE *values,
- my_bool new_str)
-{
- size_t data_size= 0;
- size_t header_size, offset_size;
+calc_var_sizes(DYN_HEADER *hdr,
+ uint column_count,
+ void *column_keys,
+ DYNAMIC_COLUMN_VALUE *values)
+{
+ struct st_service_funcs *fmt= fmt_data + hdr->format;
uint i;
- int not_null_column_count= 0;
-
- if (new_str)
- {
- /* to make dynstr_free() working in case of errors */
- bzero(str, sizeof(DYNAMIC_COLUMN));
- }
-
+ hdr->nmpool_size= hdr->data_size= 0;
+ hdr->column_count= 0;
for (i= 0; i < column_count; i++)
{
if (values[i].type != DYN_COL_NULL)
{
size_t tmp;
- not_null_column_count++;
- data_size+= (tmp=dynamic_column_value_len(values + i));
+ hdr->column_count++;
+ hdr->data_size+= (tmp= dynamic_column_value_len(values + i,
+ hdr->format));
if (tmp == (size_t) ~0)
return ER_DYNCOL_DATA;
+ hdr->nmpool_size+= (*fmt->name_size)(column_keys, i);
}
}
-
- /* We can handle data up to 1fffffff = 536870911 bytes now */
- if ((offset_size= dynamic_column_offset_bytes(data_size)) >=
- MAX_OFFSET_LENGTH)
+ /*
+ We can handle data up to 0x1fffffff (old format) and
+ 0xfffffffff (new format) bytes now.
+ */
+ if ((hdr->offset_size= fmt->dynamic_column_offset_bytes(hdr->data_size)) >=
+ fmt->max_offset_size)
return ER_DYNCOL_LIMIT;
- /* header entry is column number + offset & type */
- header_size= not_null_column_count * (offset_size + 2);
+ /* header entry is column number or string pointer + offset & type */
+ hdr->entry_size= fmt->fixed_hdr_entry + hdr->offset_size;
+ hdr->header_size= hdr->column_count * hdr->entry_size;
+ return ER_DYNCOL_OK;
+}
+
+/**
+ Create packed string which contains given columns (internal multi format)
+
+ @param str String where to write the data
+ @param column_count Number of columns in the arrays
+ @param column_keys Array of columns keys (format dependent)
+ @param values Array of columns values
+ @param new_str True if we need allocate new string
+ @param string_keys keys are strings
+
+ @return ER_DYNCOL_* return code
+*/
+
+static enum enum_dyncol_func_result
+dynamic_column_create_many_internal_fmt(DYNAMIC_COLUMN *str,
+ uint column_count,
+ void *column_keys,
+ DYNAMIC_COLUMN_VALUE *values,
+ my_bool new_str,
+ my_bool string_keys)
+{
+ DYN_HEADER header;
+ enum enum_dyncol_func_result rc;
+ bzero(&header, sizeof(header));
+ header.format= (string_keys ? 1 : 0);
- return dynamic_new_column_store(str,
- header_size, offset_size,
+ if (new_str)
+ {
+ /* to make dynstr_free() working in case of errors */
+ bzero(str, sizeof(DYNAMIC_COLUMN));
+ }
+
+ if ((rc= calc_var_sizes(&header, column_count, column_keys, values)) < 0)
+ return rc;
+
+ return dynamic_new_column_store(str, &header,
column_count,
- not_null_column_count,
- data_size,
- column_numbers, values,
+ column_keys, values,
new_str);
}
@@ -1194,11 +1813,60 @@ dynamic_column_create_many(DYNAMIC_COLUMN *str,
DYNAMIC_COLUMN_VALUE *values)
{
DBUG_ENTER("dynamic_column_create_many");
- DBUG_RETURN(dynamic_column_create_many_internal(str, column_count,
- column_numbers, values,
- TRUE));
+ DBUG_RETURN(dynamic_column_create_many_internal_fmt(str, column_count,
+ column_numbers, values,
+ TRUE, FALSE));
+}
+
+/**
+ Create packed string which contains given columns
+
+ @param str String where to write the data
+ @param column_count Number of columns in the arrays
+ @param column_numbers Array of columns numbers
+ @param values Array of columns values
+ @param new_string True if we need allocate new string
+
+ @return ER_DYNCOL_* return code
+*/
+
+enum enum_dyncol_func_result
+mariadb_dyncol_create_many(DYNAMIC_COLUMN *str,
+ uint column_count,
+ uint *column_numbers,
+ DYNAMIC_COLUMN_VALUE *values,
+ my_bool new_string)
+{
+ DBUG_ENTER("mariadb_dyncol_create_many");
+ DBUG_RETURN(dynamic_column_create_many_internal_fmt(str, column_count,
+ column_numbers, values,
+ new_string, FALSE));
}
+/**
+ Create packed string which contains given columns
+
+ @param str String where to write the data
+ @param column_count Number of columns in the arrays
+ @param column_keys Array of columns keys
+ @param values Array of columns value
+ @param new_string True if we need allocate new string
+
+ @return ER_DYNCOL_* return code
+*/
+
+enum enum_dyncol_func_result
+mariadb_dyncol_create_many_named(DYNAMIC_COLUMN *str,
+ uint column_count,
+ LEX_STRING *column_keys,
+ DYNAMIC_COLUMN_VALUE *values,
+ my_bool new_string)
+{
+ DBUG_ENTER("mariadb_dyncol_create_many_named");
+ DBUG_RETURN(dynamic_column_create_many_internal_fmt(str, column_count,
+ column_keys, values,
+ new_string, TRUE));
+}
/**
Create packed string which contains given column
@@ -1239,32 +1907,48 @@ static size_t get_length_interval(uchar *entry, uchar *entry_next,
DYNAMIC_COLUMN_TYPE type, type_next;
DBUG_ASSERT(entry < entry_next);
- type_and_offset_read(&type, &offset, entry, offset_size);
+ if (type_and_offset_read_num(&type, &offset, entry + COLUMN_NUMBER_SIZE,
+ offset_size))
+ return DYNCOL_OFFSET_ERROR;
if (entry_next >= header_end)
return (last_offset - offset);
- type_and_offset_read(&type_next, &offset_next, entry_next, offset_size);
+ if (type_and_offset_read_num(&type_next, &offset_next,
+ entry_next + COLUMN_NUMBER_SIZE, offset_size))
+ return DYNCOL_OFFSET_ERROR;
return (offset_next - offset);
}
-/*
- Calculate length of data of one column
+/**
+ Calculate length of data between given hdr->entry and next_entry
- @param entry Pointer to the first entry
- @param header_end Pointer to the header end
- @param offset_size Size of offset field in bytes
- @param last_offset Size of the data segment
+ @param hdr descriptor of dynamic column record
+ @param next_entry next header entry (can point just after last header
+ entry)
@return number of bytes
*/
-static size_t get_length(uchar *entry, uchar *header_end,
- size_t offset_size,
- size_t last_offset)
+static size_t hdr_interval_length(DYN_HEADER *hdr, uchar *next_entry)
{
- return get_length_interval(entry,
- entry + offset_size + COLUMN_NUMBER_SIZE,
- header_end, offset_size, last_offset);
+ struct st_service_funcs *fmt= fmt_data + hdr->format;
+ size_t next_entry_offset;
+ DYNAMIC_COLUMN_TYPE next_entry_type;
+ DBUG_ASSERT(hdr->entry < next_entry);
+ DBUG_ASSERT(hdr->entry >= hdr->header);
+ DBUG_ASSERT(next_entry <= hdr->header + hdr->header_size);
+
+ if ((*fmt->type_and_offset_read)(&hdr->type, &hdr->offset,
+ hdr->entry + fmt->fixed_hdr_entry,
+ hdr->offset_size))
+ return DYNCOL_OFFSET_ERROR;
+ if (next_entry == hdr->header + hdr->header_size)
+ return hdr->data_size - hdr->offset;
+ if ((*fmt->type_and_offset_read)(&next_entry_type, &next_entry_offset,
+ next_entry + fmt->fixed_hdr_entry,
+ hdr->offset_size))
+ return DYNCOL_OFFSET_ERROR;
+ return (next_entry_offset - hdr->offset);
}
@@ -1272,7 +1956,7 @@ static size_t get_length(uchar *entry, uchar *header_end,
Comparator function for references to header entries for qsort
*/
-static int header_compar(const void *a, const void *b)
+static int header_compar_num(const void *a, const void *b)
{
uint va= uint2korr((uchar*)a), vb= uint2korr((uchar*)b);
return (va > vb ? 1 : (va < vb ? -1 : 0));
@@ -1280,70 +1964,183 @@ static int header_compar(const void *a, const void *b)
/**
+ Find entry in the numeric format header by the column number
+
+ @param hdr descriptor of dynamic column record
+ @param key number to find
+
+ @return pointer to the entry or NULL
+*/
+
+static uchar *find_entry_num(DYN_HEADER *hdr, uint key)
+{
+ uchar header_entry[2+4];
+ DBUG_ASSERT(hdr->format == dyncol_fmt_num);
+ int2store(header_entry, key);
+ return hdr->entry= bsearch(header_entry, hdr->header,
+ (size_t)hdr->column_count,
+ hdr->entry_size, &header_compar_num);
+}
+
+
+/**
+ Read name from header entry
+
+ @param hdr descriptor of dynamic column record
+ @param entry pointer to the header entry
+ @param name where to put name
+
+ @return 0 ok
+ @return 1 error in data
+*/
+
+static my_bool read_name(DYN_HEADER *hdr, uchar *entry, LEX_STRING *name)
+{
+ size_t nmoffset= uint2korr(entry);
+ uchar *next_entry= entry + hdr->entry_size;
+
+ if (nmoffset > hdr->nmpool_size)
+ return 1;
+
+ name->str= (char *)hdr->nmpool + nmoffset;
+ if (next_entry == hdr->header + hdr->header_size)
+ name->length= hdr->nmpool_size - nmoffset;
+ else
+ {
+ size_t next_nmoffset= uint2korr(next_entry);
+ if (next_nmoffset > hdr->nmpool_size)
+ return 1;
+ name->length= next_nmoffset - nmoffset;
+ }
+ return 0;
+}
+
+
+/**
+ Find entry in the names format header by the column number
+
+ @param hdr descriptor of dynamic column record
+ @param key name to find
+
+ @return pointer to the entry or NULL
+*/
+static uchar *find_entry_named(DYN_HEADER *hdr, LEX_STRING *key)
+{
+ uchar *min= hdr->header;
+ uchar *max= hdr->header + (hdr->column_count - 1) * hdr->entry_size;
+ uchar *mid;
+ DBUG_ASSERT(hdr->format == dyncol_fmt_str);
+ DBUG_ASSERT(hdr->nmpool != NULL);
+ while (max >= min)
+ {
+ LEX_STRING name;
+ int cmp;
+ mid= hdr->header + ((min - hdr->header) +
+ (max - hdr->header)) /
+ 2 /
+ hdr->entry_size * hdr->entry_size;
+ if (read_name(hdr, mid, &name))
+ return NULL;
+ cmp= mariadb_dyncol_column_cmp_named(&name, key);
+ if (cmp < 0)
+ min= mid + hdr->entry_size;
+ else if (cmp > 0)
+ max= mid - hdr->entry_size;
+ else
+ return mid;
+ }
+ return NULL;
+}
+
+
+/**
+ Write number in the buffer (backward direction - starts from the buffer end)
+
+ @return pointer on the number begining
+*/
+
+static char *backwritenum(char *chr, uint numkey)
+{
+ if (numkey == 0)
+ *(--chr)= '0';
+ else
+ while (numkey > 0)
+ {
+ *(--chr)= '0' + numkey % 10;
+ numkey/= 10;
+ }
+ return chr;
+}
+
+
+/**
Find column and fill information about it
- @param type Returns type of the column
- @param data Returns a pointer to the data
- @param length Returns length of the data
- @param offset_size Size of offset field in bytes
- @param column_count Number of column in the packed string
- @param data_end Pointer to the data end
- @param num Number of the column we want to fetch
- @param entry_pos NULL or place where to put reference to the entry
+ @param hdr descriptor of dynamic column record
+ @param numkey Number of the column to fetch (if strkey is NULL)
+ @param strkey Name of the column to fetch (or NULL)
@return 0 ok
@return 1 error in data
*/
static my_bool
-find_column(DYNAMIC_COLUMN_TYPE *type, uchar **data, size_t *length,
- uchar *header, size_t offset_size, uint column_count,
- uchar *data_end, uint num, uchar **entry_pos)
+find_column(DYN_HEADER *hdr, uint numkey, LEX_STRING *strkey)
{
- uchar *entry;
- size_t offset, total_data, header_size, entry_size;
- uchar key[2+4];
+ LEX_STRING nmkey;
+ char nmkeybuff[DYNCOL_NUM_CHAR]; /* to fit max 2 bytes number */
+ DBUG_ASSERT(hdr->header != NULL);
- if (!entry_pos)
- entry_pos= &entry;
-
- calc_param(&entry_size, &header_size, offset_size, column_count);
+ if (hdr->header + hdr->header_size > hdr->data_end)
+ return TRUE;
- if (header + header_size > data_end)
- return 1;
+ /* fix key */
+ if (hdr->format == dyncol_fmt_num && strkey != NULL)
+ {
+ char *end;
+ numkey= (uint) strtoul(strkey->str, &end, 10);
+ if (end != strkey->str + strkey->length)
+ {
+ /* we can't find non-numeric key among numeric ones */
+ hdr->type= DYN_COL_NULL;
+ return 0;
+ }
+ }
+ else if (hdr->format == dyncol_fmt_str && strkey == NULL)
+ {
+ nmkey.str= backwritenum(nmkeybuff + sizeof(nmkeybuff), numkey);
+ nmkey.length= (nmkeybuff + sizeof(nmkeybuff)) - nmkey.str;
+ strkey= &nmkey;
+ }
+ if (hdr->format == dyncol_fmt_num)
+ hdr->entry= find_entry_num(hdr, numkey);
+ else
+ hdr->entry= find_entry_named(hdr, strkey);
- int2store(key, num);
- entry= bsearch(key, header, (size_t)column_count, entry_size,
- &header_compar);
- if (!entry)
+ if (!hdr->entry)
{
/* Column not found */
- *type= DYN_COL_NULL;
- *entry_pos= NULL;
+ hdr->type= DYN_COL_NULL;
return 0;
}
- type_and_offset_read(type, &offset, entry, offset_size);
- total_data= data_end - (header + header_size);
- if (offset > total_data)
- return 1;
- *data= header + header_size + offset;
- *length= get_length(entry, header + header_size, offset_size,
- total_data);
+ hdr->length= hdr_interval_length(hdr, hdr->entry + hdr->entry_size);
+ hdr->data= hdr->dtpool + hdr->offset;
/*
Check that the found data is withing the ranges. This can happen if
we get data with wrong offsets.
*/
- if ((long) *length < 0 || offset + *length > total_data)
+ if (hdr->length == DYNCOL_OFFSET_ERROR ||
+ hdr->length > INT_MAX || hdr->offset > hdr->data_size)
return 1;
- *entry_pos= entry;
return 0;
}
/**
- Read and check the header of the dynamic string
+ Read and check the header of the dynamic string
+ @param hdr descriptor of dynamic column record
@param str Dynamic string
@retval FALSE OK
@@ -1354,22 +2151,31 @@ find_column(DYNAMIC_COLUMN_TYPE *type, uchar **data, size_t *length,
already have handled this case.
*/
-static inline my_bool read_fixed_header(DYNAMIC_COLUMN *str,
- size_t *offset_size,
- uint *column_count)
+static inline my_bool read_fixed_header(DYN_HEADER *hdr,
+ DYNAMIC_COLUMN *str)
{
DBUG_ASSERT(str != NULL && str->length != 0);
- if ((str->length < FIXED_HEADER_SIZE) ||
+ if ((str->length < 1) ||
(str->str[0] & (~DYNCOL_FLG_KNOWN)))
+ return 1;
+ hdr->format= ((str->str[0] & DYNCOL_FLG_NAMES) ?
+ dyncol_fmt_str:
+ dyncol_fmt_num);
+ if ((str->length < fmt_data[hdr->format].fixed_hdr))
return 1; /* Wrong header */
- *offset_size= (str->str[0] & DYNCOL_FLG_OFFSET) + 1;
- *column_count= uint2korr(str->str + 1);
+ hdr->offset_size= (str->str[0] & DYNCOL_FLG_OFFSET) + 1 +
+ (hdr->format == dyncol_fmt_str ? 1 : 0);
+ hdr->column_count= uint2korr(str->str + 1);
+ if (hdr->format == dyncol_fmt_str)
+ hdr->nmpool_size= uint2korr(str->str + 3); // only 2 bytes supported for now
+ else
+ hdr->nmpool_size= 0;
return 0;
}
/**
- Get dynamic column value
+ Get dynamic column value by column number
@param str The packed string to extract the column
@param column_nr Number of column to fetch
@@ -1378,258 +2184,236 @@ static inline my_bool read_fixed_header(DYNAMIC_COLUMN *str,
@return ER_DYNCOL_* return code
*/
-int dynamic_column_get(DYNAMIC_COLUMN *str, uint column_nr,
+enum enum_dyncol_func_result
+dynamic_column_get(DYNAMIC_COLUMN *str, uint column_nr,
DYNAMIC_COLUMN_VALUE *store_it_here)
{
- uchar *data;
- size_t offset_size, length;
- uint column_count;
- enum enum_dyncol_func_result rc= ER_DYNCOL_FORMAT;
+ return dynamic_column_get_internal(str, store_it_here, column_nr, NULL);
+}
- if (str->length == 0)
- goto null;
+enum enum_dyncol_func_result
+mariadb_dyncol_get(DYNAMIC_COLUMN *str, uint column_nr,
+ DYNAMIC_COLUMN_VALUE *store_it_here)
+{
+ return dynamic_column_get_internal(str, store_it_here, column_nr, NULL);
+}
- if (read_fixed_header(str, &offset_size, &column_count))
- goto err;
- if (column_count == 0)
- goto null;
+/**
+ Get dynamic column value by name
- if (find_column(&store_it_here->type, &data, &length,
- (uchar*)str->str + FIXED_HEADER_SIZE,
- offset_size, column_count, (uchar*)str->str + str->length,
- column_nr, NULL))
- goto err;
+ @param str The packed string to extract the column
+ @param name Name of column to fetch
+ @param store_it_here Where to store the extracted value
+
+ @return ER_DYNCOL_* return code
+*/
+
+enum enum_dyncol_func_result
+mariadb_dyncol_get_named(DYNAMIC_COLUMN *str, LEX_STRING *name,
+ DYNAMIC_COLUMN_VALUE *store_it_here)
+{
+ DBUG_ASSERT(name != NULL);
+ return dynamic_column_get_internal(str, store_it_here, 0, name);
+}
- switch (store_it_here->type) {
+
+static enum enum_dyncol_func_result
+dynamic_column_get_value(DYN_HEADER *hdr, DYNAMIC_COLUMN_VALUE *store_it_here)
+{
+ static enum enum_dyncol_func_result rc;
+ switch ((store_it_here->type= hdr->type)) {
case DYN_COL_INT:
- rc= dynamic_column_sint_read(store_it_here, data, length);
+ rc= dynamic_column_sint_read(store_it_here, hdr->data, hdr->length);
break;
case DYN_COL_UINT:
- rc= dynamic_column_uint_read(store_it_here, data, length);
+ rc= dynamic_column_uint_read(store_it_here, hdr->data, hdr->length);
break;
case DYN_COL_DOUBLE:
- rc= dynamic_column_double_read(store_it_here, data, length);
+ rc= dynamic_column_double_read(store_it_here, hdr->data, hdr->length);
break;
case DYN_COL_STRING:
- rc= dynamic_column_string_read(store_it_here, data, length);
+ rc= dynamic_column_string_read(store_it_here, hdr->data, hdr->length);
break;
case DYN_COL_DECIMAL:
- rc= dynamic_column_decimal_read(store_it_here, data, length);
+ rc= dynamic_column_decimal_read(store_it_here, hdr->data, hdr->length);
break;
case DYN_COL_DATETIME:
- rc= dynamic_column_date_time_read(store_it_here, data, length);
+ rc= dynamic_column_date_time_read(store_it_here, hdr->data,
+ hdr->length);
break;
case DYN_COL_DATE:
- rc= dynamic_column_date_read(store_it_here, data, length);
+ rc= dynamic_column_date_read(store_it_here, hdr->data, hdr->length);
break;
case DYN_COL_TIME:
- rc= dynamic_column_time_read(store_it_here, data, length);
+ rc= dynamic_column_time_read(store_it_here, hdr->data, hdr->length);
break;
case DYN_COL_NULL:
rc= ER_DYNCOL_OK;
break;
+ case DYN_COL_DYNCOL:
+ rc= dynamic_column_dyncol_read(store_it_here, hdr->data, hdr->length);
+ break;
default:
- goto err;
+ rc= ER_DYNCOL_FORMAT;
+ store_it_here->type= DYN_COL_NULL;
+ break;
}
return rc;
-
-null:
- rc= ER_DYNCOL_OK;
-err:
- store_it_here->type= DYN_COL_NULL;
- return rc;
}
/**
- Delete column with given number from the packed string
+ Get dynamic column value by number or name
- @param str The packed string to delete the column
- @param column_nr Number of column to delete
+ @param str The packed string to extract the column
+ @param store_it_here Where to store the extracted value
+ @param numkey Number of the column to fetch (if strkey is NULL)
+ @param strkey Name of the column to fetch (or NULL)
@return ER_DYNCOL_* return code
*/
-int dynamic_column_delete(DYNAMIC_COLUMN *str, uint column_nr)
+static enum enum_dyncol_func_result
+dynamic_column_get_internal(DYNAMIC_COLUMN *str,
+ DYNAMIC_COLUMN_VALUE *store_it_here,
+ uint num_key, LEX_STRING *str_key)
{
- uchar *data, *header_entry, *read, *write;
- size_t offset_size, new_offset_size, length, entry_size, new_entry_size,
- header_size, new_header_size, data_size, new_data_size,
- deleted_entry_offset;
- uint column_count, i;
- DYNAMIC_COLUMN_TYPE type;
+ DYN_HEADER header;
+ enum enum_dyncol_func_result rc= ER_DYNCOL_FORMAT;
+ bzero(&header, sizeof(header));
if (str->length == 0)
- return ER_DYNCOL_OK; /* no columns */
+ goto null;
- if (read_fixed_header(str, &offset_size, &column_count))
- return ER_DYNCOL_FORMAT;
+ if ((rc= init_read_hdr(&header, str)) < 0)
+ goto err;
- if (column_count == 0)
- {
- str->length= 0;
- return ER_DYNCOL_OK; /* no columns */
- }
+ if (header.column_count == 0)
+ goto null;
- if (find_column(&type, &data, &length, (uchar*)str->str + FIXED_HEADER_SIZE,
- offset_size, column_count, (uchar*)str->str + str->length,
- column_nr, &header_entry))
- return ER_DYNCOL_FORMAT;
+ if (find_column(&header, num_key, str_key))
+ goto err;
- if (type == DYN_COL_NULL)
- return ER_DYNCOL_OK; /* no such column */
+ rc= dynamic_column_get_value(&header, store_it_here);
+ return rc;
- if (column_count == 1)
- {
- /* delete the only column; Return empty string */
- str->length= 0;
- return ER_DYNCOL_OK;
- }
+null:
+ rc= ER_DYNCOL_OK;
+err:
+ store_it_here->type= DYN_COL_NULL;
+ return rc;
+}
- /* Calculate entry_size and header_size */
- calc_param(&entry_size, &header_size, offset_size, column_count);
- data_size= str->length - FIXED_HEADER_SIZE - header_size;
- new_data_size= data_size - length;
- if ((new_offset_size= dynamic_column_offset_bytes(new_data_size)) >=
- MAX_OFFSET_LENGTH)
- return ER_DYNCOL_LIMIT;
- DBUG_ASSERT(new_offset_size <= offset_size);
+/**
+ Check existence of the column in the packed string (by number)
- calc_param(&new_entry_size, &new_header_size,
- new_offset_size, column_count - 1);
+ @param str The packed string to check the column
+ @param column_nr Number of column to check
- deleted_entry_offset= ((data - (uchar*) str->str) -
- header_size - FIXED_HEADER_SIZE);
+ @return ER_DYNCOL_* return code
+*/
- /* rewrite header*/
- set_fixed_header(str, new_offset_size, column_count - 1);
- for (i= 0, write= read= (uchar *)str->str + FIXED_HEADER_SIZE;
- i < column_count;
- i++, read+= entry_size, write+= new_entry_size)
- {
- size_t offs;
- uint nm;
- DYNAMIC_COLUMN_TYPE tp;
- if (read == header_entry)
- {
-#ifndef DBUG_OFF
- nm= uint2korr(read);
- type_and_offset_read(&tp, &offs, read,
- offset_size);
- DBUG_ASSERT(nm == column_nr);
- DBUG_ASSERT(offs == deleted_entry_offset);
-#endif
- write-= new_entry_size; /* do not move writer */
- continue; /* skip removed field */
- }
+enum enum_dyncol_func_result
+dynamic_column_exists(DYNAMIC_COLUMN *str, uint column_nr)
+{
+ return dynamic_column_exists_internal(str, column_nr, NULL);
+}
- nm= uint2korr(read),
- type_and_offset_read(&tp, &offs, read,
- offset_size);
+enum enum_dyncol_func_result
+mariadb_dyncol_exists(DYNAMIC_COLUMN *str, uint column_nr)
+{
+ return dynamic_column_exists_internal(str, column_nr, NULL);
+}
- if (offs > deleted_entry_offset)
- offs-= length; /* data stored after removed data */
+/**
+ Check existence of the column in the packed string (by name)
- int2store(write, nm);
- type_and_offset_store(write, new_offset_size, tp, offs);
- }
+ @param str The packed string to check the column
+ @param name Name of column to check
- /* move data */
- {
- size_t first_chunk_len= ((data - (uchar *)str->str) -
- FIXED_HEADER_SIZE - header_size);
- size_t second_chunk_len= new_data_size - first_chunk_len;
- if (first_chunk_len)
- memmove(str->str + FIXED_HEADER_SIZE + new_header_size,
- str->str + FIXED_HEADER_SIZE + header_size,
- first_chunk_len);
- if (second_chunk_len)
- memmove(str->str +
- FIXED_HEADER_SIZE + new_header_size + first_chunk_len,
- str->str +
- FIXED_HEADER_SIZE + header_size + first_chunk_len + length,
- second_chunk_len);
- }
-
- /* fix str length */
- DBUG_ASSERT(str->length >=
- FIXED_HEADER_SIZE + new_header_size + new_data_size);
- str->length= FIXED_HEADER_SIZE + new_header_size + new_data_size;
+ @return ER_DYNCOL_* return code
+*/
- return ER_DYNCOL_OK;
+enum enum_dyncol_func_result
+mariadb_dyncol_exists_named(DYNAMIC_COLUMN *str, LEX_STRING *name)
+{
+ DBUG_ASSERT(name != NULL);
+ return dynamic_column_exists_internal(str, 0, name);
}
/**
- Check existence of the column in the packed string
+ Check existence of the column in the packed string (by name of number)
@param str The packed string to check the column
- @param column_nr Number of column to check
+ @param num_key Number of the column to fetch (if strkey is NULL)
+ @param str_key Name of the column to fetch (or NULL)
@return ER_DYNCOL_* return code
*/
-enum enum_dyncol_func_result
-dynamic_column_exists(DYNAMIC_COLUMN *str, uint column_nr)
+static enum enum_dyncol_func_result
+dynamic_column_exists_internal(DYNAMIC_COLUMN *str, uint num_key,
+ LEX_STRING *str_key)
{
- uchar *data;
- size_t offset_size, length;
- uint column_count;
- DYNAMIC_COLUMN_TYPE type;
+ DYN_HEADER header;
+ enum enum_dyncol_func_result rc;
+ bzero(&header, sizeof(header));
if (str->length == 0)
return ER_DYNCOL_NO; /* no columns */
- if (read_fixed_header(str, &offset_size, &column_count))
- return ER_DYNCOL_FORMAT;
+ if ((rc= init_read_hdr(&header, str)) < 0)
+ return rc;
- if (column_count == 0)
+ if (header.column_count == 0)
return ER_DYNCOL_NO; /* no columns */
- if (find_column(&type, &data, &length, (uchar*)str->str + FIXED_HEADER_SIZE,
- offset_size, column_count, (uchar*)str->str + str->length,
- column_nr, NULL))
+ if (find_column(&header, num_key, str_key))
return ER_DYNCOL_FORMAT;
- return (type != DYN_COL_NULL ? ER_DYNCOL_YES : ER_DYNCOL_NO);
+ return (header.type != DYN_COL_NULL ? ER_DYNCOL_YES : ER_DYNCOL_NO);
}
/**
- List not-null columns in the packed string
+ List not-null columns in the packed string (only numeric format)
@param str The packed string
@param array_of_uint Where to put reference on created array
@return ER_DYNCOL_* return code
*/
-
enum enum_dyncol_func_result
dynamic_column_list(DYNAMIC_COLUMN *str, DYNAMIC_ARRAY *array_of_uint)
{
+ DYN_HEADER header;
uchar *read;
- size_t offset_size, entry_size;
- uint column_count, i;
+ uint i;
+ enum enum_dyncol_func_result rc;
bzero(array_of_uint, sizeof(*array_of_uint)); /* In case of errors */
if (str->length == 0)
return ER_DYNCOL_OK; /* no columns */
- if (read_fixed_header(str, &offset_size, &column_count))
- return ER_DYNCOL_FORMAT;
+ if ((rc= init_read_hdr(&header, str)) < 0)
+ return rc;
- entry_size= COLUMN_NUMBER_SIZE + offset_size;
+ if (header.format != dyncol_fmt_num)
+ return ER_DYNCOL_FORMAT;
- if (entry_size * column_count + FIXED_HEADER_SIZE > str->length)
+ if (header.entry_size * header.column_count + FIXED_HEADER_SIZE >
+ str->length)
return ER_DYNCOL_FORMAT;
- if (init_dynamic_array(array_of_uint, sizeof(uint), column_count, 0))
+ if (my_init_dynamic_array(array_of_uint, sizeof(uint), header.column_count,
+ 0, MYF(0)))
return ER_DYNCOL_RESOURCE;
- for (i= 0, read= (uchar *)str->str + FIXED_HEADER_SIZE;
- i < column_count;
- i++, read+= entry_size)
+ for (i= 0, read= header.header;
+ i < header.column_count;
+ i++, read+= header.entry_size)
{
uint nm= uint2korr(read);
/* Insert can't never fail as it's pre-allocated above */
@@ -1638,73 +2422,247 @@ dynamic_column_list(DYNAMIC_COLUMN *str, DYNAMIC_ARRAY *array_of_uint)
return ER_DYNCOL_OK;
}
+/**
+ List not-null columns in the packed string (only numeric format)
+
+ @param str The packed string
+ @param array_of_uint Where to put reference on created array
+
+ @return ER_DYNCOL_* return code
+*/
+enum enum_dyncol_func_result
+mariadb_dyncol_list(DYNAMIC_COLUMN *str, uint *count, uint **nums)
+{
+ DYN_HEADER header;
+ uchar *read;
+ uint i;
+ enum enum_dyncol_func_result rc;
+
+ (*nums)= 0; /* In case of errors */
+ if (str->length == 0)
+ return ER_DYNCOL_OK; /* no columns */
+
+ if ((rc= init_read_hdr(&header, str)) < 0)
+ return rc;
+
+ if (header.format != dyncol_fmt_num)
+ return ER_DYNCOL_FORMAT;
+
+ if (header.entry_size * header.column_count + FIXED_HEADER_SIZE >
+ str->length)
+ return ER_DYNCOL_FORMAT;
+
+ if (!((*nums)= my_malloc(sizeof(uint) * header.column_count, MYF(0))))
+ return ER_DYNCOL_RESOURCE;
+
+ for (i= 0, read= header.header;
+ i < header.column_count;
+ i++, read+= header.entry_size)
+ {
+ (*nums)[i]= uint2korr(read);
+ }
+ (*count)= header.column_count;
+ return ER_DYNCOL_OK;
+}
+
+/**
+ List not-null columns in the packed string (any format)
+
+ @param str The packed string
+ @param count Number of names in the list
+ @param names Where to put names list (should be freed)
+
+ @return ER_DYNCOL_* return code
+*/
+
+enum enum_dyncol_func_result
+mariadb_dyncol_list_named(DYNAMIC_COLUMN *str, uint *count, LEX_STRING **names)
+{
+ DYN_HEADER header;
+ uchar *read;
+ char *pool;
+ struct st_service_funcs *fmt;
+ uint i;
+ enum enum_dyncol_func_result rc;
+
+ (*names)= 0; (*count)= 0;
+
+ if (str->length == 0)
+ return ER_DYNCOL_OK; /* no columns */
+
+ if ((rc= init_read_hdr(&header, str)) < 0)
+ return rc;
+
+ fmt= fmt_data + header.format;
+
+ if (header.entry_size * header.column_count + fmt->fixed_hdr >
+ str->length)
+ return ER_DYNCOL_FORMAT;
+
+ if (header.format == dyncol_fmt_num)
+ *names= my_malloc(sizeof(LEX_STRING) * header.column_count +
+ DYNCOL_NUM_CHAR * header.column_count, MYF(0));
+ else
+ *names= my_malloc(sizeof(LEX_STRING) * header.column_count +
+ header.nmpool_size + header.column_count, MYF(0));
+ if (!(*names))
+ return ER_DYNCOL_RESOURCE;
+ pool= ((char *)(*names)) + sizeof(LEX_STRING) * header.column_count;
+
+ for (i= 0, read= header.header;
+ i < header.column_count;
+ i++, read+= header.entry_size)
+ {
+ if (header.format == dyncol_fmt_num)
+ {
+ uint nm= uint2korr(read);
+ (*names)[i].str= pool;
+ pool+= DYNCOL_NUM_CHAR;
+ (*names)[i].length=
+ longlong2str(nm, (*names)[i].str, 10) - (*names)[i].str;
+ }
+ else
+ {
+ LEX_STRING tmp;
+ if (read_name(&header, read, &tmp))
+ return ER_DYNCOL_FORMAT;
+ (*names)[i].length= tmp.length;
+ (*names)[i].str= pool;
+ pool+= tmp.length + 1;
+ memcpy((*names)[i].str, (const void *)tmp.str, tmp.length);
+ (*names)[i].str[tmp.length]= '\0'; // just for safety
+ }
+ }
+ (*count)= header.column_count;
+ return ER_DYNCOL_OK;
+}
/**
Find the place of the column in the header or place where it should be put
- @param num Number of the column
- @param header Pointer to the header
- @param entry_size Size of a header entry
- @param column_count Number of columns in the packed string
- @param entry Return pointer to the entry or next entry
+ @param hdr descriptor of dynamic column record
+ @param key Name or number of column to fetch
+ (depends on string_key)
+ @param string_key True if we gave pointer to LEX_STRING.
@retval TRUE found
@retval FALSE pointer set to the next row
*/
static my_bool
-find_place(uint num, uchar *header, size_t entry_size,
- uint column_count, uchar **entry)
+find_place(DYN_HEADER *hdr, void *key, my_bool string_keys)
{
uint mid, start, end, val;
- int flag;
- LINT_INIT(flag); /* 100 % safe */
+ int UNINIT_VAR(flag);
+ LEX_STRING str;
+ char buff[DYNCOL_NUM_CHAR];
+ my_bool need_conversion= ((string_keys ? dyncol_fmt_str : dyncol_fmt_num) !=
+ hdr->format);
+ /* new format can't be numeric if the old one is names */
+ DBUG_ASSERT(string_keys ||
+ hdr->format == dyncol_fmt_num);
start= 0;
- end= column_count -1;
+ end= hdr->column_count -1;
mid= 1;
while (start != end)
{
- uint val;
- mid= (start + end) / 2;
- val= uint2korr(header + mid * entry_size);
- if ((flag= CMP_NUM(num, val)) <= 0)
- end= mid;
- else
- start= mid + 1;
+ uint val;
+ mid= (start + end) / 2;
+ hdr->entry= hdr->header + mid * hdr->entry_size;
+ if (!string_keys)
+ {
+ val= uint2korr(hdr->entry);
+ flag= CMP_NUM(*((uint *)key), val);
+ }
+ else
+ {
+ if (need_conversion)
+ {
+ str.str= backwritenum(buff + sizeof(buff), uint2korr(hdr->entry));
+ str.length= (buff + sizeof(buff)) - str.str;
+ }
+ else
+ {
+ DBUG_ASSERT(hdr->format == dyncol_fmt_str);
+ if (read_name(hdr, hdr->entry, &str))
+ return 0;
+ }
+ flag= mariadb_dyncol_column_cmp_named((LEX_STRING *)key, &str);
+ }
+ if (flag <= 0)
+ end= mid;
+ else
+ start= mid + 1;
}
+ hdr->entry= hdr->header + start * hdr->entry_size;
if (start != mid)
{
- val= uint2korr(header + start * entry_size);
- flag= CMP_NUM(num, val);
+ if (!string_keys)
+ {
+ val= uint2korr(hdr->entry);
+ flag= CMP_NUM(*((uint *)key), val);
+ }
+ else
+ {
+ if (need_conversion)
+ {
+ str.str= backwritenum(buff + sizeof(buff), uint2korr(hdr->entry));
+ str.length= (buff + sizeof(buff)) - str.str;
+ }
+ else
+ {
+ DBUG_ASSERT(hdr->format == dyncol_fmt_str);
+ if (read_name(hdr, hdr->entry, &str))
+ return 0;
+ }
+ flag= mariadb_dyncol_column_cmp_named((LEX_STRING *)key, &str);
+ }
}
- *entry= header + start * entry_size;
if (flag > 0)
- *entry+= entry_size; /* Point at next bigger key */
+ hdr->entry+= hdr->entry_size; /* Point at next bigger key */
return flag == 0;
}
/*
- Description of plan of adding/removing/updating a packed string
+ It is internal structure which describes a plan of changing the record
+ of dynamic columns
*/
typedef enum {PLAN_REPLACE, PLAN_ADD, PLAN_DELETE, PLAN_NOP} PLAN_ACT;
struct st_plan {
DYNAMIC_COLUMN_VALUE *val;
- uint *num;
+ void *key;
uchar *place;
size_t length;
- int hdelta, ddelta;
+ long long hdelta, ddelta, ndelta;
+ long long mv_offset, mv_length;
+ uint mv_end;
PLAN_ACT act;
};
typedef struct st_plan PLAN;
-static int plan_sort(const void *a, const void *b)
+/**
+ Sort function for plan by column number
+*/
+
+static int plan_sort_num(const void *a, const void *b)
{
- return ((PLAN *)a)->num[0] - ((PLAN *)b)->num[0];
+ return *((uint *)((PLAN *)a)->key) - *((uint *)((PLAN *)b)->key);
+}
+
+
+/**
+ Sort function for plan by column name
+*/
+
+static int plan_sort_named(const void *a, const void *b)
+{
+ return mariadb_dyncol_column_cmp_named((LEX_STRING *)((PLAN *)a)->key,
+ (LEX_STRING *)((PLAN *)b)->key);
}
#define DELTA_CHECK(S, D, C) \
@@ -1714,9 +2672,558 @@ static int plan_sort(const void *a, const void *b)
((S) < 0 && (D) > 0)) \
{ \
(C)= TRUE; \
- break; \
- } \
+ }
+/**
+ Update dynamic column by copying in a new record (string).
+
+ @param str Dynamic column record to change
+ @param plan Plan of changing the record
+ @param add_column_count number of records in the plan array.
+ @param hdr descriptor of old dynamic column record
+ @param new_hdr descriptor of new dynamic column record
+ @param convert need conversion from numeric to names format
+
+ @return ER_DYNCOL_* return code
+*/
+
+static enum enum_dyncol_func_result
+dynamic_column_update_copy(DYNAMIC_COLUMN *str, PLAN *plan,
+ uint add_column_count,
+ DYN_HEADER *hdr, DYN_HEADER *new_hdr,
+ my_bool convert)
+{
+ DYNAMIC_COLUMN tmp;
+ struct st_service_funcs *fmt= fmt_data + hdr->format,
+ *new_fmt= fmt_data + new_hdr->format;
+ uint i, j, k;
+ size_t all_headers_size;
+
+ if (dynamic_column_init_named(&tmp,
+ (new_fmt->fixed_hdr + new_hdr->header_size +
+ new_hdr->nmpool_size +
+ new_hdr->data_size + DYNCOL_SYZERESERVE)))
+ {
+ return ER_DYNCOL_RESOURCE;
+ }
+ bzero(tmp.str, new_fmt->fixed_hdr);
+ (*new_fmt->set_fixed_hdr)(&tmp, new_hdr);
+ /* Adjust tmp to contain whole the future header */
+ tmp.length= new_fmt->fixed_hdr + new_hdr->header_size + new_hdr->nmpool_size;
+
+
+ /*
+ Copy data to the new string
+ i= index in array of changes
+ j= index in packed string header index
+ */
+ new_hdr->entry= new_hdr->header;
+ new_hdr->name= new_hdr->nmpool;
+ all_headers_size= new_fmt->fixed_hdr +
+ new_hdr->header_size + new_hdr->nmpool_size;
+ for (i= 0, j= 0; i < add_column_count || j < hdr->column_count; i++)
+ {
+ size_t UNINIT_VAR(first_offset);
+ uint start= j, end;
+
+ /*
+ Search in i and j for the next column to add from i and where to
+ add.
+ */
+
+ while (i < add_column_count && plan[i].act == PLAN_NOP)
+ i++; /* skip NOP */
+
+ if (i == add_column_count)
+ j= end= hdr->column_count;
+ else
+ {
+ /*
+ old data portion. We don't need to check that j < column_count
+ as plan[i].place is guaranteed to have a pointer inside the
+ data.
+ */
+ while (hdr->header + j * hdr->entry_size < plan[i].place)
+ j++;
+ end= j;
+ if ((plan[i].act == PLAN_REPLACE || plan[i].act == PLAN_DELETE))
+ j++; /* data at 'j' will be removed */
+ }
+
+ /*
+ Adjust all headers since last loop.
+ We have to do this as the offset for data has moved
+ */
+ for (k= start; k < end; k++)
+ {
+ uchar *read= hdr->header + k * hdr->entry_size;
+ void *key;
+ LEX_STRING name;
+ size_t offs;
+ uint nm;
+ DYNAMIC_COLUMN_TYPE tp;
+ char buff[DYNCOL_NUM_CHAR];
+
+ if (hdr->format == dyncol_fmt_num)
+ {
+ if (convert)
+ {
+ name.str= backwritenum(buff + sizeof(buff), uint2korr(read));
+ name.length= (buff + sizeof(buff)) - name.str;
+ key= &name;
+ }
+ else
+ {
+ nm= uint2korr(read); /* Column nummber */
+ key= &nm;
+ }
+ }
+ else
+ {
+ if (read_name(hdr, read, &name))
+ goto err;
+ key= &name;
+ }
+ if (fmt->type_and_offset_read(&tp, &offs,
+ read + fmt->fixed_hdr_entry,
+ hdr->offset_size))
+ goto err;
+ if (k == start)
+ first_offset= offs;
+ else if (offs < first_offset)
+ goto err;
+
+ offs+= plan[i].ddelta;
+ {
+ DYNAMIC_COLUMN_VALUE val;
+ val.type= tp; // only the type used in the header
+ if ((*new_fmt->put_header_entry)(new_hdr, key, &val, offs))
+ goto err;
+ }
+ }
+
+ /* copy first the data that was not replaced in original packed data */
+ if (start < end)
+ {
+ size_t data_size;
+ /* Add old data last in 'tmp' */
+ hdr->entry= hdr->header + start * hdr->entry_size;
+ data_size=
+ hdr_interval_length(hdr, hdr->header + end * hdr->entry_size);
+ if (data_size == DYNCOL_OFFSET_ERROR ||
+ (long) data_size < 0 ||
+ data_size > hdr->data_size - first_offset)
+ goto err;
+
+ memcpy(tmp.str + tmp.length, (char *)hdr->dtpool + first_offset,
+ data_size);
+ tmp.length+= data_size;
+ }
+
+ /* new data adding */
+ if (i < add_column_count)
+ {
+ if( plan[i].act == PLAN_ADD || plan[i].act == PLAN_REPLACE)
+ {
+ if ((*new_fmt->put_header_entry)(new_hdr, plan[i].key,
+ plan[i].val,
+ tmp.length - all_headers_size))
+ goto err;
+ data_store(&tmp, plan[i].val, new_hdr->format); /* Append new data */
+ }
+ }
+ }
+ dynamic_column_column_free(str);
+ *str= tmp;
+ return ER_DYNCOL_OK;
+err:
+ dynamic_column_column_free(&tmp);
+ return ER_DYNCOL_FORMAT;
+}
+
+static enum enum_dyncol_func_result
+dynamic_column_update_move_left(DYNAMIC_COLUMN *str, PLAN *plan,
+ size_t offset_size,
+ size_t entry_size,
+ size_t header_size,
+ size_t new_offset_size,
+ size_t new_entry_size,
+ size_t new_header_size,
+ uint column_count,
+ uint new_column_count,
+ uint add_column_count,
+ uchar *header_end,
+ size_t max_offset)
+{
+ uchar *write;
+ uchar *header_base= (uchar *)str->str + FIXED_HEADER_SIZE;
+ uint i, j, k;
+ size_t curr_offset;
+
+ write= (uchar *)str->str + FIXED_HEADER_SIZE;
+ set_fixed_header(str, (uint)new_offset_size, new_column_count);
+
+ /*
+ Move headers first.
+ i= index in array of changes
+ j= index in packed string header index
+ */
+ for (curr_offset= 0, i= 0, j= 0;
+ i < add_column_count || j < column_count;
+ i++)
+ {
+ size_t UNINIT_VAR(first_offset);
+ uint start= j, end;
+
+ /*
+ Search in i and j for the next column to add from i and where to
+ add.
+ */
+
+ while (i < add_column_count && plan[i].act == PLAN_NOP)
+ i++; /* skip NOP */
+
+ if (i == add_column_count)
+ j= end= column_count;
+ else
+ {
+ /*
+ old data portion. We don't need to check that j < column_count
+ as plan[i].place is guaranteed to have a pointer inside the
+ data.
+ */
+ while (header_base + j * entry_size < plan[i].place)
+ j++;
+ end= j;
+ if ((plan[i].act == PLAN_REPLACE || plan[i].act == PLAN_DELETE))
+ j++; /* data at 'j' will be removed */
+ }
+ plan[i].mv_end= end;
+
+ {
+ DYNAMIC_COLUMN_TYPE tp;
+ if (type_and_offset_read_num(&tp, &first_offset,
+ header_base + start * entry_size +
+ COLUMN_NUMBER_SIZE, offset_size))
+ return ER_DYNCOL_FORMAT;
+ }
+ /* find data to be moved */
+ if (start < end)
+ {
+ size_t data_size=
+ get_length_interval(header_base + start * entry_size,
+ header_base + end * entry_size,
+ header_end, offset_size, max_offset);
+ if (data_size == DYNCOL_OFFSET_ERROR ||
+ (long) data_size < 0 ||
+ data_size > max_offset - first_offset)
+ {
+ str->length= 0; // just something valid
+ return ER_DYNCOL_FORMAT;
+ }
+ DBUG_ASSERT(curr_offset == first_offset + plan[i].ddelta);
+ plan[i].mv_offset= first_offset;
+ plan[i].mv_length= data_size;
+ curr_offset+= data_size;
+ }
+ else
+ {
+ plan[i].mv_length= 0;
+ plan[i].mv_offset= curr_offset;
+ }
+
+ if (plan[i].ddelta == 0 && offset_size == new_offset_size &&
+ plan[i].act != PLAN_DELETE)
+ write+= entry_size * (end - start);
+ else
+ {
+ /*
+ Adjust all headers since last loop.
+ We have to do this as the offset for data has moved
+ */
+ for (k= start; k < end; k++)
+ {
+ uchar *read= header_base + k * entry_size;
+ size_t offs;
+ uint nm;
+ DYNAMIC_COLUMN_TYPE tp;
+
+ nm= uint2korr(read); /* Column nummber */
+ if (type_and_offset_read_num(&tp, &offs, read + COLUMN_NUMBER_SIZE,
+ offset_size))
+ return ER_DYNCOL_FORMAT;
+
+ if (k > start && offs < first_offset)
+ {
+ str->length= 0; // just something valid
+ return ER_DYNCOL_FORMAT;
+ }
+
+ offs+= plan[i].ddelta;
+ int2store(write, nm);
+ /* write rest of data at write + COLUMN_NUMBER_SIZE */
+ type_and_offset_store_num(write, new_offset_size, tp, offs);
+ write+= new_entry_size;
+ }
+ }
+
+ /* new data adding */
+ if (i < add_column_count)
+ {
+ if( plan[i].act == PLAN_ADD || plan[i].act == PLAN_REPLACE)
+ {
+ int2store(write, *((uint *)plan[i].key));
+ type_and_offset_store_num(write, new_offset_size,
+ plan[i].val[0].type,
+ curr_offset);
+ write+= new_entry_size;
+ curr_offset+= plan[i].length;
+ }
+ }
+ }
+
+ /*
+ Move data.
+ i= index in array of changes
+ j= index in packed string header index
+ */
+ str->length= (FIXED_HEADER_SIZE + new_header_size);
+ for (i= 0, j= 0;
+ i < add_column_count || j < column_count;
+ i++)
+ {
+ uint start= j, end;
+
+ /*
+ Search in i and j for the next column to add from i and where to
+ add.
+ */
+
+ while (i < add_column_count && plan[i].act == PLAN_NOP)
+ i++; /* skip NOP */
+
+ j= end= plan[i].mv_end;
+ if (i != add_column_count &&
+ (plan[i].act == PLAN_REPLACE || plan[i].act == PLAN_DELETE))
+ j++;
+
+ /* copy first the data that was not replaced in original packed data */
+ if (start < end && plan[i].mv_length)
+ {
+ memmove((header_base + new_header_size +
+ plan[i].mv_offset + plan[i].ddelta),
+ header_base + header_size + plan[i].mv_offset,
+ plan[i].mv_length);
+ }
+ str->length+= plan[i].mv_length;
+
+ /* new data adding */
+ if (i < add_column_count)
+ {
+ if( plan[i].act == PLAN_ADD || plan[i].act == PLAN_REPLACE)
+ {
+ data_store(str, plan[i].val, dyncol_fmt_num);/* Append new data */
+ }
+ }
+ }
+ return ER_DYNCOL_OK;
+}
+
+#ifdef UNUSED
+static enum enum_dyncol_func_result
+dynamic_column_update_move_right(DYNAMIC_COLUMN *str, PLAN *plan,
+ size_t offset_size,
+ size_t entry_size,
+ size_t header_size,
+ size_t new_offset_size,
+ size_t new_entry_size,
+ size_t new_header_size,
+ uint column_count,
+ uint new_column_count,
+ uint add_column_count,
+ uchar *header_end,
+ size_t max_offset)
+{
+ uchar *write;
+ uchar *header_base= (uchar *)str->str + FIXED_HEADER_SIZE;
+ uint i, j, k;
+ size_t curr_offset;
+
+ write= (uchar *)str->str + FIXED_HEADER_SIZE;
+ set_fixed_header(str, new_offset_size, new_column_count);
+
+ /*
+ Move data first.
+ i= index in array of changes
+ j= index in packed string header index
+ */
+ for (curr_offset= 0, i= 0, j= 0;
+ i < add_column_count || j < column_count;
+ i++)
+ {
+ size_t UNINIT_VAR(first_offset);
+ uint start= j, end;
+
+ /*
+ Search in i and j for the next column to add from i and where to
+ add.
+ */
+
+ while (i < add_column_count && plan[i].act == PLAN_NOP)
+ i++; /* skip NOP */
+
+ if (i == add_column_count)
+ j= end= column_count;
+ else
+ {
+ /*
+ old data portion. We don't need to check that j < column_count
+ as plan[i].place is guaranteed to have a pointer inside the
+ data.
+ */
+ while (header_base + j * entry_size < plan[i].place)
+ j++;
+ end= j;
+ if ((plan[i].act == PLAN_REPLACE || plan[i].act == PLAN_DELETE))
+ j++; /* data at 'j' will be removed */
+ }
+ plan[i].mv_end= end;
+
+ {
+ DYNAMIC_COLUMN_TYPE tp;
+ type_and_offset_read_num(&tp, &first_offset,
+ header_base +
+ start * entry_size + COLUMN_NUMBER_SIZE,
+ offset_size);
+ }
+ /* find data to be moved */
+ if (start < end)
+ {
+ size_t data_size=
+ get_length_interval(header_base + start * entry_size,
+ header_base + end * entry_size,
+ header_end, offset_size, max_offset);
+ if (data_size == DYNCOL_OFFSET_ERROR ||
+ (long) data_size < 0 ||
+ data_size > max_offset - first_offset)
+ {
+ str->length= 0; // just something valid
+ return ER_DYNCOL_FORMAT;
+ }
+ DBUG_ASSERT(curr_offset == first_offset + plan[i].ddelta);
+ plan[i].mv_offset= first_offset;
+ plan[i].mv_length= data_size;
+ curr_offset+= data_size;
+ }
+ else
+ {
+ plan[i].mv_length= 0;
+ plan[i].mv_offset= curr_offset;
+ }
+
+ if (plan[i].ddelta == 0 && offset_size == new_offset_size &&
+ plan[i].act != PLAN_DELETE)
+ write+= entry_size * (end - start);
+ else
+ {
+ /*
+ Adjust all headers since last loop.
+ We have to do this as the offset for data has moved
+ */
+ for (k= start; k < end; k++)
+ {
+ uchar *read= header_base + k * entry_size;
+ size_t offs;
+ uint nm;
+ DYNAMIC_COLUMN_TYPE tp;
+
+ nm= uint2korr(read); /* Column nummber */
+ type_and_offset_read_num(&tp, &offs, read + COLUMN_NUMBER_SIZE,
+ offset_size);
+ if (k > start && offs < first_offset)
+ {
+ str->length= 0; // just something valid
+ return ER_DYNCOL_FORMAT;
+ }
+
+ offs+= plan[i].ddelta;
+ int2store(write, nm);
+ /* write rest of data at write + COLUMN_NUMBER_SIZE */
+ if (type_and_offset_store_num(write, new_offset_size, tp, offs))
+ {
+ str->length= 0; // just something valid
+ return ER_DYNCOL_FORMAT;
+ }
+ write+= new_entry_size;
+ }
+ }
+
+ /* new data adding */
+ if (i < add_column_count)
+ {
+ if( plan[i].act == PLAN_ADD || plan[i].act == PLAN_REPLACE)
+ {
+ int2store(write, *((uint *)plan[i].key));
+ if (type_and_offset_store_num(write, new_offset_size,
+ plan[i].val[0].type,
+ curr_offset))
+ {
+ str->length= 0; // just something valid
+ return ER_DYNCOL_FORMAT;
+ }
+ write+= new_entry_size;
+ curr_offset+= plan[i].length;
+ }
+ }
+ }
+
+ /*
+ Move headers.
+ i= index in array of changes
+ j= index in packed string header index
+ */
+ str->length= (FIXED_HEADER_SIZE + new_header_size);
+ for (i= 0, j= 0;
+ i < add_column_count || j < column_count;
+ i++)
+ {
+ uint start= j, end;
+
+ /*
+ Search in i and j for the next column to add from i and where to
+ add.
+ */
+
+ while (i < add_column_count && plan[i].act == PLAN_NOP)
+ i++; /* skip NOP */
+
+ j= end= plan[i].mv_end;
+ if (i != add_column_count &&
+ (plan[i].act == PLAN_REPLACE || plan[i].act == PLAN_DELETE))
+ j++;
+
+ /* copy first the data that was not replaced in original packed data */
+ if (start < end && plan[i].mv_length)
+ {
+ memmove((header_base + new_header_size +
+ plan[i].mv_offset + plan[i].ddelta),
+ header_base + header_size + plan[i].mv_offset,
+ plan[i].mv_length);
+ }
+ str->length+= plan[i].mv_length;
+
+ /* new data adding */
+ if (i < add_column_count)
+ {
+ if( plan[i].act == PLAN_ADD || plan[i].act == PLAN_REPLACE)
+ {
+ data_store(str, plan[i].val, dyncol_fmt_num); /* Append new data */
+ }
+ }
+ }
+ return ER_DYNCOL_OK;
+}
+#endif
/**
Update the packed string with the given columns
@@ -1728,6 +3235,8 @@ static int plan_sort(const void *a, const void *b)
@return ER_DYNCOL_* return code
*/
+/* plan allocated on the stack */
+#define IN_PLACE_PLAN 4
enum enum_dyncol_func_result
dynamic_column_update_many(DYNAMIC_COLUMN *str,
@@ -1735,39 +3244,95 @@ dynamic_column_update_many(DYNAMIC_COLUMN *str,
uint *column_numbers,
DYNAMIC_COLUMN_VALUE *values)
{
- PLAN *plan;
- uchar *header_end;
- long data_delta= 0;
- uint i, j, k;
- uint new_column_count, column_count, not_null;
+ return dynamic_column_update_many_fmt(str, add_column_count, column_numbers,
+ values, FALSE);
+}
+
+enum enum_dyncol_func_result
+mariadb_dyncol_update_many(DYNAMIC_COLUMN *str,
+ uint add_column_count,
+ uint *column_numbers,
+ DYNAMIC_COLUMN_VALUE *values)
+{
+ return dynamic_column_update_many_fmt(str, add_column_count, column_numbers,
+ values, FALSE);
+}
+
+enum enum_dyncol_func_result
+mariadb_dyncol_update_many_named(DYNAMIC_COLUMN *str,
+ uint add_column_count,
+ LEX_STRING *column_names,
+ DYNAMIC_COLUMN_VALUE *values)
+{
+ return dynamic_column_update_many_fmt(str, add_column_count, column_names,
+ values, TRUE);
+}
+
+static uint numlen(uint val)
+{
+ uint res;
+ if (val == 0)
+ return 1;
+ res= 0;
+ while(val)
+ {
+ res++;
+ val/=10;
+ }
+ return res;
+}
+
+static enum enum_dyncol_func_result
+dynamic_column_update_many_fmt(DYNAMIC_COLUMN *str,
+ uint add_column_count,
+ void *column_keys,
+ DYNAMIC_COLUMN_VALUE *values,
+ my_bool string_keys)
+{
+ PLAN *plan, *alloc_plan= NULL, in_place_plan[IN_PLACE_PLAN];
+ uchar *element;
+ DYN_HEADER header, new_header;
+ struct st_service_funcs *fmt, *new_fmt;
+ long long data_delta= 0, name_delta= 0;
+ uint i;
+ uint not_null;
+ long long header_delta= 0;
+ long long header_delta_sign, data_delta_sign;
+ int copy= FALSE;
enum enum_dyncol_func_result rc;
- int header_delta;
- size_t offset_size, entry_size, header_size, data_size;
- size_t new_offset_size, new_entry_size, new_header_size, new_data_size;
- size_t max_offset;
+ my_bool convert;
if (add_column_count == 0)
return ER_DYNCOL_OK;
+ bzero(&header, sizeof(header));
+ bzero(&new_header, sizeof(new_header));
+ new_header.format= (string_keys ? dyncol_fmt_str : dyncol_fmt_num);
+ new_fmt= fmt_data + new_header.format;
+
/*
Get columns in column order. As the data in 'str' is already
in column order this allows to replace all columns in one loop.
*/
-
- if (!(plan= my_malloc(sizeof(PLAN) * (add_column_count + 1), MYF(0))))
+ if (IN_PLACE_PLAN > add_column_count)
+ plan= in_place_plan;
+ else if (!(alloc_plan= plan=
+ my_malloc(sizeof(PLAN) * (add_column_count + 1), MYF(0))))
return ER_DYNCOL_RESOURCE;
not_null= add_column_count;
- for (i= 0; i < add_column_count; i++)
+ for (i= 0, element= (uchar *) column_keys;
+ i < add_column_count;
+ i++, element+= new_fmt->key_size_in_array)
{
- if (column_numbers[i] > UINT_MAX16)
+ if ((*new_fmt->check_limit)(&element))
{
rc= ER_DYNCOL_DATA;
goto end;
}
plan[i].val= values + i;
- plan[i].num= column_numbers + i;
+ plan[i].key= element;
if (values[i].type == DYN_COL_NULL)
not_null--;
@@ -1783,22 +3348,32 @@ dynamic_column_update_many(DYNAMIC_COLUMN *str,
}
/* Check that header is ok */
- if (read_fixed_header(str, &offset_size, &column_count))
- {
- rc= ER_DYNCOL_FORMAT;
+ if ((rc= init_read_hdr(&header, str)) < 0)
goto end;
- }
- if (column_count == 0)
+ fmt= fmt_data + header.format;
+ /* new format can't be numeric if the old one is names */
+ DBUG_ASSERT(new_header.format == dyncol_fmt_str ||
+ header.format == dyncol_fmt_num);
+ if (header.column_count == 0)
goto create_new_string;
- qsort(plan, (size_t)add_column_count, sizeof(PLAN), &plan_sort);
+ qsort(plan, (size_t)add_column_count, sizeof(PLAN), new_fmt->plan_sort);
- new_column_count= column_count;
- calc_param(&entry_size, &header_size, offset_size, column_count);
- max_offset= str->length - (FIXED_HEADER_SIZE + header_size);
- header_end= (uchar*) str->str + FIXED_HEADER_SIZE + header_size;
+ new_header.column_count= header.column_count;
+ new_header.nmpool_size= header.nmpool_size;
+ if ((convert= (new_header.format == dyncol_fmt_str &&
+ header.format == dyncol_fmt_num)))
+ {
+ DBUG_ASSERT(new_header.nmpool_size == 0);
+ for(i= 0, header.entry= header.header;
+ i < header.column_count;
+ i++, header.entry+= header.entry_size)
+ {
+ new_header.nmpool_size+= numlen(uint2korr(header.entry));
+ }
+ }
- if (header_size + FIXED_HEADER_SIZE > str->length)
+ if (fmt->fixed_hdr + header.header_size + header.nmpool_size > str->length)
{
rc= ER_DYNCOL_FORMAT;
goto end;
@@ -1808,17 +3383,15 @@ dynamic_column_update_many(DYNAMIC_COLUMN *str,
Calculate how many columns and data is added/deleted and make a 'plan'
for each of them.
*/
- header_delta= 0;
for (i= 0; i < add_column_count; i++)
{
- uchar *entry;
-
/*
For now we don't allow creating two columns with the same number
at the time of create. This can be fixed later to just use the later
by comparing the pointers.
*/
- if (i < add_column_count - 1 && plan[i].num[0] == plan[i + 1].num[0])
+ if (i < add_column_count - 1 &&
+ new_fmt->column_sort(&plan[i].key, &plan[i + 1].key) == 0)
{
rc= ER_DYNCOL_DATA;
goto end;
@@ -1826,26 +3399,42 @@ dynamic_column_update_many(DYNAMIC_COLUMN *str,
/* Set common variables for all plans */
plan[i].ddelta= data_delta;
+ plan[i].ndelta= name_delta;
/* get header delta in entries */
plan[i].hdelta= header_delta;
plan[i].length= 0; /* Length if NULL */
- if (find_place(plan[i].num[0],
- (uchar *)str->str + FIXED_HEADER_SIZE,
- entry_size, column_count, &entry))
+ if (find_place(&header, plan[i].key, string_keys))
{
- size_t entry_data_size;
+ size_t entry_data_size, entry_name_size= 0;
/* Data existed; We have to replace or delete it */
- entry_data_size= get_length(entry, header_end,
- offset_size, max_offset);
- if ((long) entry_data_size < 0)
+ entry_data_size= hdr_interval_length(&header, header.entry +
+ header.entry_size);
+ if (entry_data_size == DYNCOL_OFFSET_ERROR ||
+ (long) entry_data_size < 0)
{
rc= ER_DYNCOL_FORMAT;
goto end;
}
+ if (new_header.format == dyncol_fmt_str)
+ {
+ if (header.format == dyncol_fmt_str)
+ {
+ LEX_STRING name;
+ if (read_name(&header, header.entry, &name))
+ {
+ rc= ER_DYNCOL_FORMAT;
+ goto end;
+ }
+ entry_name_size= name.length;
+ }
+ else
+ entry_name_size= numlen(uint2korr(header.entry));
+ }
+
if (plan[i].val->type == DYN_COL_NULL)
{
/* Inserting a NULL means delete the old data */
@@ -1853,6 +3442,7 @@ dynamic_column_update_many(DYNAMIC_COLUMN *str,
plan[i].act= PLAN_DELETE; /* Remove old value */
header_delta--; /* One row less in header */
data_delta-= entry_data_size; /* Less data to store */
+ name_delta-= entry_name_size;
}
else
{
@@ -1860,13 +3450,18 @@ dynamic_column_update_many(DYNAMIC_COLUMN *str,
plan[i].act= PLAN_REPLACE;
/* get data delta in bytes */
- if ((plan[i].length= dynamic_column_value_len(plan[i].val)) ==
+ if ((plan[i].length= dynamic_column_value_len(plan[i].val,
+ new_header.format)) ==
(size_t) ~0)
{
rc= ER_DYNCOL_DATA;
goto end;
}
data_delta+= plan[i].length - entry_data_size;
+ if (new_header.format == dyncol_fmt_str)
+ {
+ name_delta+= ((LEX_STRING *)(plan[i].key))->length - entry_name_size;
+ }
}
}
else
@@ -1884,226 +3479,849 @@ dynamic_column_update_many(DYNAMIC_COLUMN *str,
plan[i].act= PLAN_ADD;
header_delta++; /* One more row in header */
/* get data delta in bytes */
- if ((plan[i].length= dynamic_column_value_len(plan[i].val)) ==
+ if ((plan[i].length= dynamic_column_value_len(plan[i].val,
+ new_header.format)) ==
(size_t) ~0)
{
rc= ER_DYNCOL_DATA;
goto end;
}
data_delta+= plan[i].length;
+ if (new_header.format == dyncol_fmt_str)
+ name_delta+= ((LEX_STRING *)plan[i].key)->length;
}
}
- plan[i].place= entry;
+ plan[i].place= header.entry;
}
plan[add_column_count].hdelta= header_delta;
plan[add_column_count].ddelta= data_delta;
- new_column_count= column_count + header_delta;
+ plan[add_column_count].act= PLAN_NOP;
+ plan[add_column_count].place= header.dtpool;
+
+ new_header.column_count= (uint)(header.column_count + header_delta);
/*
Check if it is only "increasing" or only "decreasing" plan for (header
and data separately).
*/
- data_size= str->length - header_size - FIXED_HEADER_SIZE;
- new_data_size= data_size + data_delta;
- if ((new_offset_size= dynamic_column_offset_bytes(new_data_size)) >=
- MAX_OFFSET_LENGTH)
+ new_header.data_size= header.data_size + data_delta;
+ new_header.nmpool_size= new_header.nmpool_size + name_delta;
+ DBUG_ASSERT(new_header.format != dyncol_fmt_num ||
+ new_header.nmpool_size == 0);
+ if ((new_header.offset_size=
+ new_fmt->dynamic_column_offset_bytes(new_header.data_size)) >=
+ new_fmt->max_offset_size)
{
rc= ER_DYNCOL_LIMIT;
goto end;
}
-#ifdef NOT_IMPLEMENTED
- /* if (new_offset_size != offset_size) then we have to rewrite header */
- header_delta_sign= new_offset_size - offset_size;
+ copy= ((header.format != new_header.format) ||
+ (new_header.format == dyncol_fmt_str));
+ /* if (new_header.offset_size!=offset_size) then we have to rewrite header */
+ header_delta_sign=
+ ((int)new_header.offset_size + new_fmt->fixed_hdr_entry) -
+ ((int)header.offset_size + fmt->fixed_hdr_entry);
data_delta_sign= 0;
- for (i= 0; i < add_column_count; i++)
+ // plan[add_column_count] contains last deltas.
+ for (i= 0; i <= add_column_count && !copy; i++)
{
/* This is the check for increasing/decreasing */
DELTA_CHECK(header_delta_sign, plan[i].hdelta, copy);
DELTA_CHECK(data_delta_sign, plan[i].ddelta, copy);
}
-#endif
- calc_param(&new_entry_size, &new_header_size,
- new_offset_size, new_column_count);
+ calc_param(&new_header.entry_size, &new_header.header_size,
+ new_fmt->fixed_hdr_entry,
+ new_header.offset_size, new_header.column_count);
/*
- The following code always make a copy. In future we can do a more
- optimized version when data is only increasing / decreasing.
+ Need copy because:
+ 1, Header/data parts moved in different directions.
+ 2. There is no enough allocated space in the string.
+ 3. Header and data moved in different directions.
*/
+ if (copy || /*1.*/
+ str->max_length < str->length + header_delta + data_delta || /*2.*/
+ ((header_delta_sign < 0 && data_delta_sign > 0) ||
+ (header_delta_sign > 0 && data_delta_sign < 0))) /*3.*/
+ rc= dynamic_column_update_copy(str, plan, add_column_count,
+ &header, &new_header,
+ convert);
+ else
+ if (header_delta_sign < 0)
+ rc= dynamic_column_update_move_left(str, plan, header.offset_size,
+ header.entry_size,
+ header.header_size,
+ new_header.offset_size,
+ new_header.entry_size,
+ new_header.header_size,
+ header.column_count,
+ new_header.column_count,
+ add_column_count, header.dtpool,
+ header.data_size);
+ else
+ /*
+ rc= dynamic_column_update_move_right(str, plan, offset_size,
+ entry_size, header_size,
+ new_header.offset_size,
+ new_header.entry_size,
+ new_heder.header_size, column_count,
+ new_header.column_count,
+ add_column_count, header_end,
+ header.data_size);
+ */
+ rc= dynamic_column_update_copy(str, plan, add_column_count,
+ &header, &new_header,
+ convert);
+end:
+ my_free(alloc_plan);
+ return rc;
+
+create_new_string:
+ /* There is no columns from before, so let's just add the new ones */
+ rc= ER_DYNCOL_OK;
+ my_free(alloc_plan);
+ if (not_null != 0)
+ rc= dynamic_column_create_many_internal_fmt(str, add_column_count,
+ (uint*)column_keys, values,
+ str->str == NULL,
+ string_keys);
+ goto end;
+}
+
+
+/**
+ Update the packed string with the given column
+
+ @param str String where to write the data
+ @param column_number Array of columns number
+ @param values Array of columns values
+
+ @return ER_DYNCOL_* return code
+*/
+
+
+int dynamic_column_update(DYNAMIC_COLUMN *str, uint column_nr,
+ DYNAMIC_COLUMN_VALUE *value)
+{
+ return dynamic_column_update_many(str, 1, &column_nr, value);
+}
+
- /*if (copy) */
+enum enum_dyncol_func_result
+mariadb_dyncol_check(DYNAMIC_COLUMN *str)
+{
+ struct st_service_funcs *fmt;
+ enum enum_dyncol_func_result rc= ER_DYNCOL_FORMAT;
+ DYN_HEADER header;
+ uint i;
+ size_t data_offset= 0, name_offset= 0;
+ size_t prev_data_offset= 0, prev_name_offset= 0;
+ LEX_STRING name= {0,0}, prev_name= {0,0};
+ uint num= 0, prev_num= 0;
+ void *key, *prev_key;
+ enum enum_dynamic_column_type type= DYN_COL_NULL, prev_type= DYN_COL_NULL;
+
+ DBUG_ENTER("dynamic_column_check");
+
+ if (str->length == 0)
+ {
+ DBUG_PRINT("info", ("empty string is OK"));
+ DBUG_RETURN(ER_DYNCOL_OK);
+ }
+
+ bzero(&header, sizeof(header));
+
+ /* Check that header is OK */
+ if (read_fixed_header(&header, str))
+ {
+ DBUG_PRINT("info", ("Reading fixed string header failed"));
+ goto end;
+ }
+ fmt= fmt_data + header.format;
+ calc_param(&header.entry_size, &header.header_size,
+ fmt->fixed_hdr_entry, header.offset_size,
+ header.column_count);
+ /* headers are out of string length (no space for data and part of headers) */
+ if (fmt->fixed_hdr + header.header_size + header.nmpool_size > str->length)
+ {
+ DBUG_PRINT("info", ("Fixed header: %u Header size: %u "
+ "Name pool size: %u but Strig length: %u",
+ (uint)fmt->fixed_hdr,
+ (uint)header.header_size,
+ (uint)header.nmpool_size,
+ (uint)str->length));
+ goto end;
+ }
+ header.header= (uchar*)str->str + fmt->fixed_hdr;
+ header.nmpool= header.header + header.header_size;
+ header.dtpool= header.nmpool + header.nmpool_size;
+ header.data_size= str->length - fmt->fixed_hdr -
+ header.header_size - header.nmpool_size;
+
+ /* read and check headers */
+ if (header.format == dyncol_fmt_num)
+ {
+ key= &num;
+ prev_key= &prev_num;
+ }
+ else
+ {
+ key= &name;
+ prev_key= &prev_name;
+ }
+ for (i= 0, header.entry= header.header;
+ i < header.column_count;
+ i++, header.entry+= header.entry_size)
{
- DYNAMIC_COLUMN tmp;
- uchar *header_base= (uchar *)str->str + FIXED_HEADER_SIZE,
- *write;
- if (dynamic_column_init_str(&tmp,
- (FIXED_HEADER_SIZE + new_header_size +
- new_data_size + DYNCOL_SYZERESERVE)))
+
+ if (header.format == dyncol_fmt_num)
{
- rc= ER_DYNCOL_RESOURCE;
- goto end;
+ num= uint2korr(header.entry);
+ }
+ else
+ {
+ DBUG_ASSERT(header.format == dyncol_fmt_str);
+ if (read_name(&header, header.entry, &name))
+ {
+ DBUG_PRINT("info", ("Reading name failed: Field order: %u"
+ " Name offset: %u"
+ " Name pool size: %u",
+ (uint) i,
+ uint2korr(header.entry),
+ (uint)header.nmpool_size));
+ goto end;
+ }
+ name_offset= name.str - (char *)header.nmpool;
}
- write= (uchar *)tmp.str + FIXED_HEADER_SIZE;
- /* Adjust tmp to contain whole the future header */
- tmp.length= FIXED_HEADER_SIZE + new_header_size;
- set_fixed_header(&tmp, new_offset_size, new_column_count);
- data_delta= 0;
+ if ((*fmt->type_and_offset_read)(&type, &data_offset,
+ header.entry + fmt->fixed_hdr_entry,
+ header.offset_size))
+ goto end;
- /*
- Copy data to the new string
- i= index in array of changes
- j= index in packed string header index
- */
+ DBUG_ASSERT(type != DYN_COL_NULL);
+ if (data_offset > header.data_size)
+ {
+ DBUG_PRINT("info", ("Field order: %u Data offset: %u"
+ " > Data pool size: %u",
+ (uint)i,
+ (uint)data_offset,
+ (uint)header.data_size));
+ goto end;
+ }
+ if (prev_type != DYN_COL_NULL)
+ {
+ /* It is not first entry */
+ if (prev_data_offset >= data_offset)
+ {
+ DBUG_PRINT("info", ("Field order: %u Previous data offset: %u"
+ " >= Current data offset: %u",
+ (uint)i,
+ (uint)prev_data_offset,
+ (uint)data_offset));
+ goto end;
+ }
+ if (prev_name_offset > name_offset)
+ {
+ DBUG_PRINT("info", ("Field order: %u Previous name offset: %u"
+ " > Current name offset: %u",
+ (uint)i,
+ (uint)prev_data_offset,
+ (uint)data_offset));
+ goto end;
+ }
+ if ((*fmt->column_sort)(&prev_key, &key) >= 0)
+ {
+ DBUG_PRINT("info", ("Field order: %u Previous key >= Current key",
+ (uint)i));
+ goto end;
+ }
+ }
+ prev_num= num;
+ prev_name= name;
+ prev_data_offset= data_offset;
+ prev_name_offset= name_offset;
+ prev_type= type;
+ }
- for (i= 0, j= 0; i < add_column_count || j < column_count; i++)
+ /* check data, which we can */
+ for (i= 0, header.entry= header.header;
+ i < header.column_count;
+ i++, header.entry+= header.entry_size)
+ {
+ DYNAMIC_COLUMN_VALUE store;
+ // already checked by previouse pass
+ (*fmt->type_and_offset_read)(&header.type, &header.offset,
+ header.entry + fmt->fixed_hdr_entry,
+ header.offset_size);
+ header.length=
+ hdr_interval_length(&header, header.entry + header.entry_size);
+ header.data= header.dtpool + header.offset;
+ switch ((header.type)) {
+ case DYN_COL_INT:
+ rc= dynamic_column_sint_read(&store, header.data, header.length);
+ break;
+ case DYN_COL_UINT:
+ rc= dynamic_column_uint_read(&store, header.data, header.length);
+ break;
+ case DYN_COL_DOUBLE:
+ rc= dynamic_column_double_read(&store, header.data, header.length);
+ break;
+ case DYN_COL_STRING:
+ rc= dynamic_column_string_read(&store, header.data, header.length);
+ break;
+ case DYN_COL_DECIMAL:
+ rc= dynamic_column_decimal_read(&store, header.data, header.length);
+ break;
+ case DYN_COL_DATETIME:
+ rc= dynamic_column_date_time_read(&store, header.data,
+ header.length);
+ break;
+ case DYN_COL_DATE:
+ rc= dynamic_column_date_read(&store, header.data, header.length);
+ break;
+ case DYN_COL_TIME:
+ rc= dynamic_column_time_read(&store, header.data, header.length);
+ break;
+ case DYN_COL_DYNCOL:
+ rc= dynamic_column_dyncol_read(&store, header.data, header.length);
+ break;
+ case DYN_COL_NULL:
+ default:
+ rc= ER_DYNCOL_FORMAT;
+ goto end;
+ }
+ if (rc != ER_DYNCOL_OK)
{
- size_t first_offset;
- uint start= j, end;
- LINT_INIT(first_offset);
+ DBUG_ASSERT(rc < 0);
+ DBUG_PRINT("info", ("Field order: %u Can't read data: %i",
+ (uint)i, (int) rc));
+ goto end;
+ }
+ }
- /*
- Search in i and j for the next column to add from i and where to
- add.
- */
+ rc= ER_DYNCOL_OK;
+end:
+ DBUG_RETURN(rc);
+}
- while (i < add_column_count && plan[i].act == PLAN_NOP)
- i++; /* skip NOP */
- if (i == add_column_count)
- j= end= column_count;
- else
- {
- /*
- old data portion. We don't need to check that j < column_count
- as plan[i].place is guaranteed to have a pointer inside the
- data.
- */
- while (header_base + j * entry_size < plan[i].place)
- j++;
- end= j;
- if ((plan[i].act == PLAN_REPLACE || plan[i].act == PLAN_DELETE))
- j++; /* data at 'j' will be removed */
- }
- if (plan[i].ddelta == 0 && offset_size == new_offset_size)
+enum enum_dyncol_func_result
+mariadb_dyncol_val_str(DYNAMIC_STRING *str, DYNAMIC_COLUMN_VALUE *val,
+ CHARSET_INFO *cs, char quote)
+{
+ char buff[40];
+ size_t len;
+ switch (val->type) {
+ case DYN_COL_INT:
+ len= snprintf(buff, sizeof(buff), "%lld", val->x.long_value);
+ if (dynstr_append_mem(str, buff, len))
+ return ER_DYNCOL_RESOURCE;
+ break;
+ case DYN_COL_UINT:
+ len= snprintf(buff, sizeof(buff), "%llu", val->x.ulong_value);
+ if (dynstr_append_mem(str, buff, len))
+ return ER_DYNCOL_RESOURCE;
+ break;
+ case DYN_COL_DOUBLE:
+ len= my_snprintf(buff, sizeof(buff), "%g", val->x.double_value);
+ if (dynstr_realloc(str, len + (quote ? 2 : 0)))
+ return ER_DYNCOL_RESOURCE;
+ if (quote)
+ str->str[str->length++]= quote;
+ dynstr_append_mem(str, buff, len);
+ if (quote)
+ str->str[str->length++]= quote;
+ break;
+ case DYN_COL_DYNCOL:
+ case DYN_COL_STRING:
{
- uchar *read= header_base + start * entry_size;
- DYNAMIC_COLUMN_TYPE tp;
- /*
- It's safe to copy the header unchanged. This is usually the
- case for the first header block before any changed data.
- */
- if (start < end) /* Avoid memcpy with 0 */
+ char *alloc= NULL;
+ char *from= val->x.string.value.str;
+ ulong bufflen;
+ my_bool conv= !my_charset_same(val->x.string.charset, cs);
+ my_bool rc;
+ len= val->x.string.value.length;
+ bufflen= (ulong)(len * (conv ? cs->mbmaxlen : 1));
+ if (dynstr_realloc(str, bufflen))
+ return ER_DYNCOL_RESOURCE;
+
+ // guaranty UTF-8 string for value
+ if (!my_charset_same(val->x.string.charset, cs))
{
- size_t length= entry_size * (end - start);
- memcpy(write, read, length);
- write+= length;
+ uint dummy_errors;
+ if (!quote)
+ {
+ /* convert to the destination */
+ str->length+= copy_and_convert_extended(str->str, bufflen,
+ cs,
+ from, (uint32)len,
+ val->x.string.charset,
+ &dummy_errors);
+ return ER_DYNCOL_OK;
+ }
+ if ((alloc= (char *)my_malloc(bufflen, MYF(0))))
+ {
+ len=
+ copy_and_convert_extended(alloc, bufflen, cs,
+ from, (uint32)len,
+ val->x.string.charset,
+ &dummy_errors);
+ from= alloc;
+ }
+ else
+ return ER_DYNCOL_RESOURCE;
}
- /* Read first_offset */
- type_and_offset_read(&tp, &first_offset, read, offset_size);
+ if (quote)
+ rc= dynstr_append_quoted(str, from, len, quote);
+ else
+ rc= dynstr_append_mem(str, from, len);
+ if (alloc)
+ my_free(alloc);
+ if (rc)
+ return ER_DYNCOL_RESOURCE;
+ break;
}
- else
+ case DYN_COL_DECIMAL:
{
- /*
- Adjust all headers since last loop.
- We have to do this as the offset for data has moved
- */
- for (k= start; k < end; k++)
- {
- uchar *read= header_base + k * entry_size;
- size_t offs;
- uint nm;
- DYNAMIC_COLUMN_TYPE tp;
+ int len= sizeof(buff);
+ decimal2string(&val->x.decimal.value, buff, &len,
+ 0, val->x.decimal.value.frac,
+ '0');
+ if (dynstr_append_mem(str, buff, len))
+ return ER_DYNCOL_RESOURCE;
+ break;
+ }
+ case DYN_COL_DATETIME:
+ case DYN_COL_DATE:
+ case DYN_COL_TIME:
+ len= my_TIME_to_str(&val->x.time_value, buff, AUTO_SEC_PART_DIGITS);
+ if (dynstr_realloc(str, len + (quote ? 2 : 0)))
+ return ER_DYNCOL_RESOURCE;
+ if (quote)
+ str->str[str->length++]= '"';
+ dynstr_append_mem(str, buff, len);
+ if (quote)
+ str->str[str->length++]= '"';
+ break;
+ case DYN_COL_NULL:
+ if (dynstr_append_mem(str, "null", 4))
+ return ER_DYNCOL_RESOURCE;
+ break;
+ default:
+ return(ER_DYNCOL_FORMAT);
+ }
+ return(ER_DYNCOL_OK);
+}
- nm= uint2korr(read); /* Column nummber */
- type_and_offset_read(&tp, &offs, read, offset_size);
- if (k == start)
- first_offset= offs;
- else if (offs < first_offset)
+
+enum enum_dyncol_func_result
+mariadb_dyncol_val_long(longlong *ll, DYNAMIC_COLUMN_VALUE *val)
+{
+ enum enum_dyncol_func_result rc= ER_DYNCOL_OK;
+ *ll= 0;
+ switch (val->type) {
+ case DYN_COL_INT:
+ *ll= val->x.long_value;
+ break;
+ case DYN_COL_UINT:
+ *ll= (longlong)val->x.ulong_value;
+ if (val->x.ulong_value > ULONGLONG_MAX)
+ rc= ER_DYNCOL_TRUNCATED;
+ break;
+ case DYN_COL_DOUBLE:
+ *ll= (longlong)val->x.double_value;
+ if (((double) *ll) != val->x.double_value)
+ rc= ER_DYNCOL_TRUNCATED;
+ break;
+ case DYN_COL_STRING:
+ {
+ char *src= val->x.string.value.str;
+ size_t len= val->x.string.value.length;
+ longlong i= 0, sign= 1;
+
+ while (len && my_isspace(&my_charset_latin1, *src)) src++,len--;
+
+ if (len)
+ {
+ if (*src == '-')
{
- dynamic_column_column_free(&tmp);
- rc= ER_DYNCOL_FORMAT;
- goto end;
+ sign= -1;
+ src++;
+ } else if (*src == '-')
+ src++;
+ while(len && my_isdigit(&my_charset_latin1, *src))
+ {
+ i= i * 10 + (*src - '0');
+ src++;
}
-
- offs+= plan[i].ddelta;
- int2store(write, nm);
- /* write rest of data at write + COLUMN_NUMBER_SIZE */
- type_and_offset_store(write, new_offset_size, tp, offs);
- write+= new_entry_size;
}
+ else
+ rc= ER_DYNCOL_TRUNCATED;
+ if (len)
+ rc= ER_DYNCOL_TRUNCATED;
+ *ll= i * sign;
+ break;
}
+ case DYN_COL_DECIMAL:
+ if (decimal2longlong(&val->x.decimal.value, ll) != E_DEC_OK)
+ rc= ER_DYNCOL_TRUNCATED;
+ break;
+ case DYN_COL_DATETIME:
+ *ll= (val->x.time_value.year * 10000000000ull +
+ val->x.time_value.month * 100000000L +
+ val->x.time_value.day * 1000000 +
+ val->x.time_value.hour * 10000 +
+ val->x.time_value.minute * 100 +
+ val->x.time_value.second) *
+ (val->x.time_value.neg ? -1 : 1);
+ break;
+ case DYN_COL_DATE:
+ *ll= (val->x.time_value.year * 10000 +
+ val->x.time_value.month * 100 +
+ val->x.time_value.day) *
+ (val->x.time_value.neg ? -1 : 1);
+ break;
+ case DYN_COL_TIME:
+ *ll= (val->x.time_value.hour * 10000 +
+ val->x.time_value.minute * 100 +
+ val->x.time_value.second) *
+ (val->x.time_value.neg ? -1 : 1);
+ break;
+ case DYN_COL_DYNCOL:
+ case DYN_COL_NULL:
+ rc= ER_DYNCOL_TRUNCATED;
+ break;
+ default:
+ return(ER_DYNCOL_FORMAT);
+ }
+ return(rc);
+}
- /* copy first the data that was not replaced in original packed data */
- if (start < end)
- {
- /* Add old data last in 'tmp' */
- size_t data_size=
- get_length_interval(header_base + start * entry_size,
- header_base + end * entry_size,
- header_end, offset_size, max_offset);
- if ((long) data_size < 0 ||
- data_size > max_offset - first_offset)
- {
- dynamic_column_column_free(&tmp);
- rc= ER_DYNCOL_FORMAT;
- goto end;
- }
- memcpy(tmp.str + tmp.length, (char *)header_end + first_offset,
- data_size);
- tmp.length+= data_size;
+enum enum_dyncol_func_result
+mariadb_dyncol_val_double(double *dbl, DYNAMIC_COLUMN_VALUE *val)
+{
+ enum enum_dyncol_func_result rc= ER_DYNCOL_OK;
+ *dbl= 0;
+ switch (val->type) {
+ case DYN_COL_INT:
+ *dbl= (double)val->x.long_value;
+ if (((longlong) *dbl) != val->x.long_value)
+ rc= ER_DYNCOL_TRUNCATED;
+ break;
+ case DYN_COL_UINT:
+ *dbl= (double)val->x.ulong_value;
+ if (((ulonglong) *dbl) != val->x.ulong_value)
+ rc= ER_DYNCOL_TRUNCATED;
+ break;
+ case DYN_COL_DOUBLE:
+ *dbl= val->x.double_value;
+ break;
+ case DYN_COL_STRING:
+ {
+ char *str, *end;
+ if ((str= malloc(val->x.string.value.length + 1)))
+ return ER_DYNCOL_RESOURCE;
+ memcpy(str, val->x.string.value.str, val->x.string.value.length);
+ str[val->x.string.value.length]= '\0';
+ *dbl= strtod(str, &end);
+ if (*end != '\0')
+ rc= ER_DYNCOL_TRUNCATED;
}
+ case DYN_COL_DECIMAL:
+ if (decimal2double(&val->x.decimal.value, dbl) != E_DEC_OK)
+ rc= ER_DYNCOL_TRUNCATED;
+ break;
+ case DYN_COL_DATETIME:
+ *dbl= (double)(val->x.time_value.year * 10000000000ull +
+ val->x.time_value.month * 100000000L +
+ val->x.time_value.day * 1000000 +
+ val->x.time_value.hour * 10000 +
+ val->x.time_value.minute * 100 +
+ val->x.time_value.second) *
+ (val->x.time_value.neg ? -1 : 1);
+ break;
+ case DYN_COL_DATE:
+ *dbl= (double)(val->x.time_value.year * 10000 +
+ val->x.time_value.month * 100 +
+ val->x.time_value.day) *
+ (val->x.time_value.neg ? -1 : 1);
+ break;
+ case DYN_COL_TIME:
+ *dbl= (double)(val->x.time_value.hour * 10000 +
+ val->x.time_value.minute * 100 +
+ val->x.time_value.second) *
+ (val->x.time_value.neg ? -1 : 1);
+ break;
+ case DYN_COL_DYNCOL:
+ case DYN_COL_NULL:
+ rc= ER_DYNCOL_TRUNCATED;
+ break;
+ default:
+ return(ER_DYNCOL_FORMAT);
+ }
+ return(rc);
+}
+
+
+/**
+ Convert to JSON
+
+ @param str The packed string
+ @param json Where to put json result
+
+ @return ER_DYNCOL_* return code
+*/
- /* new data adding */
- if (i < add_column_count)
+#define JSON_STACK_PROTECTION 10
+
+static enum enum_dyncol_func_result
+mariadb_dyncol_json_internal(DYNAMIC_COLUMN *str, DYNAMIC_STRING *json,
+ uint lvl)
+{
+ DYN_HEADER header;
+ uint i;
+ enum enum_dyncol_func_result rc;
+
+ if (lvl >= JSON_STACK_PROTECTION)
+ {
+ rc= ER_DYNCOL_RESOURCE;
+ goto err;
+ }
+
+
+ if (str->length == 0)
+ return ER_DYNCOL_OK; /* no columns */
+
+ if ((rc= init_read_hdr(&header, str)) < 0)
+ goto err;
+
+ if (header.entry_size * header.column_count + FIXED_HEADER_SIZE >
+ str->length)
+ {
+ rc= ER_DYNCOL_FORMAT;
+ goto err;
+ }
+
+ rc= ER_DYNCOL_RESOURCE;
+
+ if (dynstr_append_mem(json, "{", 1))
+ goto err;
+ for (i= 0, header.entry= header.header;
+ i < header.column_count;
+ i++, header.entry+= header.entry_size)
+ {
+ DYNAMIC_COLUMN_VALUE val;
+ if (i != 0 && dynstr_append_mem(json, ",", 1))
+ goto err;
+ header.length=
+ hdr_interval_length(&header, header.entry + header.entry_size);
+ header.data= header.dtpool + header.offset;
+ /*
+ Check that the found data is withing the ranges. This can happen if
+ we get data with wrong offsets.
+ */
+ if (header.length == DYNCOL_OFFSET_ERROR ||
+ header.length > INT_MAX || header.offset > header.data_size)
+ {
+ rc= ER_DYNCOL_FORMAT;
+ goto err;
+ }
+ if ((rc= dynamic_column_get_value(&header, &val)) < 0)
+ goto err;
+ if (header.format == dyncol_fmt_num)
+ {
+ uint nm= uint2korr(header.entry);
+ if (dynstr_realloc(json, DYNCOL_NUM_CHAR + 3))
+ goto err;
+ json->str[json->length++]= '"';
+ json->length+= (snprintf(json->str + json->length,
+ DYNCOL_NUM_CHAR, "%u", nm));
+ }
+ else
+ {
+ LEX_STRING name;
+ if (read_name(&header, header.entry, &name))
{
- if( plan[i].act == PLAN_ADD || plan[i].act == PLAN_REPLACE)
- {
- int2store(write, plan[i].num[0]);
- type_and_offset_store(write, new_offset_size,
- plan[i].val[0].type,
- tmp.length -
- (FIXED_HEADER_SIZE + new_header_size));
- write+= new_entry_size;
- data_store(&tmp, plan[i].val); /* Append new data */
- }
- data_delta= plan[i].ddelta;
+ rc= ER_DYNCOL_FORMAT;
+ goto err;
+ }
+ if (dynstr_realloc(json, name.length + 3))
+ goto err;
+ json->str[json->length++]= '"';
+ memcpy(json->str + json->length, name.str, name.length);
+ json->length+= name.length;
+ }
+ json->str[json->length++]= '"';
+ json->str[json->length++]= ':';
+ if (val.type == DYN_COL_DYNCOL)
+ {
+ /* here we use it only for read so can cheat a bit */
+ DYNAMIC_COLUMN dc;
+ bzero(&dc, sizeof(dc));
+ dc.str= val.x.string.value.str;
+ dc.length= val.x.string.value.length;
+ if (mariadb_dyncol_json_internal(&dc, json, lvl + 1) < 0)
+ {
+ dc.str= NULL; dc.length= 0;
+ goto err;
}
+ dc.str= NULL; dc.length= 0;
+ }
+ else
+ {
+ if ((rc= mariadb_dyncol_val_str(json, &val,
+ &my_charset_utf8_general_ci, '"')) < 0)
+ goto err;
}
- dynamic_column_column_free(str);
- *str= tmp;
}
+ if (dynstr_append_mem(json, "}", 1))
+ {
+ rc= ER_DYNCOL_RESOURCE;
+ goto err;
+ }
+ return ER_DYNCOL_OK;
- rc= ER_DYNCOL_OK;
-
-end:
- my_free(plan);
+err:
+ json->length= 0;
return rc;
+}
-create_new_string:
- /* There is no columns from before, so let's just add the new ones */
- rc= ER_DYNCOL_OK;
- if (not_null != 0)
- rc= dynamic_column_create_many_internal(str, add_column_count,
- column_numbers, values,
- str->str == NULL);
- goto end;
+enum enum_dyncol_func_result
+mariadb_dyncol_json(DYNAMIC_COLUMN *str, DYNAMIC_STRING *json)
+{
+
+ if (init_dynamic_string(json, NULL, str->length * 2, 100))
+ return ER_DYNCOL_RESOURCE;
+
+ return mariadb_dyncol_json_internal(str, json, 1);
}
/**
- Update the packed string with the given column
+ Convert to DYNAMIC_COLUMN_VALUE values and names (LEX_STING) dynamic array
- @param str String where to write the data
- @param column_number Array of columns number
- @param values Array of columns values
+ @param str The packed string
+ @param count number of elements in the arrays
+ @param names Where to put names (should be free by user)
+ @param vals Where to put values (should be free by user)
@return ER_DYNCOL_* return code
*/
+enum enum_dyncol_func_result
+mariadb_dyncol_unpack(DYNAMIC_COLUMN *str,
+ uint *count,
+ LEX_STRING **names, DYNAMIC_COLUMN_VALUE **vals)
+{
+ DYN_HEADER header;
+ char *nm;
+ uint i;
+ enum enum_dyncol_func_result rc;
+
+ *count= 0; *names= 0; *vals= 0;
-int dynamic_column_update(DYNAMIC_COLUMN *str, uint column_nr,
- DYNAMIC_COLUMN_VALUE *value)
+ if (str->length == 0)
+ return ER_DYNCOL_OK; /* no columns */
+
+ if ((rc= init_read_hdr(&header, str)) < 0)
+ return rc;
+
+
+ if (header.entry_size * header.column_count + FIXED_HEADER_SIZE >
+ str->length)
+ return ER_DYNCOL_FORMAT;
+
+ *vals= my_malloc(sizeof(DYNAMIC_COLUMN_VALUE)* header.column_count, MYF(0));
+ if (header.format == dyncol_fmt_num)
+ {
+ *names= my_malloc(sizeof(LEX_STRING) * header.column_count +
+ DYNCOL_NUM_CHAR * header.column_count, MYF(0));
+ nm= (char *)(names + sizeof(LEX_STRING) * header.column_count);
+ }
+ else
+ {
+ *names= my_malloc(sizeof(LEX_STRING) * header.column_count, MYF(0));
+ nm= 0;
+ }
+ if (!(*vals) || !(*names))
+ {
+ rc= ER_DYNCOL_RESOURCE;
+ goto err;
+ }
+
+ for (i= 0, header.entry= header.header;
+ i < header.column_count;
+ i++, header.entry+= header.entry_size)
+ {
+ header.length=
+ hdr_interval_length(&header, header.entry + header.entry_size);
+ header.data= header.dtpool + header.offset;
+ /*
+ Check that the found data is withing the ranges. This can happen if
+ we get data with wrong offsets.
+ */
+ if (header.length == DYNCOL_OFFSET_ERROR ||
+ header.length > INT_MAX || header.offset > header.data_size)
+ {
+ rc= ER_DYNCOL_FORMAT;
+ goto err;
+ }
+ if ((rc= dynamic_column_get_value(&header, (*vals) + i)) < 0)
+ goto err;
+
+ if (header.format == dyncol_fmt_num)
+ {
+ uint num= uint2korr(header.entry);
+ (*names)[i].str= nm;
+ (*names)[i].length= snprintf(nm, DYNCOL_NUM_CHAR, "%u", num);
+ nm+= (*names)[i].length + 1;
+ }
+ else
+ {
+ if (read_name(&header, header.entry, (*names) + i))
+ {
+ rc= ER_DYNCOL_FORMAT;
+ goto err;
+ }
+ }
+ }
+
+ *count= header.column_count;
+ return ER_DYNCOL_OK;
+
+err:
+ if (*vals)
+ {
+ my_free(*vals);
+ *vals= 0;
+ }
+ if (*names)
+ {
+ my_free(*names);
+ *names= 0;
+ }
+ return rc;
+}
+
+/**
+ Get not NULL column count
+
+ @param str The packed string
+ @param column_count Where to put column count
+
+ @return ER_DYNCOL_* return code
+*/
+
+enum enum_dyncol_func_result
+mariadb_dyncol_column_count(DYNAMIC_COLUMN *str, uint *column_count)
{
- return dynamic_column_update_many(str, 1, &column_nr, value);
+ DYN_HEADER header;
+ enum enum_dyncol_func_result rc;
+
+ if ((rc= init_read_hdr(&header, str)) < 0)
+ return rc;
+ *column_count= header.column_count;
+ return rc;
}
diff --git a/mysys/mf_tempdir.c b/mysys/mf_tempdir.c
index eceb90bb619..f8450a100e5 100644
--- a/mysys/mf_tempdir.c
+++ b/mysys/mf_tempdir.c
@@ -30,7 +30,7 @@ my_bool init_tmpdir(MY_TMPDIR *tmpdir, const char *pathlist)
DBUG_PRINT("enter", ("pathlist: %s", pathlist ? pathlist : "NULL"));
mysql_mutex_init(key_TMPDIR_mutex, &tmpdir->mutex, MY_MUTEX_INIT_FAST);
- if (my_init_dynamic_array(&tmpdir->full_list, sizeof(char*), 1, 5))
+ if (my_init_dynamic_array(&tmpdir->full_list, sizeof(char*), 1, 5, MYF(0)))
goto err;
if (!pathlist || !pathlist[0])
{
diff --git a/mysys/my_alloc.c b/mysys/my_alloc.c
index 1054db6cee4..6c8a73df4a7 100644
--- a/mysys/my_alloc.c
+++ b/mysys/my_alloc.c
@@ -22,6 +22,10 @@
#undef EXTRA_DEBUG
#define EXTRA_DEBUG
+/* data packed in MEM_ROOT -> min_malloc */
+
+#define MALLOC_FLAG(A) ((A & 1) ? MY_THREAD_SPECIFIC : 0)
+
/*
Initialize memory root
@@ -34,6 +38,7 @@
should be no less than ALLOC_ROOT_MIN_BLOCK_SIZE)
pre_alloc_size - if non-0, then size of block that should be
pre-allocated during memory root initialization.
+ my_flags MY_THREAD_SPECIFIC flag for my_malloc
DESCRIPTION
This function prepares memory root for further use, sets initial size of
@@ -41,17 +46,24 @@
Altough error can happen during execution of this function if
pre_alloc_size is non-0 it won't be reported. Instead it will be
reported as error in first alloc_root() on this memory root.
+
+ We don't want to change the structure size for MEM_ROOT.
+ Because of this, we store in MY_THREAD_SPECIFIC as bit 1 in block_size
*/
void init_alloc_root(MEM_ROOT *mem_root, size_t block_size,
- size_t pre_alloc_size __attribute__((unused)))
+ size_t pre_alloc_size __attribute__((unused)),
+ myf my_flags)
{
DBUG_ENTER("init_alloc_root");
DBUG_PRINT("enter",("root: 0x%lx", (long) mem_root));
mem_root->free= mem_root->used= mem_root->pre_alloc= 0;
mem_root->min_malloc= 32;
- mem_root->block_size= block_size - ALLOC_ROOT_MIN_BLOCK_SIZE;
+ mem_root->block_size= (block_size - ALLOC_ROOT_MIN_BLOCK_SIZE) & ~1;
+ if (test(my_flags & MY_THREAD_SPECIFIC))
+ mem_root->block_size|= 1;
+
mem_root->error_handler= 0;
mem_root->block_num= 4; /* We shift this with >>2 */
mem_root->first_block_usage= 0;
@@ -61,7 +73,7 @@ void init_alloc_root(MEM_ROOT *mem_root, size_t block_size,
{
if ((mem_root->free= mem_root->pre_alloc=
(USED_MEM*) my_malloc(pre_alloc_size+ ALIGN_SIZE(sizeof(USED_MEM)),
- MYF(0))))
+ MYF(my_flags))))
{
mem_root->free->size= pre_alloc_size+ALIGN_SIZE(sizeof(USED_MEM));
mem_root->free->left= pre_alloc_size;
@@ -72,7 +84,6 @@ void init_alloc_root(MEM_ROOT *mem_root, size_t block_size,
DBUG_VOID_RETURN;
}
-
/*
SYNOPSIS
reset_root_defaults()
@@ -95,7 +106,8 @@ void reset_root_defaults(MEM_ROOT *mem_root, size_t block_size,
{
DBUG_ASSERT(alloc_root_inited(mem_root));
- mem_root->block_size= block_size - ALLOC_ROOT_MIN_BLOCK_SIZE;
+ mem_root->block_size= (((block_size - ALLOC_ROOT_MIN_BLOCK_SIZE) & ~1) |
+ (mem_root->block_size & 1));
#if !(defined(HAVE_valgrind) && defined(EXTRA_DEBUG))
if (pre_alloc_size)
{
@@ -126,7 +138,9 @@ void reset_root_defaults(MEM_ROOT *mem_root, size_t block_size,
prev= &mem->next;
}
/* Allocate new prealloc block and add it to the end of free list */
- if ((mem= (USED_MEM *) my_malloc(size, MYF(0))))
+ if ((mem= (USED_MEM *) my_malloc(size,
+ MYF(MALLOC_FLAG(mem_root->
+ block_size)))))
{
mem->size= size;
mem->left= pre_alloc_size;
@@ -163,7 +177,9 @@ void *alloc_root(MEM_ROOT *mem_root, size_t length)
});
length+=ALIGN_SIZE(sizeof(USED_MEM));
- if (!(next = (USED_MEM*) my_malloc(length,MYF(MY_WME | ME_FATALERROR))))
+ if (!(next = (USED_MEM*) my_malloc(length,
+ MYF(MY_WME | ME_FATALERROR |
+ MALLOC_FLAG(mem_root->block_size)))))
{
if (mem_root->error_handler)
(*mem_root->error_handler)();
@@ -210,11 +226,14 @@ void *alloc_root(MEM_ROOT *mem_root, size_t length)
}
if (! next)
{ /* Time to alloc new block */
- block_size= mem_root->block_size * (mem_root->block_num >> 2);
+ block_size= (mem_root->block_size & ~1) * (mem_root->block_num >> 2);
get_size= length+ALIGN_SIZE(sizeof(USED_MEM));
get_size= max(get_size, block_size);
- if (!(next = (USED_MEM*) my_malloc(get_size,MYF(MY_WME | ME_FATALERROR))))
+ if (!(next = (USED_MEM*) my_malloc(get_size,
+ MYF(MY_WME | ME_FATALERROR |
+ MALLOC_FLAG(mem_root->
+ block_size)))))
{
if (mem_root->error_handler)
(*mem_root->error_handler)();
diff --git a/mysys/my_chmod.c b/mysys/my_chmod.c
index afdea758833..91fd51b47d2 100644
--- a/mysys/my_chmod.c
+++ b/mysys/my_chmod.c
@@ -34,7 +34,7 @@
int my_chmod(const char *name, mode_t mode, myf my_flags)
{
DBUG_ENTER("my_chmod");
- DBUG_PRINT("my",("name: %s mode: %lu flags: %d", name, (ulong) mode,
+ DBUG_PRINT("my",("name: %s mode: %lu flags: %lu", name, (ulong) mode,
my_flags));
if (chmod(name, mode))
diff --git a/mysys/my_chsize.c b/mysys/my_chsize.c
index 63964916d6f..51da6be7935 100644
--- a/mysys/my_chsize.c
+++ b/mysys/my_chsize.c
@@ -43,7 +43,7 @@ int my_chsize(File fd, my_off_t newlength, int filler, myf MyFlags)
my_off_t oldsize;
uchar buff[IO_SIZE];
DBUG_ENTER("my_chsize");
- DBUG_PRINT("my",("fd: %d length: %lu MyFlags: %d",fd,(ulong) newlength,
+ DBUG_PRINT("my",("fd: %d length: %lu MyFlags: %lu",fd,(ulong) newlength,
MyFlags));
if ((oldsize= my_seek(fd, 0L, MY_SEEK_END, MYF(MY_WME+MY_FAE))) == newlength)
diff --git a/mysys/my_copy.c b/mysys/my_copy.c
index 21de1e953a2..58cacb9639d 100644
--- a/mysys/my_copy.c
+++ b/mysys/my_copy.c
@@ -61,7 +61,7 @@ int my_copy(const char *from, const char *to, myf MyFlags)
MY_STAT stat_buff,new_stat_buff;
my_bool file_created= 0;
DBUG_ENTER("my_copy");
- DBUG_PRINT("my",("from %s to %s MyFlags %d", from, to, MyFlags));
+ DBUG_PRINT("my",("from %s to %s MyFlags %lu", from, to, MyFlags));
from_file=to_file= -1;
DBUG_ASSERT(!(MyFlags & (MY_FNABP | MY_NABP))); /* for my_read/my_write */
diff --git a/mysys/my_create.c b/mysys/my_create.c
index 2e4e8eb1af2..51de343d4a1 100644
--- a/mysys/my_create.c
+++ b/mysys/my_create.c
@@ -38,7 +38,7 @@ File my_create(const char *FileName, int CreateFlags, int access_flags,
{
int fd, rc;
DBUG_ENTER("my_create");
- DBUG_PRINT("my",("Name: '%s' CreateFlags: %d AccessFlags: %d MyFlags: %d",
+ DBUG_PRINT("my",("Name: '%s' CreateFlags: %d AccessFlags: %d MyFlags: %lu",
FileName, CreateFlags, access_flags, MyFlags));
#if defined(_WIN32)
fd= my_win_open(FileName, access_flags | O_CREAT);
diff --git a/mysys/my_delete.c b/mysys/my_delete.c
index cf9573f592b..0655501aa16 100644
--- a/mysys/my_delete.c
+++ b/mysys/my_delete.c
@@ -21,7 +21,7 @@ int my_delete(const char *name, myf MyFlags)
{
int err;
DBUG_ENTER("my_delete");
- DBUG_PRINT("my",("name %s MyFlags %d", name, MyFlags));
+ DBUG_PRINT("my",("name %s MyFlags %lu", name, MyFlags));
if ((err = unlink(name)) == -1)
{
diff --git a/mysys/my_error.c b/mysys/my_error.c
index 3302add688b..08c67412fe1 100644
--- a/mysys/my_error.c
+++ b/mysys/my_error.c
@@ -75,7 +75,7 @@ void my_error(int nr, myf MyFlags, ...)
va_list args;
char ebuff[ERRMSGSIZE];
DBUG_ENTER("my_error");
- DBUG_PRINT("my", ("nr: %d MyFlags: %d errno: %d", nr, MyFlags, errno));
+ DBUG_PRINT("my", ("nr: %d MyFlags: %lu errno: %d", nr, MyFlags, errno));
/* Search for the error messages array, which could contain the message. */
for (meh_p= my_errmsgs_list; meh_p; meh_p= meh_p->meh_next)
@@ -114,7 +114,7 @@ void my_printf_error(uint error, const char *format, myf MyFlags, ...)
va_list args;
char ebuff[ERRMSGSIZE];
DBUG_ENTER("my_printf_error");
- DBUG_PRINT("my", ("nr: %d MyFlags: %d errno: %d format: %s",
+ DBUG_PRINT("my", ("nr: %d MyFlags: %lu errno: %d format: %s",
error, MyFlags, errno, format));
va_start(args,MyFlags);
@@ -140,7 +140,7 @@ void my_printv_error(uint error, const char *format, myf MyFlags, va_list ap)
{
char ebuff[ERRMSGSIZE];
DBUG_ENTER("my_printv_error");
- DBUG_PRINT("my", ("nr: %d MyFlags: %d errno: %d format: %s",
+ DBUG_PRINT("my", ("nr: %d MyFlags: %lu errno: %d format: %s",
error, MyFlags, errno, format));
(void) my_vsnprintf(ebuff, sizeof(ebuff), format, ap);
diff --git a/mysys/my_fopen.c b/mysys/my_fopen.c
index 54469d2c05a..8a30dd6c10b 100644
--- a/mysys/my_fopen.c
+++ b/mysys/my_fopen.c
@@ -44,7 +44,7 @@ FILE *my_fopen(const char *filename, int flags, myf MyFlags)
FILE *fd;
char type[5];
DBUG_ENTER("my_fopen");
- DBUG_PRINT("my",("Name: '%s' flags: %d MyFlags: %d",
+ DBUG_PRINT("my",("Name: '%s' flags: %d MyFlags: %lu",
filename, flags, MyFlags));
make_ftype(type,flags);
@@ -229,7 +229,7 @@ int my_fclose(FILE *fd, myf MyFlags)
{
int err,file;
DBUG_ENTER("my_fclose");
- DBUG_PRINT("my",("stream: 0x%lx MyFlags: %d", (long) fd, MyFlags));
+ DBUG_PRINT("my",("stream: 0x%lx MyFlags: %lu", (long) fd, MyFlags));
mysql_mutex_lock(&THR_LOCK_open);
file= my_fileno(fd);
@@ -265,7 +265,7 @@ FILE *my_fdopen(File Filedes, const char *name, int Flags, myf MyFlags)
FILE *fd;
char type[5];
DBUG_ENTER("my_fdopen");
- DBUG_PRINT("my",("fd: %d Flags: %d MyFlags: %d",
+ DBUG_PRINT("my",("fd: %d Flags: %d MyFlags: %lu",
Filedes, Flags, MyFlags));
make_ftype(type,Flags);
diff --git a/mysys/my_fstream.c b/mysys/my_fstream.c
index e758609741b..de752fa149f 100644
--- a/mysys/my_fstream.c
+++ b/mysys/my_fstream.c
@@ -46,7 +46,7 @@ size_t my_fread(FILE *stream, uchar *Buffer, size_t Count, myf MyFlags)
{
size_t readbytes;
DBUG_ENTER("my_fread");
- DBUG_PRINT("my",("stream: 0x%lx Buffer: 0x%lx Count: %u MyFlags: %d",
+ DBUG_PRINT("my",("stream: 0x%lx Buffer: 0x%lx Count: %u MyFlags: %lu",
(long) stream, (long) Buffer, (uint) Count, MyFlags));
if ((readbytes= fread(Buffer, sizeof(char), Count, stream)) != Count)
@@ -94,7 +94,7 @@ size_t my_fwrite(FILE *stream, const uchar *Buffer, size_t Count, myf MyFlags)
uint errors;
#endif
DBUG_ENTER("my_fwrite");
- DBUG_PRINT("my",("stream: 0x%lx Buffer: 0x%lx Count: %u MyFlags: %d",
+ DBUG_PRINT("my",("stream: 0x%lx Buffer: 0x%lx Count: %u MyFlags: %lu",
(long) stream, (long) Buffer, (uint) Count, MyFlags));
#if !defined(NO_BACKGROUND) && defined(USE_MY_STREAM)
@@ -163,7 +163,7 @@ my_off_t my_fseek(FILE *stream, my_off_t pos, int whence,
myf MyFlags __attribute__((unused)))
{
DBUG_ENTER("my_fseek");
- DBUG_PRINT("my",("stream: 0x%lx pos: %lu whence: %d MyFlags: %d",
+ DBUG_PRINT("my",("stream: 0x%lx pos: %lu whence: %d MyFlags: %lu",
(long) stream, (long) pos, whence, MyFlags));
DBUG_RETURN(fseek(stream, (off_t) pos, whence) ?
MY_FILEPOS_ERROR : (my_off_t) ftell(stream));
@@ -176,7 +176,7 @@ my_off_t my_ftell(FILE *stream, myf MyFlags __attribute__((unused)))
{
off_t pos;
DBUG_ENTER("my_ftell");
- DBUG_PRINT("my",("stream: 0x%lx MyFlags: %d", (long) stream, MyFlags));
+ DBUG_PRINT("my",("stream: 0x%lx MyFlags: %lu", (long) stream, MyFlags));
pos=ftell(stream);
DBUG_PRINT("exit",("ftell: %lu",(ulong) pos));
DBUG_RETURN((my_off_t) pos);
diff --git a/mysys/my_getwd.c b/mysys/my_getwd.c
index 444ed4273b5..79ec58d3c5c 100644
--- a/mysys/my_getwd.c
+++ b/mysys/my_getwd.c
@@ -48,7 +48,7 @@ int my_getwd(char * buf, size_t size, myf MyFlags)
{
char * pos;
DBUG_ENTER("my_getwd");
- DBUG_PRINT("my",("buf: 0x%lx size: %u MyFlags %d",
+ DBUG_PRINT("my",("buf: 0x%lx size: %u MyFlags %lu",
(long) buf, (uint) size, MyFlags));
if (size < 1)
@@ -95,7 +95,7 @@ int my_setwd(const char *dir, myf MyFlags)
size_t length;
char *start, *pos;
DBUG_ENTER("my_setwd");
- DBUG_PRINT("my",("dir: '%s' MyFlags %d", dir, MyFlags));
+ DBUG_PRINT("my",("dir: '%s' MyFlags %lu", dir, MyFlags));
start=(char *) dir;
if (! dir[0] || (dir[0] == FN_LIBCHAR && dir[1] == 0))
diff --git a/mysys/my_lib.c b/mysys/my_lib.c
index b42a3d55d93..9c8655338c1 100644
--- a/mysys/my_lib.c
+++ b/mysys/my_lib.c
@@ -100,7 +100,7 @@ MY_DIR *my_dir(const char *path, myf MyFlags)
char dirent_tmp[sizeof(struct dirent)+_POSIX_PATH_MAX+1];
DBUG_ENTER("my_dir");
- DBUG_PRINT("my",("path: '%s' MyFlags: %d",path,MyFlags));
+ DBUG_PRINT("my",("path: '%s' MyFlags: %lu",path,MyFlags));
#if !defined(HAVE_READDIR_R)
mysql_mutex_lock(&THR_LOCK_open);
@@ -122,12 +122,14 @@ MY_DIR *my_dir(const char *path, myf MyFlags)
ALIGN_SIZE(sizeof(DYNAMIC_ARRAY)));
if (my_init_dynamic_array(dir_entries_storage, sizeof(FILEINFO),
- ENTRIES_START_SIZE, ENTRIES_INCREMENT))
+ ENTRIES_START_SIZE, ENTRIES_INCREMENT,
+ MYF(MyFlags)))
{
my_free(buffer);
goto error;
}
- init_alloc_root(names_storage, NAMES_START_SIZE, NAMES_START_SIZE);
+ init_alloc_root(names_storage, NAMES_START_SIZE, NAMES_START_SIZE,
+ MYF(MyFlags));
/* MY_DIR structure is allocated and completly initialized at this point */
result= (MY_DIR*)buffer;
@@ -263,12 +265,13 @@ MY_DIR *my_dir(const char *path, myf MyFlags)
ALIGN_SIZE(sizeof(DYNAMIC_ARRAY)));
if (my_init_dynamic_array(dir_entries_storage, sizeof(FILEINFO),
- ENTRIES_START_SIZE, ENTRIES_INCREMENT))
+ ENTRIES_START_SIZE, ENTRIES_INCREMENT,
+ MYF(MyFlags)))
{
my_free(buffer);
goto error;
}
- init_alloc_root(names_storage, NAMES_START_SIZE, NAMES_START_SIZE);
+ init_alloc_root(names_storage, NAMES_START_SIZE, NAMES_START_SIZE, MYF(MyFlags));
/* MY_DIR structure is allocated and completly initialized at this point */
result= (MY_DIR*)buffer;
@@ -383,7 +386,7 @@ int my_fstat(File Filedes, MY_STAT *stat_area,
myf MyFlags __attribute__((unused)))
{
DBUG_ENTER("my_fstat");
- DBUG_PRINT("my",("fd: %d MyFlags: %d", Filedes, MyFlags));
+ DBUG_PRINT("my",("fd: %d MyFlags: %lu", Filedes, MyFlags));
#ifdef _WIN32
DBUG_RETURN(my_win_fstat(Filedes, stat_area));
#else
@@ -396,7 +399,7 @@ MY_STAT *my_stat(const char *path, MY_STAT *stat_area, myf my_flags)
{
int m_used;
DBUG_ENTER("my_stat");
- DBUG_PRINT("my", ("path: '%s' stat_area: 0x%lx MyFlags: %d", path,
+ DBUG_PRINT("my", ("path: '%s' stat_area: 0x%lx MyFlags: %lu", path,
(long) stat_area, my_flags));
if ((m_used= (stat_area == NULL)))
diff --git a/mysys/my_lock.c b/mysys/my_lock.c
index 54ec3838b58..0abbc6c3084 100644
--- a/mysys/my_lock.c
+++ b/mysys/my_lock.c
@@ -144,7 +144,7 @@ int my_lock(File fd, int locktype, my_off_t start, my_off_t length,
#endif
DBUG_ENTER("my_lock");
- DBUG_PRINT("my",("fd: %d Op: %d start: %ld Length: %ld MyFlags: %d",
+ DBUG_PRINT("my",("fd: %d Op: %d start: %ld Length: %ld MyFlags: %lu",
fd,locktype,(long) start,(long) length,MyFlags));
if (my_disable_locking && ! (MyFlags & MY_FORCE_LOCK))
DBUG_RETURN(0);
diff --git a/mysys/my_malloc.c b/mysys/my_malloc.c
index 1a9caf71380..8d1a3d926d6 100644
--- a/mysys/my_malloc.c
+++ b/mysys/my_malloc.c
@@ -18,6 +18,60 @@
#include "mysys_err.h"
#include <m_string.h>
+/* If we have our own safemalloc (for debugging) */
+#if defined(SAFEMALLOC)
+#define MALLOC_SIZE_AND_FLAG(p,b) sf_malloc_usable_size(p,b)
+#define MALLOC_PREFIX_SIZE 0
+#define MALLOC_STORE_SIZE(a,b,c,d)
+#define MALLOC_FIX_POINTER_FOR_FREE(a) a
+#else
+/*
+ * We use double as prefix size as this guarantees the correct
+ * alignment on all platforms and will optimize things for
+ * memcpy(), memcmp() etc.
+ */
+#define MALLOC_PREFIX_SIZE (sizeof(double))
+#define MALLOC_SIZE(p) (*(size_t*) ((char*)(p) - MALLOC_PREFIX_SIZE))
+#define MALLOC_STORE_SIZE(p, type_of_p, size, flag) \
+{\
+ *(size_t*) p= (size) | (flag); \
+ (p)= (type_of_p) (((char*) (p)) + MALLOC_PREFIX_SIZE); \
+}
+static inline size_t malloc_size_and_flag(void *p, my_bool *is_thread_specific)
+{
+ size_t size= MALLOC_SIZE(p);
+ *is_thread_specific= (size & 1);
+ return size & ~ (ulonglong) 1;
+}
+#define MALLOC_SIZE_AND_FLAG(p,b) malloc_size_and_flag(p, b);
+#define MALLOC_FIX_POINTER_FOR_FREE(p) (((char*) (p)) - MALLOC_PREFIX_SIZE)
+#endif /* SAFEMALLOC */
+
+static MALLOC_SIZE_CB malloc_size_cb_func= NULL;
+
+/**
+ Inform application that memory usage has changed
+
+ @param size Size of memory segment allocated or freed
+ @param flag 1 if thread specific (allocated by MY_THREAD_SPECIFIC),
+ 0 if system specific.
+
+ The type os size is long long, to be able to handle negative numbers to
+ decrement the memory usage
+*/
+
+static void update_malloc_size(long long size, my_bool is_thread_specific)
+{
+ if (malloc_size_cb_func)
+ malloc_size_cb_func(size, is_thread_specific);
+}
+
+void set_malloc_size_cb(MALLOC_SIZE_CB func)
+{
+ malloc_size_cb_func= func;
+}
+
+
/**
Allocate a sized block of memory.
@@ -30,7 +84,9 @@ void *my_malloc(size_t size, myf my_flags)
{
void* point;
DBUG_ENTER("my_malloc");
- DBUG_PRINT("my",("size: %lu my_flags: %d", (ulong) size, my_flags));
+ DBUG_PRINT("my",("size: %lu my_flags: %lu", (ulong) size, my_flags));
+ compile_time_assert(sizeof(size_t) <= sizeof(double));
+
if (!(my_flags & (MY_WME | MY_FAE)))
my_flags|= my_global_flags;
@@ -38,12 +94,9 @@ void *my_malloc(size_t size, myf my_flags)
if (!size)
size=1;
- point= sf_malloc(size);
- DBUG_EXECUTE_IF("simulate_out_of_memory",
- {
- my_free(point);
- point= NULL;
- });
+ /* We have to align size to be able to store markers in it */
+ size= ALIGN_SIZE(size);
+ point= sf_malloc(size + MALLOC_PREFIX_SIZE, my_flags);
if (point == NULL)
{
@@ -59,8 +112,20 @@ void *my_malloc(size_t size, myf my_flags)
if (my_flags & MY_FAE)
exit(1);
}
- else if (my_flags & MY_ZEROFILL)
- bzero(point, size);
+ else
+ {
+ MALLOC_STORE_SIZE(point, void*, size, test(my_flags & MY_THREAD_SPECIFIC));
+ update_malloc_size(size + MALLOC_PREFIX_SIZE,
+ test(my_flags & MY_THREAD_SPECIFIC));
+ DBUG_EXECUTE_IF("simulate_out_of_memory",
+ {
+ /* my_free() handles memory accounting */
+ my_free(point);
+ point= NULL;
+ });
+ if (my_flags & MY_ZEROFILL)
+ bzero(point, size);
+ }
DBUG_PRINT("exit",("ptr: %p", point));
DBUG_RETURN(point);
}
@@ -79,23 +144,53 @@ void *my_malloc(size_t size, myf my_flags)
void *my_realloc(void *oldpoint, size_t size, myf my_flags)
{
void *point;
+ size_t old_size;
+ my_bool old_flags;
DBUG_ENTER("my_realloc");
- DBUG_PRINT("my",("ptr: %p size: %lu my_flags: %d", oldpoint,
+ DBUG_PRINT("my",("ptr: %p size: %lu my_flags: %lu", oldpoint,
(ulong) size, my_flags));
DBUG_ASSERT(size > 0);
if (!oldpoint && (my_flags & MY_ALLOW_ZERO_PTR))
DBUG_RETURN(my_malloc(size, my_flags));
- if ((point= sf_realloc(oldpoint, size)) == NULL)
+
+ size= ALIGN_SIZE(size);
+ old_size= MALLOC_SIZE_AND_FLAG(oldpoint, &old_flags);
+ /*
+ Test that the new and old area are the same, if not MY_THREAD_MOVE is
+ given
+ */
+ DBUG_ASSERT((test(my_flags & MY_THREAD_SPECIFIC) == old_flags) ||
+ (my_flags & MY_THREAD_MOVE));
+ if ((point= sf_realloc(MALLOC_FIX_POINTER_FOR_FREE(oldpoint),
+ size + MALLOC_PREFIX_SIZE, my_flags)) == NULL)
{
if (my_flags & MY_FREE_ON_ERROR)
+ {
+ /* my_free will take care of size accounting */
my_free(oldpoint);
+ oldpoint= 0;
+ }
if (my_flags & MY_HOLD_ON_ERROR)
DBUG_RETURN(oldpoint);
my_errno=errno;
if (my_flags & (MY_FAE+MY_WME))
my_error(EE_OUTOFMEMORY, MYF(ME_BELL+ME_WAITTANG), size);
}
+ else
+ {
+ MALLOC_STORE_SIZE(point, void*, size, test(my_flags & MY_THREAD_SPECIFIC));
+ if (test(my_flags & MY_THREAD_SPECIFIC) != old_flags)
+ {
+ /* memory moved between system and thread specific */
+ update_malloc_size(-(longlong) old_size - MALLOC_PREFIX_SIZE, old_flags);
+ update_malloc_size((longlong) size + MALLOC_PREFIX_SIZE,
+ my_flags & MY_THREAD_SPECIFIC);
+ }
+ else
+ update_malloc_size((longlong)size - (longlong)old_size, old_flags);
+ }
+
DBUG_PRINT("exit",("ptr: %p", point));
DBUG_RETURN(point);
}
@@ -112,7 +207,14 @@ void my_free(void *ptr)
{
DBUG_ENTER("my_free");
DBUG_PRINT("my",("ptr: %p", ptr));
- sf_free(ptr);
+ if (ptr)
+ {
+ size_t old_size;
+ my_bool old_flags;
+ old_size= MALLOC_SIZE_AND_FLAG(ptr, &old_flags);
+ update_malloc_size(- (longlong) old_size - MALLOC_PREFIX_SIZE, old_flags);
+ sf_free(MALLOC_FIX_POINTER_FOR_FREE(ptr));
+ }
DBUG_VOID_RETURN;
}
diff --git a/mysys/my_open.c b/mysys/my_open.c
index 645d6709358..5263ba4b5c8 100644
--- a/mysys/my_open.c
+++ b/mysys/my_open.c
@@ -39,7 +39,7 @@ File my_open(const char *FileName, int Flags, myf MyFlags)
{
File fd;
DBUG_ENTER("my_open");
- DBUG_PRINT("my",("Name: '%s' Flags: %d MyFlags: %d",
+ DBUG_PRINT("my",("Name: '%s' Flags: %d MyFlags: %lu",
FileName, Flags, MyFlags));
if (!(MyFlags & (MY_WME | MY_FAE | MY_FFNF)))
MyFlags|= my_global_flags;
@@ -71,7 +71,7 @@ int my_close(File fd, myf MyFlags)
{
int err;
DBUG_ENTER("my_close");
- DBUG_PRINT("my",("fd: %d MyFlags: %d",fd, MyFlags));
+ DBUG_PRINT("my",("fd: %d MyFlags: %lu",fd, MyFlags));
if (!(MyFlags & (MY_WME | MY_FAE)))
MyFlags|= my_global_flags;
diff --git a/mysys/my_pread.c b/mysys/my_pread.c
index 51b4c5f5599..745cde9ec41 100644
--- a/mysys/my_pread.c
+++ b/mysys/my_pread.c
@@ -52,7 +52,7 @@ size_t my_pread(File Filedes, uchar *Buffer, size_t Count, my_off_t offset,
DBUG_ENTER("my_pread");
- DBUG_PRINT("my",("fd: %d Seek: %llu Buffer: %p Count: %lu MyFlags: %d",
+ DBUG_PRINT("my",("fd: %d Seek: %llu Buffer: %p Count: %lu MyFlags: %lu",
Filedes, (ulonglong)offset, Buffer, (ulong)Count, MyFlags));
if (!(MyFlags & (MY_WME | MY_FAE | MY_FNABP)))
@@ -130,7 +130,7 @@ size_t my_pwrite(int Filedes, const uchar *Buffer, size_t Count,
size_t writtenbytes, written;
uint errors;
DBUG_ENTER("my_pwrite");
- DBUG_PRINT("my",("fd: %d Seek: %llu Buffer: %p Count: %lu MyFlags: %d",
+ DBUG_PRINT("my",("fd: %d Seek: %llu Buffer: %p Count: %lu MyFlags: %lu",
Filedes, (ulonglong)offset, Buffer, (ulong)Count, MyFlags));
errors= 0;
written= 0;
diff --git a/mysys/my_read.c b/mysys/my_read.c
index 0afbf3773f3..66b7f6d353d 100644
--- a/mysys/my_read.c
+++ b/mysys/my_read.c
@@ -37,7 +37,7 @@ size_t my_read(File Filedes, uchar *Buffer, size_t Count, myf MyFlags)
{
size_t readbytes, save_count;
DBUG_ENTER("my_read");
- DBUG_PRINT("my",("fd: %d Buffer: %p Count: %lu MyFlags: %d",
+ DBUG_PRINT("my",("fd: %d Buffer: %p Count: %lu MyFlags: %lu",
Filedes, Buffer, (ulong) Count, MyFlags));
save_count= Count;
if (!(MyFlags & (MY_WME | MY_FAE | MY_FNABP)))
diff --git a/mysys/my_redel.c b/mysys/my_redel.c
index d15dd87001a..3c68e69b46a 100644
--- a/mysys/my_redel.c
+++ b/mysys/my_redel.c
@@ -46,7 +46,7 @@ int my_redel(const char *org_name, const char *tmp_name,
{
int error=1;
DBUG_ENTER("my_redel");
- DBUG_PRINT("my",("org_name: '%s' tmp_name: '%s' MyFlags: %d",
+ DBUG_PRINT("my",("org_name: '%s' tmp_name: '%s' MyFlags: %lu",
org_name,tmp_name,MyFlags));
if (my_copystat(org_name,tmp_name,MyFlags) < 0)
@@ -88,15 +88,11 @@ end:
int my_copystat(const char *from, const char *to, int MyFlags)
{
- struct stat statbuf;
+ MY_STAT statbuf;
- if (stat(from, &statbuf))
- {
- my_errno=errno;
- if (MyFlags & (MY_FAE+MY_WME))
- my_error(EE_STAT, MYF(ME_BELL+ME_WAITTANG),from,errno);
+ if (my_stat(from, &statbuf, MyFlags) == NULL)
return -1; /* Can't get stat on input file */
- }
+
if ((statbuf.st_mode & S_IFMT) != S_IFREG)
return 1;
diff --git a/mysys/my_rename.c b/mysys/my_rename.c
index b89bc4c8fbd..8a9e6eb3dfd 100644
--- a/mysys/my_rename.c
+++ b/mysys/my_rename.c
@@ -25,7 +25,7 @@ int my_rename(const char *from, const char *to, myf MyFlags)
{
int error = 0;
DBUG_ENTER("my_rename");
- DBUG_PRINT("my",("from %s to %s MyFlags %d", from, to, MyFlags));
+ DBUG_PRINT("my",("from %s to %s MyFlags %lu", from, to, MyFlags));
#if defined(HAVE_RENAME)
#if defined(__WIN__)
diff --git a/mysys/my_seek.c b/mysys/my_seek.c
index 1033d7ac806..e15179a408f 100644
--- a/mysys/my_seek.c
+++ b/mysys/my_seek.c
@@ -48,7 +48,7 @@ my_off_t my_seek(File fd, my_off_t pos, int whence, myf MyFlags)
{
os_off_t newpos= -1;
DBUG_ENTER("my_seek");
- DBUG_PRINT("my",("fd: %d Pos: %llu Whence: %d MyFlags: %d",
+ DBUG_PRINT("my",("fd: %d Pos: %llu Whence: %d MyFlags: %lu",
fd, (ulonglong) pos, whence, MyFlags));
DBUG_ASSERT(pos != MY_FILEPOS_ERROR); /* safety check */
@@ -84,7 +84,7 @@ my_off_t my_tell(File fd, myf MyFlags)
{
os_off_t pos;
DBUG_ENTER("my_tell");
- DBUG_PRINT("my",("fd: %d MyFlags: %d",fd, MyFlags));
+ DBUG_PRINT("my",("fd: %d MyFlags: %lu",fd, MyFlags));
DBUG_ASSERT(fd >= 0);
#if defined (HAVE_TELL) && !defined (_WIN32)
pos= tell(fd);
diff --git a/mysys/my_sync.c b/mysys/my_sync.c
index 88bcb685271..c0afd587ada 100644
--- a/mysys/my_sync.c
+++ b/mysys/my_sync.c
@@ -65,16 +65,13 @@ int my_sync(File fd, myf my_flags)
{
int res;
DBUG_ENTER("my_sync");
-
- DBUG_PRINT("my",("fd: %d my_flags: %d", fd, my_flags));
+ DBUG_PRINT("my",("fd: %d my_flags: %lu", fd, my_flags));
if (my_disable_sync)
DBUG_RETURN(0);
statistic_increment(my_sync_count,&THR_LOCK_open);
- DBUG_PRINT("my",("Fd: %d my_flags: %d", fd, my_flags));
-
if (before_sync_wait)
(*before_sync_wait)();
@@ -158,7 +155,7 @@ int my_sync_dir(const char *dir_name __attribute__((unused)),
int res= 0;
const char *correct_dir_name;
DBUG_ENTER("my_sync_dir");
- DBUG_PRINT("my",("Dir: '%s' my_flags: %d", dir_name, my_flags));
+ DBUG_PRINT("my",("Dir: '%s' my_flags: %lu", dir_name, my_flags));
/* Sometimes the path does not contain an explicit directory */
correct_dir_name= (dir_name[0] == 0) ? cur_dir_name : dir_name;
/*
diff --git a/mysys/my_thr_init.c b/mysys/my_thr_init.c
index 7c64faa7a28..4e5bed84637 100644
--- a/mysys/my_thr_init.c
+++ b/mysys/my_thr_init.c
@@ -425,7 +425,12 @@ struct st_my_thread_var *_my_thread_var(void)
my_thread_id my_thread_dbug_id()
{
- return my_thread_var->id;
+ /*
+ We need to do this test as some system thread may not yet have called
+ my_thread_init().
+ */
+ struct st_my_thread_var *tmp= my_thread_var;
+ return tmp ? tmp->id : 0;
}
#ifdef DBUG_OFF
diff --git a/mysys/my_write.c b/mysys/my_write.c
index c4cba7a927d..204e2e1488d 100644
--- a/mysys/my_write.c
+++ b/mysys/my_write.c
@@ -25,7 +25,7 @@ size_t my_write(File Filedes, const uchar *Buffer, size_t Count, myf MyFlags)
size_t writtenbytes, written;
uint errors;
DBUG_ENTER("my_write");
- DBUG_PRINT("my",("fd: %d Buffer: %p Count: %lu MyFlags: %d",
+ DBUG_PRINT("my",("fd: %d Buffer: %p Count: %lu MyFlags: %lu",
Filedes, Buffer, (ulong) Count, MyFlags));
errors= 0; written= 0;
if (!(MyFlags & (MY_WME | MY_FAE | MY_FNABP)))
diff --git a/mysys/mysys_priv.h b/mysys/mysys_priv.h
index 400135c9aaa..9c6855bb92f 100644
--- a/mysys/mysys_priv.h
+++ b/mysys/mysys_priv.h
@@ -72,12 +72,13 @@ extern PSI_file_key key_file_charset, key_file_cnf;
#endif /* HAVE_PSI_INTERFACE */
#ifdef SAFEMALLOC
-void *sf_malloc(size_t size);
-void *sf_realloc(void *ptr, size_t size);
+void *sf_malloc(size_t size, myf my_flags);
+void *sf_realloc(void *ptr, size_t size, myf my_flags);
void sf_free(void *ptr);
+size_t sf_malloc_usable_size(void *ptr, my_bool *is_thread_specific);
#else
-#define sf_malloc(X) malloc(X)
-#define sf_realloc(X,Y) realloc(X,Y)
+#define sf_malloc(X,Y) malloc(X)
+#define sf_realloc(X,Y,Z) realloc(X,Y)
#define sf_free(X) free(X)
#endif
diff --git a/mysys/safemalloc.c b/mysys/safemalloc.c
index 2f01573fee7..bdcfe4480db 100644
--- a/mysys/safemalloc.c
+++ b/mysys/safemalloc.c
@@ -58,6 +58,8 @@ struct st_irem
#ifdef HAVE_BACKTRACE
void *frame[SF_REMEMBER_FRAMES]; /* call stack */
#endif
+ uint32 flags; /* Flags passed to malloc */
+ my_thread_id thread_id; /* Which thread did the allocation */
uint32 marker; /* Underrun marker value */
};
@@ -79,11 +81,21 @@ static int bad_ptr(const char *where, void *ptr);
static void free_memory(void *ptr);
static void sf_terminate();
+/* Setup default call to get a thread id for the memory */
+
+my_thread_id default_sf_malloc_dbug_id(void)
+{
+ return my_thread_dbug_id();
+}
+
+my_thread_id (*sf_malloc_dbug_id)(void)= default_sf_malloc_dbug_id;
+
+
/**
allocates memory
*/
-void *sf_malloc(size_t size)
+void *sf_malloc(size_t size, myf my_flags)
{
struct st_irem *irem;
uchar *data;
@@ -112,7 +124,9 @@ void *sf_malloc(size_t size)
data= (uchar*) (irem + 1);
irem->datasize= size;
irem->prev= 0;
+ irem->flags= my_flags;
irem->marker= MAGICSTART;
+ irem->thread_id= sf_malloc_dbug_id();
data[size + 0]= MAGICEND0;
data[size + 1]= MAGICEND1;
data[size + 2]= MAGICEND2;
@@ -152,17 +166,17 @@ void *sf_malloc(size_t size)
return data;
}
-void *sf_realloc(void *ptr, size_t size)
+void *sf_realloc(void *ptr, size_t size, myf my_flags)
{
char *data;
if (!ptr)
- return sf_malloc(size);
+ return sf_malloc(size, my_flags);
if (bad_ptr("Reallocating", ptr))
return 0;
- if ((data= sf_malloc(size)))
+ if ((data= sf_malloc(size, my_flags)))
{
struct st_irem *irem= (struct st_irem *)ptr - 1;
set_if_smaller(size, irem->datasize);
@@ -180,28 +194,25 @@ void sf_free(void *ptr)
free_memory(ptr);
}
-static void free_memory(void *ptr)
-{
- struct st_irem *irem= (struct st_irem *)ptr - 1;
-
- pthread_mutex_lock(&sf_mutex);
- /* Remove this structure from the linked list */
- if (irem->prev)
- irem->prev->next= irem->next;
- else
- sf_malloc_root= irem->next;
+/**
+ Return size of memory block and if block is thread specific
- if (irem->next)
- irem->next->prev= irem->prev;
+ sf_malloc_usable_size()
+ @param ptr Pointer to malloced block
+ @param flags We will store 1 here if block is marked as MY_THREAD_SPECIFIC
+ otherwise 0
- /* Handle the statistics */
- sf_malloc_count--;
- pthread_mutex_unlock(&sf_mutex);
+ @return Size of block
+*/
- /* only trash the data and magic values, but keep the stack trace */
- TRASH_FREE((uchar*)(irem + 1) - 4, irem->datasize + 8);
- free(irem);
- return;
+size_t sf_malloc_usable_size(void *ptr, my_bool *is_thread_specific)
+{
+ struct st_irem *irem= (struct st_irem *)ptr - 1;
+ DBUG_ENTER("sf_malloc_usable_size");
+ *is_thread_specific= test(irem->flags & MY_THREAD_SPECIFIC);
+ DBUG_PRINT("exit", ("size: %lu flags: %lu", (ulong) irem->datasize,
+ (ulong)irem->flags));
+ DBUG_RETURN(irem->datasize);
}
#ifdef HAVE_BACKTRACE
@@ -233,6 +244,39 @@ static void print_stack(void **frame)
#define print_stack(X) fprintf(stderr, "???\n")
#endif
+static void free_memory(void *ptr)
+{
+ struct st_irem *irem= (struct st_irem *)ptr - 1;
+
+ if ((irem->flags & MY_THREAD_SPECIFIC) && irem->thread_id &&
+ irem->thread_id != sf_malloc_dbug_id())
+ {
+ fprintf(stderr, "Warning: %4lu bytes freed by T@%lu, allocated by T@%lu at ",
+ (ulong) irem->datasize,
+ (ulong) sf_malloc_dbug_id(), (ulong) irem->thread_id);
+ print_stack(irem->frame);
+ }
+
+ pthread_mutex_lock(&sf_mutex);
+ /* Remove this structure from the linked list */
+ if (irem->prev)
+ irem->prev->next= irem->next;
+ else
+ sf_malloc_root= irem->next;
+
+ if (irem->next)
+ irem->next->prev= irem->prev;
+
+ /* Handle the statistics */
+ sf_malloc_count--;
+ pthread_mutex_unlock(&sf_mutex);
+
+ /* only trash the data and magic values, but keep the stack trace */
+ TRASH_FREE((uchar*)(irem + 1) - 4, irem->datasize + 8);
+ free(irem);
+ return;
+}
+
static void warn(const char *format,...)
{
va_list args;
@@ -310,9 +354,11 @@ static int sf_sanity()
/**
report on all the memory pieces that have not been free'd
+
+ @param id Id of thread to report. 0 if all
*/
-static void sf_terminate()
+void sf_report_leaked_memory(my_thread_id id)
{
size_t total= 0;
struct st_irem *irem;
@@ -320,21 +366,31 @@ static void sf_terminate()
sf_sanity();
/* Report on all the memory that was allocated but not free'd */
- if (!sf_leaking_memory && sf_malloc_root)
+
+ for (irem= sf_malloc_root; irem; irem= irem->next)
{
- for (irem= sf_malloc_root; irem; irem= irem->next)
+ if (!id || (irem->thread_id == id && irem->flags & MY_THREAD_SPECIFIC))
{
- fprintf(stderr, "Warning: %4lu bytes lost, allocated at ",
- (ulong) irem->datasize);
+ my_thread_id tid = irem->thread_id && irem->flags & MY_THREAD_SPECIFIC ?
+ irem->thread_id : 0;
+ fprintf(stderr, "Warning: %4lu bytes lost, allocated by T@%lu at ",
+ (ulong) irem->datasize,tid);
print_stack(irem->frame);
total+= irem->datasize;
}
+ }
+ if (total)
fprintf(stderr, "Memory lost: %lu bytes in %d chunks\n",
(ulong) total, sf_malloc_count);
- }
+ return;
+}
+
+static void sf_terminate()
+{
+ if (!sf_leaking_memory)
+ sf_report_leaked_memory(0);
pthread_mutex_destroy(&sf_mutex);
- return;
}
#endif
diff --git a/mysys/string.c b/mysys/string.c
index d9791341c60..1263e7824f9 100644
--- a/mysys/string.c
+++ b/mysys/string.c
@@ -175,6 +175,36 @@ my_bool dynstr_append_os_quoted(DYNAMIC_STRING *str, const char *append, ...)
return ret;
}
+my_bool dynstr_append_quoted(DYNAMIC_STRING *str,
+ const char *append, size_t len,
+ char quote)
+{
+ uint additional= (str->alloc_increment ? str->alloc_increment : 10);
+ uint lim= additional;
+ uint i;
+ if (dynstr_realloc(str, len + additional + 2))
+ return TRUE;
+ str->str[str->length++]= quote;
+ for (i= 0; i < len; i++)
+ {
+ register char c= append[i];
+ if (c == quote || c == '\\')
+ {
+ if (!lim)
+ {
+ if (dynstr_realloc(str, additional))
+ return TRUE;
+ lim= additional;
+ }
+ lim--;
+ str->str[str->length++]= '\\';
+ }
+ str->str[str->length++]= c;
+ }
+ str->str[str->length++]= quote;
+ return FALSE;
+}
+
void dynstr_free(DYNAMIC_STRING *str)
{
@@ -193,3 +223,77 @@ void dynstr_reassociate(DYNAMIC_STRING *str, char **ptr, size_t *length,
*alloc_length= str->max_length;
str->str=0;
}
+
+
+/*
+ copy a string from one character set to another
+
+ SYNOPSIS
+ copy_and_convert()
+ to Store result here
+ to_cs Character set of result string
+ from Copy from here
+ from_length Length of from string
+ from_cs From character set
+
+ NOTES
+ 'to' must be big enough as form_length * to_cs->mbmaxlen
+
+ RETURN
+ length of bytes copied to 'to'
+*/
+
+uint32
+copy_and_convert_extended(char *to, uint32 to_length, CHARSET_INFO *to_cs,
+ const char *from, uint32 from_length,
+ CHARSET_INFO *from_cs,
+ uint *errors)
+{
+ int cnvres;
+ my_wc_t wc;
+ const uchar *from_end= (const uchar*) from+from_length;
+ char *to_start= to;
+ uchar *to_end= (uchar*) to+to_length;
+ my_charset_conv_mb_wc mb_wc= from_cs->cset->mb_wc;
+ my_charset_conv_wc_mb wc_mb= to_cs->cset->wc_mb;
+ uint error_count= 0;
+
+ while (1)
+ {
+ if ((cnvres= (*mb_wc)(from_cs, &wc, (uchar*) from,
+ from_end)) > 0)
+ from+= cnvres;
+ else if (cnvres == MY_CS_ILSEQ)
+ {
+ error_count++;
+ from++;
+ wc= '?';
+ }
+ else if (cnvres > MY_CS_TOOSMALL)
+ {
+ /*
+ A correct multibyte sequence detected
+ But it doesn't have Unicode mapping.
+ */
+ error_count++;
+ from+= (-cnvres);
+ wc= '?';
+ }
+ else
+ break; // Not enough characters
+
+outp:
+ if ((cnvres= (*wc_mb)(to_cs, wc, (uchar*) to, to_end)) > 0)
+ to+= cnvres;
+ else if (cnvres == MY_CS_ILUNI && wc != '?')
+ {
+ error_count++;
+ wc= '?';
+ goto outp;
+ }
+ else
+ break;
+ }
+ *errors= error_count;
+ return (uint32) (to - to_start);
+}
diff --git a/mysys/tree.c b/mysys/tree.c
index 85770194f25..fe2d3f45d57 100644
--- a/mysys/tree.c
+++ b/mysys/tree.c
@@ -84,8 +84,9 @@ static int test_rb_tree(TREE_ELEMENT *element);
#endif
void init_tree(TREE *tree, size_t default_alloc_size, size_t memory_limit,
- int size, qsort_cmp2 compare, my_bool with_delete,
- tree_element_free free_element, void *custom_arg)
+ int size, qsort_cmp2 compare,
+ tree_element_free free_element, void *custom_arg,
+ myf my_flags)
{
DBUG_ENTER("init_tree");
DBUG_PRINT("enter",("tree: 0x%lx size: %d", (long) tree, size));
@@ -104,6 +105,7 @@ void init_tree(TREE *tree, size_t default_alloc_size, size_t memory_limit,
tree->custom_arg = custom_arg;
tree->null_element.colour=BLACK;
tree->null_element.left=tree->null_element.right=0;
+ tree->my_flags= my_flags;
tree->flag= 0;
if (!free_element && size >= 0 &&
((uint) size <= sizeof(void*) || ((uint) size & (sizeof(void*)-1))))
@@ -125,10 +127,10 @@ void init_tree(TREE *tree, size_t default_alloc_size, size_t memory_limit,
tree->offset_to_key=0; /* use key through pointer */
tree->size_of_element+=sizeof(void*);
}
- if (!(tree->with_delete=with_delete))
+ if (!(tree->with_delete= test(my_flags & MY_TREE_WITH_DELETE)))
{
- init_alloc_root(&tree->mem_root, default_alloc_size, 0);
- tree->mem_root.min_malloc=(sizeof(TREE_ELEMENT)+tree->size_of_element);
+ init_alloc_root(&tree->mem_root, default_alloc_size, 0, MYF(my_flags));
+ tree->mem_root.min_malloc= sizeof(TREE_ELEMENT)+tree->size_of_element;
}
DBUG_VOID_RETURN;
}
@@ -236,7 +238,8 @@ TREE_ELEMENT *tree_insert(TREE *tree, void *key, uint key_size,
key_size+=tree->size_of_element;
if (tree->with_delete)
- element=(TREE_ELEMENT *) my_malloc(alloc_size, MYF(MY_WME));
+ element=(TREE_ELEMENT *) my_malloc(alloc_size,
+ MYF(tree->my_flags | MY_WME));
else
element=(TREE_ELEMENT *) alloc_root(&tree->mem_root,alloc_size);
if (!element)
diff --git a/mysys/waiting_threads.c b/mysys/waiting_threads.c
index 0a9474e68b4..21b2a9ac78a 100644
--- a/mysys/waiting_threads.c
+++ b/mysys/waiting_threads.c
@@ -403,7 +403,7 @@ static void wt_resource_init(uchar *arg)
bzero(rc, sizeof(*rc));
rc_rwlock_init(rc);
mysql_cond_init(key_WT_RESOURCE_cond, &rc->cond, 0);
- my_init_dynamic_array(&rc->owners, sizeof(WT_THD *), 0, 5);
+ my_init_dynamic_array(&rc->owners, sizeof(WT_THD *), 0, 5, MYF(0));
DBUG_VOID_RETURN;
}
@@ -509,7 +509,7 @@ void wt_thd_lazy_init(WT_THD *thd, const ulong *ds, const ulong *ts,
thd->deadlock_search_depth_long= dl;
thd->timeout_long= tl;
/* dynamic array is also initialized lazily - without memory allocations */
- my_init_dynamic_array(&thd->my_resources, sizeof(WT_RESOURCE *), 0, 5);
+ my_init_dynamic_array(&thd->my_resources, sizeof(WT_RESOURCE *), 0, 5, MYF(0));
#ifndef DBUG_OFF
thd->name= my_thread_name();
#endif
diff --git a/packaging/rpm-uln/CMakeLists.txt b/packaging/rpm-uln/CMakeLists.txt
new file mode 100644
index 00000000000..c8f13379697
--- /dev/null
+++ b/packaging/rpm-uln/CMakeLists.txt
@@ -0,0 +1,38 @@
+# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+
+IF(UNIX)
+ SET(prefix ${CMAKE_INSTALL_PREFIX})
+
+ SET(SPECFILENAME "mysql.${VERSION}.spec")
+ IF("${VERSION}" MATCHES "-ndb-")
+ STRING(REGEX REPLACE "^.*-ndb-" "" NDBVERSION "${VERSION}")
+ SET(SPECFILENAME "mysql-cluster-${NDBVERSION}.spec")
+ ENDIF()
+
+ # Left in current directory, to be taken during build
+ CONFIGURE_FILE(mysql.spec.sh ${CMAKE_CURRENT_BINARY_DIR}/${SPECFILENAME} @ONLY)
+
+ FOREACH(ulnfile filter-requires-mysql.sh generate-tarball.sh my.cnf my_config.h
+ mysql-5.5-errno.patch mysql-5.5-fix-tests.patch mysql-5.5-libdir.patch
+ mysql-5.5-mtr1.patch mysql-5.5-stack-guard.patch mysql-5.5-testing.patch
+ mysql-chain-certs.patch mysql-embedded-check.c mysql-expired-certs.patch
+ mysql.init mysql-install-test.patch mysql-strmov.patch scriptstub.c
+ README.mysql-docs)
+ CONFIGURE_FILE(${ulnfile} ${CMAKE_CURRENT_BINARY_DIR}/${ulnfile} COPYONLY)
+ ENDFOREACH()
+ENDIF()
+
diff --git a/packaging/rpm-uln/README-ULN b/packaging/rpm-uln/README-ULN
new file mode 100644
index 00000000000..8ae44a18605
--- /dev/null
+++ b/packaging/rpm-uln/README-ULN
@@ -0,0 +1,15 @@
+In order to have RPMs of MySQL which are distributed via ULN for Oracle Linux
+to be as closely compatible to such RPMs built and distributed by RedHat,
+this directory contains additional files which originated at RedHat
+and are used only for such RPMs intended for distribution via ULN.
+
+Especially, this directory contains the spec file used to build these RPMs,
+named "mysql.spec". Please regard the following note:
+
+ You are receiving a copy of the Red Hat spec file.
+ The terms of the Oracle license do NOT apply to the Red Hat spec file;
+ it is licensed under the
+ GNU GENERAL PUBLIC LICENSE Version 2, June 1991
+ separately from the Oracle programs you receive.
+
+
diff --git a/packaging/rpm-uln/README.mysql-docs b/packaging/rpm-uln/README.mysql-docs
new file mode 100644
index 00000000000..dd894a7b9c0
--- /dev/null
+++ b/packaging/rpm-uln/README.mysql-docs
@@ -0,0 +1,4 @@
+The official MySQL documentation is not freely redistributable, so we cannot
+include it in RHEL or Fedora. You can find it on-line at
+
+http://dev.mysql.com/doc/
diff --git a/packaging/rpm-uln/filter-requires-mysql.sh b/packaging/rpm-uln/filter-requires-mysql.sh
new file mode 100755
index 00000000000..d435062b8dc
--- /dev/null
+++ b/packaging/rpm-uln/filter-requires-mysql.sh
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+/usr/lib/rpm/perl.req $* | grep -v -e "perl(th" -e "perl(lib::mtr" -e "perl(mtr"
diff --git a/packaging/rpm-uln/generate-tarball.sh b/packaging/rpm-uln/generate-tarball.sh
new file mode 100755
index 00000000000..2ff4bff2349
--- /dev/null
+++ b/packaging/rpm-uln/generate-tarball.sh
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+VERSION=$1
+
+rm -rf mysql-$VERSION
+
+tar xfz mysql-$VERSION.tar.gz || exit 1
+
+rm mysql-$VERSION/Docs/mysql.info
+
+tar cfz mysql-$VERSION-nodocs.tar.gz mysql-$VERSION || exit 1
+
+rm -rf mysql-$VERSION
+
+exit 0
diff --git a/packaging/rpm-uln/my.cnf b/packaging/rpm-uln/my.cnf
new file mode 100644
index 00000000000..fae0fa276e1
--- /dev/null
+++ b/packaging/rpm-uln/my.cnf
@@ -0,0 +1,10 @@
+[mysqld]
+datadir=/var/lib/mysql
+socket=/var/lib/mysql/mysql.sock
+user=mysql
+# Disabling symbolic-links is recommended to prevent assorted security risks
+symbolic-links=0
+
+[mysqld_safe]
+log-error=/var/log/mysqld.log
+pid-file=/var/run/mysqld/mysqld.pid
diff --git a/packaging/rpm-uln/my_config.h b/packaging/rpm-uln/my_config.h
new file mode 100644
index 00000000000..435a126ac97
--- /dev/null
+++ b/packaging/rpm-uln/my_config.h
@@ -0,0 +1,29 @@
+/*
+ * Kluge to support multilib installation of both 32- and 64-bit RPMS:
+ * we need to arrange that header files that appear in both RPMs are
+ * identical. Hence, this file is architecture-independent and calls
+ * in an arch-dependent file that will appear in just one RPM.
+ *
+ * To avoid breaking arches not explicitly supported by Red Hat, we
+ * use this indirection file *only* on known multilib arches.
+ *
+ * Note: this may well fail if user tries to use gcc's -I- option.
+ * But that option is deprecated anyway.
+ */
+#if defined(__x86_64__)
+#include "my_config_x86_64.h"
+#elif defined(__i386__)
+#include "my_config_i386.h"
+#elif defined(__ppc64__) || defined(__powerpc64__)
+#include "my_config_ppc64.h"
+#elif defined(__ppc__) || defined(__powerpc__)
+#include "my_config_ppc.h"
+#elif defined(__s390x__)
+#include "my_config_s390x.h"
+#elif defined(__s390__)
+#include "my_config_s390.h"
+#elif defined(__sparc__) && defined(__arch64__)
+#include "my_config_sparc64.h"
+#elif defined(__sparc__)
+#include "my_config_sparc.h"
+#endif
diff --git a/packaging/rpm-uln/mysql-5.5-errno.patch b/packaging/rpm-uln/mysql-5.5-errno.patch
new file mode 100644
index 00000000000..033e5195973
--- /dev/null
+++ b/packaging/rpm-uln/mysql-5.5-errno.patch
@@ -0,0 +1,21 @@
+"extern int errno" is just a really bad idea.
+
+
+diff -Naur mysql-5.1.32.orig/include/my_sys.h mysql-5.1.32/include/my_sys.h
+--- mysql-5.1.32.orig/include/my_sys.h 2009-02-13 19:52:19.000000000 -0500
++++ mysql-5.1.32/include/my_sys.h 2009-03-04 18:08:40.000000000 -0500
+@@ -199,13 +199,8 @@
+ #define my_afree(PTR) my_free(PTR)
+ #endif /* HAVE_ALLOCA */
+
+-#ifndef errno /* did we already get it? */
+-#ifdef HAVE_ERRNO_AS_DEFINE
+ #include <errno.h> /* errno is a define */
+-#else
+-extern int errno; /* declare errno */
+-#endif
+-#endif /* #ifndef errno */
++
+ extern char *home_dir; /* Home directory for user */
+ extern const char *my_progname; /* program-name (printed in errors) */
+ extern char curr_dir[]; /* Current directory for user */
diff --git a/packaging/rpm-uln/mysql-5.5-fix-tests.patch b/packaging/rpm-uln/mysql-5.5-fix-tests.patch
new file mode 100644
index 00000000000..a1ab7a82210
--- /dev/null
+++ b/packaging/rpm-uln/mysql-5.5-fix-tests.patch
@@ -0,0 +1,34 @@
+Adapt tests (where needed) to RedHat conventions.
+
+1) The RedHat convention uses the package name "mysql*" whereas upstream uses "MySQL*".
+ Test "file_contents" constructs path names and needs to be adapted.
+
+=== modified file 'mysql-test/t/file_contents.test'
+--- mysql-5.5.17-orig/mysql-test/t/file_contents.test 2011-10-10 12:03:29 +0000
++++ mysql-5.5.17/mysql-test/t/file_contents.test 2011-11-16 18:07:55 +0000
+@@ -17,20 +17,20 @@ if ($dir_bin =~ m|/usr/|) {
+ $dir_docs =~ s|/lib|/share/doc|;
+ if(-d "$dir_docs/packages") {
+ # SuSE: "packages/" in the documentation path
+- $dir_docs = glob "$dir_docs/packages/MySQL-server*";
++ $dir_docs = glob "$dir_docs/packages/mysql-server*";
+ } else {
+ # RedHat: version number in directory name
+- $dir_docs = glob "$dir_docs/MySQL-server*";
++ $dir_docs = glob "$dir_docs/mysql-server*";
+ }
+ } elsif ($dir_bin =~ m|/usr$|) {
+ # RPM build during development
+ $dir_docs = "$dir_bin/share/doc";
+ if(-d "$dir_docs/packages") {
+ # SuSE: "packages/" in the documentation path
+- $dir_docs = glob "$dir_docs/packages/MySQL-server*";
++ $dir_docs = glob "$dir_docs/packages/mysql-server*";
+ } else {
+ # RedHat: version number in directory name
+- $dir_docs = glob "$dir_docs/MySQL-server*";
++ $dir_docs = glob "$dir_docs/mysql-server*";
+ }
+ } else {
+ # tar.gz package, Windows, or developer work (in BZR)
+
diff --git a/packaging/rpm-uln/mysql-5.5-libdir.patch b/packaging/rpm-uln/mysql-5.5-libdir.patch
new file mode 100644
index 00000000000..2ab3e9eec27
--- /dev/null
+++ b/packaging/rpm-uln/mysql-5.5-libdir.patch
@@ -0,0 +1,28 @@
+The RPMs built by MySQL AB (-> Sun -> Oracle) put the libraries into "/usr/lib".
+Those built by RedHat put them into "/usr/lib/mysql".
+This patch is to modify the cmake files to follow the RedHat convention.
+Similar, the server is now in "/usr/libexec" (formerly "/usr/sbin").
+
+
+diff -Naur mysql-5.5.17.orig/cmake/install_layout.cmake mysql-5.5.17/cmake/install_layout.cmake
+--- mysql-5.5.17.orig/cmake/install_layout.cmake 2011-06-30 15:46:53 +0000
++++ mysql-5.5.17/cmake/install_layout.cmake 2011-10-27 16:40:10 +0000
+@@ -140,14 +140,14 @@ SET(INSTALL_SBINDIR_RPM
+ # be applied at build time via "rpmbuild".
+ #
+ SET(INSTALL_BINDIR_RPM "bin")
+-SET(INSTALL_SBINDIR_RPM "sbin")
++SET(INSTALL_SBINDIR_RPM "libexec")
+ SET(INSTALL_SCRIPTDIR_RPM "bin")
+ #
+ IF(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64")
+- SET(INSTALL_LIBDIR_RPM "lib64")
++ SET(INSTALL_LIBDIR_RPM "lib64/mysql")
+ SET(INSTALL_PLUGINDIR_RPM "lib64/mysql/plugin")
+ ELSE()
+- SET(INSTALL_LIBDIR_RPM "lib")
++ SET(INSTALL_LIBDIR_RPM "lib/mysql")
+ SET(INSTALL_PLUGINDIR_RPM "lib/mysql/plugin")
+ ENDIF()
+ #
+
diff --git a/packaging/rpm-uln/mysql-5.5-mtr1.patch b/packaging/rpm-uln/mysql-5.5-mtr1.patch
new file mode 100644
index 00000000000..7a7dc85f16c
--- /dev/null
+++ b/packaging/rpm-uln/mysql-5.5-mtr1.patch
@@ -0,0 +1,25 @@
+Drop support for version 1 of "mysql-test-run.pl" from the RPMs:
+
+1) The auto-generation of Perl dependencies will mishandle that code,
+ probably because its run directory differs from its storage location.
+2) It does not provide several variables which are used in tests of MySQL 5.5
+
+If you really need it, take it from the source tarball.
+
+=== modified file 'mysql-test/mysql-test-run.pl'
+--- mysql-5.5.17-orig/mysql-test/mysql-test-run.pl 2011-10-03 11:16:40 +0000
++++ mysql-5.5.17/mysql-test/mysql-test-run.pl 2011-11-16 19:06:38 +0000
+@@ -58,10 +58,9 @@ BEGIN {
+ if ( $version == 1 )
+ {
+ print "=======================================================\n";
+- print " WARNING: Using mysql-test-run.pl version 1! \n";
++ print " ERROR: Support for version 1 is dropped in this distribution! \n";
+ print "=======================================================\n";
+- # Should use exec() here on *nix but this appears not to work on Windows
+- exit(system($^X, "lib/v1/mysql-test-run.pl", @ARGV) >> 8);
++ exit(1);
+ }
+ elsif ( $version == 2 )
+ {
+
diff --git a/packaging/rpm-uln/mysql-5.5-stack-guard.patch b/packaging/rpm-uln/mysql-5.5-stack-guard.patch
new file mode 100644
index 00000000000..b2624d982de
--- /dev/null
+++ b/packaging/rpm-uln/mysql-5.5-stack-guard.patch
@@ -0,0 +1,140 @@
+mysql is not accounting for the "guard page" when setting thread stack size
+requests. This is fatal on PPC systems, which may use guard pages as large
+as 64K. This patch also documents the IA64 situation a bit better.
+
+Note: there are quite a few other setstacksize calls besides the two in
+mysqld.cc; is it important to fix any of the others?
+
+Filed upstream at http://bugs.mysql.com/bug.php?id=35019
+
+
+diff -Naur mysql-5.1.30.orig/sql/mysqld.cc mysql-5.1.30/sql/mysqld.cc
+--- mysql-5.1.30.orig/sql/mysqld.cc 2008-11-14 11:37:13.000000000 -0500
++++ mysql-5.1.30/sql/mysqld.cc 2009-01-13 12:08:35.000000000 -0500
+@@ -2653,6 +2653,70 @@
+ }
+
+
++/* pthread_attr_setstacksize without so much platform-dependency */
++/* returns the actual stack size if possible */
++static size_t my_setstacksize(pthread_attr_t *attr, size_t stacksize)
++{
++ size_t guard_size = 0;
++
++#if defined(__ia64__) || defined(__ia64)
++ /*
++ On IA64, half of the requested stack size is used for "normal stack"
++ and half for "register stack". The space measured by check_stack_overrun
++ is the "normal stack", so double the request to make sure we have the
++ caller-expected amount of normal stack.
++
++ NOTE: there is no guarantee that the register stack can't grow faster
++ than normal stack, so it's very unclear that we won't dump core due to
++ stack overrun despite check_stack_overrun's efforts. Experimentation
++ shows that in the execution_constants test, the register stack grows
++ less than half as fast as normal stack, but perhaps other scenarios are
++ less forgiving. If it turns out that more space is needed for the
++ register stack, that could be forced (rather inefficiently) by using a
++ multiplier higher than 2 here.
++ */
++ stacksize *= 2;
++#endif
++
++ /*
++ On many machines, the "guard space" is subtracted from the requested
++ stack size, and that space is quite large on some platforms. So add
++ it to our request, if we can find out what it is.
++
++ FIXME: autoconfiscate use of pthread_attr_getguardsize
++ */
++ if (pthread_attr_getguardsize(attr, &guard_size))
++ guard_size = 0; /* if can't find it out, treat as 0 */
++
++ pthread_attr_setstacksize(attr, stacksize + guard_size);
++
++ /* Retrieve actual stack size if possible */
++#ifdef HAVE_PTHREAD_ATTR_GETSTACKSIZE
++ {
++ size_t real_stack_size= 0;
++ /* We must ignore real_stack_size = 0 as Solaris 2.9 can return 0 here */
++ if (pthread_attr_getstacksize(attr, &real_stack_size) == 0 &&
++ real_stack_size > guard_size)
++ {
++ real_stack_size -= guard_size;
++ if (real_stack_size < stacksize)
++ {
++ if (global_system_variables.log_warnings)
++ sql_print_warning("Asked for %ld thread stack, but got %ld",
++ (long) stacksize, (long) real_stack_size);
++ stacksize= real_stack_size;
++ }
++ }
++ }
++#endif
++
++#if defined(__ia64__) || defined(__ia64)
++ stacksize /= 2;
++#endif
++ return stacksize;
++}
++
++
+ static void start_signal_handler(void)
+ {
+ int error;
+@@ -2663,15 +2727,7 @@
+ #if !defined(HAVE_DEC_3_2_THREADS)
+ pthread_attr_setscope(&thr_attr,PTHREAD_SCOPE_SYSTEM);
+ (void) pthread_attr_setdetachstate(&thr_attr,PTHREAD_CREATE_DETACHED);
+-#if defined(__ia64__) || defined(__ia64)
+- /*
+- Peculiar things with ia64 platforms - it seems we only have half the
+- stack size in reality, so we have to double it here
+- */
+- pthread_attr_setstacksize(&thr_attr,my_thread_stack_size*2);
+-#else
+- pthread_attr_setstacksize(&thr_attr,my_thread_stack_size);
+-#endif
++ (void) my_setstacksize(&thr_attr,my_thread_stack_size);
+ #endif
+
+ mysql_mutex_lock(&LOCK_thread_count);
+@@ -4445,37 +4501,7 @@
+ unireg_abort(1); // Will do exit
+
+ init_signals();
+-#if defined(__ia64__) || defined(__ia64)
+- /*
+- Peculiar things with ia64 platforms - it seems we only have half the
+- stack size in reality, so we have to double it here
+- */
+- pthread_attr_setstacksize(&connection_attrib,my_thread_stack_size*2);
+-#else
+- pthread_attr_setstacksize(&connection_attrib,my_thread_stack_size);
+-#endif
+-#ifdef HAVE_PTHREAD_ATTR_GETSTACKSIZE
+- {
+- /* Retrieve used stack size; Needed for checking stack overflows */
+- size_t stack_size= 0;
+- pthread_attr_getstacksize(&connection_attrib, &stack_size);
+-#if defined(__ia64__) || defined(__ia64)
+- stack_size/= 2;
+-#endif
+- /* We must check if stack_size = 0 as Solaris 2.9 can return 0 here */
+- if (stack_size && stack_size < my_thread_stack_size)
+- {
+- if (global_system_variables.log_warnings)
+- sql_print_warning("Asked for %lu thread stack, but got %ld",
+- my_thread_stack_size, (long) stack_size);
+-#if defined(__ia64__) || defined(__ia64)
+- my_thread_stack_size= stack_size*2;
+-#else
+- my_thread_stack_size= stack_size;
+-#endif
+- }
+- }
+-#endif
++ my_thread_stack_size = my_setstacksize(&connection_attrib,my_thread_stack_size);
+
+ (void) thr_setconcurrency(concurrency); // 10 by default
+
diff --git a/packaging/rpm-uln/mysql-5.5-testing.patch b/packaging/rpm-uln/mysql-5.5-testing.patch
new file mode 100644
index 00000000000..74387135346
--- /dev/null
+++ b/packaging/rpm-uln/mysql-5.5-testing.patch
@@ -0,0 +1,23 @@
+Hack the top-level Makefile to enable the openssl regression tests.
+(Why doesn't this happen automatically given the configure option??)
+
+Also, increase the overall timeout for the regression tests to 12 hours,
+because on a slow or heavily-loaded build machine sometimes the default of
+5 hours isn't enough. (This has been demonstrated to fail in mass-rebuild
+scenarios, which aren't that uncommon for Fedora.) Similarly increase the
+per-testcase timeout to 30 minutes, since the default of 15 hasn't got a
+great deal of headroom either.
+
+
+diff -Naur mysql-5.1.32.orig/Makefile.am mysql-5.1.32/Makefile.am
+--- mysql-5.1.32.orig/Makefile.am 2009-02-13 19:51:56.000000000 -0500
++++ mysql-5.1.32/Makefile.am 2009-03-04 18:12:36.000000000 -0500
+@@ -98,7 +98,7 @@
+
+ test-ns:
+ cd mysql-test ; \
+- @PERL@ ./mysql-test-run.pl $(force) $(mem) --mysqld=--binlog-format=mixed
++ @PERL@ ./mysql-test-run.pl $(force) $(mem) --ssl --mysqld=--binlog-format=mixed --suite-timeout=720 --testcase-timeout=30
+
+ test-binlog-statement:
+ cd mysql-test ; \
diff --git a/packaging/rpm-uln/mysql-chain-certs.patch b/packaging/rpm-uln/mysql-chain-certs.patch
new file mode 100644
index 00000000000..4e26af16cb0
--- /dev/null
+++ b/packaging/rpm-uln/mysql-chain-certs.patch
@@ -0,0 +1,45 @@
+Fix things so that chains of certificates work in the server and client
+certificate files.
+
+This only really works for OpenSSL-based builds, as yassl is unable to read
+multiple certificates from a file. The patch below to yassl/src/ssl.cpp
+doesn't fix that, but just arranges that the viosslfactories.c patch won't
+have any ill effects in a yassl build. Since we don't use yassl in Red Hat/
+Fedora builds, I'm not feeling motivated to try to fix yassl for this.
+
+See RH bug #598656. Filed upstream at http://bugs.mysql.com/bug.php?id=54158
+
+ ===
+
+Joerg Bruehe, MySQL Build Team at Oracle: First patch adapted to code changes in MySQL 5.5
+
+
+diff -Naur mysql-5.5.29.orig/vio/viosslfactories.c mysql-5.5.29/vio/viosslfactories.c
+--- mysql-5.5.29.orig/vio/viosslfactories.c 2010-05-06 11:28:07.000000000 -0400
++++ mysql-5.5.29/vio/viosslfactories.c 2010-05-26 23:23:46.000000000 -0400
+@@ -106,7 +106,7 @@
+ key_file= cert_file;
+
+ if (cert_file &&
+- SSL_CTX_use_certificate_file(ctx, cert_file, SSL_FILETYPE_PEM) <= 0)
++ SSL_CTX_use_certificate_chain_file(ctx, cert_file) <= 0)
+ {
+ *error= SSL_INITERR_CERT;
+ DBUG_PRINT("error",("%s from file '%s'", sslGetErrString(*error), cert_file));
+diff -Naur mysql-5.1.47.orig/extra/yassl/src/ssl.cpp mysql-5.1.47/extra/yassl/src/ssl.cpp
+--- mysql-5.1.47.orig/extra/yassl/src/ssl.cpp 2010-05-06 11:24:26.000000000 -0400
++++ mysql-5.1.47/extra/yassl/src/ssl.cpp 2010-05-26 23:29:13.000000000 -0400
+@@ -1606,10 +1606,10 @@
+ }
+
+
+- int SSL_CTX_use_certificate_chain_file(SSL_CTX*, const char*)
++ int SSL_CTX_use_certificate_chain_file(SSL_CTX* ctx, const char* file)
+ {
+- // TDOD:
+- return SSL_SUCCESS;
++ // For the moment, treat like use_certificate_file
++ return read_file(ctx, file, SSL_FILETYPE_PEM, Cert);
+ }
+
+
diff --git a/packaging/rpm-uln/mysql-embedded-check.c b/packaging/rpm-uln/mysql-embedded-check.c
new file mode 100644
index 00000000000..8bf8ca53dad
--- /dev/null
+++ b/packaging/rpm-uln/mysql-embedded-check.c
@@ -0,0 +1,26 @@
+/* simple test program to see if we can link the embedded server library */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdarg.h>
+
+#include "mysql.h"
+
+MYSQL *mysql;
+
+static char *server_options[] = \
+ { "mysql_test", "--defaults-file=my.cnf", NULL };
+int num_elements = (sizeof(server_options) / sizeof(char *)) - 1;
+
+static char *server_groups[] = { "libmysqld_server",
+ "libmysqld_client", NULL };
+
+int main(int argc, char **argv)
+{
+ mysql_library_init(num_elements, server_options, server_groups);
+ mysql = mysql_init(NULL);
+ mysql_close(mysql);
+ mysql_library_end();
+
+ return 0;
+}
diff --git a/packaging/rpm-uln/mysql-expired-certs.patch b/packaging/rpm-uln/mysql-expired-certs.patch
new file mode 100644
index 00000000000..acd3a78cce7
--- /dev/null
+++ b/packaging/rpm-uln/mysql-expired-certs.patch
@@ -0,0 +1,555 @@
+Upstream insists on generating SSL testing certificates with relatively short
+lifespan, which has repeatedly caused problems (ie, one day the regression
+tests suddenly stop working). Replace them with certificates with 20-year
+lifespan. We should periodically regenerate these, too, but at least not
+very often.
+
+
+diff -Naur mysql-5.1.50.orig/mysql-test/std_data/cacert.pem mysql-5.1.50/mysql-test/std_data/cacert.pem
+--- mysql-5.1.50.orig/mysql-test/std_data/cacert.pem 2010-08-03 13:55:04.000000000 -0400
++++ mysql-5.1.50/mysql-test/std_data/cacert.pem 2010-08-27 23:42:05.751428144 -0400
+@@ -1,17 +1,22 @@
+ -----BEGIN CERTIFICATE-----
+-MIICrTCCAhagAwIBAgIJAMI7xZKjhrDbMA0GCSqGSIb3DQEBBAUAMEQxCzAJBgNV
++MIIDsjCCApqgAwIBAgIJAL5YrUwfPSWVMA0GCSqGSIb3DQEBBQUAMEQxCzAJBgNV
+ BAYTAlNFMRAwDgYDVQQIEwdVcHBzYWxhMRAwDgYDVQQHEwdVcHBzYWxhMREwDwYD
+-VQQKEwhNeVNRTCBBQjAeFw0xMDAxMjkxMTQ3MTBaFw0xNTAxMjgxMTQ3MTBaMEQx
++VQQKEwhNeVNRTCBBQjAeFw0xMDAxMjkwNTU5NTNaFw0xNTAxMjgwNTU5NTNaMEQx
+ CzAJBgNVBAYTAlNFMRAwDgYDVQQIEwdVcHBzYWxhMRAwDgYDVQQHEwdVcHBzYWxh
+-MREwDwYDVQQKEwhNeVNRTCBBQjCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA
+-wQYsOEfrN4ESP3FjsI8cghE+tZVuyK2gck61lwieVxjgFMtBd65mI5a1y9pmlOI1
+-yM4SB2Ppqcuw7/e1CdV1y7lvHrGNt5yqEHbN4QX1gvsN8TQauP/2WILturk4R4Hq
+-rKg0ZySu7f1Xhl0ed9a48LpaEHD17IcxWEGMMJwAxF0CAwEAAaOBpjCBozAMBgNV
+-HRMEBTADAQH/MB0GA1UdDgQWBBSvktYQ0ahLnyxyVKqty+WpBbBrDTB0BgNVHSME
+-bTBrgBSvktYQ0ahLnyxyVKqty+WpBbBrDaFIpEYwRDELMAkGA1UEBhMCU0UxEDAO
+-BgNVBAgTB1VwcHNhbGExEDAOBgNVBAcTB1VwcHNhbGExETAPBgNVBAoTCE15U1FM
+-IEFCggkAwjvFkqOGsNswDQYJKoZIhvcNAQEEBQADgYEAdKN1PjwMHAKG2Ww1145g
+-JQGBnKxSFOUaoSvkBi/4ntTM+ysnViWh7WvxyWjR9zU9arfr7aqsDeQxm0XDOqzj
+-AQ/cQIla2/Li8tXyfc06bisH/IHRaSc2zWqioTKbEwMdVOdrvq4a8V8ic3xYyIWn
+-7F4WeS07J8LKardSvM0+hOA=
++MREwDwYDVQQKEwhNeVNRTCBBQjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC
++ggEBAL6kNN4peX7uhK9rb06W/QbPEpVuejmdWdl2PqMshP/eSuXXw7kwVgfpxx9R
++vC000CKQQSG9MCoZjtqPnFRsetmWLZgApRpEalGXTXJqq9sEbCfoFizg94U8G7d2
++u5XJjLVmcG34ru36KoBgVx1zeH1puBAf8dOzrE4L7Y+ZQBFzFohjh8C2LqWC4nM5
++qsLmOkDWMipGqYU5DvkKjIbTbwTyRNRgZHWSPfVDDPUIUOsY4BGUp2DpgeGY9aEv
++lIs57Ev9JqlIUCV65lOhhDkG+xwmkHKHA+ECEU9cALI8+uXbh48MB9XpMOuk408X
++/lX89aZwD0/G9kmObVGnE2G+H5UCAwEAAaOBpjCBozAdBgNVHQ4EFgQUsft+d7VA
++jWgRftkR5cPG2k2sUbAwdAYDVR0jBG0wa4AUsft+d7VAjWgRftkR5cPG2k2sUbCh
++SKRGMEQxCzAJBgNVBAYTAlNFMRAwDgYDVQQIEwdVcHBzYWxhMRAwDgYDVQQHEwdV
++cHBzYWxhMREwDwYDVQQKEwhNeVNRTCBBQoIJAL5YrUwfPSWVMAwGA1UdEwQFMAMB
++Af8wDQYJKoZIhvcNAQEFBQADggEBALRUOAmdL8R8sl1y8kiEiFgDatdXK5RDqWai
++8yZChfmwTIToHhmQsOEshJe2e8hky3huUj+33VyXjINoMbebIwMuXPwEkbJal8RZ
++nSJmF0jN1Qz7J/jFffwK9xmejWZJx49Kt2+Qwrwp6kDeq9TLFqQOoVczgyJPYsTL
++NAOib5WqTud3XWvCwxrhqmWu7JZq6sp1fomP/uunprb8y2miWfLESZN2mKAhm44Q
++Lws867LT8v2lskEjq2dT1LutD5+R66XcdjgSr0uDziDs64jZwCD6ea94hVFM7ej0
++ZOXYeSEZJ56FjUxu632e9fY8NyMh30yKjjmQf1mM9PuGJvdvsWU=
+ -----END CERTIFICATE-----
+diff -Naur mysql-5.1.50.orig/mysql-test/std_data/client-cert.pem mysql-5.1.50/mysql-test/std_data/client-cert.pem
+--- mysql-5.1.50.orig/mysql-test/std_data/client-cert.pem 2010-08-03 13:55:04.000000000 -0400
++++ mysql-5.1.50/mysql-test/std_data/client-cert.pem 2010-08-27 23:42:05.752428395 -0400
+@@ -1,46 +1,69 @@
+ Certificate:
+ Data:
+- Version: 1 (0x0)
+- Serial Number: 1048577 (0x100001)
+- Signature Algorithm: md5WithRSAEncryption
++ Version: 3 (0x2)
++ Serial Number: 6 (0x6)
++ Signature Algorithm: sha1WithRSAEncryption
+ Issuer: C=SE, ST=Uppsala, L=Uppsala, O=MySQL AB
+ Validity
+- Not Before: Jan 29 11:50:22 2010 GMT
+- Not After : Jan 28 11:50:22 2015 GMT
++ Not Before: Feb 20 03:03:26 2010 GMT
++ Not After : Sep 3 03:03:26 2030 GMT
+ Subject: C=SE, ST=Uppsala, O=MySQL AB
+ Subject Public Key Info:
+ Public Key Algorithm: rsaEncryption
+- Public-Key: (1024 bit)
+- Modulus:
+- 00:cc:9a:37:49:13:66:dc:cf:e3:0b:13:a1:23:ed:
+- 78:db:4e:bd:11:f6:8c:0d:76:f9:a3:32:56:9a:f8:
+- a1:21:6a:55:4e:4d:3f:e6:67:9d:26:99:b2:cd:a4:
+- 9a:d2:2b:59:5c:d7:8a:d3:60:68:f8:18:bd:c5:be:
+- 15:e1:2a:3c:a3:d4:61:cb:f5:11:94:17:81:81:f7:
+- 87:8c:f6:6a:d2:ee:d8:e6:77:f6:62:66:4d:2e:16:
+- 8d:08:81:4a:c9:c6:4b:31:e5:b9:c7:8a:84:96:48:
+- a7:47:8c:0d:26:90:56:4e:e6:a5:6e:8c:b3:f2:9f:
+- fc:3d:78:9b:49:6e:86:83:77
++ RSA Public Key: (1024 bit)
++ Modulus (1024 bit):
++ 00:c2:e7:20:cf:89:59:2f:67:cb:4c:9f:e8:11:f2:
++ 23:e5:f1:b1:ee:3f:66:5f:c3:f5:fd:1e:31:ee:8f:
++ 4c:2a:bd:c0:4a:a5:9f:c8:44:d5:77:8f:15:1b:4d:
++ 78:6e:b2:a2:48:a5:24:33:05:40:02:b3:c1:87:8d:
++ 59:3c:1a:07:aa:86:f0:04:e1:9c:20:4b:22:32:c4:
++ 51:9e:40:e4:31:c3:57:f5:98:bf:2e:b1:fd:2c:56:
++ bf:49:d9:9b:e7:17:cc:95:5f:b5:08:19:5e:9d:df:
++ 65:22:39:2c:48:fb:69:96:31:7a:35:4d:de:60:b4:
++ c1:60:19:5f:96:56:7e:55:19
+ Exponent: 65537 (0x10001)
+- Signature Algorithm: md5WithRSAEncryption
+- 5e:1f:a3:53:5f:24:13:1c:f8:28:32:b0:7f:69:69:f3:0e:c0:
+- 34:87:10:03:7d:da:15:8b:bd:19:b8:1a:56:31:e7:85:49:81:
+- c9:7f:45:20:74:3e:89:c0:e0:26:84:51:cc:04:16:ce:69:99:
+- 01:e1:26:99:b3:e3:f5:bd:ec:5f:a0:84:e4:38:da:75:78:7b:
+- 89:9c:d2:cd:60:95:20:ba:8e:e3:7c:e6:df:76:3a:7c:89:77:
+- 02:94:86:11:3a:c4:61:7d:6f:71:83:21:8a:17:fb:17:e2:ee:
+- 02:6b:61:c1:b4:52:63:d7:d8:46:b2:c5:9c:6f:38:91:8a:35:
+- 32:0b
++ X509v3 extensions:
++ X509v3 Basic Constraints:
++ CA:FALSE
++ X509v3 Subject Key Identifier:
++ 8D:10:67:91:33:76:9C:02:E5:78:5D:D8:C5:EF:25:96:B2:D7:FA:1F
++ X509v3 Authority Key Identifier:
++ keyid:B1:FB:7E:77:B5:40:8D:68:11:7E:D9:11:E5:C3:C6:DA:4D:AC:51:B0
++ DirName:/C=SE/ST=Uppsala/L=Uppsala/O=MySQL AB
++ serial:BE:58:AD:4C:1F:3D:25:95
++
++ Signature Algorithm: sha1WithRSAEncryption
++ a9:88:10:3e:5d:2a:47:29:c8:03:27:7a:31:5a:8e:10:03:bc:
++ b5:4e:37:1d:12:7b:eb:5f:50:71:70:b1:a3:8e:93:0e:77:17:
++ 6c:47:b6:c9:a4:4d:2a:c4:38:f0:61:55:b2:7f:28:ba:06:79:
++ ee:67:11:7d:d4:c9:7f:0a:18:c8:c1:cb:d0:2c:f9:63:0f:bb:
++ 45:ca:de:ea:bb:ac:00:01:52:48:36:2b:07:2b:c8:46:c7:b1:
++ 21:81:bd:77:39:e7:4c:39:aa:bd:ac:60:d8:a7:bf:cf:14:98:
++ 4a:0b:a1:40:55:06:8d:6f:35:a9:39:a0:71:a9:97:ba:7c:73:
++ 3c:41:ba:c5:1c:11:4b:2b:43:1d:2d:ba:7b:5f:14:b5:3d:64:
++ 62:15:36:b4:16:bd:78:c8:43:8d:f9:1c:a5:d2:ac:a1:58:74:
++ e1:99:de:ad:04:19:43:a8:bd:0a:fd:19:9b:50:44:46:6d:18:
++ 55:4d:bf:b4:5b:a4:93:62:c7:64:91:6c:54:34:d1:f8:f3:ff:
++ 12:6d:5f:85:e7:35:9e:5c:42:81:5e:fb:c8:bb:44:51:98:b2:
++ ef:1b:9f:5a:22:77:28:7d:da:fb:08:c2:94:9a:0f:42:08:93:
++ 54:10:1e:ad:f2:4f:fc:62:98:51:e9:9b:b9:3a:93:d9:e4:1f:
++ 1d:c4:76:d0
+ -----BEGIN CERTIFICATE-----
+-MIIB5zCCAVACAxAAATANBgkqhkiG9w0BAQQFADBEMQswCQYDVQQGEwJTRTEQMA4G
+-A1UECBMHVXBwc2FsYTEQMA4GA1UEBxMHVXBwc2FsYTERMA8GA1UEChMITXlTUUwg
+-QUIwHhcNMTAwMTI5MTE1MDIyWhcNMTUwMTI4MTE1MDIyWjAyMQswCQYDVQQGEwJT
+-RTEQMA4GA1UECBMHVXBwc2FsYTERMA8GA1UEChMITXlTUUwgQUIwgZ8wDQYJKoZI
+-hvcNAQEBBQADgY0AMIGJAoGBAMyaN0kTZtzP4wsToSPteNtOvRH2jA12+aMyVpr4
+-oSFqVU5NP+ZnnSaZss2kmtIrWVzXitNgaPgYvcW+FeEqPKPUYcv1EZQXgYH3h4z2
+-atLu2OZ39mJmTS4WjQiBSsnGSzHluceKhJZIp0eMDSaQVk7mpW6Ms/Kf/D14m0lu
+-hoN3AgMBAAEwDQYJKoZIhvcNAQEEBQADgYEAXh+jU18kExz4KDKwf2lp8w7ANIcQ
+-A33aFYu9GbgaVjHnhUmByX9FIHQ+icDgJoRRzAQWzmmZAeEmmbPj9b3sX6CE5Dja
+-dXh7iZzSzWCVILqO43zm33Y6fIl3ApSGETrEYX1vcYMhihf7F+LuAmthwbRSY9fY
+-RrLFnG84kYo1Mgs=
++MIIDETCCAfmgAwIBAgIBBjANBgkqhkiG9w0BAQUFADBEMQswCQYDVQQGEwJTRTEQ
++MA4GA1UECBMHVXBwc2FsYTEQMA4GA1UEBxMHVXBwc2FsYTERMA8GA1UEChMITXlT
++UUwgQUIwHhcNMTAwMjIwMDMwMzI2WhcNMzAwOTAzMDMwMzI2WjAyMQswCQYDVQQG
++EwJTRTEQMA4GA1UECBMHVXBwc2FsYTERMA8GA1UEChMITXlTUUwgQUIwgZ8wDQYJ
++KoZIhvcNAQEBBQADgY0AMIGJAoGBAMLnIM+JWS9ny0yf6BHyI+Xxse4/Zl/D9f0e
++Me6PTCq9wEqln8hE1XePFRtNeG6yokilJDMFQAKzwYeNWTwaB6qG8AThnCBLIjLE
++UZ5A5DHDV/WYvy6x/SxWv0nZm+cXzJVftQgZXp3fZSI5LEj7aZYxejVN3mC0wWAZ
++X5ZWflUZAgMBAAGjgaMwgaAwCQYDVR0TBAIwADAdBgNVHQ4EFgQUjRBnkTN2nALl
++eF3Yxe8llrLX+h8wdAYDVR0jBG0wa4AUsft+d7VAjWgRftkR5cPG2k2sUbChSKRG
++MEQxCzAJBgNVBAYTAlNFMRAwDgYDVQQIEwdVcHBzYWxhMRAwDgYDVQQHEwdVcHBz
++YWxhMREwDwYDVQQKEwhNeVNRTCBBQoIJAL5YrUwfPSWVMA0GCSqGSIb3DQEBBQUA
++A4IBAQCpiBA+XSpHKcgDJ3oxWo4QA7y1TjcdEnvrX1BxcLGjjpMOdxdsR7bJpE0q
++xDjwYVWyfyi6BnnuZxF91Ml/ChjIwcvQLPljD7tFyt7qu6wAAVJINisHK8hGx7Eh
++gb13OedMOaq9rGDYp7/PFJhKC6FAVQaNbzWpOaBxqZe6fHM8QbrFHBFLK0MdLbp7
++XxS1PWRiFTa0Fr14yEON+Ryl0qyhWHThmd6tBBlDqL0K/RmbUERGbRhVTb+0W6ST
++YsdkkWxUNNH48/8SbV+F5zWeXEKBXvvIu0RRmLLvG59aIncofdr7CMKUmg9CCJNU
++EB6t8k/8YphR6Zu5OpPZ5B8dxHbQ
+ -----END CERTIFICATE-----
+diff -Naur mysql-5.1.50.orig/mysql-test/std_data/client-key.pem mysql-5.1.50/mysql-test/std_data/client-key.pem
+--- mysql-5.1.50.orig/mysql-test/std_data/client-key.pem 2010-08-03 13:55:05.000000000 -0400
++++ mysql-5.1.50/mysql-test/std_data/client-key.pem 2010-08-27 23:42:05.752428395 -0400
+@@ -1,15 +1,15 @@
+ -----BEGIN RSA PRIVATE KEY-----
+-MIICXQIBAAKBgQDMmjdJE2bcz+MLE6Ej7XjbTr0R9owNdvmjMlaa+KEhalVOTT/m
+-Z50mmbLNpJrSK1lc14rTYGj4GL3FvhXhKjyj1GHL9RGUF4GB94eM9mrS7tjmd/Zi
+-Zk0uFo0IgUrJxksx5bnHioSWSKdHjA0mkFZO5qVujLPyn/w9eJtJboaDdwIDAQAB
+-AoGASqk/4We2En+93y3jkIO4pXafIe3w/3zZ7caRue1ehx4RUQh5d+95djuB9u7J
+-HEZ7TpjM7QNyao5EueL6gvbxt0LXFvqAMni7yM9tt/HUYtHHPqYiRtUny9bKYFTm
+-l8szCCMal/wD9GZU9ByHDNHm7tHUMyMhARNTYSgx+SERFmECQQD/6jJocC4SXf6f
+-T3LqimWR02lbJ7qCoDgRglsUXh0zjrG+IIiAyE+QOCCx1GMe3Uw6bsIuYwdHT6as
+-WcdPs04xAkEAzKulvEvLVvN5zfa/DTYRTV7jh6aDleOxjsD5oN/oJXoACnPzVuUL
+-qQQMNtuAXm6Q1QItrRxpQsSKbY0UQka6JwJBAOSgoNoG5lIIYTKIMvzwGV+XBLeo
+-HYsXgh+6Wo4uql3mLErUG78ZtWL9kc/tE4R+ZdyKGLaCR/1gXmH5bwN4B/ECQEBb
+-uUH8k3REG4kojesZlVc+/00ojzgS4UKCa/yqa9VdB6ZBz8MDQydinnShkTwgiGpy
+-xOoqhO753o2UT0qH8wECQQC99IEJWUnwvExVMkLaZH5NjAFJkb22sjkmuT11tAgU
+-RQgOMoDOm6driojnOnDWOkx1r1Gy9NgMLooduja4v6cx
++MIICWwIBAAKBgQDC5yDPiVkvZ8tMn+gR8iPl8bHuP2Zfw/X9HjHuj0wqvcBKpZ/I
++RNV3jxUbTXhusqJIpSQzBUACs8GHjVk8GgeqhvAE4ZwgSyIyxFGeQOQxw1f1mL8u
++sf0sVr9J2ZvnF8yVX7UIGV6d32UiOSxI+2mWMXo1Td5gtMFgGV+WVn5VGQIDAQAB
++AoGARXcXLKDpVooJ3W+IyQyiWsw//IhANpWjUOm4JiyQmxMyO+i4ACr4Yjpu7WI5
++MEseqAGj20NdwxjKO0PXsCIe5LmrGZ+SI8+CSERFOWXWRtCWz7y7SG30i1k6suvM
++mwqWom0tJLwn93uA1lm/WSwKQwUrJRahRQd3EaZqrl7DP5kCQQD/8gbuYAT5pxQe
++ULLGM0RvEsXxDYbEDxNbY5wrBazfklBwpumxZpFl6jEAT++7Kh2Ns3A7kB1oUNlA
++FPYr+dYPAkEAwvHEwRtoyUr8jqoqVVJWI76CDmBjEOzVeMKW97ztqbs2LxZW8dYI
++iOh/myFGpdoUwgu0U8w9MmXcj3ZeZCYKVwJALyQ+AJPw9qa+fuLwOq9gsHCtwrty
++EhSQxSlwrz/pWniRll439vPkXfgntF4E0t1r+hiN2Hqv3/HcQgBaYzkuIwJAG023
++bACFxaOuCeFFepvEms8E8jSHy4gQQhCnCl24v8wLw76SQN7kZSCDNtwLRBFuVNtE
++z3PMonFn2eQPRmGZkwJAP1c1BHprMQx/ruafdscROILv3JrH40C1bR6KVVBKt1dK
++Qpnpgi7hK5rUQjDF8k3bn9ugTt06jyeHe/QhAml0kg==
+ -----END RSA PRIVATE KEY-----
+diff -Naur mysql-5.1.50.orig/mysql-test/std_data/server-cert.pem mysql-5.1.50/mysql-test/std_data/server-cert.pem
+--- mysql-5.1.50.orig/mysql-test/std_data/server-cert.pem 2010-08-03 13:55:08.000000000 -0400
++++ mysql-5.1.50/mysql-test/std_data/server-cert.pem 2010-08-27 23:42:05.753428361 -0400
+@@ -1,41 +1,69 @@
+ Certificate:
+ Data:
+- Version: 1 (0x0)
+- Serial Number: 1048578 (0x100002)
+- Signature Algorithm: md5WithRSAEncryption
++ Version: 3 (0x2)
++ Serial Number: 4 (0x4)
++ Signature Algorithm: sha1WithRSAEncryption
+ Issuer: C=SE, ST=Uppsala, L=Uppsala, O=MySQL AB
+ Validity
+- Not Before: Jan 29 11:56:49 2010 GMT
+- Not After : Jan 28 11:56:49 2015 GMT
++ Not Before: Feb 20 02:55:06 2010 GMT
++ Not After : Sep 3 02:55:06 2030 GMT
+ Subject: C=SE, ST=Uppsala, O=MySQL AB, CN=localhost
+ Subject Public Key Info:
+ Public Key Algorithm: rsaEncryption
+- Public-Key: (512 bit)
+- Modulus:
+- 00:cd:e4:87:51:9d:72:11:a0:d1:fa:f3:92:8b:13:
+- 1c:eb:f7:e2:9a:2f:72:a8:d6:65:48:d1:69:af:1b:
+- c0:4c:13:e5:60:60:51:41:e9:ab:a6:bc:13:bb:0c:
+- 5e:32:7c:d9:6c:9e:cd:05:24:84:78:db:80:91:2e:
+- d8:88:2b:c2:ed
++ RSA Public Key: (1024 bit)
++ Modulus (1024 bit):
++ 00:e3:7d:4f:c2:23:77:a9:3a:2c:d2:69:59:a0:2f:
++ 4e:d1:51:4c:ae:8d:f5:17:cc:ce:58:9c:83:4f:0b:
++ a3:bb:29:a2:b8:1d:3e:1b:04:f9:a9:3e:e2:61:d0:
++ e6:7b:b9:7c:12:d8:1f:86:c9:53:b5:04:dd:df:26:
++ e9:c0:2b:de:4a:96:2e:f3:23:6f:79:6d:a9:d2:4e:
++ 17:af:2f:de:8b:68:44:ae:de:a3:e2:c4:37:1c:04:
++ ad:73:4b:85:f9:83:ac:fe:b7:c1:54:47:2e:96:d4:
++ 31:96:85:94:69:d6:5a:63:24:04:99:89:19:1d:56:
++ 8a:d1:77:aa:87:fb:38:cd:b7
+ Exponent: 65537 (0x10001)
+- Signature Algorithm: md5WithRSAEncryption
+- 73:ce:9c:6e:39:46:b4:14:be:da:3f:f3:1b:ba:90:bc:23:43:
+- d7:82:2a:70:4e:a6:d9:5a:65:5c:b7:df:71:df:75:77:c5:80:
+- a4:af:fa:d2:59:e2:fd:c9:9c:f0:98:95:8e:69:a9:8c:7c:d8:
+- 6f:48:d2:e3:36:e0:cd:ff:3f:d1:a5:e6:ab:75:09:c4:50:10:
+- c4:96:dd:bf:3b:de:32:46:da:ca:4a:f1:d6:52:8a:33:2f:ab:
+- f5:2e:70:3f:d4:9c:be:00:c8:03:f9:39:8a:df:5b:70:3c:40:
+- ef:03:be:7c:3d:1d:32:32:f3:51:81:e2:83:30:6e:3d:38:9b:
+- fb:3c
++ X509v3 extensions:
++ X509v3 Basic Constraints:
++ CA:FALSE
++ X509v3 Subject Key Identifier:
++ CC:8C:71:40:D0:0F:BF:D1:99:79:3F:1B:E9:10:76:19:67:36:0F:A3
++ X509v3 Authority Key Identifier:
++ keyid:B1:FB:7E:77:B5:40:8D:68:11:7E:D9:11:E5:C3:C6:DA:4D:AC:51:B0
++ DirName:/C=SE/ST=Uppsala/L=Uppsala/O=MySQL AB
++ serial:BE:58:AD:4C:1F:3D:25:95
++
++ Signature Algorithm: sha1WithRSAEncryption
++ 6f:ad:5e:59:fa:84:3a:be:e2:72:b1:e8:66:2a:4e:f8:73:19:
++ 11:06:11:92:78:56:3e:d6:e8:68:29:90:8b:59:d2:fe:aa:ae:
++ 25:59:c7:e9:99:bb:4a:06:43:dd:40:bd:cb:f4:ae:79:95:7d:
++ 8e:90:ef:58:d2:a8:fc:bf:07:f3:37:b2:9b:bd:da:e6:8c:56:
++ dd:5e:c6:4a:70:7c:3e:3d:a1:e8:35:06:b8:a7:7b:ac:26:85:
++ 54:5d:09:a2:7b:77:b4:17:7f:72:31:cb:ff:cc:67:6d:e6:3e:
++ c6:dc:96:eb:4a:0a:ae:e9:48:ae:8a:e0:d6:73:57:6e:32:4c:
++ 00:dc:28:da:55:b3:9f:9f:d8:98:cc:d9:f1:b6:b3:14:67:2e:
++ a1:47:1e:51:11:cf:70:9f:31:8f:ba:59:29:f2:d0:88:0b:e2:
++ 51:6b:f8:31:ed:6d:ac:00:5e:d3:78:4c:95:97:02:cc:74:2b:
++ 3b:c6:28:e6:2a:c3:30:99:35:b4:4d:31:46:d4:90:f2:47:ed:
++ 64:85:1a:75:2a:72:0a:2f:c6:3a:2f:d2:ac:6b:31:cc:e5:a8:
++ 07:c2:d6:22:f3:c6:0f:bf:67:d9:d6:b2:79:cd:48:b5:c3:e0:
++ e3:18:7f:b5:74:c9:43:19:fb:c4:93:29:ca:cc:90:2b:1b:6f:
++ 45:f6:25:f9
+ -----BEGIN CERTIFICATE-----
+-MIIBtzCCASACAxAAAjANBgkqhkiG9w0BAQQFADBEMQswCQYDVQQGEwJTRTEQMA4G
+-A1UECBMHVXBwc2FsYTEQMA4GA1UEBxMHVXBwc2FsYTERMA8GA1UEChMITXlTUUwg
+-QUIwHhcNMTAwMTI5MTE1NjQ5WhcNMTUwMTI4MTE1NjQ5WjBGMQswCQYDVQQGEwJT
+-RTEQMA4GA1UECBMHVXBwc2FsYTERMA8GA1UEChMITXlTUUwgQUIxEjAQBgNVBAMT
+-CWxvY2FsaG9zdDBcMA0GCSqGSIb3DQEBAQUAA0sAMEgCQQDN5IdRnXIRoNH685KL
+-Exzr9+KaL3Ko1mVI0WmvG8BME+VgYFFB6aumvBO7DF4yfNlsns0FJIR424CRLtiI
+-K8LtAgMBAAEwDQYJKoZIhvcNAQEEBQADgYEAc86cbjlGtBS+2j/zG7qQvCND14Iq
+-cE6m2VplXLffcd91d8WApK/60lni/cmc8JiVjmmpjHzYb0jS4zbgzf8/0aXmq3UJ
+-xFAQxJbdvzveMkbaykrx1lKKMy+r9S5wP9ScvgDIA/k5it9bcDxA7wO+fD0dMjLz
+-UYHigzBuPTib+zw=
++MIIDJTCCAg2gAwIBAgIBBDANBgkqhkiG9w0BAQUFADBEMQswCQYDVQQGEwJTRTEQ
++MA4GA1UECBMHVXBwc2FsYTEQMA4GA1UEBxMHVXBwc2FsYTERMA8GA1UEChMITXlT
++UUwgQUIwHhcNMTAwMjIwMDI1NTA2WhcNMzAwOTAzMDI1NTA2WjBGMQswCQYDVQQG
++EwJTRTEQMA4GA1UECBMHVXBwc2FsYTERMA8GA1UEChMITXlTUUwgQUIxEjAQBgNV
++BAMTCWxvY2FsaG9zdDCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA431PwiN3
++qTos0mlZoC9O0VFMro31F8zOWJyDTwujuymiuB0+GwT5qT7iYdDme7l8EtgfhslT
++tQTd3ybpwCveSpYu8yNveW2p0k4Xry/ei2hErt6j4sQ3HAStc0uF+YOs/rfBVEcu
++ltQxloWUadZaYyQEmYkZHVaK0Xeqh/s4zbcCAwEAAaOBozCBoDAJBgNVHRMEAjAA
++MB0GA1UdDgQWBBTMjHFA0A+/0Zl5PxvpEHYZZzYPozB0BgNVHSMEbTBrgBSx+353
++tUCNaBF+2RHlw8baTaxRsKFIpEYwRDELMAkGA1UEBhMCU0UxEDAOBgNVBAgTB1Vw
++cHNhbGExEDAOBgNVBAcTB1VwcHNhbGExETAPBgNVBAoTCE15U1FMIEFCggkAvlit
++TB89JZUwDQYJKoZIhvcNAQEFBQADggEBAG+tXln6hDq+4nKx6GYqTvhzGREGEZJ4
++Vj7W6GgpkItZ0v6qriVZx+mZu0oGQ91Avcv0rnmVfY6Q71jSqPy/B/M3spu92uaM
++Vt1exkpwfD49oeg1Brine6wmhVRdCaJ7d7QXf3Ixy//MZ23mPsbclutKCq7pSK6K
++4NZzV24yTADcKNpVs5+f2JjM2fG2sxRnLqFHHlERz3CfMY+6WSny0IgL4lFr+DHt
++bawAXtN4TJWXAsx0KzvGKOYqwzCZNbRNMUbUkPJH7WSFGnUqcgovxjov0qxrMczl
++qAfC1iLzxg+/Z9nWsnnNSLXD4OMYf7V0yUMZ+8STKcrMkCsbb0X2Jfk=
+ -----END CERTIFICATE-----
+diff -Naur mysql-5.1.50.orig/mysql-test/std_data/server-key.pem mysql-5.1.50/mysql-test/std_data/server-key.pem
+--- mysql-5.1.50.orig/mysql-test/std_data/server-key.pem 2010-08-03 13:55:08.000000000 -0400
++++ mysql-5.1.50/mysql-test/std_data/server-key.pem 2010-08-27 23:42:05.754428433 -0400
+@@ -1,9 +1,15 @@
+ -----BEGIN RSA PRIVATE KEY-----
+-MIIBOwIBAAJBAM3kh1GdchGg0frzkosTHOv34povcqjWZUjRaa8bwEwT5WBgUUHp
+-q6a8E7sMXjJ82WyezQUkhHjbgJEu2Igrwu0CAwEAAQJBAJuwhFbF3NzRpBbEmnqJ
+-4GPa1UJMQMLFJF+04tqj/HxJcAIVhOJhGmmtYNw1yjz/ZsPnfJCMz4eFOtdjvGtf
+-peECIQDmFFg2WLvYo+2m9w9V7z4ZIkg7ixYkI/ObUUctfZkPOQIhAOUWnrvjFrAX
+-bIvYT/YR50+3ZDLEc51XxNgJnWqWYl1VAiEAnTOFWgyivFC1DgF8PvDp8u5TgCt2
+-A1d1GMgd490O+TECIC/WMl0/hTxOF9930vKqOGf//o9PUGkZq8QE9fcM4gtlAiAE
+-iOcFpnLjtWj57jrhuw214ucnB5rklkQQe+AtcARNkg==
++MIICXgIBAAKBgQDjfU/CI3epOizSaVmgL07RUUyujfUXzM5YnINPC6O7KaK4HT4b
++BPmpPuJh0OZ7uXwS2B+GyVO1BN3fJunAK95Kli7zI295banSThevL96LaESu3qPi
++xDccBK1zS4X5g6z+t8FURy6W1DGWhZRp1lpjJASZiRkdVorRd6qH+zjNtwIDAQAB
++AoGAUb0o91y/FjMs/72S0pes/lDz+JRRSGfyjKxQEgrgndNsADOhqRu0iTdrKDJj
++XnlbN3ooecnFJfnFrvTQcJhSmlS30j6VrBw6LXpCBK3dvjYgJ9LOne7WK+dF1+vS
++FMQtsP04C56Sxy6HJDpMyWJ6oS3Bu169ygG2AxKo+Fk+E6ECQQD38w/MzmrARz2Z
++AGeEPDUnVZPYgtmXkmks95S0/2jSoLhmgpvJimzxwpYwVG/BG8dSDVuTDu5kp05D
++3bZIp3EzAkEA6uAwJsCZPtHXlWU3wYZJsA697rUNjPaCQOIaZ/lnh5RUHTmUiw1h
++Oj/VORqKB0kXqcDfawwLjZEvh1Xli+H5bQJBANTmhw2TvEPnp/OFTl1UGUvyBmXl
++TRMB639qAu07VfVtfYi/4ya1zn/0VmOfTOoigQ5qW9Q1AOu6YNCTQl62L9MCQQDc
++YfEsW2kvNYxYJHoVfuBjbuGuOnn1e1Oqd70ZND59S6NFLMMBWlORaVWzWACNZ3rp
++kAzSj6HDeqgjD2jsQONdAkEAt7S1YHUn8F760bRn4AnAto2TVOYdArtTP/wYjd4o
++9rJREO/d8AYkYJ96APLvF0SZ4n3t1pLwQRsKKN8ZGTmzLA==
+ -----END RSA PRIVATE KEY-----
+diff -Naur mysql-5.1.50.orig/mysql-test/std_data/server8k-cert.pem mysql-5.1.50/mysql-test/std_data/server8k-cert.pem
+--- mysql-5.1.50.orig/mysql-test/std_data/server8k-cert.pem 2010-08-03 13:55:08.000000000 -0400
++++ mysql-5.1.50/mysql-test/std_data/server8k-cert.pem 2010-08-27 23:43:00.005366270 -0400
+@@ -1,51 +1,69 @@
++Certificate:
++ Data:
++ Version: 3 (0x2)
++ Serial Number: 5 (0x5)
++ Signature Algorithm: sha1WithRSAEncryption
++ Issuer: C=SE, ST=Uppsala, L=Uppsala, O=MySQL AB
++ Validity
++ Not Before: Feb 20 03:00:54 2010 GMT
++ Not After : Sep 3 03:00:54 2030 GMT
++ Subject: C=SE, ST=Uppsala, O=MySQL AB, CN=server
++ Subject Public Key Info:
++ Public Key Algorithm: rsaEncryption
++ RSA Public Key: (1024 bit)
++ Modulus (1024 bit):
++ 00:c5:da:44:95:06:77:16:21:af:a0:c4:3c:e9:f8:
++ 1d:2d:95:f9:63:90:8c:3f:86:ba:77:76:4a:52:4b:
++ 6b:af:29:f5:1c:aa:d4:3f:3e:42:9f:6d:46:ba:86:
++ 90:b1:2d:cc:db:c6:33:15:a3:f4:af:53:33:4f:a1:
++ 56:d1:aa:3b:26:10:f7:64:b5:f9:bf:1b:b1:47:8e:
++ cc:a6:d6:0d:aa:4a:77:e3:a3:63:9d:2a:dc:65:f4:
++ 7f:91:17:38:2d:d6:cd:4e:8d:53:52:97:6e:87:fc:
++ 64:60:a6:a1:00:ac:96:6c:e4:42:94:75:17:46:6f:
++ 91:b5:dd:06:47:ed:05:e3:db
++ Exponent: 65537 (0x10001)
++ X509v3 extensions:
++ X509v3 Basic Constraints:
++ CA:FALSE
++ X509v3 Subject Key Identifier:
++ 6E:60:3F:29:13:60:99:ED:0C:F7:15:B5:DB:7B:1C:FB:6F:60:19:ED
++ X509v3 Authority Key Identifier:
++ keyid:B1:FB:7E:77:B5:40:8D:68:11:7E:D9:11:E5:C3:C6:DA:4D:AC:51:B0
++ DirName:/C=SE/ST=Uppsala/L=Uppsala/O=MySQL AB
++ serial:BE:58:AD:4C:1F:3D:25:95
++
++ Signature Algorithm: sha1WithRSAEncryption
++ 63:2e:0f:07:14:06:cf:74:90:3d:37:42:f2:48:70:60:21:bc:
++ 34:52:31:f1:87:70:d2:b2:fb:ff:13:38:dc:f0:5e:43:d7:ee:
++ a7:c7:1f:ac:aa:d2:8c:4f:fa:3c:4c:73:f6:b6:c2:0c:a0:ea:
++ a2:c9:e2:73:61:c3:2e:78:40:0f:2a:d3:63:50:9b:b8:f9:89:
++ 40:ed:98:08:97:c3:07:24:17:34:b5:78:89:0a:bb:83:4c:e2:
++ 5c:2e:13:d6:21:30:ad:30:48:b5:70:12:ff:4a:6f:42:f0:f8:
++ 9f:b1:4b:bd:89:2b:f0:9d:e2:49:2b:35:69:18:1f:76:40:b4:
++ 76:bd:cb:dd:27:2f:c0:c1:e2:33:3e:6e:df:68:54:19:92:8a:
++ bb:13:9c:cf:d6:17:56:da:bf:0d:64:70:3a:45:b7:aa:5f:e3:
++ f5:96:ae:34:f2:17:37:27:d0:4b:e8:30:4a:c0:02:42:e2:d2:
++ 30:eb:eb:c7:d7:ec:d8:df:5c:43:58:e2:6f:b7:58:54:0d:c4:
++ 01:71:2d:59:8f:44:c7:a1:6c:0b:41:28:fa:b7:63:a7:68:d3:
++ 4f:c3:0f:17:9e:b2:32:50:e6:0b:87:3d:e2:39:47:c0:d8:0a:
++ 3b:f6:af:50:68:0f:9d:ef:6e:34:0d:3a:07:94:f8:a4:d7:24:
++ 86:32:d3:b4
+ -----BEGIN CERTIFICATE-----
+-MIIJFDCCBPwCAQEwDQYJKoZIhvcNAQEEBQAwTjELMAkGA1UEBhMCU0UxEDAOBgNV
+-BAgTB1VwcHNhbGExETAPBgNVBAoTCE15U1FMIEFCMQ0wCwYDVQQLEwRUZXN0MQsw
+-CQYDVQQDEwJDQTAeFw0xMDA3MjgxNDA3MjhaFw0xODEwMTQxNDA3MjhaMFIxCzAJ
+-BgNVBAYTAlNFMRAwDgYDVQQIEwdVcHBzYWxhMREwDwYDVQQKEwhNeVNRTCBBQjEN
+-MAsGA1UECxMEVGVzdDEPMA0GA1UEAxMGc2VydmVyMIIEIjANBgkqhkiG9w0BAQEF
+-AAOCBA8AMIIECgKCBAEA6h3v1OWb9I9U/Z8diBu/xYGS8NCTD3ZESboHxVI2qSEC
+-PgxNNcG8Lh0ktQdgYcOe64MnDTZX0Bibm47hoDldrAlTSffFxQhylqBBoXxDF+Lr
+-hXIqCz7K0PsK+bYusL9ezJ7PETDnCT7oy95q4GXbKsutbNsm9if4ZE41gs2KnoU2
+-DA7kvMmkKojrMIL4+BqTXA20LLo0iSbgvUTvpSJw4u96BeyzMNnxK2wP5vvTtUo5
+-hACbfU87YjaSKs+q2VXCzfyYGZk1L1xk5GUI0bP+jutf1dDzNttW2/q2Nf5rxx09
+-Gh/GwmOnEk1O7cOZ8VQCsOHirIM39NuSARsY6Y3G5XM4k2W4nxyR/RtdG9bvs/33
+-aGsZ5V5yp7WSs8s9HHwaCPSsUiLKckQ7uA0TTRgbeweMrrLKovG57jsbBBB8pQD4
+-PRd31qgxCdstWXHiWwRyI8vOLWENPXPFqA/rJwwqNdWTogy38aqVXxGYR8PIwjA2
+-OaIwFjwGZcsPNLqw6bgAN8O2UBqZHWiMF8mi7brvioDvAIufZuqa2SqT/At45H83
+-psQ6R4FsxZt6SAK7EsdPo8OYTrY1i4iPZd/eKhnEu2srEZgsKRwY5H1mvDH5fWCc
+-HSFu07sWmlmK6Or65Fsa0IaKLJiQDVVETd6xrI0wkM4AOcbKDrS7aywJ426dopbs
+-+LFdt4N0cdII4gBgJAfLuuA2yrDXRq4P6cgpVMy0R+0dEYE8zzm8zf1a+Ud273LS
+-9+LB+LJKwqbW8nOPBoiekimIKfJYoOA4+C/mAjsYl1sVjjEhXJAs9S9L2UvnUk1P
+-sZi4UKHI6eAIEl7VM1sQ4GbdZ0px2dF2Ax7pGkhD+DLpYyYkCprharKZdmuUNLUd
+-NhXxi/HSEiE+Uy+o8RIzmH7LuROl/ZgnfHjJEiBLt2qPvwrwYd4c3XuXWs4YsWfV
+-JTt8Mx2ihgVcdGy9//shCSmgJwR1oWrhgC10AEL2fKeRnYUal1i+IxFPp7nb8uwx
+-UADgR0cY4A3qR/JP489QFIcxBTVs65De+Bq3ecnujk6yeGpD9iptonq4Y8uNZMc1
+-kOE7GiFGwR4EufT5SEMh+tUkjth2r+842vmZZuxrVQaohDiATmIJA07W51zKH+nQ
+-uw4qVKnAhPaDLCLc7YMIH9JcmkeQX0nf8/S2O2WYDH8glVDi5hfW08tCmV647vRY
+-nTIywUTO0lFpz7M+VyMNaJ6yXU6biBV5hLAI8C5ldr/SWI789W2+ebBaJ9gfK+PT
+-trohFSK37GcoSH4V6qSLJHCBASEsiddqHIHMLJZRYD+B6J3tLhjVUM43u+MEGbFT
+-d33ZDke/WzLTExWkaOv36e67gDBmgDuj9yroq3wGfwIDAQABMA0GCSqGSIb3DQEB
+-BAUAA4IEAQCc9RBhRbuWlmRZPZkqIdi5/+enyjoMmOa6ryJPxFSP8D2jrlHgQsk1
+-+GsJmPFT3rwWfoGAQu/aeSX4sp8OhKVJtqNA6MJrGYnZIMolgYa1wZPbkjJsdEfi
+-UsZdIB0n2+KA0xwEdGPdkGCfNPBtOg557DkcyEvsIZ9ELp4Pp2XzWRhyFGasJZc4
+-YwgD/3K2rpOPZoMkBKeKqV19j41OfLKGBVyuaqzitbu9+KT4RU1ibr2a+UuFCwdT
+-oqyN7bfWXjcjXOMkxCsOmLfKmqQxs7TEOVrYPTdYjamDxLy/e5g5FgoCxGY8iil0
+-+YFLZyH6eEx/Os9DlG/M3O1MeRD9U97CdsphbDVZIDyWw5xeX8qQHJe0KSprAgiG
+-TLhTZHeyrKujQCQS1oFFmNy4gSqXt0j1/6/9T80j6HeyjiiYEaEQK9YLTAjRoA7W
+-VN8wtHI5F3RlNOVQEJks/bjdlpLL3VhaWtfewGh/mXRGcow84cgcsejMexmhreHm
+-JfTUl9+X1IFFxGq2/606A9ROQ7kN/s4rXu7/TiMODXI/kZijoWd2SCc7Z0YWoNo7
+-IRKkmZtrsflJbObEuK2Jk59uqzSxyQOBId8qtbPo8qJJyHGV5GCp34g4x67BxJBo
+-h1iyVMamBAS5Ip1ejghuROrB8Hit8NhAZApXju62btJeXLX+mQayXb/wC/IXNJJD
+-83tXiLfZgs6GzLAq7+KW/64sZSvj87CPiNtxkvjchAvyr+fhbBXCrf4rlOjJE6SH
+-Je2/Jon7uqijncARGLBeYUT0Aa6k1slpXuSKxDNt7EIkP21kDZ5/OJ0Y1u587KVB
+-dEhuDgNf2/8ij7gAQBwBoZMe1DrwddrxgLLBlyHpAZetNYFZNT+Cs/OlpqI0Jm59
+-kK9pX0BY4AGOd23XM3K/uLawdmf67kkftim7aVaqXFHPiWsJVtlzmidKvNSmbmZe
+-dOmMXp6PBoqcdusFVUS7vjd3KAes5wUX/CaTyOOPRu0LMSnpwEnaL76IC9x4Jd6d
+-7QqY/OFTjpPH8nP57LwouiT6MgSUCWGaOkPuBJ9w9sENSbbINpgJJ42iAe2kE+R7
+-qEIvf/2ETCTseeQUqm2nWiSPLkNagEh6kojmEoKrGyrv3YjrSXSOY1a70tDVy43+
+-ueQDQzNZm3Q7inpke2ZKvWyY0LQmLzP2te+tnNBcdLyKJx7emPRTuMUlEdK7cLbt
+-V3Sy9IKtyAXqqd66fPFj4NhJygyncj8M6CSqhG5L0GhDbkA8UJ8yK/gfKm3h5xe2
+-utULK5VMtAhQt6cVahO59A9t/OI17y45bmlIgdlEQISzVFe9ZbIUJW44zBfPx74k
+-/w8pMRr8gEuRqpL2WdJiKGG6lhMHLVFo
++MIIDIjCCAgqgAwIBAgIBBTANBgkqhkiG9w0BAQUFADBEMQswCQYDVQQGEwJTRTEQ
++MA4GA1UECBMHVXBwc2FsYTEQMA4GA1UEBxMHVXBwc2FsYTERMA8GA1UEChMITXlT
++UUwgQUIwHhcNMTAwMjIwMDMwMDU0WhcNMzAwOTAzMDMwMDU0WjBDMQswCQYDVQQG
++EwJTRTEQMA4GA1UECBMHVXBwc2FsYTERMA8GA1UEChMITXlTUUwgQUIxDzANBgNV
++BAMTBnNlcnZlcjCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAxdpElQZ3FiGv
++oMQ86fgdLZX5Y5CMP4a6d3ZKUktrryn1HKrUPz5Cn21GuoaQsS3M28YzFaP0r1Mz
++T6FW0ao7JhD3ZLX5vxuxR47MptYNqkp346NjnSrcZfR/kRc4LdbNTo1TUpduh/xk
++YKahAKyWbORClHUXRm+Rtd0GR+0F49sCAwEAAaOBozCBoDAJBgNVHRMEAjAAMB0G
++A1UdDgQWBBRuYD8pE2CZ7Qz3FbXbexz7b2AZ7TB0BgNVHSMEbTBrgBSx+353tUCN
++aBF+2RHlw8baTaxRsKFIpEYwRDELMAkGA1UEBhMCU0UxEDAOBgNVBAgTB1VwcHNh
++bGExEDAOBgNVBAcTB1VwcHNhbGExETAPBgNVBAoTCE15U1FMIEFCggkAvlitTB89
++JZUwDQYJKoZIhvcNAQEFBQADggEBAGMuDwcUBs90kD03QvJIcGAhvDRSMfGHcNKy
+++/8TONzwXkPX7qfHH6yq0oxP+jxMc/a2wgyg6qLJ4nNhwy54QA8q02NQm7j5iUDt
++mAiXwwckFzS1eIkKu4NM4lwuE9YhMK0wSLVwEv9Kb0Lw+J+xS72JK/Cd4kkrNWkY
++H3ZAtHa9y90nL8DB4jM+bt9oVBmSirsTnM/WF1bavw1kcDpFt6pf4/WWrjTyFzcn
++0EvoMErAAkLi0jDr68fX7NjfXENY4m+3WFQNxAFxLVmPRMehbAtBKPq3Y6do00/D
++DxeesjJQ5guHPeI5R8DYCjv2r1BoD53vbjQNOgeU+KTXJIYy07Q=
+ -----END CERTIFICATE-----
+diff -Naur mysql-5.1.50.orig/mysql-test/std_data/server8k-key.pem mysql-5.1.50/mysql-test/std_data/server8k-key.pem
+--- mysql-5.1.50.orig/mysql-test/std_data/server8k-key.pem 2010-08-03 13:55:08.000000000 -0400
++++ mysql-5.1.50/mysql-test/std_data/server8k-key.pem 2010-08-27 23:43:10.165365998 -0400
+@@ -1,99 +1,15 @@
+ -----BEGIN RSA PRIVATE KEY-----
+-MIISKQIBAAKCBAEA6h3v1OWb9I9U/Z8diBu/xYGS8NCTD3ZESboHxVI2qSECPgxN
+-NcG8Lh0ktQdgYcOe64MnDTZX0Bibm47hoDldrAlTSffFxQhylqBBoXxDF+LrhXIq
+-Cz7K0PsK+bYusL9ezJ7PETDnCT7oy95q4GXbKsutbNsm9if4ZE41gs2KnoU2DA7k
+-vMmkKojrMIL4+BqTXA20LLo0iSbgvUTvpSJw4u96BeyzMNnxK2wP5vvTtUo5hACb
+-fU87YjaSKs+q2VXCzfyYGZk1L1xk5GUI0bP+jutf1dDzNttW2/q2Nf5rxx09Gh/G
+-wmOnEk1O7cOZ8VQCsOHirIM39NuSARsY6Y3G5XM4k2W4nxyR/RtdG9bvs/33aGsZ
+-5V5yp7WSs8s9HHwaCPSsUiLKckQ7uA0TTRgbeweMrrLKovG57jsbBBB8pQD4PRd3
+-1qgxCdstWXHiWwRyI8vOLWENPXPFqA/rJwwqNdWTogy38aqVXxGYR8PIwjA2OaIw
+-FjwGZcsPNLqw6bgAN8O2UBqZHWiMF8mi7brvioDvAIufZuqa2SqT/At45H83psQ6
+-R4FsxZt6SAK7EsdPo8OYTrY1i4iPZd/eKhnEu2srEZgsKRwY5H1mvDH5fWCcHSFu
+-07sWmlmK6Or65Fsa0IaKLJiQDVVETd6xrI0wkM4AOcbKDrS7aywJ426dopbs+LFd
+-t4N0cdII4gBgJAfLuuA2yrDXRq4P6cgpVMy0R+0dEYE8zzm8zf1a+Ud273LS9+LB
+-+LJKwqbW8nOPBoiekimIKfJYoOA4+C/mAjsYl1sVjjEhXJAs9S9L2UvnUk1PsZi4
+-UKHI6eAIEl7VM1sQ4GbdZ0px2dF2Ax7pGkhD+DLpYyYkCprharKZdmuUNLUdNhXx
+-i/HSEiE+Uy+o8RIzmH7LuROl/ZgnfHjJEiBLt2qPvwrwYd4c3XuXWs4YsWfVJTt8
+-Mx2ihgVcdGy9//shCSmgJwR1oWrhgC10AEL2fKeRnYUal1i+IxFPp7nb8uwxUADg
+-R0cY4A3qR/JP489QFIcxBTVs65De+Bq3ecnujk6yeGpD9iptonq4Y8uNZMc1kOE7
+-GiFGwR4EufT5SEMh+tUkjth2r+842vmZZuxrVQaohDiATmIJA07W51zKH+nQuw4q
+-VKnAhPaDLCLc7YMIH9JcmkeQX0nf8/S2O2WYDH8glVDi5hfW08tCmV647vRYnTIy
+-wUTO0lFpz7M+VyMNaJ6yXU6biBV5hLAI8C5ldr/SWI789W2+ebBaJ9gfK+PTtroh
+-FSK37GcoSH4V6qSLJHCBASEsiddqHIHMLJZRYD+B6J3tLhjVUM43u+MEGbFTd33Z
+-Dke/WzLTExWkaOv36e67gDBmgDuj9yroq3wGfwIDAQABAoIEAQCSt6YoZqigz/50
+-XvYT6Uf6T6S1lBDFXNmY1qOuDkLBJTWRiwYMDViQEaWCaZgGTKDYeT3M8uR/Phyu
+-lRFi5vCEMufmcAeZ3hxptw7KU+R8ILJ207/zgit6YglTys9h5txTIack39+6FJmx
+-wbZ64HpETJZnpMO6+fuZaMXyLjuT8mmXjvHcOgXOvjWeFkZOveDhjJkAesUXuqyX
+-EI+ajoXuQiPXeKonkD2qd7NTjzfy4gw/ZF4NXs0ZVJeviqtIPo2xp33udOw2vRFh
+-bMvlF4cNLAbIKYVyOG0ruOfd2I7Unsc/CvD1u5vlRVuUd8OO0JZLIZR7hlRX+A58
+-8O1g2H/wJZAsF1BnLnFzDGYCX2WjCCK3Zn85FkKGRa0lTdYDduad/C/N3Y2/pHFE
+-e7U/2D7IkEei59tD2HcsDBB3MJnckkn/hyiL9qWcxqWZ61vurE+XjU6tc6fnfhk9
+-pJQ6yU3epPU7Vfsk0UGA7bbgKpsyzyH8Zl76YC2mN2ZVJjZekfhY+ibT9odEPdOl
+-yLB5iXA6/WhKkDWaOqZGOH+7MblWgT9wHINlcn+nKzOr00JHl26ac6aMlXXi9vbe
+-4jgJbFK1HYlFIndyX/BdqRTsFemDoDrVqrEYsaONoVYDd9c5qrqYOeh34DhOksQW
+-hNwWBfmMlfzgOGtCYhMeK+AajqTtUbMYQA6qp47KJd/Oa5Dvi3ZCpvZh3Ll5iIau
+-rqCtmojsWCqmpWSu7P+Wu4+O3XkUMPdQUuQ5rJFESEBB3yEJcxqk/RItTcKNElNC
+-PASrPrMD9cli7S/pJ+frbhu1Gna1ArXzXQE9pMozPaBpjCig7+15R0lL3pmOKO6e
+-WK3dgSwrnW6TQdLPlSD4lbRoiIdTHVBczztDeUqVvFiV3/cuaEi1nvaVdAYLqjuL
+-ogK4HwE/FQ54S0ijAsP52n25usoH6OTU3bSd/7NTp0vZCy3yf10x7HUdsh2DvhRO
+-3+TSK5t0yz0Nt7hNwcI6pLmWUIYcZgpFc/WsiiGscTfhy8rh3kRHI8ylGq53KNF+
+-yCVmjqnBRWs91ArxmeF1ctX2t3w5p7gf65hJWqoX/2DiSi5FBsr6HLxa5sUi4wRZ
+-136aCNt5Wu7w+AzPDbQW6qKUGSyfHJAw4JZasZcaZLise5IWb1ks0DtFbWWdT3ux
+-8r2AM7IO1WopnekrYCnx/aBvBAv4NjWozVA517ztVttPERt3AGb4nm387nYt5R2U
+-NO2GBWcDyT8JQLKmffE1AkWolCR1GsvcNLQfLCbnNppgsnsLE/viTG4mq1wjnd8O
+-2Q8nH1SVTuyGFREMp/zsiAEaGfdd0hI2r1J7OdNPBBCtmhITsy9ZYHqm5vrGvy3s
+-vi2GuB2RAoICAQD/oWUsg4eTJxHifTJLz/tVSTXnw7DhfbFVa1K1rUV63/MRQAFW
+-pabN4T6Yfp3CpdRkljCA8KPJZj7euwhm4OEg1ulpOouA+cfWlE9RFE8wyOK5SYwM
+-k+nk31P9MUC866pZg/ghzBGDub91OW1+ZGEtqnLI/n/LhiAIWt0hJvgZclTc1cAL
+-xffHVlFwoSyNl/nc3ueZCC95nOLst2XcuxZLLbOFtZCmDYsp49q/Jn6EFjn4Ge2o
+-qp38z6eZgDMP1F4lb9nDqXPHfUSt2jxKlmpfXS+IPKdba67+EjhbtmUYzaR4EoPI
+-zh+o6SrVWT6Yve7KGiYv06fuRz1m/lLQO/Arbd9ntSjgn+ZEXGOkbhnHUX3DJ4ny
+-/6XEGB9NLQjern4uNTn0AaV+uvhncapFMaIBnVfq0Cw8eog0136PBYRaVX7T44j5
+-HwIyGXWtYGA/SzDEQoksD0Y/T61BEGnLZaKeavNd82WwFvcYHZtE0J4aQGjCEE7N
+-+nijzCy+j5ETmme9KJvQHpEyXP3N4RBko1eWvyTwFZDdIXtoa6TTEI51lm+FXJ/b
+-Y+BzMr6KRo29FB+7//1ptUoMvn5hzL0PwOv2ZSTQuoG5hLDEbxWXLNhd1VHcfznF
+-3EZHwfD2F8aGQ3kz+fkMTNfK955KorDrmLgvmV9eZZ5yQxGZrs5H5YfKpwKCAgEA
+-6nSUbzfSdVFUH89NM5FmEJgkD06vqCgHl2mpyF+VmDGcay4K06eA4QbRO5kns13+
+-n6PcBl/YVW/rNE8iFi+WxfqUpAjdR1HlShvTuTRVqtFTfuN8XhbYU6VMjKyuE0kd
+-LKe3KRdwubjVNhXRZLBknU+3Y/4hnIR7mcE3/M5Zv5hjb7XnwWg/SzxV9WojCKiu
+-vQ7cXhH5/o7EuKcl1d6vueGhWsRylCG9RimwgViR2H7zD9kpkOc0nNym9cSpb0Gv
+-Lui4cf/fVwIt2HfNEGBjbM/83e2MH6b8Xp1fFAy0aXCdRtOo4LVOzJVAxn5dERMX
+-4JJ4d5cSFbssDN1bITOKzuytfBqRIQGNkOfizgQNWUiaFI0MhEN/icymjm1ybOIh
+-Gc9tzqKI4wP2X9g+u3+Oof1QaBcZ4UbZEU9ITN87Pa6XVJmpNx7A81BafWoEPFeE
+-ahoO4XDwlHZazDuSlOseEShxXcVwaIiqySy7OBEPBVuYdEd2Qw/z3JTx9Kw8MKnf
+-hu+ar5tz5dPnJIsvLeYCcJDe/K6loiZuHTtPbWEy9p6It7qubQNPBvTSBN5eVDKc
+-Q2bTQNCx8SAAA9C5gJiwWoQKsXJzbRFRY77P9JjuGpua3YJ2nYBHEJmF+fp1R33c
+-uHIyMphPMkKC4GC3/43kkMr6tck8kZbXGSYsLsBr2GkCggIBAJvvrjILQianzKcm
+-zAmnI6AQ+ssYesvyyrxaraeZvSqJdlLtgmOCxVANuQt5IW9djUSWwZvGL4Np1aw0
+-15k6UNqhftzsE7FnrVneOsww4WXXBUcV8FKz4Bf3i9qFswILmGzmrfSf8YczRfGS
+-SJKzVPxwX3jwlrBmbx/pnb7dcLbFIbNcyLvl1ZJJu4BDMVRmgssTRp/5eExtQZg4
+-//A4SA8wH7TO3yAMXvn8vrGgH8kfbdlEp88d1SYk3g4rP/rGB3A63NIYikIEzmJn
+-ICQ3wUfPJnGq3kRMWgEuyCZaCy2oNE3yrWVPJ8z3/2MJ/79ZDVNHxEeki2o1FuW+
+-+nGAPq+fZIp03iy4HdVRro7dgugtc9QaSHJtNId8V4vSjviX5Oz3FxUb9AJst58S
+-nVV8Q2FMxBa/SlzSOkhRtCg2q1gXkzhaMnIVUleRZFGQ2uWBToxKMjcoUifIyN1J
+-z999bkfI4hBLq5pRSAXz+YVu5SMKa10GaawIwJLat+i+1zboF6QyI2o/Wz8nrsNq
+-KX/ajFGu5C94WFgsVoWKNI90KBLe48Ssje9c68waBlV/WHMg1YLvU3yqVDOV+K5c
+-IHB9tPMnG+AgBYZPxSzuvnLrrkj/GeKx0WI7TrvzOLRGKJo6irMEJ8IzFegASRUq
+-TVZKYQDYRG7m+lKlSxU+pyMAh2c9AoICAE4kavCip1eIssQjYLTGSkFPo/0iGbOv
+-G9CgXAE3snFWX67tWphupKrbjdMSWcQTmPD2OTg6q6zWL4twsIi6dcMooHAHsFC7
+-//LyUV/SDJdxSyXohiQJ8zH1zwy35RDydnHSuF5OvLh53T44iWDI1dAEqLgAFI3J
+-LjTxzEpLMGiGTuYFt+ejai0WQAQayvBw4ESM9m+4CB2K0hBFTXv5y5HlnNTW0uWC
+-VUZUUMrbjUieDz8B/zOXi9aYSGFzmZFGUDAPSqJcSMEELemPDF7f8WNr8vi42tIV
+-4tlaFD1nep4F9bWMiCXU6B2RxVQi+7vcJEIqL1KUnGd3ydfD00K+ng4Xnj7Vz/cz
+-QE7CqrpFaXmPlCMzW6+dm51/AyhHXDLkL2od05hiXcNkJ7KMLWRqwExHVIxM3shR
+-x7lYNl3ArUsCrNd6m4aOjnrKFk7kjeLavHxskPccoGKrC9o0JMfTkWLgmuBJFQ0S
+-N/HzIbcvIFWF0Ms4ojb50yp6ziXhXfJOO/0KUQEki71XIhvw89mVZszDzD5lqzjf
+-HCZMBU4MbmL6NdEevFIDH0zPPkx3HPNtJt3kIJbit9wI8VhUMe+ldGnGxpWb8tKw
+-SfM3vrHkYr+lizk26XfXMFhdAuVtT7dzQKSNEyP/1a2Hs307Xzgiv8JulJ8QIkrX
+-/nsYWPOAGLG5AoICABmdW9Ppkvuhb1AEcjTWb+XCyopoBc6vit/uQWD9uO+CeX7a
+-cfzq+iH01CAjyVMc4E1JDc5Lpi106U+GRGcAAaPJB2Sp5NznoxaOVrb71blu4Q4x
+-bNjtKM/P/DXpO+yJYoOPdKtaSDhtnfNDM7H/jztJ3XIrOltKA7CcRDohbBWIx8Q0
+-0uEpvfFpZZBco3yVmjP0RLgIVYn/ZDj9wGhSvFWIJ5vv6GXmtDrcHGMLxcfv7t76
+-UVcMW/Yy4mYJRCzGOrWagyVijJ6MTVNciqadWcH1KcbB3EGoMFYMn61or2qJABPM
+-xz89IlhnROU1Re3X/QRx5t86cw6oa+FqrWMOhSs31I0dNWSuS/xDympG27YIYSDd
+-mv5seT78GjFmMJC5pPOLoXsbTPB0HpsX2/UL/w/eRAfilTOef/Cf9VE5MP/C2YR7
+-NBxUU7/+21D6WvdtBTcZbrXWGroAo8zPP+PwX0+c6WoAvqDJvCPndp8xZhSgEJN/
+-0kScptezi8n3ZHI95EA9U5mAHxHz0IhDDVzWw/z1f1SBPxKVX3+By3zaa3lrD2ch
+-cHq7nBkX72veEevnHUY8Z2rHE2G2jdmRfOtwm4sjL0VBV9fRRoxzJWRduKyeOtDL
+-EhhBhUoTrT48UnfW9hxnbNLB9P/hh+UJu9HrS2uAwHoGE1+8gcyundupGDBn
++MIICXgIBAAKBgQDF2kSVBncWIa+gxDzp+B0tlfljkIw/hrp3dkpSS2uvKfUcqtQ/
++PkKfbUa6hpCxLczbxjMVo/SvUzNPoVbRqjsmEPdktfm/G7FHjsym1g2qSnfjo2Od
++Ktxl9H+RFzgt1s1OjVNSl26H/GRgpqEArJZs5EKUdRdGb5G13QZH7QXj2wIDAQAB
++AoGBAJLCjh7Q9eLnx+QDzH9s+Q/IcH4nSbERmh1lFEopAc6j29qQ6PGkmDy0DUPs
++70VOCOh5A4mo3aZzm9sUfVb24/nRtmyTP/AtMuIVGCsUqzI28dJRGvRlY0aSQG/C
++ILqMP69kiMNGBvuyEIiJhisOmMvDFEp7HrrXHJM9qcc217DpAkEA4nzJ9yyy2e4O
++r6/D711hdfcU/F+ktXw+pL77kSSdTABUap92Uv2RL36UA4q5h8RNvq/GrzMNm6Ye
++u2IMvBCiTQJBAN+iRbiMJCSitTg5YVMluVbT87co7jbTqk7LN1ujyIFEklm4xlHG
++DLJNgEoDR7QJtAkL++FyogC4zsQsey5voscCQQCp54trTbDuI9QIoAaQrrDKWgz4
++NpfNPeOQm2UFQT5vIWAyjGWrZGViB8bp0UvVOcJI5nxaOiZfOYOcdrWu75uRAkAn
++67zMc9/j1lPJRJz2Dc7nDBD+ikTz7pcBV897AWLCiK4jbBOi91q+3YzgKXO8VNsZ
++nlUJasA2psbqSBJ5OJ5zAkEA2UxoMju54hASjT54Z92IzraVw4Vo8CYwOcw5fr7z
+++m5xg1mmWdLBclmZ+WjARzDuTHIW6u/WCxNGg42AykWzfw==
+ -----END RSA PRIVATE KEY-----
diff --git a/packaging/rpm-uln/mysql-install-test.patch b/packaging/rpm-uln/mysql-install-test.patch
new file mode 100644
index 00000000000..5980aea6a9f
--- /dev/null
+++ b/packaging/rpm-uln/mysql-install-test.patch
@@ -0,0 +1,33 @@
+Improve the documentation that will be installed in the mysql-test RPM.
+
+
+diff -Naur mysql-5.1.43.orig/mysql-test/README mysql-5.1.43/mysql-test/README
+--- mysql-5.1.43.orig/mysql-test/README 2010-01-15 12:14:43.000000000 -0500
++++ mysql-5.1.43/mysql-test/README 2010-02-13 21:18:06.000000000 -0500
+@@ -6,6 +6,16 @@
+ actually have a co-existing MySQL installation. The tests will not
+ conflict with it.
+
++For use in Red Hat distributions, you should run the script as user mysql,
++so the best bet is something like
++ cd /usr/share/mysql-test
++ sudo -u mysql ./mysql-test-run
++This will use the installed mysql executables, but will run a private copy
++of the server process (using data files within /usr/share/mysql-test),
++so you need not start the mysqld service beforehand.
++To clean up afterwards, remove the created "var" subdirectory, eg
++ sudo -u mysql rm -rf /usr/share/mysql-test/var
++
+ All tests must pass. If one or more of them fail on your system, please
+ read the following manual section for instructions on how to report the
+ problem:
+@@ -25,7 +35,8 @@
+
+ With no test cases named on the command line, mysql-test-run falls back
+ to the normal "non-extern" behavior. The reason for this is that some
+-tests cannot run with an external server.
++tests cannot run with an external server (because they need to control the
++options with which the server is started).
+
+
+ You can create your own test cases. To create a test case, create a new
diff --git a/packaging/rpm-uln/mysql-strmov.patch b/packaging/rpm-uln/mysql-strmov.patch
new file mode 100644
index 00000000000..a144d0936e4
--- /dev/null
+++ b/packaging/rpm-uln/mysql-strmov.patch
@@ -0,0 +1,32 @@
+Remove overly optimistic definition of strmov() as stpcpy().
+
+mysql uses this macro with overlapping source and destination strings,
+which is verboten per spec, and fails on some Red Hat platforms.
+Deleting the definition is sufficient to make it fall back to a
+byte-at-a-time copy loop, which should consistently give the
+expected behavior.
+
+Note: the particular case that prompted this patch is reported and fixed
+at http://bugs.mysql.com/bug.php?id=48864. However, my faith in upstream's
+ability to detect this type of error is low, and I also see little evidence
+of any real performance gain from optimizing these calls. So I'm keeping
+this patch.
+
+
+diff -Naur mysql-5.1.37.orig/include/m_string.h mysql-5.1.37/include/m_string.h
+--- mysql-5.1.37.orig/include/m_string.h 2009-07-13 19:08:50.000000000 -0400
++++ mysql-5.1.37/include/m_string.h 2009-08-31 21:49:49.000000000 -0400
+@@ -81,13 +81,6 @@
+ extern void *(*my_str_malloc)(size_t);
+ extern void (*my_str_free)(void *);
+
+-#if defined(HAVE_STPCPY)
+-#define strmov(A,B) stpcpy((A),(B))
+-#ifndef stpcpy
+-extern char *stpcpy(char *, const char *); /* For AIX with gcc 2.95.3 */
+-#endif
+-#endif
+-
+ /* Declared in int2str() */
+ extern char NEAR _dig_vec_upper[];
+ extern char NEAR _dig_vec_lower[];
diff --git a/packaging/rpm-uln/mysql.init b/packaging/rpm-uln/mysql.init
new file mode 100644
index 00000000000..310e8cfa023
--- /dev/null
+++ b/packaging/rpm-uln/mysql.init
@@ -0,0 +1,209 @@
+#!/bin/sh
+#
+# mysqld This shell script takes care of starting and stopping
+# the MySQL subsystem (mysqld).
+#
+# chkconfig: - 64 36
+# description: MySQL database server.
+# processname: mysqld
+# config: /etc/my.cnf
+# pidfile: /var/run/mysqld/mysqld.pid
+
+# Source function library.
+. /etc/rc.d/init.d/functions
+
+# Source networking configuration.
+. /etc/sysconfig/network
+
+
+exec="/usr/bin/mysqld_safe"
+prog="mysqld"
+
+# Set timeouts here so they can be overridden from /etc/sysconfig/mysqld
+STARTTIMEOUT=120
+STOPTIMEOUT=60
+
+[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
+
+lockfile=/var/lock/subsys/$prog
+
+
+# extract value of a MySQL option from config files
+# Usage: get_mysql_option SECTION VARNAME DEFAULT
+# result is returned in $result
+# We use my_print_defaults which prints all options from multiple files,
+# with the more specific ones later; hence take the last match.
+get_mysql_option(){
+ result=`/usr/bin/my_print_defaults "$1" | sed -n "s/^--$2=//p" | tail -n 1`
+ if [ -z "$result" ]; then
+ # not found, use default
+ result="$3"
+ fi
+}
+
+get_mysql_option mysqld datadir "/var/lib/mysql"
+datadir="$result"
+get_mysql_option mysqld socket "$datadir/mysql.sock"
+socketfile="$result"
+get_mysql_option mysqld_safe log-error "/var/log/mysqld.log"
+errlogfile="$result"
+get_mysql_option mysqld_safe pid-file "/var/run/mysqld/mysqld.pid"
+mypidfile="$result"
+
+
+start(){
+ [ -x $exec ] || exit 5
+ # check to see if it's already running
+ RESPONSE=`/usr/bin/mysqladmin --socket="$socketfile" --user=UNKNOWN_MYSQL_USER ping 2>&1`
+ if [ $? = 0 ]; then
+ # already running, do nothing
+ action $"Starting $prog: " /bin/true
+ ret=0
+ elif echo "$RESPONSE" | grep -q "Access denied for user"
+ then
+ # already running, do nothing
+ action $"Starting $prog: " /bin/true
+ ret=0
+ else
+ # prepare for start
+ touch "$errlogfile"
+ chown mysql:mysql "$errlogfile"
+ chmod 0640 "$errlogfile"
+ [ -x /sbin/restorecon ] && /sbin/restorecon "$errlogfile"
+ if [ ! -d "$datadir/mysql" ] ; then
+ # First, make sure $datadir is there with correct permissions
+ if [ ! -e "$datadir" -a ! -h "$datadir" ]
+ then
+ mkdir -p "$datadir" || exit 1
+ fi
+ chown mysql:mysql "$datadir"
+ chmod 0755 "$datadir"
+ [ -x /sbin/restorecon ] && /sbin/restorecon "$datadir"
+ # Now create the database
+ action $"Initializing MySQL database: " /usr/bin/mysql_install_db --datadir="$datadir" --user=mysql
+ ret=$?
+ chown -R mysql:mysql "$datadir"
+ if [ $ret -ne 0 ] ; then
+ return $ret
+ fi
+ fi
+ chown mysql:mysql "$datadir"
+ chmod 0755 "$datadir"
+ # Pass all the options determined above, to ensure consistent behavior.
+ # In many cases mysqld_safe would arrive at the same conclusions anyway
+ # but we need to be sure. (An exception is that we don't force the
+ # log-error setting, since this script doesn't really depend on that,
+ # and some users might prefer to configure logging to syslog.)
+ # Note: set --basedir to prevent probes that might trigger SELinux
+ # alarms, per bug #547485
+ $exec --datadir="$datadir" --socket="$socketfile" \
+ --pid-file="$mypidfile" \
+ --basedir=/usr --user=mysql >/dev/null 2>&1 &
+ safe_pid=$!
+ # Spin for a maximum of N seconds waiting for the server to come up;
+ # exit the loop immediately if mysqld_safe process disappears.
+ # Rather than assuming we know a valid username, accept an "access
+ # denied" response as meaning the server is functioning.
+ ret=0
+ TIMEOUT="$STARTTIMEOUT"
+ while [ $TIMEOUT -gt 0 ]; do
+ RESPONSE=`/usr/bin/mysqladmin --socket="$socketfile" --user=UNKNOWN_MYSQL_USER ping 2>&1` && break
+ echo "$RESPONSE" | grep -q "Access denied for user" && break
+ if ! /bin/kill -0 $safe_pid 2>/dev/null; then
+ echo "MySQL Daemon failed to start."
+ ret=1
+ break
+ fi
+ sleep 1
+ let TIMEOUT=${TIMEOUT}-1
+ done
+ if [ $TIMEOUT -eq 0 ]; then
+ echo "Timeout error occurred trying to start MySQL Daemon."
+ ret=1
+ fi
+ if [ $ret -eq 0 ]; then
+ action $"Starting $prog: " /bin/true
+ touch $lockfile
+ else
+ action $"Starting $prog: " /bin/false
+ fi
+ fi
+ return $ret
+}
+
+stop(){
+ if [ ! -f "$mypidfile" ]; then
+ # not running; per LSB standards this is "ok"
+ action $"Stopping $prog: " /bin/true
+ return 0
+ fi
+ MYSQLPID=`cat "$mypidfile"`
+ if [ -n "$MYSQLPID" ]; then
+ /bin/kill "$MYSQLPID" >/dev/null 2>&1
+ ret=$?
+ if [ $ret -eq 0 ]; then
+ TIMEOUT="$STOPTIMEOUT"
+ while [ $TIMEOUT -gt 0 ]; do
+ /bin/kill -0 "$MYSQLPID" >/dev/null 2>&1 || break
+ sleep 1
+ let TIMEOUT=${TIMEOUT}-1
+ done
+ if [ $TIMEOUT -eq 0 ]; then
+ echo "Timeout error occurred trying to stop MySQL Daemon."
+ ret=1
+ action $"Stopping $prog: " /bin/false
+ else
+ rm -f $lockfile
+ rm -f "$socketfile"
+ action $"Stopping $prog: " /bin/true
+ fi
+ else
+ action $"Stopping $prog: " /bin/false
+ fi
+ else
+ # failed to read pidfile, probably insufficient permissions
+ action $"Stopping $prog: " /bin/false
+ ret=4
+ fi
+ return $ret
+}
+
+restart(){
+ stop
+ start
+}
+
+condrestart(){
+ [ -e $lockfile ] && restart || :
+}
+
+
+# See how we were called.
+case "$1" in
+ start)
+ start
+ ;;
+ stop)
+ stop
+ ;;
+ status)
+ status -p "$mypidfile" $prog
+ ;;
+ restart)
+ restart
+ ;;
+ condrestart|try-restart)
+ condrestart
+ ;;
+ reload)
+ exit 3
+ ;;
+ force-reload)
+ restart
+ ;;
+ *)
+ echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
+ exit 2
+esac
+
+exit $?
diff --git a/packaging/rpm-uln/mysql.spec.sh b/packaging/rpm-uln/mysql.spec.sh
new file mode 100644
index 00000000000..8b25b160be1
--- /dev/null
+++ b/packaging/rpm-uln/mysql.spec.sh
@@ -0,0 +1,1959 @@
+#
+# This file was modified by Oracle in 2011 and later.
+# Details of the modifications are described in the "changelog" section.
+#
+# Modifications copyright (c) 2011, 2012, Oracle and/or its
+# affiliates. All rights reserved.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; see the file COPYING. If not, write to the
+# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston
+# MA 02110-1301 USA.
+
+##############################################################################
+# Some common macro definitions
+##############################################################################
+
+# NOTE: "vendor" is used in upgrade/downgrade check, so you can't
+# change these, has to be exactly as is.
+# %define mysql_old_vendor MySQL AB # Applies to traditional MySQL RPMs only.
+# %define mysql_vendor_2 Sun Microsystems, Inc.
+%define mysql_vendor Oracle and/or its affiliates
+
+%define mysql_version @VERSION@
+
+%define mysqldatadir /var/lib/mysql
+
+%define release 1
+
+##############################################################################
+# Command line handling
+##############################################################################
+#
+# To set options:
+#
+# $ rpmbuild --define="option <x>" ...
+#
+
+# ----------------------------------------------------------------------------
+# Commercial builds
+# ----------------------------------------------------------------------------
+%if %{undefined commercial}
+%define commercial 0
+%endif
+
+# ----------------------------------------------------------------------------
+# Source name
+# ----------------------------------------------------------------------------
+%if %{undefined src_base}
+%define src_base mysql
+%endif
+%define src_dir %{src_base}-%{mysql_version}
+
+# ----------------------------------------------------------------------------
+# Feature set (storage engines, options). Default to community (everything)
+# ----------------------------------------------------------------------------
+%if %{undefined feature_set}
+%define feature_set community
+%endif
+
+# ----------------------------------------------------------------------------
+# Server comment strings
+# ----------------------------------------------------------------------------
+%if %{undefined compilation_comment_debug}
+%define compilation_comment_debug MySQL Community Server - Debug (GPL)
+%endif
+%if %{undefined compilation_comment_release}
+%define compilation_comment_release MySQL Community Server (GPL)
+%endif
+
+# ----------------------------------------------------------------------------
+# Product and server suffixes
+# ----------------------------------------------------------------------------
+%if %{undefined product_suffix}
+ %if %{defined short_product_tag}
+ %define product_suffix -%{short_product_tag}
+ %else
+ %define product_suffix %{nil}
+ %endif
+%endif
+
+%if %{undefined server_suffix}
+%define server_suffix %{nil}
+%endif
+
+# ----------------------------------------------------------------------------
+# Distribution support
+# ----------------------------------------------------------------------------
+%if %{undefined distro_specific}
+%define distro_specific 0
+%endif
+%if %{distro_specific}
+ %if %(test -f /etc/oracle-release && echo 1 || echo 0)
+ %define elver %(rpm -qf --qf '%%{version}\\n' /etc/oracle-release | sed -e 's/^\\([0-9]*\\).*/\\1/g')
+ %if "%elver" == "6"
+ %define distro_description Oracle Linux 6
+ %define distro_releasetag el6
+ %define distro_buildreq gcc-c++ ncurses-devel perl readline-devel time zlib-devel
+ %define distro_requires chkconfig coreutils grep procps shadow-utils net-tools
+ %else
+ %{error:Oracle Linux %{elver} is unsupported}
+ %endif
+ %else
+ %if %(test -f /etc/redhat-release && echo 1 || echo 0)
+ %define rhelver %(rpm -qf --qf '%%{version}\\n' /etc/redhat-release | sed -e 's/^\\([0-9]*\\).*/\\1/g')
+ %if "%rhelver" == "5"
+ %define distro_description Red Hat Enterprise Linux 5
+ %define distro_releasetag rhel5
+ %define distro_buildreq gcc-c++ gperf ncurses-devel perl readline-devel time zlib-devel
+ %define distro_requires chkconfig coreutils grep procps shadow-utils net-tools
+ %else
+ %if "%rhelver" == "6"
+ %define distro_description Red Hat Enterprise Linux 6
+ %define distro_releasetag rhel6
+ %define distro_buildreq gcc-c++ ncurses-devel perl readline-devel time zlib-devel
+ %define distro_requires chkconfig coreutils grep procps shadow-utils net-tools
+ %else
+ %{error:Red Hat Enterprise Linux %{rhelver} is unsupported}
+ %endif
+ %endif
+ %else
+ %if %(test -f /etc/SuSE-release && echo 1 || echo 0)
+ %define susever %(rpm -qf --qf '%%{version}\\n' /etc/SuSE-release | cut -d. -f1)
+ %if "%susever" == "10"
+ %define distro_description SUSE Linux Enterprise Server 10
+ %define distro_releasetag sles10
+ %define distro_buildreq gcc-c++ gdbm-devel gperf ncurses-devel openldap2-client readline-devel zlib-devel
+ %define distro_requires aaa_base coreutils grep procps pwdutils
+ %else
+ %if "%susever" == "11"
+ %define distro_description SUSE Linux Enterprise Server 11
+ %define distro_releasetag sles11
+ %define distro_buildreq gcc-c++ gdbm-devel gperf ncurses-devel openldap2-client procps pwdutils readline-devel zlib-devel
+ %define distro_requires aaa_base coreutils grep procps pwdutils
+ %else
+ %{error:SuSE %{susever} is unsupported}
+ %endif
+ %endif
+ %else
+ %{error:Unsupported distribution}
+ %endif
+ %endif
+ %endif
+%else
+ %define generic_kernel %(uname -r | cut -d. -f1-2)
+ %define distro_description Generic Linux (kernel %{generic_kernel})
+ %define distro_releasetag linux%{generic_kernel}
+ %define distro_buildreq gcc-c++ gperf ncurses-devel perl readline-devel time zlib-devel
+ %define distro_requires coreutils grep procps /sbin/chkconfig /usr/sbin/useradd /usr/sbin/groupadd
+%endif
+
+# Avoid debuginfo RPMs, leaves binaries unstripped
+%define debug_package %{nil}
+
+# Hack to work around bug in RHEL5 __os_install_post macro, wrong inverted
+# test for __debug_package
+%define __strip /bin/true
+
+# ----------------------------------------------------------------------------
+# Support optional "tcmalloc" library (experimental)
+# ----------------------------------------------------------------------------
+%if %{defined malloc_lib_target}
+%define WITH_TCMALLOC 1
+%else
+%define WITH_TCMALLOC 0
+%endif
+
+##############################################################################
+# Configuration based upon above user input, not to be set directly
+##############################################################################
+
+%if %{commercial}
+%define license_files_server %{src_dir}/LICENSE.mysql
+%define license_type Commercial
+%else
+%define license_files_server %{src_dir}/COPYING %{src_dir}/README
+%define license_type GPL
+%endif
+
+##############################################################################
+# Main spec file section
+##############################################################################
+
+Name: mysql%{product_suffix}
+Summary: MySQL client programs and shared libraries
+Group: Applications/Databases
+Version: @MYSQL_RPM_VERSION@
+Release: %{release}%{?distro_releasetag:.%{distro_releasetag}}
+# exceptions allow client libraries to be linked with most open source SW,
+# not only GPL code.
+License: Copyright (c) 2000, @MYSQL_COPYRIGHT_YEAR@, %{mysql_vendor}. All rights reserved. Under %{license_type} license as shown in the Description field.
+URL: http://www.mysql.com/
+Packager: MySQL Release Engineering <mysql-build@oss.oracle.com>
+Vendor: %{mysql_vendor}
+
+# Regression tests may take a long time, override the default to skip them
+%{!?runselftest:%global runselftest 1}
+
+# Upstream has a mirror redirector for downloads, so the URL is hard to
+# represent statically. You can get the tarball by following a link from
+# http://dev.mysql.com/downloads/mysql/
+Source0: %{src_dir}.tar.gz
+# The upstream tarball includes non-free documentation that only the
+# copyright holder (MySQL -> Sun -> Oracle) may ship.
+# To remove the non-free documentation, run this script after downloading
+# the tarball into the current directory:
+# ./generate-tarball.sh $VERSION
+# Then, source name changes:
+# Source0: mysql-%{version}-nodocs.tar.gz
+%if %{commercial}
+NoSource: 0
+%endif
+Source1: generate-tarball.sh
+Source2: mysql.init
+Source3: my.cnf
+Source4: scriptstub.c
+Source5: my_config.h
+# The below is only needed for packages built outside MySQL -> Sun -> Oracle:
+Source6: README.mysql-docs
+Source9: mysql-embedded-check.c
+# Working around perl dependency checking bug in rpm FTTB. Remove later.
+Source999: filter-requires-mysql.sh
+
+# Patch1: mysql-ssl-multilib.patch Not needed by MySQL (yaSSL), will not work in 5.5 (cmake)
+Patch2: mysql-5.5-errno.patch
+Patch4: mysql-5.5-testing.patch
+Patch5: mysql-install-test.patch
+Patch6: mysql-5.5-stack-guard.patch
+# Patch7: mysql-disable-test.patch Already fixed in current 5.1
+# Patch8: mysql-setschedparam.patch Will not work in 5.5 (cmake)
+# Patch9: mysql-no-docs.patch Will not work in 5.5 (cmake)
+Patch10: mysql-strmov.patch
+ # Not used by MySQL
+# Patch12: mysql-cve-2008-7247.patch Already fixed in 5.5
+Patch13: mysql-expired-certs.patch
+ # Will not be used by MySQL
+# Patch14: mysql-missing-string-code.patch Undecided, will not work in 5.5 (cmake)
+# Patch15: mysql-lowercase-bug.patch Fixed in MySQL 5.1.54 and 5.5.9
+Patch16: mysql-chain-certs.patch
+Patch17: mysql-5.5-libdir.patch
+Patch18: mysql-5.5-fix-tests.patch
+Patch19: mysql-5.5-mtr1.patch
+
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
+BuildRequires: %{distro_buildreq}
+BuildRequires: gawk
+# make test requires time and ps
+BuildRequires: procps
+# Socket and Time::HiRes are needed to run regression tests
+BuildRequires: perl(Socket), perl(Time::HiRes)
+
+Requires: %{distro_requires}
+Requires: fileutils
+Requires: mysql-libs%{product_suffix} = %{version}-%{release}
+Requires: bash
+
+# If %%{product_suffix} is non-empty, the auto-generated capability is insufficient:
+# We want all dependency handling to use the generic name only.
+# Similar in other sub-packages
+Provides: mysql
+
+# MySQL (with caps) is upstream's spelling of their own RPMs for mysql
+Conflicts: MySQL
+# mysql-cluster used to be built from this SRPM, but no more
+Obsoletes: mysql-cluster < 5.1.44
+# We need cross-product "Obsoletes:" to allow cross-product upgrades:
+Obsoletes: mysql mysql-advanced
+
+# Working around perl dependency checking bug in rpm FTTB. Remove later.
+%global __perl_requires %{SOURCE999}
+
+%description -n mysql%{product_suffix}
+MySQL is a multi-user, multi-threaded SQL database server. MySQL is a
+client/server implementation consisting of a server daemon (mysqld)
+and many different client programs and libraries. The base package
+contains the standard MySQL client programs and generic MySQL files.
+
+The MySQL software has Dual Licensing, which means you can use the MySQL
+software free of charge under the GNU General Public License
+(http://www.gnu.org/licenses/). You can also purchase commercial MySQL
+licenses from %{mysql_vendor} if you do not wish to be bound by the terms of
+the GPL. See the chapter "Licensing and Support" in the manual for
+further info.
+
+%package -n mysql-libs%{product_suffix}
+
+Summary: The shared libraries required for MySQL clients
+Group: Applications/Databases
+Requires: /sbin/ldconfig
+Provides: mysql-libs
+Obsoletes: mysql-libs mysql-libs-advanced
+
+%description -n mysql-libs%{product_suffix}
+The mysql-libs package provides the essential shared libraries for any
+MySQL client program or interface. You will need to install this package
+to use any other MySQL package or any clients that need to connect to a
+MySQL server.
+
+%package -n mysql-server%{product_suffix}
+
+Summary: The MySQL server and related files
+Group: Applications/Databases
+Requires: mysql%{product_suffix} = %{version}-%{release}
+Requires: sh-utils
+Requires(pre): /usr/sbin/useradd
+Requires(post): chkconfig
+Requires(preun): chkconfig
+# This is for /sbin/service
+Requires(preun): initscripts
+Requires(postun): initscripts
+# mysqlhotcopy needs DBI/DBD support
+Requires: perl-DBI, perl-DBD-MySQL
+Provides: mysql-server
+Conflicts: MySQL-server
+Obsoletes: mysql-server mysql-server-advanced
+
+%description -n mysql-server%{product_suffix}
+MySQL is a multi-user, multi-threaded SQL database server. MySQL is a
+client/server implementation consisting of a server daemon (mysqld)
+and many different client programs and libraries. This package contains
+the MySQL server and some accompanying files and directories.
+
+%package -n mysql-devel%{product_suffix}
+
+Summary: Files for development of MySQL applications
+Group: Applications/Databases
+Requires: mysql%{product_suffix} = %{version}-%{release}
+Requires: openssl-devel
+Provides: mysql-devel
+Conflicts: MySQL-devel
+Obsoletes: mysql-devel mysql-devel-advanced
+
+%description -n mysql-devel%{product_suffix}
+MySQL is a multi-user, multi-threaded SQL database server. This
+package contains the libraries and header files that are needed for
+developing MySQL client applications.
+
+%package -n mysql-embedded%{product_suffix}
+
+Summary: MySQL as an embeddable library
+Group: Applications/Databases
+Provides: mysql-embedded
+Obsoletes: mysql-embedded mysql-embedded-advanced
+
+%description -n mysql-embedded%{product_suffix}
+MySQL is a multi-user, multi-threaded SQL database server. This
+package contains a version of the MySQL server that can be embedded
+into a client application instead of running as a separate process,
+as well as a command line client with such an embedded server.
+
+%package -n mysql-embedded-devel%{product_suffix}
+
+Summary: Development files for MySQL as an embeddable library
+Group: Applications/Databases
+Requires: mysql-embedded%{product_suffix} = %{version}-%{release}
+Requires: mysql-devel%{product_suffix} = %{version}-%{release}
+Provides: mysql-embedded-devel
+Obsoletes: mysql-embedded-devel mysql-embedded-devel-advanced
+
+%description -n mysql-embedded-devel%{product_suffix}
+MySQL is a multi-user, multi-threaded SQL database server. This
+package contains files needed for developing and testing with
+the embedded version of the MySQL server.
+
+%package -n mysql-test%{product_suffix}
+
+Summary: The test suite distributed with MySQL
+Group: Applications/Databases
+Requires: mysql%{product_suffix} = %{version}-%{release}
+Requires: mysql-server%{product_suffix} = %{version}-%{release}
+Provides: mysql-test
+Conflicts: MySQL-test
+Obsoletes: mysql-test mysql-test-advanced
+
+%description -n mysql-test%{product_suffix}
+MySQL is a multi-user, multi-threaded SQL database server. This
+package contains the regression test suite distributed with
+the MySQL sources.
+
+%prep
+%setup -T -a 0 -c -n %{src_dir}
+
+cd %{src_dir} # read about "%setup -n"
+# %patch1 -p1
+%patch2 -p1
+# %patch4 -p1 TODO / FIXME: if wanted, needs to be adapted to new mysql-test-run setup
+%patch5 -p1
+%patch6 -p1
+# %patch8 -p1
+# %patch9 -p1
+# %patch10 -p1
+# %patch13 -p1
+# %patch14 -p1
+%patch16 -p1
+%patch17 -p1
+%patch18 -p1
+%patch19 -p1
+
+# workaround for upstream bug #56342
+rm -f mysql-test/t/ssl_8k_key-master.opt
+
+%build
+
+# Fail quickly and obviously if user tries to build as root
+%if %runselftest
+ if [ x"`id -u`" = x0 ]; then
+ echo "The MySQL regression tests may fail if run as root."
+ echo "If you really need to build the RPM as root, use"
+ echo "--define='runselftest 0' to skip the regression tests."
+ exit 1
+ fi
+%endif
+
+# Be strict about variables, bail at earliest opportunity, etc.
+set -eu
+
+# Optional package files
+touch optional-files-devel
+
+#
+# Set environment in order of preference, MYSQL_BUILD_* first, then variable
+# name, finally a default. RPM_OPT_FLAGS is assumed to be a part of the
+# default RPM build environment.
+#
+# We set CXX=gcc by default to support so-called 'generic' binaries, where we
+# do not have a dependancy on libgcc/libstdc++. This only works while we do
+# not require C++ features such as exceptions, and may need to be removed at
+# a later date.
+#
+
+# This is a hack, $RPM_OPT_FLAGS on ia64 hosts contains flags which break
+# the compile in cmd-line-utils/readline - needs investigation, but for now
+# we simply unset it and use those specified directly in cmake.
+%if "%{_arch}" == "ia64"
+RPM_OPT_FLAGS=
+%endif
+
+# This goes in sync with Patch19. "rm" is faster than "patch" for this.
+rm -rf %{src_dir}/mysql-test/lib/v1
+
+export PATH=${MYSQL_BUILD_PATH:-$PATH}
+export CC=${MYSQL_BUILD_CC:-${CC:-gcc}}
+export CXX=${MYSQL_BUILD_CXX:-${CXX:-gcc}}
+export CFLAGS=${MYSQL_BUILD_CFLAGS:-${CFLAGS:-$RPM_OPT_FLAGS}}
+# Following "%ifarch" developed by RedHat, MySQL/Oracle does not support/maintain Linux/Sparc:
+# gcc seems to have some bugs on sparc as of 4.4.1, back off optimization
+# submitted as bz #529298
+%ifarch sparc sparcv9 sparc64
+CFLAGS=`echo $CFLAGS| sed -e "s|-O2|-O1|g" `
+%endif
+export CXXFLAGS=${MYSQL_BUILD_CXXFLAGS:-${CXXFLAGS:-$RPM_OPT_FLAGS -felide-constructors -fno-exceptions -fno-rtti}}
+export LDFLAGS=${MYSQL_BUILD_LDFLAGS:-${LDFLAGS:-}}
+export CMAKE=${MYSQL_BUILD_CMAKE:-${CMAKE:-cmake}}
+export MAKE_JFLAG=${MYSQL_BUILD_MAKE_JFLAG:-%{?_smp_mflags}}
+
+# Build debug mysqld and libmysqld.a
+mkdir debug
+(
+ cd debug
+ # Attempt to remove any optimisation flags from the debug build
+ CFLAGS=`echo " ${CFLAGS} " | \
+ sed -e 's/ -O[0-9]* / /' \
+ -e 's/ -unroll2 / /' \
+ -e 's/ -ip / /' \
+ -e 's/^ //' \
+ -e 's/ $//'`
+ CXXFLAGS=`echo " ${CXXFLAGS} " | \
+ sed -e 's/ -O[0-9]* / /' \
+ -e 's/ -unroll2 / /' \
+ -e 's/ -ip / /' \
+ -e 's/^ //' \
+ -e 's/ $//'`
+ # XXX: MYSQL_UNIX_ADDR should be in cmake/* but mysql_version is included before
+ # XXX: install_layout so we can't just set it based on INSTALL_LAYOUT=RPM
+ ${CMAKE} ../%{src_dir} -DBUILD_CONFIG=mysql_release -DINSTALL_LAYOUT=RPM \
+ -DCMAKE_BUILD_TYPE=Debug \
+ -DMYSQL_UNIX_ADDR="%{mysqldatadir}/mysql.sock" \
+ -DFEATURE_SET="%{feature_set}" \
+ -DCOMPILATION_COMMENT="%{compilation_comment_debug}" \
+ -DMYSQL_SERVER_SUFFIX="%{server_suffix}"
+ echo BEGIN_DEBUG_CONFIG ; egrep '^#define' include/config.h ; echo END_DEBUG_CONFIG
+ make ${MAKE_JFLAG} VERBOSE=1
+)
+# Build full release
+mkdir release
+(
+ cd release
+ # XXX: MYSQL_UNIX_ADDR should be in cmake/* but mysql_version is included before
+ # XXX: install_layout so we can't just set it based on INSTALL_LAYOUT=RPM
+ ${CMAKE} ../%{src_dir} -DBUILD_CONFIG=mysql_release -DINSTALL_LAYOUT=RPM \
+ -DCMAKE_BUILD_TYPE=RelWithDebInfo \
+ -DMYSQL_UNIX_ADDR="%{mysqldatadir}/mysql.sock" \
+ -DFEATURE_SET="%{feature_set}" \
+ -DCOMPILATION_COMMENT="%{compilation_comment_release}" \
+ -DMYSQL_SERVER_SUFFIX="%{server_suffix}"
+ echo BEGIN_NORMAL_CONFIG ; egrep '^#define' include/config.h ; echo END_NORMAL_CONFIG
+ make ${MAKE_JFLAG} VERBOSE=1
+)
+
+# TODO / FIXME: Do we need "scriptstub"?
+gcc $CFLAGS $LDFLAGS -o scriptstub "-DLIBDIR=\"%{_libdir}/mysql\"" %{SOURCE4}
+
+# TODO / FIXME: "libmysqld.so" should have been produced above - WORK in PROGRESS
+# regular build will make libmysqld.a but not libmysqld.so :-(
+cd release
+mkdir libmysqld/work
+cd libmysqld/work
+ar -x ../libmysqld.a
+rm rpl_utility.cc.o sql_binlog.cc.o # Try-and-Error: These modules cause unresolved references
+gcc $CFLAGS $LDFLAGS -shared -Wl,-soname,libmysqld.so.0 -o libmysqld.so.0.0.1 \
+ *.o \
+ -lpthread -lcrypt -laio -lnsl -lssl -lcrypto -lz -lrt -lstdc++ -lm -lc
+# this is to check that we built a complete library
+cp %{SOURCE9} .
+ln -s libmysqld.so.0.0.1 libmysqld.so.0
+gcc -I../../include -I../../../%{src_dir}/include $CFLAGS mysql-embedded-check.c libmysqld.so.0
+LD_LIBRARY_PATH=. ldd ./a.out
+cd ../..
+cd ..
+
+# TODO / FIXME: autotools only?
+# make check
+
+# TODO / FIXME: Test suite is run elsewhere in release builds -
+# do we need this for users who want to build from source?
+# Also, check whether MTR_BUILD_THREAD=auto would solve all issues
+%if %runselftest
+ # hack to let 32- and 64-bit tests run concurrently on same build machine
+ case `uname -m` in
+ ppc64 | s390x | x86_64 | sparc64 )
+ MTR_BUILD_THREAD=7
+ ;;
+ *)
+ MTR_BUILD_THREAD=11
+ ;;
+ esac
+ export MTR_BUILD_THREAD
+
+ # if you want to change which tests are run, look at mysql-5.5-testing.patch too.
+ (cd release && make test-bt-fast )
+%endif
+
+%install
+RBR=$RPM_BUILD_ROOT
+MBD=$RPM_BUILD_DIR/%{src_dir}
+[ -n "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
+
+# Ensure that needed directories exists
+# TODO / FIXME: needed ? install -d $RBR%{mysqldatadir}/mysql
+# TODO / FIXME: needed ? install -d $RBR%{_datadir}/mysql-test
+# TODO / FIXME: needed ? install -d $RBR%{_datadir}/mysql/SELinux/RHEL4
+# TODO / FIXME: needed ? install -d $RBR%{_includedir}
+# TODO / FIXME: needed ? install -d $RBR%{_libdir}
+# TODO / FIXME: needed ? install -d $RBR%{_mandir}
+# TODO / FIXME: needed ? install -d $RBR%{_sbindir}
+
+# Install all binaries
+(
+ cd $MBD/release
+ make DESTDIR=$RBR install
+)
+
+# For gcc builds, include libgcc.a in the devel subpackage (BUG 4921). Do
+# this in a sub-shell to ensure we don't pollute the install environment
+# with compiler bits.
+(
+ PATH=${MYSQL_BUILD_PATH:-$PATH}
+ CC=${MYSQL_BUILD_CC:-${CC:-gcc}}
+ CFLAGS=${MYSQL_BUILD_CFLAGS:-${CFLAGS:-$RPM_OPT_FLAGS}}
+ if "${CC}" -v 2>&1 | grep '^gcc.version' >/dev/null 2>&1; then
+ libgcc=`${CC} ${CFLAGS} --print-libgcc-file`
+ if [ -f ${libgcc} ]; then
+ mkdir -p $RBR%{_libdir}/mysql
+ install -m 644 ${libgcc} $RBR%{_libdir}/mysql/libmygcc.a
+ echo "%{_libdir}/mysql/libmygcc.a" >>optional-files-devel
+ fi
+ fi
+)
+
+# multilib header hacks
+# we only apply this to known Red Hat multilib arches, per bug #181335
+case `uname -i` in
+ i386 | x86_64 | ppc | ppc64 | s390 | s390x | sparc | sparc64 )
+ mv $RPM_BUILD_ROOT/usr/include/mysql/my_config.h $RPM_BUILD_ROOT/usr/include/mysql/my_config_`uname -i`.h
+ install -m 644 %{SOURCE5} $RPM_BUILD_ROOT/usr/include/mysql/
+ ;;
+ *)
+ ;;
+esac
+
+mkdir -p $RPM_BUILD_ROOT/var/log
+touch $RPM_BUILD_ROOT/var/log/mysqld.log
+
+# List the installed tree for RPM package maintenance purposes.
+find $RPM_BUILD_ROOT -print | sed "s|^$RPM_BUILD_ROOT||" | sort > ROOTFILES
+
+mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d
+mkdir -p $RPM_BUILD_ROOT/var/run/mysqld
+install -m 0755 -d $RPM_BUILD_ROOT/var/lib/mysql
+install -m 0755 %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/mysqld
+install -m 0644 %{SOURCE3} $RPM_BUILD_ROOT/etc/my.cnf
+# obsolete: mv $RPM_BUILD_ROOT/usr/sql-bench $RPM_BUILD_ROOT%{_datadir}/sql-bench # 'sql-bench' is dropped
+# obsolete: mv $RPM_BUILD_ROOT/usr/mysql-test $RPM_BUILD_ROOT%{_datadir}/mysql-test # 'mysql-test' is there already
+# 5.1.32 forgets to install the mysql-test README file
+# obsolete: install -m 0644 mysql-test/README $RPM_BUILD_ROOT%{_datadir}/mysql-test/README # 'README' is there already
+
+mv ${RPM_BUILD_ROOT}%{_bindir}/mysqlbug ${RPM_BUILD_ROOT}%{_libdir}/mysql/mysqlbug
+install -m 0755 scriptstub ${RPM_BUILD_ROOT}%{_bindir}/mysqlbug
+mv ${RPM_BUILD_ROOT}%{_bindir}/mysql_config ${RPM_BUILD_ROOT}%{_libdir}/mysql/mysql_config
+install -m 0755 scriptstub ${RPM_BUILD_ROOT}%{_bindir}/mysql_config
+
+rm -f ${RPM_BUILD_ROOT}%{_libdir}/mysql/libmysqld.a
+install -m 0755 release/libmysqld/work/libmysqld.so.0.0.1 ${RPM_BUILD_ROOT}%{_libdir}/mysql/libmysqld.so.0.0.1
+ln -s libmysqld.so.0.0.1 ${RPM_BUILD_ROOT}%{_libdir}/mysql/libmysqld.so.0
+ln -s libmysqld.so.0 ${RPM_BUILD_ROOT}%{_libdir}/mysql/libmysqld.so
+
+rm -f ${RPM_BUILD_ROOT}%{_bindir}/comp_err
+rm -f ${RPM_BUILD_ROOT}%{_mandir}/man1/comp_err.1*
+rm -f ${RPM_BUILD_ROOT}%{_bindir}/make_win_binary_distribution
+rm -f ${RPM_BUILD_ROOT}%{_bindir}/make_win_src_distribution
+rm -f ${RPM_BUILD_ROOT}%{_mandir}/man1/make_win_bin_dist.1*
+rm -f ${RPM_BUILD_ROOT}%{_mandir}/man1/make_win_src_distribution.1*
+rm -f ${RPM_BUILD_ROOT}%{_libdir}/mysql/libmysqlclient*.la
+rm -f ${RPM_BUILD_ROOT}%{_libdir}/mysql/*.a
+rm -f ${RPM_BUILD_ROOT}%{_libdir}/mysql/plugin/*.la
+rm -f ${RPM_BUILD_ROOT}%{_libdir}/mysql/plugin/*.a
+rm -f ${RPM_BUILD_ROOT}%{_datadir}/mysql/binary-configure
+rm -f ${RPM_BUILD_ROOT}%{_datadir}/mysql/make_binary_distribution
+rm -f ${RPM_BUILD_ROOT}%{_datadir}/mysql/make_sharedlib_distribution
+rm -f ${RPM_BUILD_ROOT}%{_datadir}/mysql/mi_test_all*
+rm -f ${RPM_BUILD_ROOT}%{_datadir}/mysql/ndb-config-2-node.ini
+rm -f ${RPM_BUILD_ROOT}%{_datadir}/mysql/mysql.server
+rm -f ${RPM_BUILD_ROOT}%{_datadir}/mysql/mysqld_multi.server
+rm -f ${RPM_BUILD_ROOT}%{_datadir}/mysql/MySQL-shared-compat.spec
+rm -f ${RPM_BUILD_ROOT}%{_datadir}/mysql/*.plist
+rm -f ${RPM_BUILD_ROOT}%{_datadir}/mysql/preinstall
+rm -f ${RPM_BUILD_ROOT}%{_datadir}/mysql/postinstall
+rm -f ${RPM_BUILD_ROOT}%{_datadir}/mysql/mysql-*.spec
+rm -f ${RPM_BUILD_ROOT}%{_datadir}/mysql/mysql-log-rotate
+rm -f ${RPM_BUILD_ROOT}%{_datadir}/mysql/ChangeLog
+rm -f ${RPM_BUILD_ROOT}%{_mandir}/man1/mysql-stress-test.pl.1*
+rm -f ${RPM_BUILD_ROOT}%{_mandir}/man1/mysql-test-run.pl.1*
+
+mkdir -p $RPM_BUILD_ROOT/etc/ld.so.conf.d
+echo "%{_libdir}/mysql" > $RPM_BUILD_ROOT/etc/ld.so.conf.d/%{name}-%{_arch}.conf
+
+# The below *only* applies to builds not done by MySQL / Sun / Oracle:
+# copy additional docs into build tree so %%doc will find them
+# cp %{SOURCE6} README.mysql-docs
+
+%clean
+[ -n "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
+
+%pre -n mysql-server%{product_suffix}
+
+# Check if we can safely upgrade. An upgrade is only safe if it's from one
+# of our RPMs in the same version family.
+
+# Handle both ways of spelling the capability.
+installed=`rpm -q --whatprovides mysql-server 2> /dev/null`
+if [ $? -ne 0 -o -z "$installed" ]; then
+ installed=`rpm -q --whatprovides MySQL-server 2> /dev/null`
+fi
+if [ $? -eq 0 -a -n "$installed" ]; then
+ installed=`echo $installed | sed 's/\([^ ]*\) .*/\1/'` # Tests have shown duplicated package names
+ vendor=`rpm -q --queryformat='%{VENDOR}' "$installed" 2>&1`
+ version=`rpm -q --queryformat='%{VERSION}' "$installed" 2>&1`
+ myvendor='%{mysql_vendor}'
+ myversion='%{mysql_version}'
+
+ old_family=`echo $version \
+ | sed -n -e 's,^\([1-9][0-9]*\.[0-9][0-9]*\)\..*$,\1,p'`
+ new_family=`echo $myversion \
+ | sed -n -e 's,^\([1-9][0-9]*\.[0-9][0-9]*\)\..*$,\1,p'`
+
+ [ -z "$vendor" ] && vendor='<unknown>'
+ [ -z "$old_family" ] && old_family="<unrecognized version $version>"
+ [ -z "$new_family" ] && new_family="<bad package specification: version $myversion>"
+
+ error_text=
+ if [ "$vendor" != "$myvendor" ]; then
+ error_text="$error_text
+The current MySQL server package is provided by a different
+vendor ($vendor) than $myvendor.
+Some files may be installed to different locations, including log
+files and the service startup script in %{_sysconfdir}/init.d/.
+"
+ fi
+
+ if [ "$old_family" != "$new_family" ]; then
+ error_text="$error_text
+Upgrading directly from MySQL $old_family to MySQL $new_family may not
+be safe in all cases. A manual dump and restore using mysqldump is
+recommended. It is important to review the MySQL manual's Upgrading
+section for version-specific incompatibilities.
+"
+ fi
+
+ if [ -n "$error_text" ]; then
+ cat <<HERE >&2
+
+******************************************************************
+A MySQL server package ($installed) is installed.
+$error_text
+A manual upgrade is required.
+
+- Ensure that you have a complete, working backup of your data and my.cnf
+ files
+- Shut down the MySQL server cleanly
+- Remove the existing MySQL packages. Usually this command will
+ list the packages you should remove:
+ rpm -qa | grep -i '^mysql-'
+
+ You may choose to use 'rpm --nodeps -ev <package-name>' to remove
+ the package which contains the mysqlclient shared library. The
+ library will be reinstalled by the MySQL-shared-compat package.
+- Install the new MySQL packages supplied by $myvendor
+- Ensure that the MySQL server is started
+- Run the 'mysql_upgrade' program
+
+This is a brief description of the upgrade process. Important details
+can be found in the MySQL manual, in the Upgrading section.
+******************************************************************
+HERE
+ exit 1
+ fi
+fi
+
+/usr/sbin/groupadd -g 27 -o -r mysql >/dev/null 2>&1 || :
+/usr/sbin/useradd -M -N -g mysql -o -r -d /var/lib/mysql -s /bin/bash \
+ -c "MySQL Server" -u 27 mysql >/dev/null 2>&1 || :
+
+%post -n mysql-libs%{product_suffix}
+/sbin/ldconfig
+
+%post -n mysql-server%{product_suffix}
+if [ $1 = 1 ]; then
+ /sbin/chkconfig --add mysqld
+fi
+/bin/chmod 0755 /var/lib/mysql
+/bin/touch /var/log/mysqld.log
+
+%preun -n mysql-server%{product_suffix}
+if [ $1 = 0 ]; then
+ /sbin/service mysqld stop >/dev/null 2>&1
+ /sbin/chkconfig --del mysqld
+fi
+
+%postun -n mysql-libs%{product_suffix}
+if [ $1 = 0 ] ; then
+ /sbin/ldconfig
+fi
+
+%postun -n mysql-server%{product_suffix}
+if [ $1 -ge 1 ]; then
+ /sbin/service mysqld condrestart >/dev/null 2>&1 || :
+fi
+
+
+%files -n mysql%{product_suffix}
+%defattr(-,root,root)
+%doc %{license_files_server}
+
+# The below file *only* applies to builds not done by MySQL / Sun / Oracle:
+# %doc README.mysql-docs
+
+%{_bindir}/msql2mysql
+%{_bindir}/mysql
+%{_bindir}/mysql_config
+%{_bindir}/mysql_find_rows
+%{_bindir}/mysql_waitpid
+%{_bindir}/mysqlaccess
+%{_bindir}/mysqlaccess.conf
+%{_bindir}/mysqladmin
+%{_bindir}/mysqlbinlog
+%{_bindir}/mysqlcheck
+%{_bindir}/mysqldump
+%{_bindir}/mysqlimport
+%{_bindir}/mysqlshow
+%{_bindir}/mysqlslap
+%{_bindir}/my_print_defaults
+
+%{_mandir}/man1/mysql.1*
+%{_mandir}/man1/mysql_config.1*
+%{_mandir}/man1/mysql_find_rows.1*
+%{_mandir}/man1/mysql_waitpid.1*
+%{_mandir}/man1/mysqlaccess.1*
+%{_mandir}/man1/mysqladmin.1*
+%{_mandir}/man1/mysqldump.1*
+%{_mandir}/man1/mysqlshow.1*
+%{_mandir}/man1/mysqlslap.1*
+%{_mandir}/man1/my_print_defaults.1*
+
+%{_libdir}/mysql/mysqlbug
+%{_libdir}/mysql/mysql_config
+
+%files -n mysql-libs%{product_suffix}
+%defattr(-,root,root)
+%doc %{license_files_server}
+# although the default my.cnf contains only server settings, we put it in the
+# libs package because it can be used for client settings too.
+%config(noreplace) /etc/my.cnf
+%dir %{_libdir}/mysql
+%{_libdir}/mysql/libmysqlclient*.so.*
+/etc/ld.so.conf.d/*
+
+%dir %{_datadir}/mysql
+%{_datadir}/mysql/english
+%lang(cs) %{_datadir}/mysql/czech
+%lang(da) %{_datadir}/mysql/danish
+%lang(nl) %{_datadir}/mysql/dutch
+%lang(et) %{_datadir}/mysql/estonian
+%lang(fr) %{_datadir}/mysql/french
+%lang(de) %{_datadir}/mysql/german
+%lang(el) %{_datadir}/mysql/greek
+%lang(hu) %{_datadir}/mysql/hungarian
+%lang(it) %{_datadir}/mysql/italian
+%lang(ja) %{_datadir}/mysql/japanese
+%lang(ko) %{_datadir}/mysql/korean
+%lang(no) %{_datadir}/mysql/norwegian
+%lang(no) %{_datadir}/mysql/norwegian-ny
+%lang(pl) %{_datadir}/mysql/polish
+%lang(pt) %{_datadir}/mysql/portuguese
+%lang(ro) %{_datadir}/mysql/romanian
+%lang(ru) %{_datadir}/mysql/russian
+%lang(sr) %{_datadir}/mysql/serbian
+%lang(sk) %{_datadir}/mysql/slovak
+%lang(es) %{_datadir}/mysql/spanish
+%lang(sv) %{_datadir}/mysql/swedish
+%lang(uk) %{_datadir}/mysql/ukrainian
+%{_datadir}/mysql/charsets
+
+%files -n mysql-server%{product_suffix} -f release/support-files/plugins.files
+%defattr(-,root,root)
+%doc release/support-files/*.cnf
+%doc %{_datadir}/info/mysql.info*
+%doc %{src_dir}/Docs/ChangeLog
+%doc %{src_dir}/Docs/INFO_SRC*
+%doc release/Docs/INFO_BIN*
+
+%{_bindir}/myisamchk
+%{_bindir}/myisam_ftdump
+%{_bindir}/myisamlog
+%{_bindir}/myisampack
+%{_bindir}/mysql_convert_table_format
+%{_bindir}/mysql_fix_extensions
+%{_bindir}/mysql_install_db
+%{_bindir}/mysql_plugin
+%{_bindir}/mysql_secure_installation
+%if %{commercial}
+%else
+%{_bindir}/mysql_setpermission
+%endif
+%{_bindir}/mysql_tzinfo_to_sql
+%{_bindir}/mysql_upgrade
+%{_bindir}/mysql_zap
+%{_bindir}/mysqlbug
+%{_bindir}/mysqldumpslow
+%{_bindir}/mysqld_multi
+%{_bindir}/mysqld_safe
+%{_bindir}/mysqlhotcopy
+%{_bindir}/mysqltest
+%{_bindir}/innochecksum
+%{_bindir}/perror
+%{_bindir}/replace
+%{_bindir}/resolve_stack_dump
+%{_bindir}/resolveip
+
+/usr/libexec/mysqld
+/usr/libexec/mysqld-debug
+%{_libdir}/mysql/plugin/daemon_example.ini
+
+%if %{WITH_TCMALLOC}
+%{_libdir}/mysql/%{malloc_lib_target}
+%endif
+
+# obsolete by "-f release/support-files/plugins.files" above
+# %{_libdir}/mysql/plugin
+
+%{_mandir}/man1/msql2mysql.1*
+%{_mandir}/man1/myisamchk.1*
+%{_mandir}/man1/myisamlog.1*
+%{_mandir}/man1/myisampack.1*
+%{_mandir}/man1/mysql_convert_table_format.1*
+%{_mandir}/man1/myisam_ftdump.1*
+%{_mandir}/man1/mysql.server.1*
+%{_mandir}/man1/mysql_fix_extensions.1*
+%{_mandir}/man1/mysql_install_db.1*
+%{_mandir}/man1/mysql_plugin.1*
+%{_mandir}/man1/mysql_secure_installation.1*
+%{_mandir}/man1/mysql_upgrade.1*
+%{_mandir}/man1/mysql_zap.1*
+%{_mandir}/man1/mysqlbug.1*
+%{_mandir}/man1/mysqldumpslow.1*
+%{_mandir}/man1/mysqlbinlog.1*
+%{_mandir}/man1/mysqlcheck.1*
+%{_mandir}/man1/mysqld_multi.1*
+%{_mandir}/man1/mysqld_safe.1*
+%{_mandir}/man1/mysqlhotcopy.1*
+%{_mandir}/man1/mysqlimport.1*
+%{_mandir}/man1/mysqlman.1*
+%if %{commercial}
+%else
+%{_mandir}/man1/mysql_setpermission.1*
+%endif
+%{_mandir}/man1/mysqltest.1*
+%{_mandir}/man1/innochecksum.1*
+%{_mandir}/man1/perror.1*
+%{_mandir}/man1/replace.1*
+%{_mandir}/man1/resolve_stack_dump.1*
+%{_mandir}/man1/resolveip.1*
+%{_mandir}/man1/mysql_tzinfo_to_sql.1*
+%{_mandir}/man8/mysqld.8*
+
+%{_datadir}/mysql/errmsg-utf8.txt
+%{_datadir}/mysql/fill_help_tables.sql
+%{_datadir}/mysql/magic
+%{_datadir}/mysql/mysql_system_tables.sql
+%{_datadir}/mysql/mysql_system_tables_data.sql
+%{_datadir}/mysql/mysql_test_data_timezone.sql
+%{_datadir}/mysql/my-*.cnf
+%{_datadir}/mysql/config.*.ini
+
+/etc/rc.d/init.d/mysqld
+%attr(0755,mysql,mysql) %dir /var/run/mysqld
+%attr(0755,mysql,mysql) %dir /var/lib/mysql
+%attr(0640,mysql,mysql) %config(noreplace) %verify(not md5 size mtime) /var/log/mysqld.log
+
+# TODO / FIXME: Do we need "libmygcc.a"? If yes, append "-f optional-files-devel"
+# and fix the "rm -f" list in the "install" section.
+%files -n mysql-devel%{product_suffix}
+%defattr(-,root,root)
+/usr/include/mysql
+/usr/share/aclocal/mysql.m4
+%{_libdir}/mysql/libmysqlclient*.so
+
+%files -n mysql-embedded%{product_suffix}
+%defattr(-,root,root)
+%doc %{license_files_server}
+%{_libdir}/mysql/libmysqld.so.*
+%{_bindir}/mysql_embedded
+
+%files -n mysql-embedded-devel%{product_suffix}
+%defattr(-,root,root)
+%{_libdir}/mysql/libmysqld.so
+%{_bindir}/mysql_client_test_embedded
+%{_bindir}/mysqltest_embedded
+%{_mandir}/man1/mysql_client_test_embedded.1*
+%{_mandir}/man1/mysqltest_embedded.1*
+
+%files -n mysql-test%{product_suffix}
+%defattr(-,root,root)
+%{_bindir}/mysql_client_test
+%attr(-,mysql,mysql) %{_datadir}/mysql-test
+
+%{_mandir}/man1/mysql_client_test.1*
+
+%changelog
+* Tue Sep 18 2012 Joerg Bruehe <joerg.bruehe@oracle.com>
+- Restrict the vendor check to Oracle: There is no history here
+ which we have to allow for.
+
+* Thu Jul 26 2012 Joerg Bruehe <joerg.bruehe@oracle.com>
+- Add the vendor and release series checks from the traditional MySQL RPM
+ spec file, to protect against errors happening during upgrades.
+- Do some code alignment with the traditional MySQL RPM spec file,
+ to make synchronous maintenance (and possibly even integration?) easier.
+
+* Mon Feb 13 2012 Joerg Bruehe <joerg.bruehe@oracle.com>
+- Add "Provides:" lines for the generic names of the subpackages,
+ independent of "product_suffix".
+
+* Tue Feb 7 2012 Joerg Bruehe <joerg.bruehe@oracle.com>
+- Make "mysql_setpermission" and its man page appear in GPL builds only.
+
+* Thu Nov 24 2011 Joerg Bruehe <joerg.bruehe@oracle.com>
+- Add two patches (#18 + #19) regarding the test suite;
+ version 1 of "mysql-test-run.pl" had to go because the auto-detection
+ of Perl dependencies does not handle differences between run directory
+ and delivery location.
+
+* Thu Nov 3 2011 Joerg Bruehe <joerg.bruehe@oracle.com>
+- Adapt from MySQL 5.1 to 5.5, tested using 5.5.17:
+ - Done by the MySQL Build Team at Oracle:
+ set as packager, set copyright owner and related info;
+ - handle command line options, allowing different configurations, platforms, ...
+ - configurations will show up in the file name as "product_suffix",
+ - use "-n" for all subpackage specifications,
+ - license may be GPL or commercial, mention that in the description,
+ the license output and the included license files will vary,
+ - commercial is "nosource",
+ - improve "requires" listings for different platforms,
+ - explicitly use "product_suffix" in the "requires" entries;
+ - adapt to 5.5 changes in features and function:
+ - remove "mysql-bench" package (files are outdated, not maintained),
+ - no InnoDB plugin,
+ - the set of plugins will vary by configuration, to control the "server"
+ package contents use "-f release/support-files/plugins.files" in the
+ "files" section,
+ - remove "mysqlmanager", "mysql_fix_privilege_tables",
+ - add "mysql_embedded", "mysql-plugin", "mysqlaccess.conf", "magic",
+ - "errmsg.txt" is now in UTF8: "errmsg-utf8.txt",
+ - adapt patches to changed code where needed, rename these to include "5.5",
+ - stop using patches which are not applicable to 5.5;
+ - 5.5 uses a different way of building:
+ - autotools are replaced by cmake,
+ - both a "release" and a "debug" server are built in separate subtrees
+ ("out of source"!), this also affects path names in further handling,
+ - the debug server is added to the "server" subpackage,
+ - add "mysql-5.5-libdir.patch" to handle file placement at user site.
+
+* Mon Dec 20 2010 Tom Lane <tgl@redhat.com> 5.1.52-1.1
+- Update to MySQL 5.1.52, for various fixes described at
+ http://dev.mysql.com/doc/refman/5.1/en/news-5-1-52.html
+ including numerous small security issues
+Resolves: #652553
+- Sync with current Fedora package; this includes:
+- Duplicate COPYING and EXCEPTIONS-CLIENT in -libs and -embedded subpackages,
+ to ensure they are available when any subset of mysql RPMs are installed,
+ per revised packaging guidelines
+- Allow init script's STARTTIMEOUT/STOPTIMEOUT to be overridden from sysconfig
+
+* Thu Jul 15 2010 Tom Lane <tgl@redhat.com> 5.1.47-4
+- Add backported patch for CVE-2010-2008 (upstream bug 53804)
+Resolves: #614215
+- Add BuildRequires perl(Time::HiRes) ... seems to no longer be installed
+ by just pulling in perl.
+
+* Mon Jun 28 2010 Tom Lane <tgl@redhat.com> 5.1.47-3
+- Add -p "$mypidfile" to initscript's status call to improve corner cases.
+ (Note: can't be fixed in Fedora until 595597 is fixed there.)
+Resolves: #596008
+
+* Mon Jun 7 2010 Tom Lane <tgl@redhat.com> 5.1.47-2
+- Add back "partition" storage engine
+Resolves: #598585
+- Fix broken "federated" storage engine plugin
+Resolves: #587170
+- Read all certificates in SSL certificate files, to support chained certs
+Resolves: #598656
+
+* Mon May 24 2010 Tom Lane <tgl@redhat.com> 5.1.47-1
+- Update to MySQL 5.1.47, for various fixes described at
+ http://dev.mysql.com/doc/refman/5.1/en/news-5-1-47.html
+ http://dev.mysql.com/doc/refman/5.1/en/news-5-1-46.html
+ http://dev.mysql.com/doc/refman/5.1/en/news-5-1-45.html
+ including fixes for CVE-2010-1621, CVE-2010-1626,
+ CVE-2010-1848, CVE-2010-1849, CVE-2010-1850
+Resolves: #590598
+- Create mysql group explicitly in pre-server script, to ensure correct GID
+
+* Mon Mar 8 2010 Tom Lane <tgl@redhat.com> 5.1.44-2
+- Update to MySQL 5.1.44, for various fixes described at
+ http://dev.mysql.com/doc/refman/5.1/en/news-5-1-44.html
+Resolves: #565554
+- Remove mysql.info, which is not freely redistributable
+Related: #560181
+- Revert broken upstream fix for their bug 45058
+Related: #566547
+- Bring init script into some modicum of compliance with Fedora/LSB standards
+Resolves: #557711
+Resolves: #562749
+
+* Mon Feb 15 2010 Tom Lane <tgl@redhat.com> 5.1.43-2
+- Update to MySQL 5.1.43, for various fixes described at
+ http://dev.mysql.com/doc/refman/5.1/en/news-5-1-43.html
+Resolves: #565554
+- Remove mysql-cluster, which is no longer supported by upstream in this
+ source distribution. If we want it we'll need a separate SRPM for it.
+Resolves: #565210
+
+* Fri Jan 29 2010 Tom Lane <tgl@redhat.com> 5.1.42-7
+- Add backported patch for CVE-2008-7247 (upstream bug 39277)
+Resolves: #549329
+- Use non-expired certificates for SSL testing (upstream bug 50702)
+
+* Tue Jan 26 2010 Tom Lane <tgl@redhat.com> 5.1.42-6
+- Emit explicit error message if user tries to build RPM as root
+Resolves: #558915
+
+* Wed Jan 20 2010 Tom Lane <tgl@redhat.com> 5.1.42-5
+- Correct Source0: tag and comment to reflect how to get the tarball
+
+* Fri Jan 8 2010 Tom Lane <tgl@redhat.com> 5.1.42-4
+- Sync with current Fedora build, including:
+- Update to MySQL 5.1.42, for various fixes described at
+ http://dev.mysql.com/doc/refman/5.1/en/news-5-1-42.html
+- Disable symbolic links by default in /etc/my.cnf
+Resolves: #553653
+- Remove static libraries (.a files) from package, per packaging guidelines
+- Change %%define to %%global, per packaging guidelines
+- Disable building the innodb plugin; it tickles assorted gcc bugs and
+ doesn't seem entirely ready for prime time anyway.
+Resolves: #553632
+- Start mysqld_safe with --basedir=/usr, to avoid unwanted SELinux messages
+ (see 547485)
+- Stop waiting during "service mysqld start" if mysqld_safe exits
+Resolves: #544095
+
+* Mon Nov 23 2009 Tom Lane <tgl@redhat.com> 5.1.41-1
+- Update to MySQL 5.1.41, for various fixes described at
+ http://dev.mysql.com/doc/refman/5.1/en/news-5-1-41.html
+ including fixes for CVE-2009-4019
+Resolves: #549327
+- Don't set old_passwords=1; we aren't being bug-compatible with 3.23 anymore
+Resolves: #540735
+
+* Tue Nov 10 2009 Tom Lane <tgl@redhat.com> 5.1.40-1
+- Update to MySQL 5.1.40, for various fixes described at
+ http://dev.mysql.com/doc/refman/5.1/en/news-5-1-40.html
+- Do not force the --log-error setting in mysqld init script
+Resolves: #533736
+
+* Sat Oct 17 2009 Tom Lane <tgl@redhat.com> 5.1.39-4
+- Replace kluge fix for ndbd sparc crash with a real fix (mysql bug 48132)
+
+* Thu Oct 15 2009 Tom Lane <tgl@redhat.com> 5.1.39-3
+- Work around two different compiler bugs on sparc, one by backing off
+ optimization from -O2 to -O1, and the other with a klugy patch
+Related: #529298, #529299
+- Clean up bogosity in multilib stub header support: ia64 should not be
+ listed (it's not multilib), sparc and sparc64 should be
+
+* Wed Sep 23 2009 Tom Lane <tgl@redhat.com> 5.1.39-2
+- Work around upstream bug 46895 by disabling outfile_loaddata test
+
+* Tue Sep 22 2009 Tom Lane <tgl@redhat.com> 5.1.39-1
+- Update to MySQL 5.1.39, for various fixes described at
+ http://dev.mysql.com/doc/refman/5.1/en/news-5-1-39.html
+
+* Mon Aug 31 2009 Tom Lane <tgl@redhat.com> 5.1.37-5
+- Work around unportable assumptions about stpcpy(); re-enable main.mysql test
+- Clean up some obsolete parameters to the configure script
+
+* Sat Aug 29 2009 Tom Lane <tgl@redhat.com> 5.1.37-4
+- Remove one misguided patch; turns out I was chasing a glibc bug
+- Temporarily disable "main.mysql" test; there's something broken there too,
+ but we need to get mysql built in rawhide for dependency reasons
+
+* Fri Aug 21 2009 Tomas Mraz <tmraz@redhat.com> - 5.1.37-3
+- rebuilt with new openssl
+
+* Fri Aug 14 2009 Tom Lane <tgl@redhat.com> 5.1.37-2
+- Add a couple of patches to improve the probability of the regression tests
+ completing in koji builds
+
+* Sun Aug 2 2009 Tom Lane <tgl@redhat.com> 5.1.37-1
+- Update to MySQL 5.1.37, for various fixes described at
+ http://dev.mysql.com/doc/refman/5.1/en/news-5-1-37.html
+
+* Sat Jul 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.1.36-2
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
+
+* Fri Jul 10 2009 Tom Lane <tgl@redhat.com> 5.1.36-1
+- Update to MySQL 5.1.36, for various fixes described at
+ http://dev.mysql.com/doc/refman/5.1/en/news-5-1-36.html
+
+* Sat Jun 6 2009 Tom Lane <tgl@redhat.com> 5.1.35-1
+- Update to MySQL 5.1.35, for various fixes described at
+ http://dev.mysql.com/doc/refman/5.1/en/news-5-1-35.html
+- Ensure that /var/lib/mysql is created with the right SELinux context
+Resolves: #502966
+
+* Fri May 15 2009 Tom Lane <tgl@redhat.com> 5.1.34-1
+- Update to MySQL 5.1.34, for various fixes described at
+ http://dev.mysql.com/doc/refman/5.1/en/news-5-1-34.html
+- Increase startup timeout per bug #472222
+
+* Wed Apr 15 2009 Tom Lane <tgl@redhat.com> 5.1.33-2
+- Increase stack size of ndbd threads for safety's sake.
+Related: #494631
+
+* Tue Apr 7 2009 Tom Lane <tgl@redhat.com> 5.1.33-1
+- Update to MySQL 5.1.33.
+- Disable use of pthread_setschedparam; doesn't work the way code expects.
+Related: #477624
+
+* Wed Mar 4 2009 Tom Lane <tgl@redhat.com> 5.1.32-1
+- Update to MySQL 5.1.32.
+
+* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.1.31-2
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
+
+* Fri Feb 13 2009 Tom Lane <tgl@redhat.com> 5.1.31-1
+- Update to MySQL 5.1.31.
+
+* Thu Jan 22 2009 Tom Lane <tgl@redhat.com> 5.1.30-2
+- hm, apparently --with-innodb and --with-ndbcluster are still needed
+ even though no longer documented ...
+
+* Thu Jan 22 2009 Tom Lane <tgl@redhat.com> 5.1.30-1
+- Update to MySQL 5.1.30. Note that this includes an ABI break for
+ libmysqlclient (it's now got .so major version 16).
+- This also updates mysql for new openssl build
+
+* Wed Oct 1 2008 Tom Lane <tgl@redhat.com> 5.0.67-2
+- Build the "embedded server" library, and package it in a new sub-RPM
+ mysql-embedded, along with mysql-embedded-devel for devel support files.
+Resolves: #149829
+
+* Sat Aug 23 2008 Tom Lane <tgl@redhat.com> 5.0.67-1
+- Update to mysql version 5.0.67
+- Move mysql_config's man page to base package, again (apparently I synced
+ that change the wrong way while importing specfile changes for ndbcluster)
+
+* Sun Jul 27 2008 Tom Lane <tgl@redhat.com> 5.0.51a-2
+- Enable ndbcluster support
+Resolves: #163758
+- Suppress odd crash messages during package build, caused by trying to
+ build dbug manual (which we don't install anyway) with dbug disabled
+Resolves: #437053
+- Improve mysql.init to pass configured datadir to mysql_install_db,
+ and to force user=mysql for both mysql_install_db and mysqld_safe.
+Related: #450178
+
+* Mon Mar 3 2008 Tom Lane <tgl@redhat.com> 5.0.51a-1
+- Update to mysql version 5.0.51a
+
+* Mon Mar 3 2008 Tom Lane <tgl@redhat.com> 5.0.45-11
+- Fix mysql-stack-guard patch to work correctly on IA64
+- Fix mysql.init to wait correctly when socket is not in default place
+Related: #435494
+
+* Mon Mar 03 2008 Dennis Gilmore <dennis@ausil.us> 5.0.45-10
+- add sparc64 to 64 bit arches for test suite checking
+- add sparc, sparcv9 and sparc64 to multilib handling
+
+* Thu Feb 28 2008 Tom Lane <tgl@redhat.com> 5.0.45-9
+- Fix the stack overflow problem encountered in January. It seems the real
+issue is that the buildfarm machines were moved to RHEL5, which uses 64K not
+4K pages on PPC, and because RHEL5 takes the guard area out of the requested
+thread stack size we no longer had enough headroom.
+Related: #435337
+
+* Tue Feb 19 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 5.0.45-8
+- Autorebuild for GCC 4.3
+
+* Tue Jan 8 2008 Tom Lane <tgl@redhat.com> 5.0.45-7
+- Unbelievable ... upstream still thinks that it's a good idea to have a
+ regression test that is guaranteed to begin failing come January 1.
+- ... and it seems we need to raise STACK_MIN_SIZE again too.
+
+* Thu Dec 13 2007 Tom Lane <tgl@redhat.com> 5.0.45-6
+- Back-port upstream fixes for CVE-2007-5925, CVE-2007-5969, CVE-2007-6303.
+Related: #422211
+
+* Wed Dec 5 2007 Tom Lane <tgl@redhat.com> 5.0.45-5
+- Rebuild for new openssl
+
+* Sat Aug 25 2007 Tom Lane <tgl@redhat.com> 5.0.45-4
+- Seems we need explicit BuildRequires on gawk and procps now
+- Rebuild to fix Fedora toolchain issues
+
+* Sun Aug 12 2007 Tom Lane <tgl@redhat.com> 5.0.45-3
+- Recent perl changes in rawhide mean we need a more specific BuildRequires
+
+* Thu Aug 2 2007 Tom Lane <tgl@redhat.com> 5.0.45-2
+- Update License tag to match code.
+- Work around recent Fedora change that makes "open" a macro name.
+
+* Sun Jul 22 2007 Tom Lane <tgl@redhat.com> 5.0.45-1
+- Update to MySQL 5.0.45
+Resolves: #246535
+- Move mysql_config's man page to base package
+Resolves: #245770
+- move my_print_defaults to base RPM, for consistency with Stacks packaging
+- mysql user is no longer deleted at RPM uninstall
+Resolves: #241912
+
+* Thu Mar 29 2007 Tom Lane <tgl@redhat.com> 5.0.37-2
+- Use a less hacky method of getting default values in initscript
+Related: #233771, #194596
+- Improve packaging of mysql-libs per suggestions from Remi Collet
+Resolves: #233731
+- Update default /etc/my.cnf ([mysql.server] has been bogus for a long time)
+
+* Mon Mar 12 2007 Tom Lane <tgl@redhat.com> 5.0.37-1
+- Update to MySQL 5.0.37
+Resolves: #231838
+- Put client library into a separate mysql-libs RPM to reduce dependencies
+Resolves: #205630
+
+* Fri Feb 9 2007 Tom Lane <tgl@redhat.com> 5.0.33-1
+- Update to MySQL 5.0.33
+- Install band-aid fix for "view" regression test designed to fail after 2006
+- Don't chmod -R the entire database directory tree on every startup
+Related: #221085
+- Fix unsafe use of install-info
+Resolves: #223713
+- Cope with new automake in F7
+Resolves: #224171
+
+* Thu Nov 9 2006 Tom Lane <tgl@redhat.com> 5.0.27-1
+- Update to MySQL 5.0.27 (see CVE-2006-4031, CVE-2006-4226, CVE-2006-4227)
+Resolves: #202247, #202675, #203427, #203428, #203432, #203434, #208641
+- Fix init script to return status 1 on server start timeout
+Resolves: #203910
+- Move mysqldumpslow from base package to mysql-server
+Resolves: #193559
+- Adjust link options for BDB module
+Resolves: #199368
+
+* Wed Jul 12 2006 Jesse Keating <jkeating@redhat.com> - 5.0.22-2.1
+- rebuild
+
+* Sat Jun 10 2006 Tom Lane <tgl@redhat.com> 5.0.22-2
+- Work around brew's tendency not to clean up failed builds completely,
+ by adding code in mysql-testing.patch to kill leftover mysql daemons.
+
+* Thu Jun 8 2006 Tom Lane <tgl@redhat.com> 5.0.22-1
+- Update to MySQL 5.0.22 (fixes CVE-2006-2753)
+- Install temporary workaround for gcc bug on s390x (bz #193912)
+
+* Tue May 2 2006 Tom Lane <tgl@redhat.com> 5.0.21-2
+- Fix bogus perl Requires for mysql-test
+
+* Mon May 1 2006 Tom Lane <tgl@redhat.com> 5.0.21-1
+- Update to MySQL 5.0.21
+
+* Mon Mar 27 2006 Tom Lane <tgl@redhat.com> 5.0.18-4
+- Modify multilib header hack to not break non-RH arches, per bug #181335
+- Remove logrotate script, per bug #180639.
+- Add a new mysql-test RPM to carry the regression test files;
+ hack up test scripts as needed to make them run in /usr/share/mysql-test.
+
+* Fri Feb 10 2006 Jesse Keating <jkeating@redhat.com> - 5.0.18-2.1
+- bump again for double-long bug on ppc(64)
+
+* Thu Feb 9 2006 Tom Lane <tgl@redhat.com> 5.0.18-2
+- err-log option has been renamed to log-error, fix my.cnf and initscript
+
+* Tue Feb 07 2006 Jesse Keating <jkeating@redhat.com> - 5.0.18-1.1
+- rebuilt for new gcc4.1 snapshot and glibc changes
+
+* Thu Jan 5 2006 Tom Lane <tgl@redhat.com> 5.0.18-1
+- Update to MySQL 5.0.18
+
+* Thu Dec 15 2005 Tom Lane <tgl@redhat.com> 5.0.16-4
+- fix my_config.h for ppc platforms
+
+* Thu Dec 15 2005 Tom Lane <tgl@redhat.com> 5.0.16-3
+- my_config.h needs to guard against 64-bit platforms that also define the
+ 32-bit symbol
+
+* Wed Dec 14 2005 Tom Lane <tgl@redhat.com> 5.0.16-2
+- oops, looks like we want uname -i not uname -m
+
+* Mon Dec 12 2005 Tom Lane <tgl@redhat.com> 5.0.16-1
+- Update to MySQL 5.0.16
+- Add EXCEPTIONS-CLIENT license info to the shipped documentation
+- Make my_config.h architecture-independent for multilib installs;
+ put the original my_config.h into my_config_$ARCH.h
+- Add -fwrapv to CFLAGS so that gcc 4.1 doesn't break it
+
+* Fri Dec 09 2005 Jesse Keating <jkeating@redhat.com>
+- rebuilt
+
+* Mon Nov 14 2005 Tom Lane <tgl@redhat.com> 5.0.15-3
+- Make stop script wait for daemon process to disappear (bz#172426)
+
+* Wed Nov 9 2005 Tom Lane <tgl@redhat.com> 5.0.15-2
+- Rebuild due to openssl library update.
+
+* Thu Nov 3 2005 Tom Lane <tgl@redhat.com> 5.0.15-1
+- Update to MySQL 5.0.15 (scratch build for now)
+
+* Wed Oct 5 2005 Tom Lane <tgl@redhat.com> 4.1.14-1
+- Update to MySQL 4.1.14
+
+* Tue Aug 23 2005 Tom Lane <tgl@redhat.com> 4.1.12-3
+- Use politically correct patch name.
+
+* Tue Jul 12 2005 Tom Lane <tgl@redhat.com> 4.1.12-2
+- Fix buffer overflow newly exposed in isam code; it's the same issue
+ previously found in myisam, and not very exciting, but I'm tired of
+ seeing build warnings.
+
+* Mon Jul 11 2005 Tom Lane <tgl@redhat.com> 4.1.12-1
+- Update to MySQL 4.1.12 (includes a fix for bz#158688, bz#158689)
+- Extend mysql-test-ssl.patch to solve rpl_openssl test failure (bz#155850)
+- Update mysql-lock-ssl.patch to match the upstream committed version
+- Add --with-isam to re-enable the old ISAM table type, per bz#159262
+- Add dependency on openssl-devel per bz#159569
+- Remove manual.txt, as upstream decided not to ship it anymore;
+ it was redundant with the mysql.info file anyway.
+
+* Mon May 9 2005 Tom Lane <tgl@redhat.com> 4.1.11-4
+- Include proper locking for OpenSSL in the server, per bz#155850
+
+* Mon Apr 25 2005 Tom Lane <tgl@redhat.com> 4.1.11-3
+- Enable openssl tests during build, per bz#155850
+- Might as well turn on --disable-dependency-tracking
+
+* Fri Apr 8 2005 Tom Lane <tgl@redhat.com> 4.1.11-2
+- Avoid dependency on <asm/atomic.h>, cause it won't build anymore on ia64.
+ This is probably a cleaner solution for bz#143537, too.
+
+* Thu Apr 7 2005 Tom Lane <tgl@redhat.com> 4.1.11-1
+- Update to MySQL 4.1.11 to fix bz#152911 as well as other issues
+- Move perl-DBI, perl-DBD-MySQL dependencies to server package (bz#154123)
+- Override configure thread library test to suppress HAVE_LINUXTHREADS check
+- Fix BDB failure on s390x (bz#143537)
+- At last we can enable "make test" on all arches
+
+* Fri Mar 11 2005 Tom Lane <tgl@redhat.com> 4.1.10a-1
+- Update to MySQL 4.1.10a to fix security vulnerabilities (bz#150868,
+ for CAN-2005-0711, and bz#150871 for CAN-2005-0709, CAN-2005-0710).
+
+* Sun Mar 6 2005 Tom Lane <tgl@redhat.com> 4.1.10-3
+- Fix package Requires: interdependencies.
+
+* Sat Mar 5 2005 Tom Lane <tgl@redhat.com> 4.1.10-2
+- Need -fno-strict-aliasing in at least one place, probably more.
+- Work around some C spec violations in mysql.
+
+* Fri Feb 18 2005 Tom Lane <tgl@redhat.com> 4.1.10-1
+- Update to MySQL 4.1.10.
+
+* Sat Jan 15 2005 Tom Lane <tgl@redhat.com> 4.1.9-1
+- Update to MySQL 4.1.9.
+
+* Wed Jan 12 2005 Tom Lane <tgl@redhat.com> 4.1.7-10
+- Don't assume /etc/my.cnf will specify pid-file (bz#143724)
+
+* Wed Jan 12 2005 Tim Waugh <twaugh@redhat.com> 4.1.7-9
+- Rebuilt for new readline.
+
+* Tue Dec 21 2004 Tom Lane <tgl@redhat.com> 4.1.7-8
+- Run make test on all archs except s390x (which seems to have a bdb issue)
+
+* Mon Dec 13 2004 Tom Lane <tgl@redhat.com> 4.1.7-7
+- Suppress someone's silly idea that libtool overhead can be skipped
+
+* Sun Dec 12 2004 Tom Lane <tgl@redhat.com> 4.1.7-6
+- Fix init script to not need a valid username for startup check (bz#142328)
+- Fix init script to honor settings appearing in /etc/my.cnf (bz#76051)
+- Enable SSL (bz#142032)
+
+* Thu Dec 2 2004 Tom Lane <tgl@redhat.com> 4.1.7-5
+- Add a restorecon to keep the mysql.log file in the right context (bz#143887)
+
+* Tue Nov 23 2004 Tom Lane <tgl@redhat.com> 4.1.7-4
+- Turn off old_passwords in default /etc/my.cnf file, for better compatibility
+ with mysql 3.x clients (per suggestion from Joe Orton).
+
+* Fri Oct 29 2004 Tom Lane <tgl@redhat.com> 4.1.7-3
+- Handle ldconfig more cleanly (put a file in /etc/ld.so.conf.d/).
+
+* Thu Oct 28 2004 Tom Lane <tgl@redhat.com> 4.1.7-2
+- rebuild in devel branch
+
+* Wed Oct 27 2004 Tom Lane <tgl@redhat.com> 4.1.7-1
+- Update to MySQL 4.1.x.
+
+* Tue Oct 12 2004 Tom Lane <tgl@redhat.com> 3.23.58-13
+- fix security issues CAN-2004-0835, CAN-2004-0836, CAN-2004-0837
+ (bugs #135372, 135375, 135387)
+- fix privilege escalation on GRANT ALL ON `Foo\_Bar` (CAN-2004-0957)
+
+* Wed Oct 06 2004 Tom Lane <tgl@redhat.com> 3.23.58-12
+- fix multilib problem with mysqlbug and mysql_config
+- adjust chkconfig priority per bug #128852
+- remove bogus quoting per bug #129409 (MySQL 4.0 has done likewise)
+- add sleep to mysql.init restart(); may or may not fix bug #133993
+
+* Tue Oct 05 2004 Tom Lane <tgl@redhat.com> 3.23.58-11
+- fix low-priority security issues CAN-2004-0388, CAN-2004-0381, CAN-2004-0457
+ (bugs #119442, 125991, 130347, 130348)
+- fix bug with dropping databases under recent kernels (bug #124352)
+
+* Tue Jun 15 2004 Elliot Lee <sopwith@redhat.com> 3.23.58-10
+- rebuilt
+
+* Sat Apr 17 2004 Warren Togami <wtogami@redhat.com> 3.23.58-9
+- remove redundant INSTALL-SOURCE, manual.*
+- compress manual.txt.bz2
+- BR time
+
+* Tue Mar 16 2004 Tom Lane <tgl@redhat.com> 3.23.58-8
+- repair logfile attributes in %%files, per bug #102190
+- repair quoting problem in mysqlhotcopy, per bug #112693
+- repair missing flush in mysql_setpermission, per bug #113960
+- repair broken error message printf, per bug #115165
+- delete mysql user during uninstall, per bug #117017
+- rebuilt
+
+* Tue Mar 02 2004 Elliot Lee <sopwith@redhat.com>
+- rebuilt
+
+* Tue Feb 24 2004 Tom Lane <tgl@redhat.com>
+- fix chown syntax in mysql.init
+- rebuild
+
+* Fri Feb 13 2004 Elliot Lee <sopwith@redhat.com>
+- rebuilt
+
+* Tue Nov 18 2003 Kim Ho <kho@redhat.com> 3.23.58-5
+- update mysql.init to use anonymous user (UNKNOWN_MYSQL_USER) for
+ pinging mysql server (#108779)
+
+* Mon Oct 27 2003 Kim Ho <kho@redhat.com> 3.23.58-4
+- update mysql.init to wait (max 10 seconds) for mysql server to
+ start (#58732)
+
+* Mon Oct 27 2003 Patrick Macdonald <patrickm@redhat.com> 3.23.58-3
+- re-enable Berkeley DB support (#106832)
+- re-enable ia64 testing
+
+* Fri Sep 19 2003 Patrick Macdonald <patrickm@redhat.com> 3.23.58-2
+- rebuilt
+
+* Mon Sep 15 2003 Patrick Macdonald <patrickm@redhat.com> 3.23.58-1
+- upgrade to 3.23.58 for security fix
+
+* Tue Aug 26 2003 Patrick Macdonald <patrickm@redhat.com> 3.23.57-2
+- rebuilt
+
+* Wed Jul 02 2003 Patrick Macdonald <patrickm@redhat.com> 3.23.57-1
+- revert to prior version of MySQL due to license incompatibilities
+ with packages that link against the client. The MySQL folks are
+ looking into the issue.
+
+* Wed Jun 18 2003 Patrick Macdonald <patrickm@redhat.com> 4.0.13-4
+- restrict test on ia64 (temporary)
+
+* Wed Jun 04 2003 Elliot Lee <sopwith@redhat.com> 4.0.13-3
+- rebuilt
+
+* Thu May 29 2003 Patrick Macdonald <patrickm@redhat.com> 4.0.13-2
+- fix filter-requires-mysql.sh with less restrictive for mysql-bench
+
+* Wed May 28 2003 Patrick Macdonald <patrickm@redhat.com> 4.0.13-1
+- update for MySQL 4.0
+- back-level shared libraries available in mysqlclient10 package
+
+* Fri May 09 2003 Patrick Macdonald <patrickm@redhat.com> 3.23.56-2
+- add sql-bench package (#90110)
+
+* Wed Mar 19 2003 Patrick Macdonald <patrickm@redhat.com> 3.23.56-1
+- upgrade to 3.23.56 for security fixes
+- remove patch for double-free (included in 3.23.56)
+
+* Tue Feb 18 2003 Patrick Macdonald <patrickm@redhat.com> 3.23.54a-11
+- enable thread safe client
+- add patch for double free fix
+
+* Wed Jan 22 2003 Tim Powers <timp@redhat.com>
+- rebuilt
+
+* Mon Jan 13 2003 Karsten Hopp <karsten@redhat.de> 3.23.54a-9
+- disable checks on s390x
+
+* Sat Jan 4 2003 Jeff Johnson <jbj@redhat.com> 3.23.54a-8
+- use internal dep generator.
+
+* Wed Jan 1 2003 Bill Nottingham <notting@redhat.com> 3.23.54a-7
+- fix mysql_config on hammer
+
+* Sun Dec 22 2002 Tim Powers <timp@redhat.com> 3.23.54a-6
+- don't use rpms internal dep generator
+
+* Tue Dec 17 2002 Elliot Lee <sopwith@redhat.com> 3.23.54a-5
+- Push it into the build system
+
+* Mon Dec 16 2002 Joe Orton <jorton@redhat.com> 3.23.54a-4
+- upgrade to 3.23.54a for safe_mysqld fix
+
+* Thu Dec 12 2002 Joe Orton <jorton@redhat.com> 3.23.54-3
+- upgrade to 3.23.54 for latest security fixes
+
+* Tue Nov 19 2002 Jakub Jelinek <jakub@redhat.com> 3.23.52-5
+- Always include <errno.h> for errno
+- Remove unpackaged files
+
+* Tue Nov 12 2002 Florian La Roche <Florian.LaRoche@redhat.de>
+- do not prereq userdel, not used at all
+
+* Mon Sep 9 2002 Trond Eivind Glomsrd <teg@redhat.com> 3.23.52-4
+- Use %%{_libdir}
+- Add patch for x86-64
+
+* Wed Sep 4 2002 Jakub Jelinek <jakub@redhat.com> 3.23.52-3
+- rebuilt with gcc-3.2-7
+
+* Thu Aug 29 2002 Trond Eivind Glomsrd <teg@redhat.com> 3.23.52-2
+- Add --enable-local-infile to configure - a new option
+ which doesn't default to the old behaviour (#72885)
+
+* Fri Aug 23 2002 Trond Eivind Glomsrd <teg@redhat.com> 3.23.52-1
+- 3.23.52. Fixes a minor security problem, various bugfixes.
+
+* Sat Aug 10 2002 Elliot Lee <sopwith@redhat.com> 3.23.51-5
+- rebuilt with gcc-3.2 (we hope)
+
+* Mon Jul 22 2002 Trond Eivind Glomsrd <teg@redhat.com> 3.23.51-4
+- rebuild
+
+* Thu Jul 18 2002 Trond Eivind Glomsrd <teg@redhat.com> 3.23.51-3
+- Fix #63543 and #63542
+
+* Thu Jul 11 2002 Trond Eivind Glomsrd <teg@redhat.com> 3.23.51-2
+- Turn off bdb on PPC(#68591)
+- Turn off the assembly optimizations, for safety.
+
+* Wed Jun 26 2002 Trond Eivind Glomsrd <teg@redhat.com> 3.23.51-1
+- Work around annoying auto* thinking this is a crosscompile
+- 3.23.51
+
+* Fri Jun 21 2002 Tim Powers <timp@redhat.com>
+- automated rebuild
+
+* Mon Jun 10 2002 Trond Eivind Glomsrd <teg@redhat.com> 3.23.50-2
+- Add dependency on perl-DBI and perl-DBD-MySQL (#66349)
+
+* Thu May 30 2002 Trond Eivind Glomsrd <teg@redhat.com> 3.23.50-1
+- 3.23.50
+
+* Thu May 23 2002 Tim Powers <timp@redhat.com>
+- automated rebuild
+
+* Mon May 13 2002 Trond Eivind Glomsrd <teg@redhat.com> 3.23.49-4
+- Rebuild
+- Don't set CXX to gcc, it doesn't work anymore
+- Exclude Alpha
+
+* Mon Apr 8 2002 Trond Eivind Glomsrd <teg@redhat.com> 3.23.49-3
+- Add the various .cnf examples as doc files to mysql-server (#60349)
+- Don't include manual.ps, it's just 200 bytes with a URL inside (#60349)
+- Don't include random files in /usr/share/mysql (#60349)
+- langify (#60349)
+
+* Thu Feb 21 2002 Trond Eivind Glomsrd <teg@redhat.com> 3.23.49-2
+- Rebuild
+
+* Sun Feb 17 2002 Trond Eivind Glomsrd <teg@redhat.com> 3.23.49-1
+- 3.23.49
+
+* Thu Feb 14 2002 Trond Eivind Glomsrd <teg@redhat.com> 3.23.48-2
+- work around perl dependency bug.
+
+* Mon Feb 11 2002 Trond Eivind Glomsrd <teg@redhat.com> 3.23.48-1
+- 3.23.48
+
+* Thu Jan 17 2002 Trond Eivind Glomsrd <teg@redhat.com> 3.23.47-4
+- Use kill, not mysqladmin, to flush logs and shut down. Thus,
+ an admin password can be set with no problems.
+- Remove reload from init script
+
+* Wed Jan 16 2002 Trond Eivind Glomsrd <teg@redhat.com> 3.23.47-3
+- remove db3-devel from buildrequires,
+ MySQL has had its own bundled copy since the mid thirties
+
+* Sun Jan 6 2002 Trond Eivind Glomsrd <teg@redhat.com> 3.23.47-1
+- 3.23.47
+- Don't build for alpha, toolchain immature.
+
+* Mon Dec 3 2001 Trond Eivind Glomsrd <teg@redhat.com> 3.23.46-1
+- 3.23.46
+- use -fno-rtti and -fno-exceptions, and set CXX to increase stability.
+ Recommended by mysql developers.
+
+* Sun Nov 25 2001 Trond Eivind Glomsrd <teg@redhat.com> 3.23.45-1
+- 3.23.45
+
+* Wed Nov 14 2001 Trond Eivind Glomsrd <teg@redhat.com> 3.23.44-2
+- centralize definition of datadir in the initscript (#55873)
+
+* Fri Nov 2 2001 Trond Eivind Glomsrd <teg@redhat.com> 3.23.44-1
+- 3.23.44
+
+* Thu Oct 4 2001 Trond Eivind Glomsrd <teg@redhat.com> 3.23.43-1
+- 3.23.43
+
+* Mon Sep 10 2001 Trond Eivind Glomsrd <teg@redhat.com> 3.23.42-1
+- 3.23.42
+- reenable innodb
+
+* Tue Aug 14 2001 Trond Eivind Glomsrd <teg@redhat.com> 3.23.41-1
+- 3.23.41 bugfix release
+- disable innodb, to avoid the broken updates
+- Use "mysqladmin flush_logs" instead of kill -HUP in logrotate
+ script (#51711)
+
+* Sat Jul 21 2001 Trond Eivind Glomsrd <teg@redhat.com>
+- 3.23.40, bugfix release
+- Add zlib-devel to buildrequires:
+
+* Fri Jul 20 2001 Trond Eivind Glomsrd <teg@redhat.com>
+- BuildRequires-tweaking
+
+* Thu Jun 28 2001 Trond Eivind Glomsrd <teg@redhat.com>
+- Reenable test, but don't run them for s390, s390x or ia64
+- Make /etc/my.cnf config(noplace). Same for /etc/logrotate.d/mysqld
+
+* Thu Jun 14 2001 Trond Eivind Glomsrd <teg@redhat.com>
+- 3.23.29
+- enable innodb
+- enable assembly again
+- disable tests for now...
+
+* Tue May 15 2001 Trond Eivind Glomsrd <teg@redhat.com>
+- 3.23.38
+- Don't use BDB on Alpha - no fast mutexes
+
+* Tue Apr 24 2001 Trond Eivind Glomsrd <teg@redhat.com>
+- 3.23.37
+- Add _GNU_SOURCE to the compile flags
+
+* Wed Mar 28 2001 Trond Eivind Glomsrd <teg@redhat.com>
+- Make it obsolete our 6.2 PowerTools packages
+- 3.23.36 bugfix release - fixes some security issues
+ which didn't apply to our standard configuration
+- Make "make test" part of the build process, except on IA64
+ (it fails there)
+
+* Tue Mar 20 2001 Trond Eivind Glomsrd <teg@redhat.com>
+- 3.23.35 bugfix release
+- Don't delete the mysql user on uninstall
+
+* Tue Mar 13 2001 Trond Eivind Glomsrd <teg@redhat.com>
+- 3.23.34a bugfix release
+
+* Wed Feb 7 2001 Trond Eivind Glomsrd <teg@redhat.com>
+- added readline-devel to BuildRequires:
+
+* Tue Feb 6 2001 Trond Eivind Glomsrd <teg@redhat.com>
+- small i18n-fixes to initscript (action needs $)
+
+* Tue Jan 30 2001 Trond Eivind Glomsrd <teg@redhat.com>
+- make it shut down and rotate logs without using mysqladmin
+ (from #24909)
+
+* Mon Jan 29 2001 Trond Eivind Glomsrd <teg@redhat.com>
+- conflict with "MySQL"
+
+* Tue Jan 23 2001 Trond Eivind Glomsrd <teg@redhat.com>
+- improve gettextizing
+
+* Mon Jan 22 2001 Trond Eivind Glomsrd <teg@redhat.com>
+- 3.23.32
+- fix logrotate script (#24589)
+
+* Wed Jan 17 2001 Trond Eivind Glomsrd <teg@redhat.com>
+- gettextize
+- move the items in Requires(post): to Requires: in preparation
+ for an errata for 7.0 when 3.23.31 is released
+- 3.23.31
+
+* Tue Jan 16 2001 Trond Eivind Glomsrd <teg@redhat.com>
+- add the log file to the rpm database, and make it 0640
+ (#24116)
+- as above in logrotate script
+- changes to the init sequence - put most of the data
+ in /etc/my.cnf instead of hardcoding in the init script
+- use /var/run/mysqld/mysqld.pid instead of
+ /var/run/mysqld/pid
+- use standard safe_mysqld
+- shut down cleaner
+
+* Mon Jan 08 2001 Trond Eivind Glomsrd <teg@redhat.com>
+- 3.23.30
+- do an explicit chmod on /var/lib/mysql in post, to avoid
+ any problems with broken permissons. There is a report
+ of rm not changing this on its own (#22989)
+
+* Mon Jan 01 2001 Trond Eivind Glomsrd <teg@redhat.com>
+- bzipped source
+- changed from 85 to 78 in startup, so it starts before
+ apache (which can use modules requiring mysql)
+
+* Wed Dec 27 2000 Trond Eivind Glomsrd <teg@redhat.com>
+- 3.23.29a
+
+* Tue Dec 19 2000 Trond Eivind Glomsrd <teg@redhat.com>
+- add requirement for new libstdc++, build for errata
+
+* Mon Dec 18 2000 Trond Eivind Glomsrd <teg@redhat.com>
+- 3.23.29
+
+* Mon Nov 27 2000 Trond Eivind Glomsrd <teg@redhat.com>
+- 3.23.28 (gamma)
+- remove old patches, as they are now upstreamed
+
+* Thu Nov 14 2000 Trond Eivind Glomsrd <teg@redhat.com>
+- Add a requirement for a new glibc (#20735)
+- build on IA64
+
+* Wed Nov 1 2000 Trond Eivind Glomsrd <teg@redhat.com>
+- disable more assembly
+
+* Wed Nov 1 2000 Jakub Jelinek <jakub@redhat.com>
+- fix mysql on SPARC (#20124)
+
+* Tue Oct 31 2000 Trond Eivind Glomsrd <teg@redhat.com>
+- 3.23.27
+
+* Wed Oct 25 2000 Trond Eivind Glomsrd <teg@redhat.com>
+- add patch for fixing bogus aliasing in mysql from Jakub,
+ which should fix #18905 and #18620
+
+* Mon Oct 23 2000 Trond Eivind Glomsrd <teg@redhat.com>
+- check for negative niceness values, and negate it
+ if present (#17899)
+- redefine optflags on IA32 FTTB
+
+* Wed Oct 18 2000 Trond Eivind Glomsrd <teg@redhat.com>
+- 3.23.26, which among other fixes now uses mkstemp()
+ instead of tempnam().
+- revert changes made yesterday, the problem is now
+ isolated
+
+* Tue Oct 17 2000 Trond Eivind Glomsrd <teg@redhat.com>
+- use the compat C++ compiler FTTB. Argh.
+- add requirement of ncurses4 (see above)
+
+* Sun Oct 01 2000 Trond Eivind Glomsrd <teg@redhat.com>
+- 3.23.25
+- fix shutdown problem (#17956)
+
+* Tue Sep 26 2000 Trond Eivind Glomsrd <teg@redhat.com>
+- Don't try to include no-longer-existing PUBLIC file
+ as doc (#17532)
+
+* Thu Sep 12 2000 Trond Eivind Glomsrd <teg@redhat.com>
+- rename config file to /etc/my.cnf, which is what
+ mysqld wants... doh. (#17432)
+- include a changed safe_mysqld, so the pid file option
+ works.
+- make mysql dir world readable to they can access the
+ mysql socket. (#17432)
+- 3.23.24
+
+* Wed Sep 06 2000 Trond Eivind Glomsrd <teg@redhat.com>
+- 3.23.23
+
+* Sun Aug 27 2000 Trond Eivind Glomsrd <teg@redhat.com>
+- Add "|| :" to condrestart to avoid non-zero exit code
+
+* Thu Aug 24 2000 Trond Eivind Glomsrd <teg@redhat.com>
+- it's mysql.com, not mysql.org and use correct path to
+ source (#16830)
+
+* Wed Aug 16 2000 Trond Eivind Glomsrd <teg@redhat.com>
+- source file from /etc/rc.d, not /etc/rd.d. Doh.
+
+* Sun Aug 13 2000 Trond Eivind Glomsrd <teg@redhat.com>
+- don't run ldconfig -n, it doesn't update ld.so.cache
+ (#16034)
+- include some missing binaries
+- use safe_mysqld to start the server (request from
+ mysql developers)
+
+* Sat Aug 05 2000 Bill Nottingham <notting@redhat.com>
+- condrestart fixes
+
+* Mon Aug 01 2000 Trond Eivind Glomsrd <teg@redhat.com>
+- 3.23.22. Disable the old patches, they're now in.
+
+* Thu Jul 27 2000 Trond Eivind Glomsrd <teg@redhat.com>
+- bugfixes in the initscript
+- move the .so link to the devel package
+
+* Wed Jul 19 2000 Trond Eivind Glomsrd <teg@redhat.com>
+- rebuild due to glibc changes
+
+* Tue Jul 18 2000 Trond Eivind Glomsrd <teg@redhat.com>
+- disable compiler patch
+- don't include info directory file
+
+* Mon Jul 17 2000 Trond Eivind Glomsrd <teg@redhat.com>
+- move back to /etc/rc.d/init.d
+
+* Fri Jul 14 2000 Trond Eivind Glomsrd <teg@redhat.com>
+- more cleanups in initscript
+
+* Thu Jul 13 2000 Trond Eivind Glomsrd <teg@redhat.com>
+- add a patch to work around compiler bug
+ (from monty@mysql.com)
+
+* Wed Jul 12 2000 Trond Eivind Glomsrd <teg@redhat.com>
+- don't build the SQL daemon statically (glibc problems)
+- fix the logrotate script - only flush log if mysql
+ is running
+- change the reloading procedure
+- remove icon - glint is obsolete a long time ago
+
+* Wed Jul 12 2000 Prospector <bugzilla@redhat.com>
+- automatic rebuild
+
+* Mon Jul 10 2000 Trond Eivind Glomsrd <teg@redhat.com>
+- try the new compiler again
+- build the SQL daemon statically
+- add compile time support for complex charsets
+- enable assembler
+- more cleanups in initscript
+
+* Sun Jul 09 2000 Trond Eivind Glomsrd <teg@redhat.com>
+- use old C++ compiler
+- Exclusivearch x86
+
+* Sat Jul 08 2000 Trond Eivind Glomsrd <teg@redhat.com>
+- move .so files to devel package
+- more cleanups
+- exclude sparc for now
+
+* Wed Jul 05 2000 Trond Eivind Glomsrd <teg@redhat.com>
+- 3.23.21
+- remove file from /etc/sysconfig
+- Fix initscript a bit - initialization of databases doesn't
+ work yet
+- specify the correct licenses
+- include a /etc/my.conf (empty, FTTB)
+- add conditional restart to spec file
+
+* Tue Jul 2 2000 Jakub Jelinek <jakub@redhat.com>
+- Rebuild with new C++
+
+* Fri Jun 30 2000 Trond Eivind Glomsrd <teg@redhat.com>
+- update to 3.23.20
+- use %%configure, %%makeinstall, %%{_tmppath}, %%{_mandir},
+ %%{_infodir}, /etc/init.d
+- remove the bench package
+- change some of the descriptions a little bit
+- fix the init script
+- some compile fixes
+- specify mysql user
+- use mysql uid 27 (postgresql is 26)
+- don't build on ia64
+
+* Sat Feb 26 2000 Jos Vos <jos@xos.nl>
+- Version 3.22.32 release XOS.1 for LinuX/OS 1.8.0
+- Upgrade from version 3.22.27 to 3.22.32.
+- Do "make install" instead of "make install-strip", because "install -s"
+ now appears to fail on various scripts. Afterwards, strip manually.
+- Reorganize subpackages, according to common Red Hat packages: the client
+ program and shared library become the base package and the server and
+ some accompanying files are now in a separate server package. The
+ server package implicitly requires the base package (shared library),
+ but we have added a manual require tag anyway (because of the shared
+ config file, and more).
+- Rename the mysql-benchmark subpackage to mysql-bench.
+
+* Mon Jan 31 2000 Jos Vos <jos@xos.nl>
+- Version 3.22.27 release XOS.2 for LinuX/OS 1.7.1
+- Add post(un)install scripts for updating ld.so.conf (client subpackage).
+
+* Sun Nov 21 1999 Jos Vos <jos@xos.nl>
+- Version 3.22.27 release XOS.1 for LinuX/OS 1.7.0
+- Initial version.
+- Some ideas borrowed from Red Hat Powertools 6.1, although this spec
+ file is a full rewrite from scratch.
diff --git a/packaging/rpm-uln/scriptstub.c b/packaging/rpm-uln/scriptstub.c
new file mode 100644
index 00000000000..de942c136e7
--- /dev/null
+++ b/packaging/rpm-uln/scriptstub.c
@@ -0,0 +1,32 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+/* Translate call of myself into call of same-named script in LIBDIR */
+/* The macro LIBDIR must be defined as a double-quoted string */
+
+int main (int argc, char **argv)
+{
+ char *basename;
+ char *fullname;
+ char **newargs;
+ int i;
+
+ basename = strrchr(argv[0], '/');
+ if (basename)
+ basename++;
+ else
+ basename = argv[0];
+ fullname = malloc(strlen(LIBDIR) + strlen(basename) + 2);
+ sprintf(fullname, "%s/%s", LIBDIR, basename);
+ newargs = malloc((argc+1) * sizeof(char *));
+ newargs[0] = fullname;
+ for (i = 1; i < argc; i++)
+ newargs[i] = argv[i];
+ newargs[argc] = NULL;
+
+ execvp(fullname, newargs);
+
+ return 1;
+}
diff --git a/plugin/feedback/utils.cc b/plugin/feedback/utils.cc
index 8043c46816e..f7f962deaca 100644
--- a/plugin/feedback/utils.cc
+++ b/plugin/feedback/utils.cc
@@ -44,6 +44,12 @@ static const char *get_os_version_name(OSVERSIONINFOEX *ver)
DWORD major = ver->dwMajorVersion;
DWORD minor = ver->dwMinorVersion;
+ if (major == 6 && minor == 2)
+ {
+ return (ver->wProductType == VER_NT_WORKSTATION)?
+ "Windows 8":"Windows Server 2012";
+ }
+
if (major == 6 && minor == 1)
{
return (ver->wProductType == VER_NT_WORKSTATION)?
diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt
index 91a47bf3d48..76e92899c2a 100644
--- a/scripts/CMakeLists.txt
+++ b/scripts/CMakeLists.txt
@@ -29,7 +29,7 @@ ENDIF()
IF(CAT_EXECUTABLE)
SET(CAT_COMMAND COMMAND
${CMAKE_COMMAND} -E chdir ${CMAKE_CURRENT_SOURCE_DIR}
- ${CAT_EXECUTABLE} mysql_system_tables.sql mysql_system_tables_fix.sql >
+ ${CAT_EXECUTABLE} mysql_system_tables.sql mysql_system_tables_fix.sql mysql_performance_tables.sql >
${CMAKE_CURRENT_BINARY_DIR}/mysql_fix_privilege_tables.sql
)
ELSEIF(WIN32)
@@ -37,7 +37,7 @@ ELSEIF(WIN32)
native_outfile )
SET(CAT_COMMAND
COMMAND ${CMAKE_COMMAND} -E chdir ${CMAKE_CURRENT_SOURCE_DIR}
- cmd /c copy /b mysql_system_tables.sql + mysql_system_tables_fix.sql
+ cmd /c copy /b mysql_system_tables.sql + mysql_system_tables_fix.sql + mysql_performance_tables.sql
${native_outfile} )
ELSE()
MESSAGE(FATAL_ERROR "Cannot concatenate files")
@@ -55,6 +55,7 @@ ADD_CUSTOM_COMMAND(
DEPENDS comp_sql
${CMAKE_CURRENT_SOURCE_DIR}/mysql_system_tables.sql
${CMAKE_CURRENT_SOURCE_DIR}/mysql_system_tables_fix.sql
+ ${CMAKE_CURRENT_SOURCE_DIR}/mysql_performance_tables.sql
)
# Add target for the above to be built
@@ -74,6 +75,7 @@ ENDIF()
INSTALL(FILES
${CMAKE_CURRENT_SOURCE_DIR}/mysql_system_tables.sql
${CMAKE_CURRENT_SOURCE_DIR}/mysql_system_tables_data.sql
+ ${CMAKE_CURRENT_SOURCE_DIR}/mysql_performance_tables.sql
${CMAKE_CURRENT_SOURCE_DIR}/fill_help_tables.sql
${CMAKE_CURRENT_SOURCE_DIR}/mysql_test_data_timezone.sql
${FIX_PRIVILEGES_SQL}
@@ -283,7 +285,7 @@ SET(mysql_config_COMPONENT COMPONENT Development)
SET(msql2mysql_COMPONENT COMPONENT Client)
SET(mysqlaccess_COMPONENT COMPONENT Client)
SET(mysql_find_rows_COMPONENT COMPONENT Client)
-SET(mytop_COMPONENT Client)
+SET(mytop_COMPONENT Mytop)
IF(WIN32)
# On Windows, some .sh and some .pl.in files are configured
diff --git a/scripts/mysql_install_db.pl.in b/scripts/mysql_install_db.pl.in
index d4e22ea0340..1bc2603a718 100644
--- a/scripts/mysql_install_db.pl.in
+++ b/scripts/mysql_install_db.pl.in
@@ -423,7 +423,9 @@ my $mysqld_install_cmd_line = quote_options($mysqld_bootstrap,
"--bootstrap",
"--basedir=$opt->{basedir}",
"--datadir=$opt->{ldata}",
+ "--log-warnings=0",
"--max_allowed_packet=8M",
+ "--default-storage-engine=MyISAM",
"--net_buffer_length=16K",
@args,
);
@@ -436,6 +438,8 @@ report_verbose_wait($opt,"Installing MySQL system tables...");
open(SQL, $create_system_tables)
or error($opt,"can't open $create_system_tables for reading: $!");
+open(SQL2, $fill_system_tables)
+ or error($opt,"can't open $fill_system_tables for reading: $!");
# FIXME > /dev/null ?
if ( open(PIPE, "| $mysqld_install_cmd_line") )
{
@@ -449,8 +453,20 @@ if ( open(PIPE, "| $mysqld_install_cmd_line") )
print PIPE $_;
}
+ while ( <SQL2> )
+ {
+ # TODO: make it similar to the above condition when we're sure
+ # @@hostname returns a fqdn
+ # When doing a "cross bootstrap" install, no reference to the current
+ # host should be added to the system tables. So we filter out any
+ # lines which contain the current host name.
+ next if /\@current_hostname/;
+
+ print PIPE $_;
+ }
close PIPE;
close SQL;
+ close SQL2;
report_verbose($opt,"OK");
diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh
index 1a511524e84..639b2209b5b 100644
--- a/scripts/mysql_install_db.sh
+++ b/scripts/mysql_install_db.sh
@@ -1,6 +1,6 @@
#!/bin/sh
# Copyright (c) 2000, 2011, Oracle and/or its affiliates.
-# Copyright (c) 2009, 2011, Monty Program Ab
+# Copyright (c) 2009, 2011,2013 Monty Program Ab
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -305,9 +305,10 @@ fi
# Set up paths to SQL scripts required for bootstrap
fill_help_tables="$pkgdatadir/fill_help_tables.sql"
create_system_tables="$pkgdatadir/mysql_system_tables.sql"
+create_system_tables2="$pkgdatadir/mysql_performance_tables.sql"
fill_system_tables="$pkgdatadir/mysql_system_tables_data.sql"
-for f in "$fill_help_tables" "$create_system_tables" "$fill_system_tables"
+for f in "$fill_help_tables" "$create_system_tables" "$create_system_tables2" "$fill_system_tables"
do
if test ! -f "$f"
then
@@ -424,7 +425,7 @@ mysqld_install_cmd_line()
# Create the system and help tables by passing them to "mysqld --bootstrap"
s_echo "Installing MariaDB/MySQL system tables in '$ldata' ..."
-if { echo "use mysql;"; cat "$create_system_tables" "$fill_system_tables"; } | eval "$filter_cmd_line" | mysqld_install_cmd_line > /dev/null
+if { echo "use mysql;"; cat "$create_system_tables" "$create_system_tables2" "$fill_system_tables"; } | eval "$filter_cmd_line" | mysqld_install_cmd_line > /dev/null
then
s_echo "OK"
else
diff --git a/scripts/mysql_performance_tables.sql b/scripts/mysql_performance_tables.sql
new file mode 100644
index 00000000000..d08ef13a8a9
--- /dev/null
+++ b/scripts/mysql_performance_tables.sql
@@ -0,0 +1,1451 @@
+--
+-- PERFORMANCE SCHEMA INSTALLATION
+-- Note that this script is also reused by mysql_upgrade,
+-- so we have to be very careful here to not destroy any
+-- existing database named 'performance_schema' if it
+-- can contain user data.
+-- In case of downgrade, it's ok to drop unknown tables
+-- from a future version, as long as they belong to the
+-- performance schema engine.
+--
+
+set @have_old_pfs= (select count(*) from information_schema.schemata where schema_name='performance_schema');
+
+SET @cmd="SET @broken_tables = (select count(*) from information_schema.tables where engine != 'PERFORMANCE_SCHEMA' and table_schema='performance_schema')";
+
+-- Work around for bug#49542
+SET @str = IF(@have_old_pfs = 1, @cmd, 'SET @broken_tables = 0');
+PREPARE stmt FROM @str;
+EXECUTE stmt;
+DROP PREPARE stmt;
+
+SET @cmd="SET @broken_views = (select count(*) from information_schema.views where table_schema='performance_schema')";
+
+-- Work around for bug#49542
+SET @str = IF(@have_old_pfs = 1, @cmd, 'SET @broken_views = 0');
+PREPARE stmt FROM @str;
+EXECUTE stmt;
+DROP PREPARE stmt;
+
+SET @broken_routines = (select count(*) from mysql.proc where db='performance_schema');
+
+SET @broken_events = (select count(*) from mysql.event where db='performance_schema');
+
+SET @broken_pfs= (select @broken_tables + @broken_views + @broken_routines + @broken_events);
+
+--
+-- The performance schema database.
+-- Only drop and create the database if this is safe (no broken_pfs).
+-- This database is created, even in --without-perfschema builds,
+-- so that the database name is always reserved by the MySQL implementation.
+--
+
+SET @cmd= "DROP DATABASE IF EXISTS performance_schema";
+
+SET @str = IF(@broken_pfs = 0, @cmd, 'SET @dummy = 0');
+PREPARE stmt FROM @str;
+EXECUTE stmt;
+DROP PREPARE stmt;
+
+SET @cmd= "CREATE DATABASE performance_schema character set utf8";
+
+SET @str = IF(@broken_pfs = 0, @cmd, 'SET @dummy = 0');
+PREPARE stmt FROM @str;
+EXECUTE stmt;
+DROP PREPARE stmt;
+
+--
+-- From this point, only create the performance schema tables
+-- if the server is built with performance schema
+--
+
+set @have_pfs= (select count(engine) from information_schema.engines where engine='PERFORMANCE_SCHEMA' and support != 'NO');
+
+--
+-- TABLE COND_INSTANCES
+--
+
+SET @cmd="CREATE TABLE performance_schema.cond_instances("
+ "NAME VARCHAR(128) not null,"
+ "OBJECT_INSTANCE_BEGIN BIGINT unsigned not null"
+ ")ENGINE=PERFORMANCE_SCHEMA;";
+
+SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
+PREPARE stmt FROM @str;
+EXECUTE stmt;
+DROP PREPARE stmt;
+
+--
+-- TABLE EVENTS_WAITS_CURRENT
+--
+
+SET @cmd="CREATE TABLE performance_schema.events_waits_current("
+ "THREAD_ID INTEGER not null,"
+ "EVENT_ID BIGINT unsigned not null,"
+ "END_EVENT_ID BIGINT unsigned,"
+ "EVENT_NAME VARCHAR(128) not null,"
+ "SOURCE VARCHAR(64),"
+ "TIMER_START BIGINT unsigned,"
+ "TIMER_END BIGINT unsigned,"
+ "TIMER_WAIT BIGINT unsigned,"
+ "SPINS INTEGER unsigned,"
+ "OBJECT_SCHEMA VARCHAR(64),"
+ "OBJECT_NAME VARCHAR(512),"
+ "INDEX_NAME VARCHAR(64),"
+ "OBJECT_TYPE VARCHAR(64),"
+ "OBJECT_INSTANCE_BEGIN BIGINT unsigned not null,"
+ "NESTING_EVENT_ID BIGINT unsigned,"
+ "NESTING_EVENT_TYPE ENUM('STATEMENT', 'STAGE', 'WAIT'),"
+ "OPERATION VARCHAR(32) not null,"
+ "NUMBER_OF_BYTES BIGINT,"
+ "FLAGS INTEGER unsigned"
+ ")ENGINE=PERFORMANCE_SCHEMA;";
+
+SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
+PREPARE stmt FROM @str;
+EXECUTE stmt;
+DROP PREPARE stmt;
+
+--
+-- TABLE EVENTS_WAITS_HISTORY
+--
+
+SET @cmd="CREATE TABLE performance_schema.events_waits_history("
+ "THREAD_ID INTEGER not null,"
+ "EVENT_ID BIGINT unsigned not null,"
+ "END_EVENT_ID BIGINT unsigned,"
+ "EVENT_NAME VARCHAR(128) not null,"
+ "SOURCE VARCHAR(64),"
+ "TIMER_START BIGINT unsigned,"
+ "TIMER_END BIGINT unsigned,"
+ "TIMER_WAIT BIGINT unsigned,"
+ "SPINS INTEGER unsigned,"
+ "OBJECT_SCHEMA VARCHAR(64),"
+ "OBJECT_NAME VARCHAR(512),"
+ "INDEX_NAME VARCHAR(64),"
+ "OBJECT_TYPE VARCHAR(64),"
+ "OBJECT_INSTANCE_BEGIN BIGINT unsigned not null,"
+ "NESTING_EVENT_ID BIGINT unsigned,"
+ "NESTING_EVENT_TYPE ENUM('STATEMENT', 'STAGE', 'WAIT'),"
+ "OPERATION VARCHAR(32) not null,"
+ "NUMBER_OF_BYTES BIGINT,"
+ "FLAGS INTEGER unsigned"
+ ")ENGINE=PERFORMANCE_SCHEMA;";
+
+SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
+PREPARE stmt FROM @str;
+EXECUTE stmt;
+DROP PREPARE stmt;
+
+--
+-- TABLE EVENTS_WAITS_HISTORY_LONG
+--
+
+SET @cmd="CREATE TABLE performance_schema.events_waits_history_long("
+ "THREAD_ID INTEGER not null,"
+ "EVENT_ID BIGINT unsigned not null,"
+ "END_EVENT_ID BIGINT unsigned,"
+ "EVENT_NAME VARCHAR(128) not null,"
+ "SOURCE VARCHAR(64),"
+ "TIMER_START BIGINT unsigned,"
+ "TIMER_END BIGINT unsigned,"
+ "TIMER_WAIT BIGINT unsigned,"
+ "SPINS INTEGER unsigned,"
+ "OBJECT_SCHEMA VARCHAR(64),"
+ "OBJECT_NAME VARCHAR(512),"
+ "INDEX_NAME VARCHAR(64),"
+ "OBJECT_TYPE VARCHAR(64),"
+ "OBJECT_INSTANCE_BEGIN BIGINT unsigned not null,"
+ "NESTING_EVENT_ID BIGINT unsigned,"
+ "NESTING_EVENT_TYPE ENUM('STATEMENT', 'STAGE', 'WAIT'),"
+ "OPERATION VARCHAR(32) not null,"
+ "NUMBER_OF_BYTES BIGINT,"
+ "FLAGS INTEGER unsigned"
+ ")ENGINE=PERFORMANCE_SCHEMA;";
+
+SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
+PREPARE stmt FROM @str;
+EXECUTE stmt;
+DROP PREPARE stmt;
+
+--
+-- TABLE EVENTS_WAITS_SUMMARY_BY_INSTANCE
+--
+
+SET @cmd="CREATE TABLE performance_schema.events_waits_summary_by_instance("
+ "EVENT_NAME VARCHAR(128) not null,"
+ "OBJECT_INSTANCE_BEGIN BIGINT unsigned not null,"
+ "COUNT_STAR BIGINT unsigned not null,"
+ "SUM_TIMER_WAIT BIGINT unsigned not null,"
+ "MIN_TIMER_WAIT BIGINT unsigned not null,"
+ "AVG_TIMER_WAIT BIGINT unsigned not null,"
+ "MAX_TIMER_WAIT BIGINT unsigned not null"
+ ")ENGINE=PERFORMANCE_SCHEMA;";
+
+SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
+PREPARE stmt FROM @str;
+EXECUTE stmt;
+DROP PREPARE stmt;
+
+--
+-- TABLE EVENTS_WAITS_SUMMARY_BY_HOST_BY_EVENT_NAME
+--
+
+SET @cmd="CREATE TABLE performance_schema.events_waits_summary_by_host_by_event_name("
+ "HOST CHAR(60) collate utf8_bin default null,"
+ "EVENT_NAME VARCHAR(128) not null,"
+ "COUNT_STAR BIGINT unsigned not null,"
+ "SUM_TIMER_WAIT BIGINT unsigned not null,"
+ "MIN_TIMER_WAIT BIGINT unsigned not null,"
+ "AVG_TIMER_WAIT BIGINT unsigned not null,"
+ "MAX_TIMER_WAIT BIGINT unsigned not null"
+ ")ENGINE=PERFORMANCE_SCHEMA;";
+
+SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
+PREPARE stmt FROM @str;
+EXECUTE stmt;
+DROP PREPARE stmt;
+
+--
+-- TABLE EVENTS_WAITS_SUMMARY_BY_USER_BY_EVENT_NAME
+--
+
+SET @cmd="CREATE TABLE performance_schema.events_waits_summary_by_user_by_event_name("
+ "USER CHAR(16) collate utf8_bin default null,"
+ "EVENT_NAME VARCHAR(128) not null,"
+ "COUNT_STAR BIGINT unsigned not null,"
+ "SUM_TIMER_WAIT BIGINT unsigned not null,"
+ "MIN_TIMER_WAIT BIGINT unsigned not null,"
+ "AVG_TIMER_WAIT BIGINT unsigned not null,"
+ "MAX_TIMER_WAIT BIGINT unsigned not null"
+ ")ENGINE=PERFORMANCE_SCHEMA;";
+
+SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
+PREPARE stmt FROM @str;
+EXECUTE stmt;
+DROP PREPARE stmt;
+
+--
+-- TABLE EVENTS_WAITS_SUMMARY_BY_ACCOUNT_BY_EVENT_NAME
+--
+
+SET @cmd="CREATE TABLE performance_schema.events_waits_summary_by_account_by_event_name("
+ "USER CHAR(16) collate utf8_bin default null,"
+ "HOST CHAR(60) collate utf8_bin default null,"
+ "EVENT_NAME VARCHAR(128) not null,"
+ "COUNT_STAR BIGINT unsigned not null,"
+ "SUM_TIMER_WAIT BIGINT unsigned not null,"
+ "MIN_TIMER_WAIT BIGINT unsigned not null,"
+ "AVG_TIMER_WAIT BIGINT unsigned not null,"
+ "MAX_TIMER_WAIT BIGINT unsigned not null"
+ ")ENGINE=PERFORMANCE_SCHEMA;";
+
+SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
+PREPARE stmt FROM @str;
+EXECUTE stmt;
+DROP PREPARE stmt;
+
+--
+-- TABLE EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME
+--
+
+SET @cmd="CREATE TABLE performance_schema.events_waits_summary_by_thread_by_event_name("
+ "THREAD_ID INTEGER not null,"
+ "EVENT_NAME VARCHAR(128) not null,"
+ "COUNT_STAR BIGINT unsigned not null,"
+ "SUM_TIMER_WAIT BIGINT unsigned not null,"
+ "MIN_TIMER_WAIT BIGINT unsigned not null,"
+ "AVG_TIMER_WAIT BIGINT unsigned not null,"
+ "MAX_TIMER_WAIT BIGINT unsigned not null"
+ ")ENGINE=PERFORMANCE_SCHEMA;";
+
+SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
+PREPARE stmt FROM @str;
+EXECUTE stmt;
+DROP PREPARE stmt;
+
+--
+-- TABLE EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME
+--
+
+SET @cmd="CREATE TABLE performance_schema.events_waits_summary_global_by_event_name("
+ "EVENT_NAME VARCHAR(128) not null,"
+ "COUNT_STAR BIGINT unsigned not null,"
+ "SUM_TIMER_WAIT BIGINT unsigned not null,"
+ "MIN_TIMER_WAIT BIGINT unsigned not null,"
+ "AVG_TIMER_WAIT BIGINT unsigned not null,"
+ "MAX_TIMER_WAIT BIGINT unsigned not null"
+ ")ENGINE=PERFORMANCE_SCHEMA;";
+
+SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
+PREPARE stmt FROM @str;
+EXECUTE stmt;
+DROP PREPARE stmt;
+
+--
+-- TABLE FILE_INSTANCES
+--
+
+SET @cmd="CREATE TABLE performance_schema.file_instances("
+ "FILE_NAME VARCHAR(512) not null,"
+ "EVENT_NAME VARCHAR(128) not null,"
+ "OPEN_COUNT INTEGER unsigned not null"
+ ")ENGINE=PERFORMANCE_SCHEMA;";
+
+SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
+PREPARE stmt FROM @str;
+EXECUTE stmt;
+DROP PREPARE stmt;
+
+--
+-- TABLE FILE_SUMMARY_BY_EVENT_NAME
+--
+
+SET @cmd="CREATE TABLE performance_schema.file_summary_by_event_name("
+ "EVENT_NAME VARCHAR(128) not null,"
+ "COUNT_STAR BIGINT unsigned not null,"
+ "SUM_TIMER_WAIT BIGINT unsigned not null,"
+ "MIN_TIMER_WAIT BIGINT unsigned not null,"
+ "AVG_TIMER_WAIT BIGINT unsigned not null,"
+ "MAX_TIMER_WAIT BIGINT unsigned not null,"
+ "COUNT_READ BIGINT unsigned not null,"
+ "SUM_TIMER_READ BIGINT unsigned not null,"
+ "MIN_TIMER_READ BIGINT unsigned not null,"
+ "AVG_TIMER_READ BIGINT unsigned not null,"
+ "MAX_TIMER_READ BIGINT unsigned not null,"
+ "SUM_NUMBER_OF_BYTES_READ BIGINT not null,"
+ "COUNT_WRITE BIGINT unsigned not null,"
+ "SUM_TIMER_WRITE BIGINT unsigned not null,"
+ "MIN_TIMER_WRITE BIGINT unsigned not null,"
+ "AVG_TIMER_WRITE BIGINT unsigned not null,"
+ "MAX_TIMER_WRITE BIGINT unsigned not null,"
+ "SUM_NUMBER_OF_BYTES_WRITE BIGINT not null,"
+ "COUNT_MISC BIGINT unsigned not null,"
+ "SUM_TIMER_MISC BIGINT unsigned not null,"
+ "MIN_TIMER_MISC BIGINT unsigned not null,"
+ "AVG_TIMER_MISC BIGINT unsigned not null,"
+ "MAX_TIMER_MISC BIGINT unsigned not null"
+ ")ENGINE=PERFORMANCE_SCHEMA;";
+
+SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
+PREPARE stmt FROM @str;
+EXECUTE stmt;
+DROP PREPARE stmt;
+
+--
+-- TABLE FILE_SUMMARY_BY_INSTANCE
+--
+
+SET @cmd="CREATE TABLE performance_schema.file_summary_by_instance("
+ "FILE_NAME VARCHAR(512) not null,"
+ "EVENT_NAME VARCHAR(128) not null,"
+ "OBJECT_INSTANCE_BEGIN BIGINT unsigned not null,"
+ "COUNT_STAR BIGINT unsigned not null,"
+ "SUM_TIMER_WAIT BIGINT unsigned not null,"
+ "MIN_TIMER_WAIT BIGINT unsigned not null,"
+ "AVG_TIMER_WAIT BIGINT unsigned not null,"
+ "MAX_TIMER_WAIT BIGINT unsigned not null,"
+ "COUNT_READ BIGINT unsigned not null,"
+ "SUM_TIMER_READ BIGINT unsigned not null,"
+ "MIN_TIMER_READ BIGINT unsigned not null,"
+ "AVG_TIMER_READ BIGINT unsigned not null,"
+ "MAX_TIMER_READ BIGINT unsigned not null,"
+ "SUM_NUMBER_OF_BYTES_READ BIGINT not null,"
+ "COUNT_WRITE BIGINT unsigned not null,"
+ "SUM_TIMER_WRITE BIGINT unsigned not null,"
+ "MIN_TIMER_WRITE BIGINT unsigned not null,"
+ "AVG_TIMER_WRITE BIGINT unsigned not null,"
+ "MAX_TIMER_WRITE BIGINT unsigned not null,"
+ "SUM_NUMBER_OF_BYTES_WRITE BIGINT not null,"
+ "COUNT_MISC BIGINT unsigned not null,"
+ "SUM_TIMER_MISC BIGINT unsigned not null,"
+ "MIN_TIMER_MISC BIGINT unsigned not null,"
+ "AVG_TIMER_MISC BIGINT unsigned not null,"
+ "MAX_TIMER_MISC BIGINT unsigned not null"
+ ")ENGINE=PERFORMANCE_SCHEMA;";
+
+SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
+PREPARE stmt FROM @str;
+EXECUTE stmt;
+DROP PREPARE stmt;
+
+
+--
+-- TABLE SOCKET_INSTANCES
+--
+
+SET @cmd="CREATE TABLE performance_schema.socket_instances("
+ "EVENT_NAME VARCHAR(128) not null,"
+ "OBJECT_INSTANCE_BEGIN BIGINT unsigned not null,"
+ "THREAD_ID INTEGER,"
+ "SOCKET_ID INTEGER not null,"
+ "IP VARCHAR(64) not null,"
+ "PORT INTEGER not null,"
+ "STATE ENUM('IDLE','ACTIVE') not null"
+ ")ENGINE=PERFORMANCE_SCHEMA;";
+
+SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
+PREPARE stmt FROM @str;
+EXECUTE stmt;
+DROP PREPARE stmt;
+
+--
+-- TABLE SOCKET_SUMMARY_BY_INSTANCE
+--
+
+SET @cmd="CREATE TABLE performance_schema.socket_summary_by_instance("
+ "EVENT_NAME VARCHAR(128) not null,"
+ "OBJECT_INSTANCE_BEGIN BIGINT unsigned not null,"
+ "COUNT_STAR BIGINT unsigned not null,"
+ "SUM_TIMER_WAIT BIGINT unsigned not null,"
+ "MIN_TIMER_WAIT BIGINT unsigned not null,"
+ "AVG_TIMER_WAIT BIGINT unsigned not null,"
+ "MAX_TIMER_WAIT BIGINT unsigned not null,"
+ "COUNT_READ BIGINT unsigned not null,"
+ "SUM_TIMER_READ BIGINT unsigned not null,"
+ "MIN_TIMER_READ BIGINT unsigned not null,"
+ "AVG_TIMER_READ BIGINT unsigned not null,"
+ "MAX_TIMER_READ BIGINT unsigned not null,"
+ "SUM_NUMBER_OF_BYTES_READ BIGINT unsigned not null,"
+ "COUNT_WRITE BIGINT unsigned not null,"
+ "SUM_TIMER_WRITE BIGINT unsigned not null,"
+ "MIN_TIMER_WRITE BIGINT unsigned not null,"
+ "AVG_TIMER_WRITE BIGINT unsigned not null,"
+ "MAX_TIMER_WRITE BIGINT unsigned not null,"
+ "SUM_NUMBER_OF_BYTES_WRITE BIGINT unsigned not null,"
+ "COUNT_MISC BIGINT unsigned not null,"
+ "SUM_TIMER_MISC BIGINT unsigned not null,"
+ "MIN_TIMER_MISC BIGINT unsigned not null,"
+ "AVG_TIMER_MISC BIGINT unsigned not null,"
+ "MAX_TIMER_MISC BIGINT unsigned not null"
+ ")ENGINE=PERFORMANCE_SCHEMA;";
+
+SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
+PREPARE stmt FROM @str;
+EXECUTE stmt;
+DROP PREPARE stmt;
+
+--
+-- TABLE SOCKET_SUMMARY_BY_INSTANCE
+--
+
+SET @cmd="CREATE TABLE performance_schema.socket_summary_by_event_name("
+ "EVENT_NAME VARCHAR(128) not null,"
+ "COUNT_STAR BIGINT unsigned not null,"
+ "SUM_TIMER_WAIT BIGINT unsigned not null,"
+ "MIN_TIMER_WAIT BIGINT unsigned not null,"
+ "AVG_TIMER_WAIT BIGINT unsigned not null,"
+ "MAX_TIMER_WAIT BIGINT unsigned not null,"
+ "COUNT_READ BIGINT unsigned not null,"
+ "SUM_TIMER_READ BIGINT unsigned not null,"
+ "MIN_TIMER_READ BIGINT unsigned not null,"
+ "AVG_TIMER_READ BIGINT unsigned not null,"
+ "MAX_TIMER_READ BIGINT unsigned not null,"
+ "SUM_NUMBER_OF_BYTES_READ BIGINT unsigned not null,"
+ "COUNT_WRITE BIGINT unsigned not null,"
+ "SUM_TIMER_WRITE BIGINT unsigned not null,"
+ "MIN_TIMER_WRITE BIGINT unsigned not null,"
+ "AVG_TIMER_WRITE BIGINT unsigned not null,"
+ "MAX_TIMER_WRITE BIGINT unsigned not null,"
+ "SUM_NUMBER_OF_BYTES_WRITE BIGINT unsigned not null,"
+ "COUNT_MISC BIGINT unsigned not null,"
+ "SUM_TIMER_MISC BIGINT unsigned not null,"
+ "MIN_TIMER_MISC BIGINT unsigned not null,"
+ "AVG_TIMER_MISC BIGINT unsigned not null,"
+ "MAX_TIMER_MISC BIGINT unsigned not null"
+ ")ENGINE=PERFORMANCE_SCHEMA;";
+
+SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
+PREPARE stmt FROM @str;
+EXECUTE stmt;
+DROP PREPARE stmt;
+
+--
+-- TABLE HOST_CACHE
+--
+
+SET @cmd="CREATE TABLE performance_schema.host_cache("
+ "IP VARCHAR(64) not null,"
+ "HOST VARCHAR(255) collate utf8_bin,"
+ "HOST_VALIDATED ENUM ('YES', 'NO') not null,"
+ "SUM_CONNECT_ERRORS BIGINT not null,"
+ "COUNT_HOST_BLOCKED_ERRORS BIGINT not null,"
+ "COUNT_NAMEINFO_TRANSIENT_ERRORS BIGINT not null,"
+ "COUNT_NAMEINFO_PERMANENT_ERRORS BIGINT not null,"
+ "COUNT_FORMAT_ERRORS BIGINT not null,"
+ "COUNT_ADDRINFO_TRANSIENT_ERRORS BIGINT not null,"
+ "COUNT_ADDRINFO_PERMANENT_ERRORS BIGINT not null,"
+ "COUNT_FCRDNS_ERRORS BIGINT not null,"
+ "COUNT_HOST_ACL_ERRORS BIGINT not null,"
+ "COUNT_NO_AUTH_PLUGIN_ERRORS BIGINT not null,"
+ "COUNT_AUTH_PLUGIN_ERRORS BIGINT not null,"
+ "COUNT_HANDSHAKE_ERRORS BIGINT not null,"
+ "COUNT_PROXY_USER_ERRORS BIGINT not null,"
+ "COUNT_PROXY_USER_ACL_ERRORS BIGINT not null,"
+ "COUNT_AUTHENTICATION_ERRORS BIGINT not null,"
+ "COUNT_SSL_ERRORS BIGINT not null,"
+ "COUNT_MAX_USER_CONNECTIONS_ERRORS BIGINT not null,"
+ "COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS BIGINT not null,"
+ "COUNT_DEFAULT_DATABASE_ERRORS BIGINT not null,"
+ "COUNT_INIT_CONNECT_ERRORS BIGINT not null,"
+ "COUNT_LOCAL_ERRORS BIGINT not null,"
+ "COUNT_UNKNOWN_ERRORS BIGINT not null,"
+ "FIRST_SEEN TIMESTAMP(0) default 0,"
+ "LAST_SEEN TIMESTAMP(0) default 0,"
+ "FIRST_ERROR_SEEN TIMESTAMP(0) null default 0,"
+ "LAST_ERROR_SEEN TIMESTAMP(0) null default 0"
+ ")ENGINE=PERFORMANCE_SCHEMA;";
+
+SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
+#PREPARE stmt FROM @str;
+#EXECUTE stmt;
+#DROP PREPARE stmt;
+
+--
+-- TABLE MUTEX_INSTANCES
+--
+
+SET @cmd="CREATE TABLE performance_schema.mutex_instances("
+ "NAME VARCHAR(128) not null,"
+ "OBJECT_INSTANCE_BEGIN BIGINT unsigned not null,"
+ "LOCKED_BY_THREAD_ID INTEGER"
+ ")ENGINE=PERFORMANCE_SCHEMA;";
+
+SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
+PREPARE stmt FROM @str;
+EXECUTE stmt;
+DROP PREPARE stmt;
+
+--
+-- TABLE OBJECTS_SUMMARY_GLOBAL_BY_TYPE
+--
+
+SET @cmd="CREATE TABLE performance_schema.objects_summary_global_by_type("
+ "OBJECT_TYPE VARCHAR(64),"
+ "OBJECT_SCHEMA VARCHAR(64),"
+ "OBJECT_NAME VARCHAR(64),"
+ "COUNT_STAR BIGINT unsigned not null,"
+ "SUM_TIMER_WAIT BIGINT unsigned not null,"
+ "MIN_TIMER_WAIT BIGINT unsigned not null,"
+ "AVG_TIMER_WAIT BIGINT unsigned not null,"
+ "MAX_TIMER_WAIT BIGINT unsigned not null"
+ ")ENGINE=PERFORMANCE_SCHEMA;";
+
+SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
+PREPARE stmt FROM @str;
+EXECUTE stmt;
+DROP PREPARE stmt;
+
+--
+-- TABLE PERFORMANCE_TIMERS
+--
+
+SET @cmd="CREATE TABLE performance_schema.performance_timers("
+ "TIMER_NAME ENUM ('CYCLE', 'NANOSECOND', 'MICROSECOND', 'MILLISECOND', 'TICK') not null,"
+ "TIMER_FREQUENCY BIGINT,"
+ "TIMER_RESOLUTION BIGINT,"
+ "TIMER_OVERHEAD BIGINT"
+ ") ENGINE=PERFORMANCE_SCHEMA;";
+
+SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
+PREPARE stmt FROM @str;
+EXECUTE stmt;
+DROP PREPARE stmt;
+
+--
+-- TABLE RWLOCK_INSTANCES
+--
+
+SET @cmd="CREATE TABLE performance_schema.rwlock_instances("
+ "NAME VARCHAR(128) not null,"
+ "OBJECT_INSTANCE_BEGIN BIGINT unsigned not null,"
+ "WRITE_LOCKED_BY_THREAD_ID INTEGER,"
+ "READ_LOCKED_BY_COUNT INTEGER unsigned not null"
+ ")ENGINE=PERFORMANCE_SCHEMA;";
+
+SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
+PREPARE stmt FROM @str;
+EXECUTE stmt;
+DROP PREPARE stmt;
+
+--
+-- TABLE SETUP_ACTORS
+--
+
+SET @cmd="CREATE TABLE performance_schema.setup_actors("
+ "HOST CHAR(60) collate utf8_bin default '%' not null,"
+ "USER CHAR(16) collate utf8_bin default '%' not null,"
+ "ROLE CHAR(16) collate utf8_bin default '%' not null"
+ ")ENGINE=PERFORMANCE_SCHEMA;";
+
+SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
+PREPARE stmt FROM @str;
+EXECUTE stmt;
+DROP PREPARE stmt;
+
+--
+-- TABLE SETUP_CONSUMERS
+--
+
+SET @cmd="CREATE TABLE performance_schema.setup_consumers("
+ "NAME VARCHAR(64) not null,"
+ "ENABLED ENUM ('YES', 'NO') not null"
+ ")ENGINE=PERFORMANCE_SCHEMA;";
+
+SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
+PREPARE stmt FROM @str;
+EXECUTE stmt;
+DROP PREPARE stmt;
+
+--
+-- TABLE SETUP_INSTRUMENTS
+--
+
+SET @cmd="CREATE TABLE performance_schema.setup_instruments("
+ "NAME VARCHAR(128) not null,"
+ "ENABLED ENUM ('YES', 'NO') not null,"
+ "TIMED ENUM ('YES', 'NO') not null"
+ ")ENGINE=PERFORMANCE_SCHEMA;";
+
+SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
+PREPARE stmt FROM @str;
+EXECUTE stmt;
+DROP PREPARE stmt;
+
+--
+-- TABLE SETUP_OBJECTS
+--
+
+SET @cmd="CREATE TABLE performance_schema.setup_objects("
+ "OBJECT_TYPE ENUM ('TABLE') not null default 'TABLE',"
+ "OBJECT_SCHEMA VARCHAR(64) default '%',"
+ "OBJECT_NAME VARCHAR(64) not null default '%',"
+ "ENABLED ENUM ('YES', 'NO') not null default 'YES',"
+ "TIMED ENUM ('YES', 'NO') not null default 'YES'"
+ ")ENGINE=PERFORMANCE_SCHEMA;";
+
+SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
+PREPARE stmt FROM @str;
+EXECUTE stmt;
+DROP PREPARE stmt;
+
+--
+-- TABLE SETUP_TIMERS
+--
+
+SET @cmd="CREATE TABLE performance_schema.setup_timers("
+ "NAME VARCHAR(64) not null,"
+ "TIMER_NAME ENUM ('CYCLE', 'NANOSECOND', 'MICROSECOND', 'MILLISECOND', 'TICK') not null"
+ ")ENGINE=PERFORMANCE_SCHEMA;";
+
+SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
+PREPARE stmt FROM @str;
+EXECUTE stmt;
+DROP PREPARE stmt;
+
+--
+-- TABLE TABLE_IO_WAITS_SUMMARY_BY_INDEX_USAGE
+--
+
+SET @cmd="CREATE TABLE performance_schema.table_io_waits_summary_by_index_usage("
+ "OBJECT_TYPE VARCHAR(64),"
+ "OBJECT_SCHEMA VARCHAR(64),"
+ "OBJECT_NAME VARCHAR(64),"
+ "INDEX_NAME VARCHAR(64),"
+ "COUNT_STAR BIGINT unsigned not null,"
+ "SUM_TIMER_WAIT BIGINT unsigned not null,"
+ "MIN_TIMER_WAIT BIGINT unsigned not null,"
+ "AVG_TIMER_WAIT BIGINT unsigned not null,"
+ "MAX_TIMER_WAIT BIGINT unsigned not null,"
+ "COUNT_READ BIGINT unsigned not null,"
+ "SUM_TIMER_READ BIGINT unsigned not null,"
+ "MIN_TIMER_READ BIGINT unsigned not null,"
+ "AVG_TIMER_READ BIGINT unsigned not null,"
+ "MAX_TIMER_READ BIGINT unsigned not null,"
+ "COUNT_WRITE BIGINT unsigned not null,"
+ "SUM_TIMER_WRITE BIGINT unsigned not null,"
+ "MIN_TIMER_WRITE BIGINT unsigned not null,"
+ "AVG_TIMER_WRITE BIGINT unsigned not null,"
+ "MAX_TIMER_WRITE BIGINT unsigned not null,"
+ "COUNT_FETCH BIGINT unsigned not null,"
+ "SUM_TIMER_FETCH BIGINT unsigned not null,"
+ "MIN_TIMER_FETCH BIGINT unsigned not null,"
+ "AVG_TIMER_FETCH BIGINT unsigned not null,"
+ "MAX_TIMER_FETCH BIGINT unsigned not null,"
+ "COUNT_INSERT BIGINT unsigned not null,"
+ "SUM_TIMER_INSERT BIGINT unsigned not null,"
+ "MIN_TIMER_INSERT BIGINT unsigned not null,"
+ "AVG_TIMER_INSERT BIGINT unsigned not null,"
+ "MAX_TIMER_INSERT BIGINT unsigned not null,"
+ "COUNT_UPDATE BIGINT unsigned not null,"
+ "SUM_TIMER_UPDATE BIGINT unsigned not null,"
+ "MIN_TIMER_UPDATE BIGINT unsigned not null,"
+ "AVG_TIMER_UPDATE BIGINT unsigned not null,"
+ "MAX_TIMER_UPDATE BIGINT unsigned not null,"
+ "COUNT_DELETE BIGINT unsigned not null,"
+ "SUM_TIMER_DELETE BIGINT unsigned not null,"
+ "MIN_TIMER_DELETE BIGINT unsigned not null,"
+ "AVG_TIMER_DELETE BIGINT unsigned not null,"
+ "MAX_TIMER_DELETE BIGINT unsigned not null"
+ ")ENGINE=PERFORMANCE_SCHEMA;";
+
+SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
+PREPARE stmt FROM @str;
+EXECUTE stmt;
+DROP PREPARE stmt;
+
+--
+-- TABLE TABLE_IO_WAITS_SUMMARY_BY_TABLE
+--
+
+SET @cmd="CREATE TABLE performance_schema.table_io_waits_summary_by_table("
+ "OBJECT_TYPE VARCHAR(64),"
+ "OBJECT_SCHEMA VARCHAR(64),"
+ "OBJECT_NAME VARCHAR(64),"
+ "COUNT_STAR BIGINT unsigned not null,"
+ "SUM_TIMER_WAIT BIGINT unsigned not null,"
+ "MIN_TIMER_WAIT BIGINT unsigned not null,"
+ "AVG_TIMER_WAIT BIGINT unsigned not null,"
+ "MAX_TIMER_WAIT BIGINT unsigned not null,"
+ "COUNT_READ BIGINT unsigned not null,"
+ "SUM_TIMER_READ BIGINT unsigned not null,"
+ "MIN_TIMER_READ BIGINT unsigned not null,"
+ "AVG_TIMER_READ BIGINT unsigned not null,"
+ "MAX_TIMER_READ BIGINT unsigned not null,"
+ "COUNT_WRITE BIGINT unsigned not null,"
+ "SUM_TIMER_WRITE BIGINT unsigned not null,"
+ "MIN_TIMER_WRITE BIGINT unsigned not null,"
+ "AVG_TIMER_WRITE BIGINT unsigned not null,"
+ "MAX_TIMER_WRITE BIGINT unsigned not null,"
+ "COUNT_FETCH BIGINT unsigned not null,"
+ "SUM_TIMER_FETCH BIGINT unsigned not null,"
+ "MIN_TIMER_FETCH BIGINT unsigned not null,"
+ "AVG_TIMER_FETCH BIGINT unsigned not null,"
+ "MAX_TIMER_FETCH BIGINT unsigned not null,"
+ "COUNT_INSERT BIGINT unsigned not null,"
+ "SUM_TIMER_INSERT BIGINT unsigned not null,"
+ "MIN_TIMER_INSERT BIGINT unsigned not null,"
+ "AVG_TIMER_INSERT BIGINT unsigned not null,"
+ "MAX_TIMER_INSERT BIGINT unsigned not null,"
+ "COUNT_UPDATE BIGINT unsigned not null,"
+ "SUM_TIMER_UPDATE BIGINT unsigned not null,"
+ "MIN_TIMER_UPDATE BIGINT unsigned not null,"
+ "AVG_TIMER_UPDATE BIGINT unsigned not null,"
+ "MAX_TIMER_UPDATE BIGINT unsigned not null,"
+ "COUNT_DELETE BIGINT unsigned not null,"
+ "SUM_TIMER_DELETE BIGINT unsigned not null,"
+ "MIN_TIMER_DELETE BIGINT unsigned not null,"
+ "AVG_TIMER_DELETE BIGINT unsigned not null,"
+ "MAX_TIMER_DELETE BIGINT unsigned not null"
+ ")ENGINE=PERFORMANCE_SCHEMA;";
+
+SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
+PREPARE stmt FROM @str;
+EXECUTE stmt;
+DROP PREPARE stmt;
+
+--
+-- TABLE TABLE_LOCK_WAITS_SUMMARY_BY_TABLE
+--
+
+SET @cmd="CREATE TABLE performance_schema.table_lock_waits_summary_by_table("
+ "OBJECT_TYPE VARCHAR(64),"
+ "OBJECT_SCHEMA VARCHAR(64),"
+ "OBJECT_NAME VARCHAR(64),"
+ "COUNT_STAR BIGINT unsigned not null,"
+ "SUM_TIMER_WAIT BIGINT unsigned not null,"
+ "MIN_TIMER_WAIT BIGINT unsigned not null,"
+ "AVG_TIMER_WAIT BIGINT unsigned not null,"
+ "MAX_TIMER_WAIT BIGINT unsigned not null,"
+ "COUNT_READ BIGINT unsigned not null,"
+ "SUM_TIMER_READ BIGINT unsigned not null,"
+ "MIN_TIMER_READ BIGINT unsigned not null,"
+ "AVG_TIMER_READ BIGINT unsigned not null,"
+ "MAX_TIMER_READ BIGINT unsigned not null,"
+ "COUNT_WRITE BIGINT unsigned not null,"
+ "SUM_TIMER_WRITE BIGINT unsigned not null,"
+ "MIN_TIMER_WRITE BIGINT unsigned not null,"
+ "AVG_TIMER_WRITE BIGINT unsigned not null,"
+ "MAX_TIMER_WRITE BIGINT unsigned not null,"
+ "COUNT_READ_NORMAL BIGINT unsigned not null,"
+ "SUM_TIMER_READ_NORMAL BIGINT unsigned not null,"
+ "MIN_TIMER_READ_NORMAL BIGINT unsigned not null,"
+ "AVG_TIMER_READ_NORMAL BIGINT unsigned not null,"
+ "MAX_TIMER_READ_NORMAL BIGINT unsigned not null,"
+ "COUNT_READ_WITH_SHARED_LOCKS BIGINT unsigned not null,"
+ "SUM_TIMER_READ_WITH_SHARED_LOCKS BIGINT unsigned not null,"
+ "MIN_TIMER_READ_WITH_SHARED_LOCKS BIGINT unsigned not null,"
+ "AVG_TIMER_READ_WITH_SHARED_LOCKS BIGINT unsigned not null,"
+ "MAX_TIMER_READ_WITH_SHARED_LOCKS BIGINT unsigned not null,"
+ "COUNT_READ_HIGH_PRIORITY BIGINT unsigned not null,"
+ "SUM_TIMER_READ_HIGH_PRIORITY BIGINT unsigned not null,"
+ "MIN_TIMER_READ_HIGH_PRIORITY BIGINT unsigned not null,"
+ "AVG_TIMER_READ_HIGH_PRIORITY BIGINT unsigned not null,"
+ "MAX_TIMER_READ_HIGH_PRIORITY BIGINT unsigned not null,"
+ "COUNT_READ_NO_INSERT BIGINT unsigned not null,"
+ "SUM_TIMER_READ_NO_INSERT BIGINT unsigned not null,"
+ "MIN_TIMER_READ_NO_INSERT BIGINT unsigned not null,"
+ "AVG_TIMER_READ_NO_INSERT BIGINT unsigned not null,"
+ "MAX_TIMER_READ_NO_INSERT BIGINT unsigned not null,"
+ "COUNT_READ_EXTERNAL BIGINT unsigned not null,"
+ "SUM_TIMER_READ_EXTERNAL BIGINT unsigned not null,"
+ "MIN_TIMER_READ_EXTERNAL BIGINT unsigned not null,"
+ "AVG_TIMER_READ_EXTERNAL BIGINT unsigned not null,"
+ "MAX_TIMER_READ_EXTERNAL BIGINT unsigned not null,"
+ "COUNT_WRITE_ALLOW_WRITE BIGINT unsigned not null,"
+ "SUM_TIMER_WRITE_ALLOW_WRITE BIGINT unsigned not null,"
+ "MIN_TIMER_WRITE_ALLOW_WRITE BIGINT unsigned not null,"
+ "AVG_TIMER_WRITE_ALLOW_WRITE BIGINT unsigned not null,"
+ "MAX_TIMER_WRITE_ALLOW_WRITE BIGINT unsigned not null,"
+ "COUNT_WRITE_CONCURRENT_INSERT BIGINT unsigned not null,"
+ "SUM_TIMER_WRITE_CONCURRENT_INSERT BIGINT unsigned not null,"
+ "MIN_TIMER_WRITE_CONCURRENT_INSERT BIGINT unsigned not null,"
+ "AVG_TIMER_WRITE_CONCURRENT_INSERT BIGINT unsigned not null,"
+ "MAX_TIMER_WRITE_CONCURRENT_INSERT BIGINT unsigned not null,"
+ "COUNT_WRITE_DELAYED BIGINT unsigned not null,"
+ "SUM_TIMER_WRITE_DELAYED BIGINT unsigned not null,"
+ "MIN_TIMER_WRITE_DELAYED BIGINT unsigned not null,"
+ "AVG_TIMER_WRITE_DELAYED BIGINT unsigned not null,"
+ "MAX_TIMER_WRITE_DELAYED BIGINT unsigned not null,"
+ "COUNT_WRITE_LOW_PRIORITY BIGINT unsigned not null,"
+ "SUM_TIMER_WRITE_LOW_PRIORITY BIGINT unsigned not null,"
+ "MIN_TIMER_WRITE_LOW_PRIORITY BIGINT unsigned not null,"
+ "AVG_TIMER_WRITE_LOW_PRIORITY BIGINT unsigned not null,"
+ "MAX_TIMER_WRITE_LOW_PRIORITY BIGINT unsigned not null,"
+ "COUNT_WRITE_NORMAL BIGINT unsigned not null,"
+ "SUM_TIMER_WRITE_NORMAL BIGINT unsigned not null,"
+ "MIN_TIMER_WRITE_NORMAL BIGINT unsigned not null,"
+ "AVG_TIMER_WRITE_NORMAL BIGINT unsigned not null,"
+ "MAX_TIMER_WRITE_NORMAL BIGINT unsigned not null,"
+ "COUNT_WRITE_EXTERNAL BIGINT unsigned not null,"
+ "SUM_TIMER_WRITE_EXTERNAL BIGINT unsigned not null,"
+ "MIN_TIMER_WRITE_EXTERNAL BIGINT unsigned not null,"
+ "AVG_TIMER_WRITE_EXTERNAL BIGINT unsigned not null,"
+ "MAX_TIMER_WRITE_EXTERNAL BIGINT unsigned not null"
+ ")ENGINE=PERFORMANCE_SCHEMA;";
+
+SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
+PREPARE stmt FROM @str;
+EXECUTE stmt;
+DROP PREPARE stmt;
+
+--
+-- TABLE THREADS
+--
+
+SET @cmd="CREATE TABLE performance_schema.threads("
+ "THREAD_ID INTEGER not null,"
+ "NAME VARCHAR(128) not null,"
+ "TYPE VARCHAR(10) not null,"
+ "PROCESSLIST_ID INTEGER,"
+ "PROCESSLIST_USER VARCHAR(16),"
+ "PROCESSLIST_HOST VARCHAR(60),"
+ "PROCESSLIST_DB VARCHAR(64),"
+ "PROCESSLIST_COMMAND VARCHAR(16),"
+ "PROCESSLIST_TIME BIGINT,"
+ "PROCESSLIST_STATE VARCHAR(64),"
+ "PROCESSLIST_INFO LONGTEXT,"
+ "PARENT_THREAD_ID INTEGER,"
+ "ROLE VARCHAR(64),"
+ "INSTRUMENTED ENUM ('YES', 'NO') not null"
+ ")ENGINE=PERFORMANCE_SCHEMA;";
+
+SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
+PREPARE stmt FROM @str;
+EXECUTE stmt;
+DROP PREPARE stmt;
+
+--
+-- TABLE EVENTS_STAGES_CURRENT
+--
+
+SET @cmd="CREATE TABLE performance_schema.events_stages_current("
+ "THREAD_ID INTEGER not null,"
+ "EVENT_ID BIGINT unsigned not null,"
+ "END_EVENT_ID BIGINT unsigned,"
+ "EVENT_NAME VARCHAR(128) not null,"
+ "SOURCE VARCHAR(64),"
+ "TIMER_START BIGINT unsigned,"
+ "TIMER_END BIGINT unsigned,"
+ "TIMER_WAIT BIGINT unsigned,"
+ "NESTING_EVENT_ID BIGINT unsigned,"
+ "NESTING_EVENT_TYPE ENUM('STATEMENT', 'STAGE', 'WAIT')"
+ ")ENGINE=PERFORMANCE_SCHEMA;";
+
+SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
+PREPARE stmt FROM @str;
+EXECUTE stmt;
+DROP PREPARE stmt;
+
+--
+-- TABLE EVENTS_STAGES_HISTORY
+--
+
+SET @cmd="CREATE TABLE performance_schema.events_stages_history("
+ "THREAD_ID INTEGER not null,"
+ "EVENT_ID BIGINT unsigned not null,"
+ "END_EVENT_ID BIGINT unsigned,"
+ "EVENT_NAME VARCHAR(128) not null,"
+ "SOURCE VARCHAR(64),"
+ "TIMER_START BIGINT unsigned,"
+ "TIMER_END BIGINT unsigned,"
+ "TIMER_WAIT BIGINT unsigned,"
+ "NESTING_EVENT_ID BIGINT unsigned,"
+ "NESTING_EVENT_TYPE ENUM('STATEMENT', 'STAGE', 'WAIT')"
+ ")ENGINE=PERFORMANCE_SCHEMA;";
+
+SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
+PREPARE stmt FROM @str;
+EXECUTE stmt;
+DROP PREPARE stmt;
+
+--
+-- TABLE EVENTS_STAGES_HISTORY_LONG
+--
+
+SET @cmd="CREATE TABLE performance_schema.events_stages_history_long("
+ "THREAD_ID INTEGER not null,"
+ "EVENT_ID BIGINT unsigned not null,"
+ "END_EVENT_ID BIGINT unsigned,"
+ "EVENT_NAME VARCHAR(128) not null,"
+ "SOURCE VARCHAR(64),"
+ "TIMER_START BIGINT unsigned,"
+ "TIMER_END BIGINT unsigned,"
+ "TIMER_WAIT BIGINT unsigned,"
+ "NESTING_EVENT_ID BIGINT unsigned,"
+ "NESTING_EVENT_TYPE ENUM('STATEMENT', 'STAGE', 'WAIT')"
+ ")ENGINE=PERFORMANCE_SCHEMA;";
+
+SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
+PREPARE stmt FROM @str;
+EXECUTE stmt;
+DROP PREPARE stmt;
+
+--
+-- TABLE EVENTS_STAGES_SUMMARY_BY_THREAD_BY_EVENT_NAME
+--
+
+SET @cmd="CREATE TABLE performance_schema.events_stages_summary_by_thread_by_event_name("
+ "THREAD_ID INTEGER not null,"
+ "EVENT_NAME VARCHAR(128) not null,"
+ "COUNT_STAR BIGINT unsigned not null,"
+ "SUM_TIMER_WAIT BIGINT unsigned not null,"
+ "MIN_TIMER_WAIT BIGINT unsigned not null,"
+ "AVG_TIMER_WAIT BIGINT unsigned not null,"
+ "MAX_TIMER_WAIT BIGINT unsigned not null"
+ ")ENGINE=PERFORMANCE_SCHEMA;";
+
+SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
+PREPARE stmt FROM @str;
+EXECUTE stmt;
+DROP PREPARE stmt;
+
+--
+-- TABLE EVENTS_STAGES_SUMMARY_BY_HOST_BY_EVENT_NAME
+--
+
+SET @cmd="CREATE TABLE performance_schema.events_stages_summary_by_host_by_event_name("
+ "HOST CHAR(60) collate utf8_bin default null,"
+ "EVENT_NAME VARCHAR(128) not null,"
+ "COUNT_STAR BIGINT unsigned not null,"
+ "SUM_TIMER_WAIT BIGINT unsigned not null,"
+ "MIN_TIMER_WAIT BIGINT unsigned not null,"
+ "AVG_TIMER_WAIT BIGINT unsigned not null,"
+ "MAX_TIMER_WAIT BIGINT unsigned not null"
+ ")ENGINE=PERFORMANCE_SCHEMA;";
+
+SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
+PREPARE stmt FROM @str;
+EXECUTE stmt;
+DROP PREPARE stmt;
+
+--
+-- TABLE EVENTS_STAGES_SUMMARY_BY_USER_BY_EVENT_NAME
+--
+
+SET @cmd="CREATE TABLE performance_schema.events_stages_summary_by_user_by_event_name("
+ "USER CHAR(16) collate utf8_bin default null,"
+ "EVENT_NAME VARCHAR(128) not null,"
+ "COUNT_STAR BIGINT unsigned not null,"
+ "SUM_TIMER_WAIT BIGINT unsigned not null,"
+ "MIN_TIMER_WAIT BIGINT unsigned not null,"
+ "AVG_TIMER_WAIT BIGINT unsigned not null,"
+ "MAX_TIMER_WAIT BIGINT unsigned not null"
+ ")ENGINE=PERFORMANCE_SCHEMA;";
+
+SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
+PREPARE stmt FROM @str;
+EXECUTE stmt;
+DROP PREPARE stmt;
+
+--
+-- TABLE EVENTS_STAGES_SUMMARY_BY_ACCOUNT_BY_EVENT_NAME
+--
+
+SET @cmd="CREATE TABLE performance_schema.events_stages_summary_by_account_by_event_name("
+ "USER CHAR(16) collate utf8_bin default null,"
+ "HOST CHAR(60) collate utf8_bin default null,"
+ "EVENT_NAME VARCHAR(128) not null,"
+ "COUNT_STAR BIGINT unsigned not null,"
+ "SUM_TIMER_WAIT BIGINT unsigned not null,"
+ "MIN_TIMER_WAIT BIGINT unsigned not null,"
+ "AVG_TIMER_WAIT BIGINT unsigned not null,"
+ "MAX_TIMER_WAIT BIGINT unsigned not null"
+ ")ENGINE=PERFORMANCE_SCHEMA;";
+
+SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
+PREPARE stmt FROM @str;
+EXECUTE stmt;
+DROP PREPARE stmt;
+
+--
+-- TABLE EVENTS_STAGES_SUMMARY_GLOBAL_BY_EVENT_NAME
+--
+
+SET @cmd="CREATE TABLE performance_schema.events_stages_summary_global_by_event_name("
+ "EVENT_NAME VARCHAR(128) not null,"
+ "COUNT_STAR BIGINT unsigned not null,"
+ "SUM_TIMER_WAIT BIGINT unsigned not null,"
+ "MIN_TIMER_WAIT BIGINT unsigned not null,"
+ "AVG_TIMER_WAIT BIGINT unsigned not null,"
+ "MAX_TIMER_WAIT BIGINT unsigned not null"
+ ")ENGINE=PERFORMANCE_SCHEMA;";
+
+SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
+PREPARE stmt FROM @str;
+EXECUTE stmt;
+DROP PREPARE stmt;
+
+--
+-- TABLE EVENTS_STATEMENTS_CURRENT
+--
+
+SET @cmd="CREATE TABLE performance_schema.events_statements_current("
+ "THREAD_ID INTEGER not null,"
+ "EVENT_ID BIGINT unsigned not null,"
+ "END_EVENT_ID BIGINT unsigned,"
+ "EVENT_NAME VARCHAR(128) not null,"
+ "SOURCE VARCHAR(64),"
+ "TIMER_START BIGINT unsigned,"
+ "TIMER_END BIGINT unsigned,"
+ "TIMER_WAIT BIGINT unsigned,"
+ "LOCK_TIME bigint unsigned not null,"
+ "SQL_TEXT LONGTEXT,"
+ "DIGEST VARCHAR(32),"
+ "DIGEST_TEXT LONGTEXT,"
+ "CURRENT_SCHEMA VARCHAR(64),"
+ "OBJECT_TYPE VARCHAR(64),"
+ "OBJECT_SCHEMA VARCHAR(64),"
+ "OBJECT_NAME VARCHAR(64),"
+ "OBJECT_INSTANCE_BEGIN BIGINT unsigned,"
+ "MYSQL_ERRNO INTEGER,"
+ "RETURNED_SQLSTATE VARCHAR(5),"
+ "MESSAGE_TEXT VARCHAR(128),"
+ "ERRORS BIGINT unsigned not null,"
+ "WARNINGS BIGINT unsigned not null,"
+ "ROWS_AFFECTED BIGINT unsigned not null,"
+ "ROWS_SENT BIGINT unsigned not null,"
+ "ROWS_EXAMINED BIGINT unsigned not null,"
+ "CREATED_TMP_DISK_TABLES BIGINT unsigned not null,"
+ "CREATED_TMP_TABLES BIGINT unsigned not null,"
+ "SELECT_FULL_JOIN BIGINT unsigned not null,"
+ "SELECT_FULL_RANGE_JOIN BIGINT unsigned not null,"
+ "SELECT_RANGE BIGINT unsigned not null,"
+ "SELECT_RANGE_CHECK BIGINT unsigned not null,"
+ "SELECT_SCAN BIGINT unsigned not null,"
+ "SORT_MERGE_PASSES BIGINT unsigned not null,"
+ "SORT_RANGE BIGINT unsigned not null,"
+ "SORT_ROWS BIGINT unsigned not null,"
+ "SORT_SCAN BIGINT unsigned not null,"
+ "NO_INDEX_USED BIGINT unsigned not null,"
+ "NO_GOOD_INDEX_USED BIGINT unsigned not null,"
+ "NESTING_EVENT_ID BIGINT unsigned,"
+ "NESTING_EVENT_TYPE ENUM('STATEMENT', 'STAGE', 'WAIT')"
+ ")ENGINE=PERFORMANCE_SCHEMA;";
+
+SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
+PREPARE stmt FROM @str;
+EXECUTE stmt;
+DROP PREPARE stmt;
+
+--
+-- TABLE EVENTS_STATEMENTS_HISTORY
+--
+
+SET @cmd="CREATE TABLE performance_schema.events_statements_history("
+ "THREAD_ID INTEGER not null,"
+ "EVENT_ID BIGINT unsigned not null,"
+ "END_EVENT_ID BIGINT unsigned,"
+ "EVENT_NAME VARCHAR(128) not null,"
+ "SOURCE VARCHAR(64),"
+ "TIMER_START BIGINT unsigned,"
+ "TIMER_END BIGINT unsigned,"
+ "TIMER_WAIT BIGINT unsigned,"
+ "LOCK_TIME bigint unsigned not null,"
+ "SQL_TEXT LONGTEXT,"
+ "DIGEST VARCHAR(32),"
+ "DIGEST_TEXT LONGTEXT,"
+ "CURRENT_SCHEMA VARCHAR(64),"
+ "OBJECT_TYPE VARCHAR(64),"
+ "OBJECT_SCHEMA VARCHAR(64),"
+ "OBJECT_NAME VARCHAR(64),"
+ "OBJECT_INSTANCE_BEGIN BIGINT unsigned,"
+ "MYSQL_ERRNO INTEGER,"
+ "RETURNED_SQLSTATE VARCHAR(5),"
+ "MESSAGE_TEXT VARCHAR(128),"
+ "ERRORS BIGINT unsigned not null,"
+ "WARNINGS BIGINT unsigned not null,"
+ "ROWS_AFFECTED BIGINT unsigned not null,"
+ "ROWS_SENT BIGINT unsigned not null,"
+ "ROWS_EXAMINED BIGINT unsigned not null,"
+ "CREATED_TMP_DISK_TABLES BIGINT unsigned not null,"
+ "CREATED_TMP_TABLES BIGINT unsigned not null,"
+ "SELECT_FULL_JOIN BIGINT unsigned not null,"
+ "SELECT_FULL_RANGE_JOIN BIGINT unsigned not null,"
+ "SELECT_RANGE BIGINT unsigned not null,"
+ "SELECT_RANGE_CHECK BIGINT unsigned not null,"
+ "SELECT_SCAN BIGINT unsigned not null,"
+ "SORT_MERGE_PASSES BIGINT unsigned not null,"
+ "SORT_RANGE BIGINT unsigned not null,"
+ "SORT_ROWS BIGINT unsigned not null,"
+ "SORT_SCAN BIGINT unsigned not null,"
+ "NO_INDEX_USED BIGINT unsigned not null,"
+ "NO_GOOD_INDEX_USED BIGINT unsigned not null,"
+ "NESTING_EVENT_ID BIGINT unsigned,"
+ "NESTING_EVENT_TYPE ENUM('STATEMENT', 'STAGE', 'WAIT')"
+ ")ENGINE=PERFORMANCE_SCHEMA;";
+
+SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
+PREPARE stmt FROM @str;
+EXECUTE stmt;
+DROP PREPARE stmt;
+
+--
+-- TABLE EVENTS_STATEMENTS_HISTORY_LONG
+--
+
+SET @cmd="CREATE TABLE performance_schema.events_statements_history_long("
+ "THREAD_ID INTEGER not null,"
+ "EVENT_ID BIGINT unsigned not null,"
+ "END_EVENT_ID BIGINT unsigned,"
+ "EVENT_NAME VARCHAR(128) not null,"
+ "SOURCE VARCHAR(64),"
+ "TIMER_START BIGINT unsigned,"
+ "TIMER_END BIGINT unsigned,"
+ "TIMER_WAIT BIGINT unsigned,"
+ "LOCK_TIME bigint unsigned not null,"
+ "SQL_TEXT LONGTEXT,"
+ "DIGEST VARCHAR(32),"
+ "DIGEST_TEXT LONGTEXT,"
+ "CURRENT_SCHEMA VARCHAR(64),"
+ "OBJECT_TYPE VARCHAR(64),"
+ "OBJECT_SCHEMA VARCHAR(64),"
+ "OBJECT_NAME VARCHAR(64),"
+ "OBJECT_INSTANCE_BEGIN BIGINT unsigned,"
+ "MYSQL_ERRNO INTEGER,"
+ "RETURNED_SQLSTATE VARCHAR(5),"
+ "MESSAGE_TEXT VARCHAR(128),"
+ "ERRORS BIGINT unsigned not null,"
+ "WARNINGS BIGINT unsigned not null,"
+ "ROWS_AFFECTED BIGINT unsigned not null,"
+ "ROWS_SENT BIGINT unsigned not null,"
+ "ROWS_EXAMINED BIGINT unsigned not null,"
+ "CREATED_TMP_DISK_TABLES BIGINT unsigned not null,"
+ "CREATED_TMP_TABLES BIGINT unsigned not null,"
+ "SELECT_FULL_JOIN BIGINT unsigned not null,"
+ "SELECT_FULL_RANGE_JOIN BIGINT unsigned not null,"
+ "SELECT_RANGE BIGINT unsigned not null,"
+ "SELECT_RANGE_CHECK BIGINT unsigned not null,"
+ "SELECT_SCAN BIGINT unsigned not null,"
+ "SORT_MERGE_PASSES BIGINT unsigned not null,"
+ "SORT_RANGE BIGINT unsigned not null,"
+ "SORT_ROWS BIGINT unsigned not null,"
+ "SORT_SCAN BIGINT unsigned not null,"
+ "NO_INDEX_USED BIGINT unsigned not null,"
+ "NO_GOOD_INDEX_USED BIGINT unsigned not null,"
+ "NESTING_EVENT_ID BIGINT unsigned,"
+ "NESTING_EVENT_TYPE ENUM('STATEMENT', 'STAGE', 'WAIT')"
+ ")ENGINE=PERFORMANCE_SCHEMA;";
+
+SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
+PREPARE stmt FROM @str;
+EXECUTE stmt;
+DROP PREPARE stmt;
+
+--
+-- TABLE EVENTS_STATEMENTS_SUMMARY_BY_THREAD_BY_EVENT_NAME
+--
+
+SET @cmd="CREATE TABLE performance_schema.events_statements_summary_by_thread_by_event_name("
+ "THREAD_ID INTEGER not null,"
+ "EVENT_NAME VARCHAR(128) not null,"
+ "COUNT_STAR BIGINT unsigned not null,"
+ "SUM_TIMER_WAIT BIGINT unsigned not null,"
+ "MIN_TIMER_WAIT BIGINT unsigned not null,"
+ "AVG_TIMER_WAIT BIGINT unsigned not null,"
+ "MAX_TIMER_WAIT BIGINT unsigned not null,"
+ "SUM_LOCK_TIME BIGINT unsigned not null,"
+ "SUM_ERRORS BIGINT unsigned not null,"
+ "SUM_WARNINGS BIGINT unsigned not null,"
+ "SUM_ROWS_AFFECTED BIGINT unsigned not null,"
+ "SUM_ROWS_SENT BIGINT unsigned not null,"
+ "SUM_ROWS_EXAMINED BIGINT unsigned not null,"
+ "SUM_CREATED_TMP_DISK_TABLES BIGINT unsigned not null,"
+ "SUM_CREATED_TMP_TABLES BIGINT unsigned not null,"
+ "SUM_SELECT_FULL_JOIN BIGINT unsigned not null,"
+ "SUM_SELECT_FULL_RANGE_JOIN BIGINT unsigned not null,"
+ "SUM_SELECT_RANGE BIGINT unsigned not null,"
+ "SUM_SELECT_RANGE_CHECK BIGINT unsigned not null,"
+ "SUM_SELECT_SCAN BIGINT unsigned not null,"
+ "SUM_SORT_MERGE_PASSES BIGINT unsigned not null,"
+ "SUM_SORT_RANGE BIGINT unsigned not null,"
+ "SUM_SORT_ROWS BIGINT unsigned not null,"
+ "SUM_SORT_SCAN BIGINT unsigned not null,"
+ "SUM_NO_INDEX_USED BIGINT unsigned not null,"
+ "SUM_NO_GOOD_INDEX_USED BIGINT unsigned not null"
+ ")ENGINE=PERFORMANCE_SCHEMA;";
+
+SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
+PREPARE stmt FROM @str;
+EXECUTE stmt;
+DROP PREPARE stmt;
+
+--
+-- TABLE EVENTS_STATEMENTS_SUMMARY_BY_HOST_BY_EVENT_NAME
+--
+
+SET @cmd="CREATE TABLE performance_schema.events_statements_summary_by_host_by_event_name("
+ "HOST CHAR(60) collate utf8_bin default null,"
+ "EVENT_NAME VARCHAR(128) not null,"
+ "COUNT_STAR BIGINT unsigned not null,"
+ "SUM_TIMER_WAIT BIGINT unsigned not null,"
+ "MIN_TIMER_WAIT BIGINT unsigned not null,"
+ "AVG_TIMER_WAIT BIGINT unsigned not null,"
+ "MAX_TIMER_WAIT BIGINT unsigned not null,"
+ "SUM_LOCK_TIME BIGINT unsigned not null,"
+ "SUM_ERRORS BIGINT unsigned not null,"
+ "SUM_WARNINGS BIGINT unsigned not null,"
+ "SUM_ROWS_AFFECTED BIGINT unsigned not null,"
+ "SUM_ROWS_SENT BIGINT unsigned not null,"
+ "SUM_ROWS_EXAMINED BIGINT unsigned not null,"
+ "SUM_CREATED_TMP_DISK_TABLES BIGINT unsigned not null,"
+ "SUM_CREATED_TMP_TABLES BIGINT unsigned not null,"
+ "SUM_SELECT_FULL_JOIN BIGINT unsigned not null,"
+ "SUM_SELECT_FULL_RANGE_JOIN BIGINT unsigned not null,"
+ "SUM_SELECT_RANGE BIGINT unsigned not null,"
+ "SUM_SELECT_RANGE_CHECK BIGINT unsigned not null,"
+ "SUM_SELECT_SCAN BIGINT unsigned not null,"
+ "SUM_SORT_MERGE_PASSES BIGINT unsigned not null,"
+ "SUM_SORT_RANGE BIGINT unsigned not null,"
+ "SUM_SORT_ROWS BIGINT unsigned not null,"
+ "SUM_SORT_SCAN BIGINT unsigned not null,"
+ "SUM_NO_INDEX_USED BIGINT unsigned not null,"
+ "SUM_NO_GOOD_INDEX_USED BIGINT unsigned not null"
+ ")ENGINE=PERFORMANCE_SCHEMA;";
+
+SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
+PREPARE stmt FROM @str;
+EXECUTE stmt;
+DROP PREPARE stmt;
+
+--
+-- TABLE EVENTS_STATEMENTS_SUMMARY_BY_USER_BY_EVENT_NAME
+--
+
+SET @cmd="CREATE TABLE performance_schema.events_statements_summary_by_user_by_event_name("
+ "USER CHAR(16) collate utf8_bin default null,"
+ "EVENT_NAME VARCHAR(128) not null,"
+ "COUNT_STAR BIGINT unsigned not null,"
+ "SUM_TIMER_WAIT BIGINT unsigned not null,"
+ "MIN_TIMER_WAIT BIGINT unsigned not null,"
+ "AVG_TIMER_WAIT BIGINT unsigned not null,"
+ "MAX_TIMER_WAIT BIGINT unsigned not null,"
+ "SUM_LOCK_TIME BIGINT unsigned not null,"
+ "SUM_ERRORS BIGINT unsigned not null,"
+ "SUM_WARNINGS BIGINT unsigned not null,"
+ "SUM_ROWS_AFFECTED BIGINT unsigned not null,"
+ "SUM_ROWS_SENT BIGINT unsigned not null,"
+ "SUM_ROWS_EXAMINED BIGINT unsigned not null,"
+ "SUM_CREATED_TMP_DISK_TABLES BIGINT unsigned not null,"
+ "SUM_CREATED_TMP_TABLES BIGINT unsigned not null,"
+ "SUM_SELECT_FULL_JOIN BIGINT unsigned not null,"
+ "SUM_SELECT_FULL_RANGE_JOIN BIGINT unsigned not null,"
+ "SUM_SELECT_RANGE BIGINT unsigned not null,"
+ "SUM_SELECT_RANGE_CHECK BIGINT unsigned not null,"
+ "SUM_SELECT_SCAN BIGINT unsigned not null,"
+ "SUM_SORT_MERGE_PASSES BIGINT unsigned not null,"
+ "SUM_SORT_RANGE BIGINT unsigned not null,"
+ "SUM_SORT_ROWS BIGINT unsigned not null,"
+ "SUM_SORT_SCAN BIGINT unsigned not null,"
+ "SUM_NO_INDEX_USED BIGINT unsigned not null,"
+ "SUM_NO_GOOD_INDEX_USED BIGINT unsigned not null"
+ ")ENGINE=PERFORMANCE_SCHEMA;";
+
+SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
+PREPARE stmt FROM @str;
+EXECUTE stmt;
+DROP PREPARE stmt;
+
+--
+-- TABLE EVENTS_STATEMENTS_SUMMARY_BY_ACCOUNT_BY_EVENT_NAME
+--
+
+SET @cmd="CREATE TABLE performance_schema.events_statements_summary_by_account_by_event_name("
+ "USER CHAR(16) collate utf8_bin default null,"
+ "HOST CHAR(60) collate utf8_bin default null,"
+ "EVENT_NAME VARCHAR(128) not null,"
+ "COUNT_STAR BIGINT unsigned not null,"
+ "SUM_TIMER_WAIT BIGINT unsigned not null,"
+ "MIN_TIMER_WAIT BIGINT unsigned not null,"
+ "AVG_TIMER_WAIT BIGINT unsigned not null,"
+ "MAX_TIMER_WAIT BIGINT unsigned not null,"
+ "SUM_LOCK_TIME BIGINT unsigned not null,"
+ "SUM_ERRORS BIGINT unsigned not null,"
+ "SUM_WARNINGS BIGINT unsigned not null,"
+ "SUM_ROWS_AFFECTED BIGINT unsigned not null,"
+ "SUM_ROWS_SENT BIGINT unsigned not null,"
+ "SUM_ROWS_EXAMINED BIGINT unsigned not null,"
+ "SUM_CREATED_TMP_DISK_TABLES BIGINT unsigned not null,"
+ "SUM_CREATED_TMP_TABLES BIGINT unsigned not null,"
+ "SUM_SELECT_FULL_JOIN BIGINT unsigned not null,"
+ "SUM_SELECT_FULL_RANGE_JOIN BIGINT unsigned not null,"
+ "SUM_SELECT_RANGE BIGINT unsigned not null,"
+ "SUM_SELECT_RANGE_CHECK BIGINT unsigned not null,"
+ "SUM_SELECT_SCAN BIGINT unsigned not null,"
+ "SUM_SORT_MERGE_PASSES BIGINT unsigned not null,"
+ "SUM_SORT_RANGE BIGINT unsigned not null,"
+ "SUM_SORT_ROWS BIGINT unsigned not null,"
+ "SUM_SORT_SCAN BIGINT unsigned not null,"
+ "SUM_NO_INDEX_USED BIGINT unsigned not null,"
+ "SUM_NO_GOOD_INDEX_USED BIGINT unsigned not null"
+ ")ENGINE=PERFORMANCE_SCHEMA;";
+
+SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
+PREPARE stmt FROM @str;
+EXECUTE stmt;
+DROP PREPARE stmt;
+
+--
+-- TABLE EVENTS_STATEMENTS_SUMMARY_GLOBAL_BY_EVENT_NAME
+--
+
+SET @cmd="CREATE TABLE performance_schema.events_statements_summary_global_by_event_name("
+ "EVENT_NAME VARCHAR(128) not null,"
+ "COUNT_STAR BIGINT unsigned not null,"
+ "SUM_TIMER_WAIT BIGINT unsigned not null,"
+ "MIN_TIMER_WAIT BIGINT unsigned not null,"
+ "AVG_TIMER_WAIT BIGINT unsigned not null,"
+ "MAX_TIMER_WAIT BIGINT unsigned not null,"
+ "SUM_LOCK_TIME BIGINT unsigned not null,"
+ "SUM_ERRORS BIGINT unsigned not null,"
+ "SUM_WARNINGS BIGINT unsigned not null,"
+ "SUM_ROWS_AFFECTED BIGINT unsigned not null,"
+ "SUM_ROWS_SENT BIGINT unsigned not null,"
+ "SUM_ROWS_EXAMINED BIGINT unsigned not null,"
+ "SUM_CREATED_TMP_DISK_TABLES BIGINT unsigned not null,"
+ "SUM_CREATED_TMP_TABLES BIGINT unsigned not null,"
+ "SUM_SELECT_FULL_JOIN BIGINT unsigned not null,"
+ "SUM_SELECT_FULL_RANGE_JOIN BIGINT unsigned not null,"
+ "SUM_SELECT_RANGE BIGINT unsigned not null,"
+ "SUM_SELECT_RANGE_CHECK BIGINT unsigned not null,"
+ "SUM_SELECT_SCAN BIGINT unsigned not null,"
+ "SUM_SORT_MERGE_PASSES BIGINT unsigned not null,"
+ "SUM_SORT_RANGE BIGINT unsigned not null,"
+ "SUM_SORT_ROWS BIGINT unsigned not null,"
+ "SUM_SORT_SCAN BIGINT unsigned not null,"
+ "SUM_NO_INDEX_USED BIGINT unsigned not null,"
+ "SUM_NO_GOOD_INDEX_USED BIGINT unsigned not null"
+ ")ENGINE=PERFORMANCE_SCHEMA;";
+
+SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
+PREPARE stmt FROM @str;
+EXECUTE stmt;
+DROP PREPARE stmt;
+
+--
+-- TABLE HOSTS
+--
+
+SET @cmd="CREATE TABLE performance_schema.hosts("
+ "HOST CHAR(60) collate utf8_bin default null,"
+ "CURRENT_CONNECTIONS bigint not null,"
+ "TOTAL_CONNECTIONS bigint not null"
+ ")ENGINE=PERFORMANCE_SCHEMA;";
+
+SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
+PREPARE stmt FROM @str;
+EXECUTE stmt;
+DROP PREPARE stmt;
+
+--
+-- TABLE USERS
+--
+
+SET @cmd="CREATE TABLE performance_schema.users("
+ "USER CHAR(16) collate utf8_bin default null,"
+ "CURRENT_CONNECTIONS bigint not null,"
+ "TOTAL_CONNECTIONS bigint not null"
+ ")ENGINE=PERFORMANCE_SCHEMA;";
+
+SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
+PREPARE stmt FROM @str;
+EXECUTE stmt;
+DROP PREPARE stmt;
+
+--
+-- TABLE ACCOUNTS
+--
+
+SET @cmd="CREATE TABLE performance_schema.accounts("
+ "USER CHAR(16) collate utf8_bin default null,"
+ "HOST CHAR(60) collate utf8_bin default null,"
+ "CURRENT_CONNECTIONS bigint not null,"
+ "TOTAL_CONNECTIONS bigint not null"
+ ")ENGINE=PERFORMANCE_SCHEMA;";
+
+SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
+PREPARE stmt FROM @str;
+EXECUTE stmt;
+DROP PREPARE stmt;
+
+--
+-- TABLE EVENTS_STATEMENTS_SUMMARY_BY_DIGEST
+--
+
+SET @cmd="CREATE TABLE performance_schema.events_statements_summary_by_digest("
+ "DIGEST VARCHAR(32),"
+ "DIGEST_TEXT LONGTEXT,"
+ "COUNT_STAR BIGINT unsigned not null,"
+ "SUM_TIMER_WAIT BIGINT unsigned not null,"
+ "MIN_TIMER_WAIT BIGINT unsigned not null,"
+ "AVG_TIMER_WAIT BIGINT unsigned not null,"
+ "MAX_TIMER_WAIT BIGINT unsigned not null,"
+ "SUM_LOCK_TIME BIGINT unsigned not null,"
+ "SUM_ERRORS BIGINT unsigned not null,"
+ "SUM_WARNINGS BIGINT unsigned not null,"
+ "SUM_ROWS_AFFECTED BIGINT unsigned not null,"
+ "SUM_ROWS_SENT BIGINT unsigned not null,"
+ "SUM_ROWS_EXAMINED BIGINT unsigned not null,"
+ "SUM_CREATED_TMP_DISK_TABLES BIGINT unsigned not null,"
+ "SUM_CREATED_TMP_TABLES BIGINT unsigned not null,"
+ "SUM_SELECT_FULL_JOIN BIGINT unsigned not null,"
+ "SUM_SELECT_FULL_RANGE_JOIN BIGINT unsigned not null,"
+ "SUM_SELECT_RANGE BIGINT unsigned not null,"
+ "SUM_SELECT_RANGE_CHECK BIGINT unsigned not null,"
+ "SUM_SELECT_SCAN BIGINT unsigned not null,"
+ "SUM_SORT_MERGE_PASSES BIGINT unsigned not null,"
+ "SUM_SORT_RANGE BIGINT unsigned not null,"
+ "SUM_SORT_ROWS BIGINT unsigned not null,"
+ "SUM_SORT_SCAN BIGINT unsigned not null,"
+ "SUM_NO_INDEX_USED BIGINT unsigned not null,"
+ "SUM_NO_GOOD_INDEX_USED BIGINT unsigned not null,"
+ "FIRST_SEEN TIMESTAMP(0) default 0,"
+ "LAST_SEEN TIMESTAMP(0) default 0"
+ ")ENGINE=PERFORMANCE_SCHEMA;";
+
+
+SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
+PREPARE stmt FROM @str;
+EXECUTE stmt;
+DROP PREPARE stmt;
+
diff --git a/scripts/mysql_system_tables.sql b/scripts/mysql_system_tables.sql
index b822a164614..e76ba3d3077 100644
--- a/scripts/mysql_system_tables.sql
+++ b/scripts/mysql_system_tables.sql
@@ -21,6 +21,7 @@
set sql_mode='';
set storage_engine=myisam;
+flush tables;
CREATE TABLE IF NOT EXISTS db ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Event_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Trigger_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, PRIMARY KEY Host (Host,Db,User), KEY User (User) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Database privileges';
@@ -139,1458 +140,6 @@ CREATE TABLE IF NOT EXISTS innodb_index_stats (
SET SESSION sql_mode=@sql_mode_orig;
-
---
--- PERFORMANCE SCHEMA INSTALLATION
--- Note that this script is also reused by mysql_upgrade,
--- so we have to be very careful here to not destroy any
--- existing database named 'performance_schema' if it
--- can contain user data.
--- In case of downgrade, it's ok to drop unknown tables
--- from a future version, as long as they belong to the
--- performance schema engine.
---
-
-set @have_old_pfs= (select count(*) from information_schema.schemata where schema_name='performance_schema');
-
-SET @cmd="SET @broken_tables = (select count(*) from information_schema.tables where engine != 'PERFORMANCE_SCHEMA' and table_schema='performance_schema')";
-
--- Work around for bug#49542
-SET @str = IF(@have_old_pfs = 1, @cmd, 'SET @broken_tables = 0');
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
-
-SET @cmd="SET @broken_views = (select count(*) from information_schema.views where table_schema='performance_schema')";
-
--- Work around for bug#49542
-SET @str = IF(@have_old_pfs = 1, @cmd, 'SET @broken_views = 0');
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
-
-SET @broken_routines = (select count(*) from mysql.proc where db='performance_schema');
-
-SET @broken_events = (select count(*) from mysql.event where db='performance_schema');
-
-SET @broken_pfs= (select @broken_tables + @broken_views + @broken_routines + @broken_events);
-
---
--- The performance schema database.
--- Only drop and create the database if this is safe (no broken_pfs).
--- This database is created, even in --without-perfschema builds,
--- so that the database name is always reserved by the MySQL implementation.
---
-
-SET @cmd= "DROP DATABASE IF EXISTS performance_schema";
-
-SET @str = IF(@broken_pfs = 0, @cmd, 'SET @dummy = 0');
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
-
-SET @cmd= "CREATE DATABASE performance_schema character set utf8";
-
-SET @str = IF(@broken_pfs = 0, @cmd, 'SET @dummy = 0');
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
-
---
--- From this point, only create the performance schema tables
--- if the server is built with performance schema
---
-
-set @have_pfs= (select count(engine) from information_schema.engines where engine='PERFORMANCE_SCHEMA' and support != 'NO');
-
---
--- TABLE COND_INSTANCES
---
-
-SET @cmd="CREATE TABLE performance_schema.cond_instances("
- "NAME VARCHAR(128) not null,"
- "OBJECT_INSTANCE_BEGIN BIGINT unsigned not null"
- ")ENGINE=PERFORMANCE_SCHEMA;";
-
-SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
-
---
--- TABLE EVENTS_WAITS_CURRENT
---
-
-SET @cmd="CREATE TABLE performance_schema.events_waits_current("
- "THREAD_ID INTEGER not null,"
- "EVENT_ID BIGINT unsigned not null,"
- "END_EVENT_ID BIGINT unsigned,"
- "EVENT_NAME VARCHAR(128) not null,"
- "SOURCE VARCHAR(64),"
- "TIMER_START BIGINT unsigned,"
- "TIMER_END BIGINT unsigned,"
- "TIMER_WAIT BIGINT unsigned,"
- "SPINS INTEGER unsigned,"
- "OBJECT_SCHEMA VARCHAR(64),"
- "OBJECT_NAME VARCHAR(512),"
- "INDEX_NAME VARCHAR(64),"
- "OBJECT_TYPE VARCHAR(64),"
- "OBJECT_INSTANCE_BEGIN BIGINT unsigned not null,"
- "NESTING_EVENT_ID BIGINT unsigned,"
- "NESTING_EVENT_TYPE ENUM('STATEMENT', 'STAGE', 'WAIT'),"
- "OPERATION VARCHAR(32) not null,"
- "NUMBER_OF_BYTES BIGINT,"
- "FLAGS INTEGER unsigned"
- ")ENGINE=PERFORMANCE_SCHEMA;";
-
-SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
-
---
--- TABLE EVENTS_WAITS_HISTORY
---
-
-SET @cmd="CREATE TABLE performance_schema.events_waits_history("
- "THREAD_ID INTEGER not null,"
- "EVENT_ID BIGINT unsigned not null,"
- "END_EVENT_ID BIGINT unsigned,"
- "EVENT_NAME VARCHAR(128) not null,"
- "SOURCE VARCHAR(64),"
- "TIMER_START BIGINT unsigned,"
- "TIMER_END BIGINT unsigned,"
- "TIMER_WAIT BIGINT unsigned,"
- "SPINS INTEGER unsigned,"
- "OBJECT_SCHEMA VARCHAR(64),"
- "OBJECT_NAME VARCHAR(512),"
- "INDEX_NAME VARCHAR(64),"
- "OBJECT_TYPE VARCHAR(64),"
- "OBJECT_INSTANCE_BEGIN BIGINT unsigned not null,"
- "NESTING_EVENT_ID BIGINT unsigned,"
- "NESTING_EVENT_TYPE ENUM('STATEMENT', 'STAGE', 'WAIT'),"
- "OPERATION VARCHAR(32) not null,"
- "NUMBER_OF_BYTES BIGINT,"
- "FLAGS INTEGER unsigned"
- ")ENGINE=PERFORMANCE_SCHEMA;";
-
-SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
-
---
--- TABLE EVENTS_WAITS_HISTORY_LONG
---
-
-SET @cmd="CREATE TABLE performance_schema.events_waits_history_long("
- "THREAD_ID INTEGER not null,"
- "EVENT_ID BIGINT unsigned not null,"
- "END_EVENT_ID BIGINT unsigned,"
- "EVENT_NAME VARCHAR(128) not null,"
- "SOURCE VARCHAR(64),"
- "TIMER_START BIGINT unsigned,"
- "TIMER_END BIGINT unsigned,"
- "TIMER_WAIT BIGINT unsigned,"
- "SPINS INTEGER unsigned,"
- "OBJECT_SCHEMA VARCHAR(64),"
- "OBJECT_NAME VARCHAR(512),"
- "INDEX_NAME VARCHAR(64),"
- "OBJECT_TYPE VARCHAR(64),"
- "OBJECT_INSTANCE_BEGIN BIGINT unsigned not null,"
- "NESTING_EVENT_ID BIGINT unsigned,"
- "NESTING_EVENT_TYPE ENUM('STATEMENT', 'STAGE', 'WAIT'),"
- "OPERATION VARCHAR(32) not null,"
- "NUMBER_OF_BYTES BIGINT,"
- "FLAGS INTEGER unsigned"
- ")ENGINE=PERFORMANCE_SCHEMA;";
-
-SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
-
---
--- TABLE EVENTS_WAITS_SUMMARY_BY_INSTANCE
---
-
-SET @cmd="CREATE TABLE performance_schema.events_waits_summary_by_instance("
- "EVENT_NAME VARCHAR(128) not null,"
- "OBJECT_INSTANCE_BEGIN BIGINT unsigned not null,"
- "COUNT_STAR BIGINT unsigned not null,"
- "SUM_TIMER_WAIT BIGINT unsigned not null,"
- "MIN_TIMER_WAIT BIGINT unsigned not null,"
- "AVG_TIMER_WAIT BIGINT unsigned not null,"
- "MAX_TIMER_WAIT BIGINT unsigned not null"
- ")ENGINE=PERFORMANCE_SCHEMA;";
-
-SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
-
---
--- TABLE EVENTS_WAITS_SUMMARY_BY_HOST_BY_EVENT_NAME
---
-
-SET @cmd="CREATE TABLE performance_schema.events_waits_summary_by_host_by_event_name("
- "HOST CHAR(60) collate utf8_bin default null,"
- "EVENT_NAME VARCHAR(128) not null,"
- "COUNT_STAR BIGINT unsigned not null,"
- "SUM_TIMER_WAIT BIGINT unsigned not null,"
- "MIN_TIMER_WAIT BIGINT unsigned not null,"
- "AVG_TIMER_WAIT BIGINT unsigned not null,"
- "MAX_TIMER_WAIT BIGINT unsigned not null"
- ")ENGINE=PERFORMANCE_SCHEMA;";
-
-SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
-
---
--- TABLE EVENTS_WAITS_SUMMARY_BY_USER_BY_EVENT_NAME
---
-
-SET @cmd="CREATE TABLE performance_schema.events_waits_summary_by_user_by_event_name("
- "USER CHAR(16) collate utf8_bin default null,"
- "EVENT_NAME VARCHAR(128) not null,"
- "COUNT_STAR BIGINT unsigned not null,"
- "SUM_TIMER_WAIT BIGINT unsigned not null,"
- "MIN_TIMER_WAIT BIGINT unsigned not null,"
- "AVG_TIMER_WAIT BIGINT unsigned not null,"
- "MAX_TIMER_WAIT BIGINT unsigned not null"
- ")ENGINE=PERFORMANCE_SCHEMA;";
-
-SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
-
---
--- TABLE EVENTS_WAITS_SUMMARY_BY_ACCOUNT_BY_EVENT_NAME
---
-
-SET @cmd="CREATE TABLE performance_schema.events_waits_summary_by_account_by_event_name("
- "USER CHAR(16) collate utf8_bin default null,"
- "HOST CHAR(60) collate utf8_bin default null,"
- "EVENT_NAME VARCHAR(128) not null,"
- "COUNT_STAR BIGINT unsigned not null,"
- "SUM_TIMER_WAIT BIGINT unsigned not null,"
- "MIN_TIMER_WAIT BIGINT unsigned not null,"
- "AVG_TIMER_WAIT BIGINT unsigned not null,"
- "MAX_TIMER_WAIT BIGINT unsigned not null"
- ")ENGINE=PERFORMANCE_SCHEMA;";
-
-SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
-
---
--- TABLE EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME
---
-
-SET @cmd="CREATE TABLE performance_schema.events_waits_summary_by_thread_by_event_name("
- "THREAD_ID INTEGER not null,"
- "EVENT_NAME VARCHAR(128) not null,"
- "COUNT_STAR BIGINT unsigned not null,"
- "SUM_TIMER_WAIT BIGINT unsigned not null,"
- "MIN_TIMER_WAIT BIGINT unsigned not null,"
- "AVG_TIMER_WAIT BIGINT unsigned not null,"
- "MAX_TIMER_WAIT BIGINT unsigned not null"
- ")ENGINE=PERFORMANCE_SCHEMA;";
-
-SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
-
---
--- TABLE EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME
---
-
-SET @cmd="CREATE TABLE performance_schema.events_waits_summary_global_by_event_name("
- "EVENT_NAME VARCHAR(128) not null,"
- "COUNT_STAR BIGINT unsigned not null,"
- "SUM_TIMER_WAIT BIGINT unsigned not null,"
- "MIN_TIMER_WAIT BIGINT unsigned not null,"
- "AVG_TIMER_WAIT BIGINT unsigned not null,"
- "MAX_TIMER_WAIT BIGINT unsigned not null"
- ")ENGINE=PERFORMANCE_SCHEMA;";
-
-SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
-
---
--- TABLE FILE_INSTANCES
---
-
-SET @cmd="CREATE TABLE performance_schema.file_instances("
- "FILE_NAME VARCHAR(512) not null,"
- "EVENT_NAME VARCHAR(128) not null,"
- "OPEN_COUNT INTEGER unsigned not null"
- ")ENGINE=PERFORMANCE_SCHEMA;";
-
-SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
-
---
--- TABLE FILE_SUMMARY_BY_EVENT_NAME
---
-
-SET @cmd="CREATE TABLE performance_schema.file_summary_by_event_name("
- "EVENT_NAME VARCHAR(128) not null,"
- "COUNT_STAR BIGINT unsigned not null,"
- "SUM_TIMER_WAIT BIGINT unsigned not null,"
- "MIN_TIMER_WAIT BIGINT unsigned not null,"
- "AVG_TIMER_WAIT BIGINT unsigned not null,"
- "MAX_TIMER_WAIT BIGINT unsigned not null,"
- "COUNT_READ BIGINT unsigned not null,"
- "SUM_TIMER_READ BIGINT unsigned not null,"
- "MIN_TIMER_READ BIGINT unsigned not null,"
- "AVG_TIMER_READ BIGINT unsigned not null,"
- "MAX_TIMER_READ BIGINT unsigned not null,"
- "SUM_NUMBER_OF_BYTES_READ BIGINT not null,"
- "COUNT_WRITE BIGINT unsigned not null,"
- "SUM_TIMER_WRITE BIGINT unsigned not null,"
- "MIN_TIMER_WRITE BIGINT unsigned not null,"
- "AVG_TIMER_WRITE BIGINT unsigned not null,"
- "MAX_TIMER_WRITE BIGINT unsigned not null,"
- "SUM_NUMBER_OF_BYTES_WRITE BIGINT not null,"
- "COUNT_MISC BIGINT unsigned not null,"
- "SUM_TIMER_MISC BIGINT unsigned not null,"
- "MIN_TIMER_MISC BIGINT unsigned not null,"
- "AVG_TIMER_MISC BIGINT unsigned not null,"
- "MAX_TIMER_MISC BIGINT unsigned not null"
- ")ENGINE=PERFORMANCE_SCHEMA;";
-
-SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
-
---
--- TABLE FILE_SUMMARY_BY_INSTANCE
---
-
-SET @cmd="CREATE TABLE performance_schema.file_summary_by_instance("
- "FILE_NAME VARCHAR(512) not null,"
- "EVENT_NAME VARCHAR(128) not null,"
- "OBJECT_INSTANCE_BEGIN BIGINT unsigned not null,"
- "COUNT_STAR BIGINT unsigned not null,"
- "SUM_TIMER_WAIT BIGINT unsigned not null,"
- "MIN_TIMER_WAIT BIGINT unsigned not null,"
- "AVG_TIMER_WAIT BIGINT unsigned not null,"
- "MAX_TIMER_WAIT BIGINT unsigned not null,"
- "COUNT_READ BIGINT unsigned not null,"
- "SUM_TIMER_READ BIGINT unsigned not null,"
- "MIN_TIMER_READ BIGINT unsigned not null,"
- "AVG_TIMER_READ BIGINT unsigned not null,"
- "MAX_TIMER_READ BIGINT unsigned not null,"
- "SUM_NUMBER_OF_BYTES_READ BIGINT not null,"
- "COUNT_WRITE BIGINT unsigned not null,"
- "SUM_TIMER_WRITE BIGINT unsigned not null,"
- "MIN_TIMER_WRITE BIGINT unsigned not null,"
- "AVG_TIMER_WRITE BIGINT unsigned not null,"
- "MAX_TIMER_WRITE BIGINT unsigned not null,"
- "SUM_NUMBER_OF_BYTES_WRITE BIGINT not null,"
- "COUNT_MISC BIGINT unsigned not null,"
- "SUM_TIMER_MISC BIGINT unsigned not null,"
- "MIN_TIMER_MISC BIGINT unsigned not null,"
- "AVG_TIMER_MISC BIGINT unsigned not null,"
- "MAX_TIMER_MISC BIGINT unsigned not null"
- ")ENGINE=PERFORMANCE_SCHEMA;";
-
-SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
-
-
---
--- TABLE SOCKET_INSTANCES
---
-
-SET @cmd="CREATE TABLE performance_schema.socket_instances("
- "EVENT_NAME VARCHAR(128) not null,"
- "OBJECT_INSTANCE_BEGIN BIGINT unsigned not null,"
- "THREAD_ID INTEGER,"
- "SOCKET_ID INTEGER not null,"
- "IP VARCHAR(64) not null,"
- "PORT INTEGER not null,"
- "STATE ENUM('IDLE','ACTIVE') not null"
- ")ENGINE=PERFORMANCE_SCHEMA;";
-
-SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
-
---
--- TABLE SOCKET_SUMMARY_BY_INSTANCE
---
-
-SET @cmd="CREATE TABLE performance_schema.socket_summary_by_instance("
- "EVENT_NAME VARCHAR(128) not null,"
- "OBJECT_INSTANCE_BEGIN BIGINT unsigned not null,"
- "COUNT_STAR BIGINT unsigned not null,"
- "SUM_TIMER_WAIT BIGINT unsigned not null,"
- "MIN_TIMER_WAIT BIGINT unsigned not null,"
- "AVG_TIMER_WAIT BIGINT unsigned not null,"
- "MAX_TIMER_WAIT BIGINT unsigned not null,"
- "COUNT_READ BIGINT unsigned not null,"
- "SUM_TIMER_READ BIGINT unsigned not null,"
- "MIN_TIMER_READ BIGINT unsigned not null,"
- "AVG_TIMER_READ BIGINT unsigned not null,"
- "MAX_TIMER_READ BIGINT unsigned not null,"
- "SUM_NUMBER_OF_BYTES_READ BIGINT unsigned not null,"
- "COUNT_WRITE BIGINT unsigned not null,"
- "SUM_TIMER_WRITE BIGINT unsigned not null,"
- "MIN_TIMER_WRITE BIGINT unsigned not null,"
- "AVG_TIMER_WRITE BIGINT unsigned not null,"
- "MAX_TIMER_WRITE BIGINT unsigned not null,"
- "SUM_NUMBER_OF_BYTES_WRITE BIGINT unsigned not null,"
- "COUNT_MISC BIGINT unsigned not null,"
- "SUM_TIMER_MISC BIGINT unsigned not null,"
- "MIN_TIMER_MISC BIGINT unsigned not null,"
- "AVG_TIMER_MISC BIGINT unsigned not null,"
- "MAX_TIMER_MISC BIGINT unsigned not null"
- ")ENGINE=PERFORMANCE_SCHEMA;";
-
-SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
-
---
--- TABLE SOCKET_SUMMARY_BY_INSTANCE
---
-
-SET @cmd="CREATE TABLE performance_schema.socket_summary_by_event_name("
- "EVENT_NAME VARCHAR(128) not null,"
- "COUNT_STAR BIGINT unsigned not null,"
- "SUM_TIMER_WAIT BIGINT unsigned not null,"
- "MIN_TIMER_WAIT BIGINT unsigned not null,"
- "AVG_TIMER_WAIT BIGINT unsigned not null,"
- "MAX_TIMER_WAIT BIGINT unsigned not null,"
- "COUNT_READ BIGINT unsigned not null,"
- "SUM_TIMER_READ BIGINT unsigned not null,"
- "MIN_TIMER_READ BIGINT unsigned not null,"
- "AVG_TIMER_READ BIGINT unsigned not null,"
- "MAX_TIMER_READ BIGINT unsigned not null,"
- "SUM_NUMBER_OF_BYTES_READ BIGINT unsigned not null,"
- "COUNT_WRITE BIGINT unsigned not null,"
- "SUM_TIMER_WRITE BIGINT unsigned not null,"
- "MIN_TIMER_WRITE BIGINT unsigned not null,"
- "AVG_TIMER_WRITE BIGINT unsigned not null,"
- "MAX_TIMER_WRITE BIGINT unsigned not null,"
- "SUM_NUMBER_OF_BYTES_WRITE BIGINT unsigned not null,"
- "COUNT_MISC BIGINT unsigned not null,"
- "SUM_TIMER_MISC BIGINT unsigned not null,"
- "MIN_TIMER_MISC BIGINT unsigned not null,"
- "AVG_TIMER_MISC BIGINT unsigned not null,"
- "MAX_TIMER_MISC BIGINT unsigned not null"
- ")ENGINE=PERFORMANCE_SCHEMA;";
-
-SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
-
---
--- TABLE HOST_CACHE
---
-
-SET @cmd="CREATE TABLE performance_schema.host_cache("
- "IP VARCHAR(64) not null,"
- "HOST VARCHAR(255) collate utf8_bin,"
- "HOST_VALIDATED ENUM ('YES', 'NO') not null,"
- "SUM_CONNECT_ERRORS BIGINT not null,"
- "COUNT_HOST_BLOCKED_ERRORS BIGINT not null,"
- "COUNT_NAMEINFO_TRANSIENT_ERRORS BIGINT not null,"
- "COUNT_NAMEINFO_PERMANENT_ERRORS BIGINT not null,"
- "COUNT_FORMAT_ERRORS BIGINT not null,"
- "COUNT_ADDRINFO_TRANSIENT_ERRORS BIGINT not null,"
- "COUNT_ADDRINFO_PERMANENT_ERRORS BIGINT not null,"
- "COUNT_FCRDNS_ERRORS BIGINT not null,"
- "COUNT_HOST_ACL_ERRORS BIGINT not null,"
- "COUNT_NO_AUTH_PLUGIN_ERRORS BIGINT not null,"
- "COUNT_AUTH_PLUGIN_ERRORS BIGINT not null,"
- "COUNT_HANDSHAKE_ERRORS BIGINT not null,"
- "COUNT_PROXY_USER_ERRORS BIGINT not null,"
- "COUNT_PROXY_USER_ACL_ERRORS BIGINT not null,"
- "COUNT_AUTHENTICATION_ERRORS BIGINT not null,"
- "COUNT_SSL_ERRORS BIGINT not null,"
- "COUNT_MAX_USER_CONNECTIONS_ERRORS BIGINT not null,"
- "COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS BIGINT not null,"
- "COUNT_DEFAULT_DATABASE_ERRORS BIGINT not null,"
- "COUNT_INIT_CONNECT_ERRORS BIGINT not null,"
- "COUNT_LOCAL_ERRORS BIGINT not null,"
- "COUNT_UNKNOWN_ERRORS BIGINT not null,"
- "FIRST_SEEN TIMESTAMP(0) default 0,"
- "LAST_SEEN TIMESTAMP(0) default 0,"
- "FIRST_ERROR_SEEN TIMESTAMP(0) null default 0,"
- "LAST_ERROR_SEEN TIMESTAMP(0) null default 0"
- ")ENGINE=PERFORMANCE_SCHEMA;";
-
-SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
-#PREPARE stmt FROM @str;
-#EXECUTE stmt;
-#DROP PREPARE stmt;
-
---
--- TABLE MUTEX_INSTANCES
---
-
-SET @cmd="CREATE TABLE performance_schema.mutex_instances("
- "NAME VARCHAR(128) not null,"
- "OBJECT_INSTANCE_BEGIN BIGINT unsigned not null,"
- "LOCKED_BY_THREAD_ID INTEGER"
- ")ENGINE=PERFORMANCE_SCHEMA;";
-
-SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
-
---
--- TABLE OBJECTS_SUMMARY_GLOBAL_BY_TYPE
---
-
-SET @cmd="CREATE TABLE performance_schema.objects_summary_global_by_type("
- "OBJECT_TYPE VARCHAR(64),"
- "OBJECT_SCHEMA VARCHAR(64),"
- "OBJECT_NAME VARCHAR(64),"
- "COUNT_STAR BIGINT unsigned not null,"
- "SUM_TIMER_WAIT BIGINT unsigned not null,"
- "MIN_TIMER_WAIT BIGINT unsigned not null,"
- "AVG_TIMER_WAIT BIGINT unsigned not null,"
- "MAX_TIMER_WAIT BIGINT unsigned not null"
- ")ENGINE=PERFORMANCE_SCHEMA;";
-
-SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
-
---
--- TABLE PERFORMANCE_TIMERS
---
-
-SET @cmd="CREATE TABLE performance_schema.performance_timers("
- "TIMER_NAME ENUM ('CYCLE', 'NANOSECOND', 'MICROSECOND', 'MILLISECOND', 'TICK') not null,"
- "TIMER_FREQUENCY BIGINT,"
- "TIMER_RESOLUTION BIGINT,"
- "TIMER_OVERHEAD BIGINT"
- ") ENGINE=PERFORMANCE_SCHEMA;";
-
-SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
-
---
--- TABLE RWLOCK_INSTANCES
---
-
-SET @cmd="CREATE TABLE performance_schema.rwlock_instances("
- "NAME VARCHAR(128) not null,"
- "OBJECT_INSTANCE_BEGIN BIGINT unsigned not null,"
- "WRITE_LOCKED_BY_THREAD_ID INTEGER,"
- "READ_LOCKED_BY_COUNT INTEGER unsigned not null"
- ")ENGINE=PERFORMANCE_SCHEMA;";
-
-SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
-
---
--- TABLE SETUP_ACTORS
---
-
-SET @cmd="CREATE TABLE performance_schema.setup_actors("
- "HOST CHAR(60) collate utf8_bin default '%' not null,"
- "USER CHAR(16) collate utf8_bin default '%' not null,"
- "ROLE CHAR(16) collate utf8_bin default '%' not null"
- ")ENGINE=PERFORMANCE_SCHEMA;";
-
-SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
-
---
--- TABLE SETUP_CONSUMERS
---
-
-SET @cmd="CREATE TABLE performance_schema.setup_consumers("
- "NAME VARCHAR(64) not null,"
- "ENABLED ENUM ('YES', 'NO') not null"
- ")ENGINE=PERFORMANCE_SCHEMA;";
-
-SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
-
---
--- TABLE SETUP_INSTRUMENTS
---
-
-SET @cmd="CREATE TABLE performance_schema.setup_instruments("
- "NAME VARCHAR(128) not null,"
- "ENABLED ENUM ('YES', 'NO') not null,"
- "TIMED ENUM ('YES', 'NO') not null"
- ")ENGINE=PERFORMANCE_SCHEMA;";
-
-SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
-
---
--- TABLE SETUP_OBJECTS
---
-
-SET @cmd="CREATE TABLE performance_schema.setup_objects("
- "OBJECT_TYPE ENUM ('TABLE') not null default 'TABLE',"
- "OBJECT_SCHEMA VARCHAR(64) default '%',"
- "OBJECT_NAME VARCHAR(64) not null default '%',"
- "ENABLED ENUM ('YES', 'NO') not null default 'YES',"
- "TIMED ENUM ('YES', 'NO') not null default 'YES'"
- ")ENGINE=PERFORMANCE_SCHEMA;";
-
-SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
-
---
--- TABLE SETUP_TIMERS
---
-
-SET @cmd="CREATE TABLE performance_schema.setup_timers("
- "NAME VARCHAR(64) not null,"
- "TIMER_NAME ENUM ('CYCLE', 'NANOSECOND', 'MICROSECOND', 'MILLISECOND', 'TICK') not null"
- ")ENGINE=PERFORMANCE_SCHEMA;";
-
-SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
-
---
--- TABLE TABLE_IO_WAITS_SUMMARY_BY_INDEX_USAGE
---
-
-SET @cmd="CREATE TABLE performance_schema.table_io_waits_summary_by_index_usage("
- "OBJECT_TYPE VARCHAR(64),"
- "OBJECT_SCHEMA VARCHAR(64),"
- "OBJECT_NAME VARCHAR(64),"
- "INDEX_NAME VARCHAR(64),"
- "COUNT_STAR BIGINT unsigned not null,"
- "SUM_TIMER_WAIT BIGINT unsigned not null,"
- "MIN_TIMER_WAIT BIGINT unsigned not null,"
- "AVG_TIMER_WAIT BIGINT unsigned not null,"
- "MAX_TIMER_WAIT BIGINT unsigned not null,"
- "COUNT_READ BIGINT unsigned not null,"
- "SUM_TIMER_READ BIGINT unsigned not null,"
- "MIN_TIMER_READ BIGINT unsigned not null,"
- "AVG_TIMER_READ BIGINT unsigned not null,"
- "MAX_TIMER_READ BIGINT unsigned not null,"
- "COUNT_WRITE BIGINT unsigned not null,"
- "SUM_TIMER_WRITE BIGINT unsigned not null,"
- "MIN_TIMER_WRITE BIGINT unsigned not null,"
- "AVG_TIMER_WRITE BIGINT unsigned not null,"
- "MAX_TIMER_WRITE BIGINT unsigned not null,"
- "COUNT_FETCH BIGINT unsigned not null,"
- "SUM_TIMER_FETCH BIGINT unsigned not null,"
- "MIN_TIMER_FETCH BIGINT unsigned not null,"
- "AVG_TIMER_FETCH BIGINT unsigned not null,"
- "MAX_TIMER_FETCH BIGINT unsigned not null,"
- "COUNT_INSERT BIGINT unsigned not null,"
- "SUM_TIMER_INSERT BIGINT unsigned not null,"
- "MIN_TIMER_INSERT BIGINT unsigned not null,"
- "AVG_TIMER_INSERT BIGINT unsigned not null,"
- "MAX_TIMER_INSERT BIGINT unsigned not null,"
- "COUNT_UPDATE BIGINT unsigned not null,"
- "SUM_TIMER_UPDATE BIGINT unsigned not null,"
- "MIN_TIMER_UPDATE BIGINT unsigned not null,"
- "AVG_TIMER_UPDATE BIGINT unsigned not null,"
- "MAX_TIMER_UPDATE BIGINT unsigned not null,"
- "COUNT_DELETE BIGINT unsigned not null,"
- "SUM_TIMER_DELETE BIGINT unsigned not null,"
- "MIN_TIMER_DELETE BIGINT unsigned not null,"
- "AVG_TIMER_DELETE BIGINT unsigned not null,"
- "MAX_TIMER_DELETE BIGINT unsigned not null"
- ")ENGINE=PERFORMANCE_SCHEMA;";
-
-SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
-
---
--- TABLE TABLE_IO_WAITS_SUMMARY_BY_TABLE
---
-
-SET @cmd="CREATE TABLE performance_schema.table_io_waits_summary_by_table("
- "OBJECT_TYPE VARCHAR(64),"
- "OBJECT_SCHEMA VARCHAR(64),"
- "OBJECT_NAME VARCHAR(64),"
- "COUNT_STAR BIGINT unsigned not null,"
- "SUM_TIMER_WAIT BIGINT unsigned not null,"
- "MIN_TIMER_WAIT BIGINT unsigned not null,"
- "AVG_TIMER_WAIT BIGINT unsigned not null,"
- "MAX_TIMER_WAIT BIGINT unsigned not null,"
- "COUNT_READ BIGINT unsigned not null,"
- "SUM_TIMER_READ BIGINT unsigned not null,"
- "MIN_TIMER_READ BIGINT unsigned not null,"
- "AVG_TIMER_READ BIGINT unsigned not null,"
- "MAX_TIMER_READ BIGINT unsigned not null,"
- "COUNT_WRITE BIGINT unsigned not null,"
- "SUM_TIMER_WRITE BIGINT unsigned not null,"
- "MIN_TIMER_WRITE BIGINT unsigned not null,"
- "AVG_TIMER_WRITE BIGINT unsigned not null,"
- "MAX_TIMER_WRITE BIGINT unsigned not null,"
- "COUNT_FETCH BIGINT unsigned not null,"
- "SUM_TIMER_FETCH BIGINT unsigned not null,"
- "MIN_TIMER_FETCH BIGINT unsigned not null,"
- "AVG_TIMER_FETCH BIGINT unsigned not null,"
- "MAX_TIMER_FETCH BIGINT unsigned not null,"
- "COUNT_INSERT BIGINT unsigned not null,"
- "SUM_TIMER_INSERT BIGINT unsigned not null,"
- "MIN_TIMER_INSERT BIGINT unsigned not null,"
- "AVG_TIMER_INSERT BIGINT unsigned not null,"
- "MAX_TIMER_INSERT BIGINT unsigned not null,"
- "COUNT_UPDATE BIGINT unsigned not null,"
- "SUM_TIMER_UPDATE BIGINT unsigned not null,"
- "MIN_TIMER_UPDATE BIGINT unsigned not null,"
- "AVG_TIMER_UPDATE BIGINT unsigned not null,"
- "MAX_TIMER_UPDATE BIGINT unsigned not null,"
- "COUNT_DELETE BIGINT unsigned not null,"
- "SUM_TIMER_DELETE BIGINT unsigned not null,"
- "MIN_TIMER_DELETE BIGINT unsigned not null,"
- "AVG_TIMER_DELETE BIGINT unsigned not null,"
- "MAX_TIMER_DELETE BIGINT unsigned not null"
- ")ENGINE=PERFORMANCE_SCHEMA;";
-
-SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
-
---
--- TABLE TABLE_LOCK_WAITS_SUMMARY_BY_TABLE
---
-
-SET @cmd="CREATE TABLE performance_schema.table_lock_waits_summary_by_table("
- "OBJECT_TYPE VARCHAR(64),"
- "OBJECT_SCHEMA VARCHAR(64),"
- "OBJECT_NAME VARCHAR(64),"
- "COUNT_STAR BIGINT unsigned not null,"
- "SUM_TIMER_WAIT BIGINT unsigned not null,"
- "MIN_TIMER_WAIT BIGINT unsigned not null,"
- "AVG_TIMER_WAIT BIGINT unsigned not null,"
- "MAX_TIMER_WAIT BIGINT unsigned not null,"
- "COUNT_READ BIGINT unsigned not null,"
- "SUM_TIMER_READ BIGINT unsigned not null,"
- "MIN_TIMER_READ BIGINT unsigned not null,"
- "AVG_TIMER_READ BIGINT unsigned not null,"
- "MAX_TIMER_READ BIGINT unsigned not null,"
- "COUNT_WRITE BIGINT unsigned not null,"
- "SUM_TIMER_WRITE BIGINT unsigned not null,"
- "MIN_TIMER_WRITE BIGINT unsigned not null,"
- "AVG_TIMER_WRITE BIGINT unsigned not null,"
- "MAX_TIMER_WRITE BIGINT unsigned not null,"
- "COUNT_READ_NORMAL BIGINT unsigned not null,"
- "SUM_TIMER_READ_NORMAL BIGINT unsigned not null,"
- "MIN_TIMER_READ_NORMAL BIGINT unsigned not null,"
- "AVG_TIMER_READ_NORMAL BIGINT unsigned not null,"
- "MAX_TIMER_READ_NORMAL BIGINT unsigned not null,"
- "COUNT_READ_WITH_SHARED_LOCKS BIGINT unsigned not null,"
- "SUM_TIMER_READ_WITH_SHARED_LOCKS BIGINT unsigned not null,"
- "MIN_TIMER_READ_WITH_SHARED_LOCKS BIGINT unsigned not null,"
- "AVG_TIMER_READ_WITH_SHARED_LOCKS BIGINT unsigned not null,"
- "MAX_TIMER_READ_WITH_SHARED_LOCKS BIGINT unsigned not null,"
- "COUNT_READ_HIGH_PRIORITY BIGINT unsigned not null,"
- "SUM_TIMER_READ_HIGH_PRIORITY BIGINT unsigned not null,"
- "MIN_TIMER_READ_HIGH_PRIORITY BIGINT unsigned not null,"
- "AVG_TIMER_READ_HIGH_PRIORITY BIGINT unsigned not null,"
- "MAX_TIMER_READ_HIGH_PRIORITY BIGINT unsigned not null,"
- "COUNT_READ_NO_INSERT BIGINT unsigned not null,"
- "SUM_TIMER_READ_NO_INSERT BIGINT unsigned not null,"
- "MIN_TIMER_READ_NO_INSERT BIGINT unsigned not null,"
- "AVG_TIMER_READ_NO_INSERT BIGINT unsigned not null,"
- "MAX_TIMER_READ_NO_INSERT BIGINT unsigned not null,"
- "COUNT_READ_EXTERNAL BIGINT unsigned not null,"
- "SUM_TIMER_READ_EXTERNAL BIGINT unsigned not null,"
- "MIN_TIMER_READ_EXTERNAL BIGINT unsigned not null,"
- "AVG_TIMER_READ_EXTERNAL BIGINT unsigned not null,"
- "MAX_TIMER_READ_EXTERNAL BIGINT unsigned not null,"
- "COUNT_WRITE_ALLOW_WRITE BIGINT unsigned not null,"
- "SUM_TIMER_WRITE_ALLOW_WRITE BIGINT unsigned not null,"
- "MIN_TIMER_WRITE_ALLOW_WRITE BIGINT unsigned not null,"
- "AVG_TIMER_WRITE_ALLOW_WRITE BIGINT unsigned not null,"
- "MAX_TIMER_WRITE_ALLOW_WRITE BIGINT unsigned not null,"
- "COUNT_WRITE_CONCURRENT_INSERT BIGINT unsigned not null,"
- "SUM_TIMER_WRITE_CONCURRENT_INSERT BIGINT unsigned not null,"
- "MIN_TIMER_WRITE_CONCURRENT_INSERT BIGINT unsigned not null,"
- "AVG_TIMER_WRITE_CONCURRENT_INSERT BIGINT unsigned not null,"
- "MAX_TIMER_WRITE_CONCURRENT_INSERT BIGINT unsigned not null,"
- "COUNT_WRITE_DELAYED BIGINT unsigned not null,"
- "SUM_TIMER_WRITE_DELAYED BIGINT unsigned not null,"
- "MIN_TIMER_WRITE_DELAYED BIGINT unsigned not null,"
- "AVG_TIMER_WRITE_DELAYED BIGINT unsigned not null,"
- "MAX_TIMER_WRITE_DELAYED BIGINT unsigned not null,"
- "COUNT_WRITE_LOW_PRIORITY BIGINT unsigned not null,"
- "SUM_TIMER_WRITE_LOW_PRIORITY BIGINT unsigned not null,"
- "MIN_TIMER_WRITE_LOW_PRIORITY BIGINT unsigned not null,"
- "AVG_TIMER_WRITE_LOW_PRIORITY BIGINT unsigned not null,"
- "MAX_TIMER_WRITE_LOW_PRIORITY BIGINT unsigned not null,"
- "COUNT_WRITE_NORMAL BIGINT unsigned not null,"
- "SUM_TIMER_WRITE_NORMAL BIGINT unsigned not null,"
- "MIN_TIMER_WRITE_NORMAL BIGINT unsigned not null,"
- "AVG_TIMER_WRITE_NORMAL BIGINT unsigned not null,"
- "MAX_TIMER_WRITE_NORMAL BIGINT unsigned not null,"
- "COUNT_WRITE_EXTERNAL BIGINT unsigned not null,"
- "SUM_TIMER_WRITE_EXTERNAL BIGINT unsigned not null,"
- "MIN_TIMER_WRITE_EXTERNAL BIGINT unsigned not null,"
- "AVG_TIMER_WRITE_EXTERNAL BIGINT unsigned not null,"
- "MAX_TIMER_WRITE_EXTERNAL BIGINT unsigned not null"
- ")ENGINE=PERFORMANCE_SCHEMA;";
-
-SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
-
---
--- TABLE THREADS
---
-
-SET @cmd="CREATE TABLE performance_schema.threads("
- "THREAD_ID INTEGER not null,"
- "NAME VARCHAR(128) not null,"
- "TYPE VARCHAR(10) not null,"
- "PROCESSLIST_ID INTEGER,"
- "PROCESSLIST_USER VARCHAR(16),"
- "PROCESSLIST_HOST VARCHAR(60),"
- "PROCESSLIST_DB VARCHAR(64),"
- "PROCESSLIST_COMMAND VARCHAR(16),"
- "PROCESSLIST_TIME BIGINT,"
- "PROCESSLIST_STATE VARCHAR(64),"
- "PROCESSLIST_INFO LONGTEXT,"
- "PARENT_THREAD_ID INTEGER,"
- "ROLE VARCHAR(64),"
- "INSTRUMENTED ENUM ('YES', 'NO') not null"
- ")ENGINE=PERFORMANCE_SCHEMA;";
-
-SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
-
---
--- TABLE EVENTS_STAGES_CURRENT
---
-
-SET @cmd="CREATE TABLE performance_schema.events_stages_current("
- "THREAD_ID INTEGER not null,"
- "EVENT_ID BIGINT unsigned not null,"
- "END_EVENT_ID BIGINT unsigned,"
- "EVENT_NAME VARCHAR(128) not null,"
- "SOURCE VARCHAR(64),"
- "TIMER_START BIGINT unsigned,"
- "TIMER_END BIGINT unsigned,"
- "TIMER_WAIT BIGINT unsigned,"
- "NESTING_EVENT_ID BIGINT unsigned,"
- "NESTING_EVENT_TYPE ENUM('STATEMENT', 'STAGE', 'WAIT')"
- ")ENGINE=PERFORMANCE_SCHEMA;";
-
-SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
-
---
--- TABLE EVENTS_STAGES_HISTORY
---
-
-SET @cmd="CREATE TABLE performance_schema.events_stages_history("
- "THREAD_ID INTEGER not null,"
- "EVENT_ID BIGINT unsigned not null,"
- "END_EVENT_ID BIGINT unsigned,"
- "EVENT_NAME VARCHAR(128) not null,"
- "SOURCE VARCHAR(64),"
- "TIMER_START BIGINT unsigned,"
- "TIMER_END BIGINT unsigned,"
- "TIMER_WAIT BIGINT unsigned,"
- "NESTING_EVENT_ID BIGINT unsigned,"
- "NESTING_EVENT_TYPE ENUM('STATEMENT', 'STAGE', 'WAIT')"
- ")ENGINE=PERFORMANCE_SCHEMA;";
-
-SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
-
---
--- TABLE EVENTS_STAGES_HISTORY_LONG
---
-
-SET @cmd="CREATE TABLE performance_schema.events_stages_history_long("
- "THREAD_ID INTEGER not null,"
- "EVENT_ID BIGINT unsigned not null,"
- "END_EVENT_ID BIGINT unsigned,"
- "EVENT_NAME VARCHAR(128) not null,"
- "SOURCE VARCHAR(64),"
- "TIMER_START BIGINT unsigned,"
- "TIMER_END BIGINT unsigned,"
- "TIMER_WAIT BIGINT unsigned,"
- "NESTING_EVENT_ID BIGINT unsigned,"
- "NESTING_EVENT_TYPE ENUM('STATEMENT', 'STAGE', 'WAIT')"
- ")ENGINE=PERFORMANCE_SCHEMA;";
-
-SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
-
---
--- TABLE EVENTS_STAGES_SUMMARY_BY_THREAD_BY_EVENT_NAME
---
-
-SET @cmd="CREATE TABLE performance_schema.events_stages_summary_by_thread_by_event_name("
- "THREAD_ID INTEGER not null,"
- "EVENT_NAME VARCHAR(128) not null,"
- "COUNT_STAR BIGINT unsigned not null,"
- "SUM_TIMER_WAIT BIGINT unsigned not null,"
- "MIN_TIMER_WAIT BIGINT unsigned not null,"
- "AVG_TIMER_WAIT BIGINT unsigned not null,"
- "MAX_TIMER_WAIT BIGINT unsigned not null"
- ")ENGINE=PERFORMANCE_SCHEMA;";
-
-SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
-
---
--- TABLE EVENTS_STAGES_SUMMARY_BY_HOST_BY_EVENT_NAME
---
-
-SET @cmd="CREATE TABLE performance_schema.events_stages_summary_by_host_by_event_name("
- "HOST CHAR(60) collate utf8_bin default null,"
- "EVENT_NAME VARCHAR(128) not null,"
- "COUNT_STAR BIGINT unsigned not null,"
- "SUM_TIMER_WAIT BIGINT unsigned not null,"
- "MIN_TIMER_WAIT BIGINT unsigned not null,"
- "AVG_TIMER_WAIT BIGINT unsigned not null,"
- "MAX_TIMER_WAIT BIGINT unsigned not null"
- ")ENGINE=PERFORMANCE_SCHEMA;";
-
-SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
-
---
--- TABLE EVENTS_STAGES_SUMMARY_BY_USER_BY_EVENT_NAME
---
-
-SET @cmd="CREATE TABLE performance_schema.events_stages_summary_by_user_by_event_name("
- "USER CHAR(16) collate utf8_bin default null,"
- "EVENT_NAME VARCHAR(128) not null,"
- "COUNT_STAR BIGINT unsigned not null,"
- "SUM_TIMER_WAIT BIGINT unsigned not null,"
- "MIN_TIMER_WAIT BIGINT unsigned not null,"
- "AVG_TIMER_WAIT BIGINT unsigned not null,"
- "MAX_TIMER_WAIT BIGINT unsigned not null"
- ")ENGINE=PERFORMANCE_SCHEMA;";
-
-SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
-
---
--- TABLE EVENTS_STAGES_SUMMARY_BY_ACCOUNT_BY_EVENT_NAME
---
-
-SET @cmd="CREATE TABLE performance_schema.events_stages_summary_by_account_by_event_name("
- "USER CHAR(16) collate utf8_bin default null,"
- "HOST CHAR(60) collate utf8_bin default null,"
- "EVENT_NAME VARCHAR(128) not null,"
- "COUNT_STAR BIGINT unsigned not null,"
- "SUM_TIMER_WAIT BIGINT unsigned not null,"
- "MIN_TIMER_WAIT BIGINT unsigned not null,"
- "AVG_TIMER_WAIT BIGINT unsigned not null,"
- "MAX_TIMER_WAIT BIGINT unsigned not null"
- ")ENGINE=PERFORMANCE_SCHEMA;";
-
-SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
-
---
--- TABLE EVENTS_STAGES_SUMMARY_GLOBAL_BY_EVENT_NAME
---
-
-SET @cmd="CREATE TABLE performance_schema.events_stages_summary_global_by_event_name("
- "EVENT_NAME VARCHAR(128) not null,"
- "COUNT_STAR BIGINT unsigned not null,"
- "SUM_TIMER_WAIT BIGINT unsigned not null,"
- "MIN_TIMER_WAIT BIGINT unsigned not null,"
- "AVG_TIMER_WAIT BIGINT unsigned not null,"
- "MAX_TIMER_WAIT BIGINT unsigned not null"
- ")ENGINE=PERFORMANCE_SCHEMA;";
-
-SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
-
---
--- TABLE EVENTS_STATEMENTS_CURRENT
---
-
-SET @cmd="CREATE TABLE performance_schema.events_statements_current("
- "THREAD_ID INTEGER not null,"
- "EVENT_ID BIGINT unsigned not null,"
- "END_EVENT_ID BIGINT unsigned,"
- "EVENT_NAME VARCHAR(128) not null,"
- "SOURCE VARCHAR(64),"
- "TIMER_START BIGINT unsigned,"
- "TIMER_END BIGINT unsigned,"
- "TIMER_WAIT BIGINT unsigned,"
- "LOCK_TIME bigint unsigned not null,"
- "SQL_TEXT LONGTEXT,"
- "DIGEST VARCHAR(32),"
- "DIGEST_TEXT LONGTEXT,"
- "CURRENT_SCHEMA VARCHAR(64),"
- "OBJECT_TYPE VARCHAR(64),"
- "OBJECT_SCHEMA VARCHAR(64),"
- "OBJECT_NAME VARCHAR(64),"
- "OBJECT_INSTANCE_BEGIN BIGINT unsigned,"
- "MYSQL_ERRNO INTEGER,"
- "RETURNED_SQLSTATE VARCHAR(5),"
- "MESSAGE_TEXT VARCHAR(128),"
- "ERRORS BIGINT unsigned not null,"
- "WARNINGS BIGINT unsigned not null,"
- "ROWS_AFFECTED BIGINT unsigned not null,"
- "ROWS_SENT BIGINT unsigned not null,"
- "ROWS_EXAMINED BIGINT unsigned not null,"
- "CREATED_TMP_DISK_TABLES BIGINT unsigned not null,"
- "CREATED_TMP_TABLES BIGINT unsigned not null,"
- "SELECT_FULL_JOIN BIGINT unsigned not null,"
- "SELECT_FULL_RANGE_JOIN BIGINT unsigned not null,"
- "SELECT_RANGE BIGINT unsigned not null,"
- "SELECT_RANGE_CHECK BIGINT unsigned not null,"
- "SELECT_SCAN BIGINT unsigned not null,"
- "SORT_MERGE_PASSES BIGINT unsigned not null,"
- "SORT_RANGE BIGINT unsigned not null,"
- "SORT_ROWS BIGINT unsigned not null,"
- "SORT_SCAN BIGINT unsigned not null,"
- "NO_INDEX_USED BIGINT unsigned not null,"
- "NO_GOOD_INDEX_USED BIGINT unsigned not null,"
- "NESTING_EVENT_ID BIGINT unsigned,"
- "NESTING_EVENT_TYPE ENUM('STATEMENT', 'STAGE', 'WAIT')"
- ")ENGINE=PERFORMANCE_SCHEMA;";
-
-SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
-
---
--- TABLE EVENTS_STATEMENTS_HISTORY
---
-
-SET @cmd="CREATE TABLE performance_schema.events_statements_history("
- "THREAD_ID INTEGER not null,"
- "EVENT_ID BIGINT unsigned not null,"
- "END_EVENT_ID BIGINT unsigned,"
- "EVENT_NAME VARCHAR(128) not null,"
- "SOURCE VARCHAR(64),"
- "TIMER_START BIGINT unsigned,"
- "TIMER_END BIGINT unsigned,"
- "TIMER_WAIT BIGINT unsigned,"
- "LOCK_TIME bigint unsigned not null,"
- "SQL_TEXT LONGTEXT,"
- "DIGEST VARCHAR(32),"
- "DIGEST_TEXT LONGTEXT,"
- "CURRENT_SCHEMA VARCHAR(64),"
- "OBJECT_TYPE VARCHAR(64),"
- "OBJECT_SCHEMA VARCHAR(64),"
- "OBJECT_NAME VARCHAR(64),"
- "OBJECT_INSTANCE_BEGIN BIGINT unsigned,"
- "MYSQL_ERRNO INTEGER,"
- "RETURNED_SQLSTATE VARCHAR(5),"
- "MESSAGE_TEXT VARCHAR(128),"
- "ERRORS BIGINT unsigned not null,"
- "WARNINGS BIGINT unsigned not null,"
- "ROWS_AFFECTED BIGINT unsigned not null,"
- "ROWS_SENT BIGINT unsigned not null,"
- "ROWS_EXAMINED BIGINT unsigned not null,"
- "CREATED_TMP_DISK_TABLES BIGINT unsigned not null,"
- "CREATED_TMP_TABLES BIGINT unsigned not null,"
- "SELECT_FULL_JOIN BIGINT unsigned not null,"
- "SELECT_FULL_RANGE_JOIN BIGINT unsigned not null,"
- "SELECT_RANGE BIGINT unsigned not null,"
- "SELECT_RANGE_CHECK BIGINT unsigned not null,"
- "SELECT_SCAN BIGINT unsigned not null,"
- "SORT_MERGE_PASSES BIGINT unsigned not null,"
- "SORT_RANGE BIGINT unsigned not null,"
- "SORT_ROWS BIGINT unsigned not null,"
- "SORT_SCAN BIGINT unsigned not null,"
- "NO_INDEX_USED BIGINT unsigned not null,"
- "NO_GOOD_INDEX_USED BIGINT unsigned not null,"
- "NESTING_EVENT_ID BIGINT unsigned,"
- "NESTING_EVENT_TYPE ENUM('STATEMENT', 'STAGE', 'WAIT')"
- ")ENGINE=PERFORMANCE_SCHEMA;";
-
-SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
-
---
--- TABLE EVENTS_STATEMENTS_HISTORY_LONG
---
-
-SET @cmd="CREATE TABLE performance_schema.events_statements_history_long("
- "THREAD_ID INTEGER not null,"
- "EVENT_ID BIGINT unsigned not null,"
- "END_EVENT_ID BIGINT unsigned,"
- "EVENT_NAME VARCHAR(128) not null,"
- "SOURCE VARCHAR(64),"
- "TIMER_START BIGINT unsigned,"
- "TIMER_END BIGINT unsigned,"
- "TIMER_WAIT BIGINT unsigned,"
- "LOCK_TIME bigint unsigned not null,"
- "SQL_TEXT LONGTEXT,"
- "DIGEST VARCHAR(32),"
- "DIGEST_TEXT LONGTEXT,"
- "CURRENT_SCHEMA VARCHAR(64),"
- "OBJECT_TYPE VARCHAR(64),"
- "OBJECT_SCHEMA VARCHAR(64),"
- "OBJECT_NAME VARCHAR(64),"
- "OBJECT_INSTANCE_BEGIN BIGINT unsigned,"
- "MYSQL_ERRNO INTEGER,"
- "RETURNED_SQLSTATE VARCHAR(5),"
- "MESSAGE_TEXT VARCHAR(128),"
- "ERRORS BIGINT unsigned not null,"
- "WARNINGS BIGINT unsigned not null,"
- "ROWS_AFFECTED BIGINT unsigned not null,"
- "ROWS_SENT BIGINT unsigned not null,"
- "ROWS_EXAMINED BIGINT unsigned not null,"
- "CREATED_TMP_DISK_TABLES BIGINT unsigned not null,"
- "CREATED_TMP_TABLES BIGINT unsigned not null,"
- "SELECT_FULL_JOIN BIGINT unsigned not null,"
- "SELECT_FULL_RANGE_JOIN BIGINT unsigned not null,"
- "SELECT_RANGE BIGINT unsigned not null,"
- "SELECT_RANGE_CHECK BIGINT unsigned not null,"
- "SELECT_SCAN BIGINT unsigned not null,"
- "SORT_MERGE_PASSES BIGINT unsigned not null,"
- "SORT_RANGE BIGINT unsigned not null,"
- "SORT_ROWS BIGINT unsigned not null,"
- "SORT_SCAN BIGINT unsigned not null,"
- "NO_INDEX_USED BIGINT unsigned not null,"
- "NO_GOOD_INDEX_USED BIGINT unsigned not null,"
- "NESTING_EVENT_ID BIGINT unsigned,"
- "NESTING_EVENT_TYPE ENUM('STATEMENT', 'STAGE', 'WAIT')"
- ")ENGINE=PERFORMANCE_SCHEMA;";
-
-SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
-
---
--- TABLE EVENTS_STATEMENTS_SUMMARY_BY_THREAD_BY_EVENT_NAME
---
-
-SET @cmd="CREATE TABLE performance_schema.events_statements_summary_by_thread_by_event_name("
- "THREAD_ID INTEGER not null,"
- "EVENT_NAME VARCHAR(128) not null,"
- "COUNT_STAR BIGINT unsigned not null,"
- "SUM_TIMER_WAIT BIGINT unsigned not null,"
- "MIN_TIMER_WAIT BIGINT unsigned not null,"
- "AVG_TIMER_WAIT BIGINT unsigned not null,"
- "MAX_TIMER_WAIT BIGINT unsigned not null,"
- "SUM_LOCK_TIME BIGINT unsigned not null,"
- "SUM_ERRORS BIGINT unsigned not null,"
- "SUM_WARNINGS BIGINT unsigned not null,"
- "SUM_ROWS_AFFECTED BIGINT unsigned not null,"
- "SUM_ROWS_SENT BIGINT unsigned not null,"
- "SUM_ROWS_EXAMINED BIGINT unsigned not null,"
- "SUM_CREATED_TMP_DISK_TABLES BIGINT unsigned not null,"
- "SUM_CREATED_TMP_TABLES BIGINT unsigned not null,"
- "SUM_SELECT_FULL_JOIN BIGINT unsigned not null,"
- "SUM_SELECT_FULL_RANGE_JOIN BIGINT unsigned not null,"
- "SUM_SELECT_RANGE BIGINT unsigned not null,"
- "SUM_SELECT_RANGE_CHECK BIGINT unsigned not null,"
- "SUM_SELECT_SCAN BIGINT unsigned not null,"
- "SUM_SORT_MERGE_PASSES BIGINT unsigned not null,"
- "SUM_SORT_RANGE BIGINT unsigned not null,"
- "SUM_SORT_ROWS BIGINT unsigned not null,"
- "SUM_SORT_SCAN BIGINT unsigned not null,"
- "SUM_NO_INDEX_USED BIGINT unsigned not null,"
- "SUM_NO_GOOD_INDEX_USED BIGINT unsigned not null"
- ")ENGINE=PERFORMANCE_SCHEMA;";
-
-SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
-
---
--- TABLE EVENTS_STATEMENTS_SUMMARY_BY_HOST_BY_EVENT_NAME
---
-
-SET @cmd="CREATE TABLE performance_schema.events_statements_summary_by_host_by_event_name("
- "HOST CHAR(60) collate utf8_bin default null,"
- "EVENT_NAME VARCHAR(128) not null,"
- "COUNT_STAR BIGINT unsigned not null,"
- "SUM_TIMER_WAIT BIGINT unsigned not null,"
- "MIN_TIMER_WAIT BIGINT unsigned not null,"
- "AVG_TIMER_WAIT BIGINT unsigned not null,"
- "MAX_TIMER_WAIT BIGINT unsigned not null,"
- "SUM_LOCK_TIME BIGINT unsigned not null,"
- "SUM_ERRORS BIGINT unsigned not null,"
- "SUM_WARNINGS BIGINT unsigned not null,"
- "SUM_ROWS_AFFECTED BIGINT unsigned not null,"
- "SUM_ROWS_SENT BIGINT unsigned not null,"
- "SUM_ROWS_EXAMINED BIGINT unsigned not null,"
- "SUM_CREATED_TMP_DISK_TABLES BIGINT unsigned not null,"
- "SUM_CREATED_TMP_TABLES BIGINT unsigned not null,"
- "SUM_SELECT_FULL_JOIN BIGINT unsigned not null,"
- "SUM_SELECT_FULL_RANGE_JOIN BIGINT unsigned not null,"
- "SUM_SELECT_RANGE BIGINT unsigned not null,"
- "SUM_SELECT_RANGE_CHECK BIGINT unsigned not null,"
- "SUM_SELECT_SCAN BIGINT unsigned not null,"
- "SUM_SORT_MERGE_PASSES BIGINT unsigned not null,"
- "SUM_SORT_RANGE BIGINT unsigned not null,"
- "SUM_SORT_ROWS BIGINT unsigned not null,"
- "SUM_SORT_SCAN BIGINT unsigned not null,"
- "SUM_NO_INDEX_USED BIGINT unsigned not null,"
- "SUM_NO_GOOD_INDEX_USED BIGINT unsigned not null"
- ")ENGINE=PERFORMANCE_SCHEMA;";
-
-SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
-
---
--- TABLE EVENTS_STATEMENTS_SUMMARY_BY_USER_BY_EVENT_NAME
---
-
-SET @cmd="CREATE TABLE performance_schema.events_statements_summary_by_user_by_event_name("
- "USER CHAR(16) collate utf8_bin default null,"
- "EVENT_NAME VARCHAR(128) not null,"
- "COUNT_STAR BIGINT unsigned not null,"
- "SUM_TIMER_WAIT BIGINT unsigned not null,"
- "MIN_TIMER_WAIT BIGINT unsigned not null,"
- "AVG_TIMER_WAIT BIGINT unsigned not null,"
- "MAX_TIMER_WAIT BIGINT unsigned not null,"
- "SUM_LOCK_TIME BIGINT unsigned not null,"
- "SUM_ERRORS BIGINT unsigned not null,"
- "SUM_WARNINGS BIGINT unsigned not null,"
- "SUM_ROWS_AFFECTED BIGINT unsigned not null,"
- "SUM_ROWS_SENT BIGINT unsigned not null,"
- "SUM_ROWS_EXAMINED BIGINT unsigned not null,"
- "SUM_CREATED_TMP_DISK_TABLES BIGINT unsigned not null,"
- "SUM_CREATED_TMP_TABLES BIGINT unsigned not null,"
- "SUM_SELECT_FULL_JOIN BIGINT unsigned not null,"
- "SUM_SELECT_FULL_RANGE_JOIN BIGINT unsigned not null,"
- "SUM_SELECT_RANGE BIGINT unsigned not null,"
- "SUM_SELECT_RANGE_CHECK BIGINT unsigned not null,"
- "SUM_SELECT_SCAN BIGINT unsigned not null,"
- "SUM_SORT_MERGE_PASSES BIGINT unsigned not null,"
- "SUM_SORT_RANGE BIGINT unsigned not null,"
- "SUM_SORT_ROWS BIGINT unsigned not null,"
- "SUM_SORT_SCAN BIGINT unsigned not null,"
- "SUM_NO_INDEX_USED BIGINT unsigned not null,"
- "SUM_NO_GOOD_INDEX_USED BIGINT unsigned not null"
- ")ENGINE=PERFORMANCE_SCHEMA;";
-
-SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
-
---
--- TABLE EVENTS_STATEMENTS_SUMMARY_BY_ACCOUNT_BY_EVENT_NAME
---
-
-SET @cmd="CREATE TABLE performance_schema.events_statements_summary_by_account_by_event_name("
- "USER CHAR(16) collate utf8_bin default null,"
- "HOST CHAR(60) collate utf8_bin default null,"
- "EVENT_NAME VARCHAR(128) not null,"
- "COUNT_STAR BIGINT unsigned not null,"
- "SUM_TIMER_WAIT BIGINT unsigned not null,"
- "MIN_TIMER_WAIT BIGINT unsigned not null,"
- "AVG_TIMER_WAIT BIGINT unsigned not null,"
- "MAX_TIMER_WAIT BIGINT unsigned not null,"
- "SUM_LOCK_TIME BIGINT unsigned not null,"
- "SUM_ERRORS BIGINT unsigned not null,"
- "SUM_WARNINGS BIGINT unsigned not null,"
- "SUM_ROWS_AFFECTED BIGINT unsigned not null,"
- "SUM_ROWS_SENT BIGINT unsigned not null,"
- "SUM_ROWS_EXAMINED BIGINT unsigned not null,"
- "SUM_CREATED_TMP_DISK_TABLES BIGINT unsigned not null,"
- "SUM_CREATED_TMP_TABLES BIGINT unsigned not null,"
- "SUM_SELECT_FULL_JOIN BIGINT unsigned not null,"
- "SUM_SELECT_FULL_RANGE_JOIN BIGINT unsigned not null,"
- "SUM_SELECT_RANGE BIGINT unsigned not null,"
- "SUM_SELECT_RANGE_CHECK BIGINT unsigned not null,"
- "SUM_SELECT_SCAN BIGINT unsigned not null,"
- "SUM_SORT_MERGE_PASSES BIGINT unsigned not null,"
- "SUM_SORT_RANGE BIGINT unsigned not null,"
- "SUM_SORT_ROWS BIGINT unsigned not null,"
- "SUM_SORT_SCAN BIGINT unsigned not null,"
- "SUM_NO_INDEX_USED BIGINT unsigned not null,"
- "SUM_NO_GOOD_INDEX_USED BIGINT unsigned not null"
- ")ENGINE=PERFORMANCE_SCHEMA;";
-
-SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
-
---
--- TABLE EVENTS_STATEMENTS_SUMMARY_GLOBAL_BY_EVENT_NAME
---
-
-SET @cmd="CREATE TABLE performance_schema.events_statements_summary_global_by_event_name("
- "EVENT_NAME VARCHAR(128) not null,"
- "COUNT_STAR BIGINT unsigned not null,"
- "SUM_TIMER_WAIT BIGINT unsigned not null,"
- "MIN_TIMER_WAIT BIGINT unsigned not null,"
- "AVG_TIMER_WAIT BIGINT unsigned not null,"
- "MAX_TIMER_WAIT BIGINT unsigned not null,"
- "SUM_LOCK_TIME BIGINT unsigned not null,"
- "SUM_ERRORS BIGINT unsigned not null,"
- "SUM_WARNINGS BIGINT unsigned not null,"
- "SUM_ROWS_AFFECTED BIGINT unsigned not null,"
- "SUM_ROWS_SENT BIGINT unsigned not null,"
- "SUM_ROWS_EXAMINED BIGINT unsigned not null,"
- "SUM_CREATED_TMP_DISK_TABLES BIGINT unsigned not null,"
- "SUM_CREATED_TMP_TABLES BIGINT unsigned not null,"
- "SUM_SELECT_FULL_JOIN BIGINT unsigned not null,"
- "SUM_SELECT_FULL_RANGE_JOIN BIGINT unsigned not null,"
- "SUM_SELECT_RANGE BIGINT unsigned not null,"
- "SUM_SELECT_RANGE_CHECK BIGINT unsigned not null,"
- "SUM_SELECT_SCAN BIGINT unsigned not null,"
- "SUM_SORT_MERGE_PASSES BIGINT unsigned not null,"
- "SUM_SORT_RANGE BIGINT unsigned not null,"
- "SUM_SORT_ROWS BIGINT unsigned not null,"
- "SUM_SORT_SCAN BIGINT unsigned not null,"
- "SUM_NO_INDEX_USED BIGINT unsigned not null,"
- "SUM_NO_GOOD_INDEX_USED BIGINT unsigned not null"
- ")ENGINE=PERFORMANCE_SCHEMA;";
-
-SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
-
---
--- TABLE HOSTS
---
-
-SET @cmd="CREATE TABLE performance_schema.hosts("
- "HOST CHAR(60) collate utf8_bin default null,"
- "CURRENT_CONNECTIONS bigint not null,"
- "TOTAL_CONNECTIONS bigint not null"
- ")ENGINE=PERFORMANCE_SCHEMA;";
-
-SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
-
---
--- TABLE USERS
---
-
-SET @cmd="CREATE TABLE performance_schema.users("
- "USER CHAR(16) collate utf8_bin default null,"
- "CURRENT_CONNECTIONS bigint not null,"
- "TOTAL_CONNECTIONS bigint not null"
- ")ENGINE=PERFORMANCE_SCHEMA;";
-
-SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
-
---
--- TABLE ACCOUNTS
---
-
-SET @cmd="CREATE TABLE performance_schema.accounts("
- "USER CHAR(16) collate utf8_bin default null,"
- "HOST CHAR(60) collate utf8_bin default null,"
- "CURRENT_CONNECTIONS bigint not null,"
- "TOTAL_CONNECTIONS bigint not null"
- ")ENGINE=PERFORMANCE_SCHEMA;";
-
-SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
-
---
--- TABLE EVENTS_STATEMENTS_SUMMARY_BY_DIGEST
---
-
-SET @cmd="CREATE TABLE performance_schema.events_statements_summary_by_digest("
- "DIGEST VARCHAR(32),"
- "DIGEST_TEXT LONGTEXT,"
- "COUNT_STAR BIGINT unsigned not null,"
- "SUM_TIMER_WAIT BIGINT unsigned not null,"
- "MIN_TIMER_WAIT BIGINT unsigned not null,"
- "AVG_TIMER_WAIT BIGINT unsigned not null,"
- "MAX_TIMER_WAIT BIGINT unsigned not null,"
- "SUM_LOCK_TIME BIGINT unsigned not null,"
- "SUM_ERRORS BIGINT unsigned not null,"
- "SUM_WARNINGS BIGINT unsigned not null,"
- "SUM_ROWS_AFFECTED BIGINT unsigned not null,"
- "SUM_ROWS_SENT BIGINT unsigned not null,"
- "SUM_ROWS_EXAMINED BIGINT unsigned not null,"
- "SUM_CREATED_TMP_DISK_TABLES BIGINT unsigned not null,"
- "SUM_CREATED_TMP_TABLES BIGINT unsigned not null,"
- "SUM_SELECT_FULL_JOIN BIGINT unsigned not null,"
- "SUM_SELECT_FULL_RANGE_JOIN BIGINT unsigned not null,"
- "SUM_SELECT_RANGE BIGINT unsigned not null,"
- "SUM_SELECT_RANGE_CHECK BIGINT unsigned not null,"
- "SUM_SELECT_SCAN BIGINT unsigned not null,"
- "SUM_SORT_MERGE_PASSES BIGINT unsigned not null,"
- "SUM_SORT_RANGE BIGINT unsigned not null,"
- "SUM_SORT_ROWS BIGINT unsigned not null,"
- "SUM_SORT_SCAN BIGINT unsigned not null,"
- "SUM_NO_INDEX_USED BIGINT unsigned not null,"
- "SUM_NO_GOOD_INDEX_USED BIGINT unsigned not null,"
- "FIRST_SEEN TIMESTAMP(0) default 0,"
- "LAST_SEEN TIMESTAMP(0) default 0"
- ")ENGINE=PERFORMANCE_SCHEMA;";
-
-
-SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
-
CREATE TABLE IF NOT EXISTS proxies_priv (Host char(60) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Proxied_host char(60) binary DEFAULT '' NOT NULL, Proxied_user char(16) binary DEFAULT '' NOT NULL, With_grant BOOL DEFAULT 0 NOT NULL, Grantor char(77) DEFAULT '' NOT NULL, Timestamp timestamp, PRIMARY KEY Host (Host,User,Proxied_host,Proxied_user), KEY Grantor (Grantor) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='User proxy privileges';
-- Remember for later if proxies_priv table already existed
diff --git a/scripts/mysql_system_tables_fix.sql b/scripts/mysql_system_tables_fix.sql
index 9f67ae37497..abe1f487915 100644
--- a/scripts/mysql_system_tables_fix.sql
+++ b/scripts/mysql_system_tables_fix.sql
@@ -621,29 +621,6 @@ ALTER TABLE user MODIFY Create_tablespace_priv enum('N','Y') COLLATE utf8_genera
UPDATE user SET Create_tablespace_priv = Super_priv WHERE @hadCreateTablespacePriv = 0;
---
--- Unlike 'performance_schema', the 'mysql' database is reserved already,
--- so no user procedure is supposed to be there.
---
--- NOTE: until upgrade is finished, stored routines are not available,
--- because system tables (e.g. mysql.proc) might be not usable.
---
-drop procedure if exists mysql.die;
-create procedure mysql.die() signal sqlstate 'HY000' set message_text='Unexpected content found in the performance_schema database.';
-
---
--- For broken upgrades, SIGNAL the error
---
-
-SET @cmd="call mysql.die()";
-
-SET @str = IF(@broken_pfs > 0, @cmd, 'SET @dummy = 0');
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
-
-drop procedure mysql.die;
-
ALTER TABLE user ADD plugin char(64) DEFAULT '', ADD authentication_string TEXT;
ALTER TABLE user MODIFY plugin char(64) CHARACTER SET latin1 DEFAULT '' NOT NULL;
ALTER TABLE user MODIFY authentication_string TEXT NOT NULL;
diff --git a/scripts/mysqlaccess.sh b/scripts/mysqlaccess.sh
index 9fb9e78e753..43844e5ec68 100644
--- a/scripts/mysqlaccess.sh
+++ b/scripts/mysqlaccess.sh
@@ -930,7 +930,7 @@ sub MergeConfigFile {
$unsafeConfig = $fname;
}
}
- if ( $group eq 'client' ) {
+ if ( $group eq 'client' || $group eq "client-server") {
$MYSQL_CNF{'mysql'}{$item} = $value;
$MYSQL_CNF{'mysqldump'}{$item} = $value;
} else {
@@ -2423,7 +2423,7 @@ sub Print_Header {
sub Print_Footer {
if ($MySQLaccess::CMD) { #command-line mode
print "\n"
- ."BUGs can be reported by email to bugs\@mysql.com\n";
+ ."BUGs can be reported trough https://mariadb.atlassian.net/browse/MDEV\n";
}
if ($MySQLaccess::CGI) { #CGI-BIN mode
if ($MySQLaccess::Param{'brief'}) {
@@ -2431,7 +2431,7 @@ sub Print_Footer {
}
print "<HR>\n"
."<ADDRESS>\n"
- ."BUGs can be reported by email to <a href=mailto:bugs\@mysql.com>bugs\@mysql.com</a><BR>\n"
+ ."BUGs can be reported through <a href=\"https://mariadb.atlassian.net/browse/MDEV\">MariaDB JIRA</a><BR>\n"
# ."Don't forget to mention the version $VERSION!<BR>\n"
."</ADDRESS>\n"
."</BODY>\n"
diff --git a/scripts/mysqld_multi.sh b/scripts/mysqld_multi.sh
index 99ce187fcd4..81015746ae9 100644
--- a/scripts/mysqld_multi.sh
+++ b/scripts/mysqld_multi.sh
@@ -64,6 +64,28 @@ $homedir = $ENV{HOME};
$my_progname = $0;
$my_progname =~ s/.*[\/]//;
+
+if (defined($ENV{UMASK})) {
+ my $UMASK = $ENV{UMASK};
+ my $m;
+ my $fmode = "0640";
+
+ if(($UMASK =~ m/[^0246]/) || ($UMASK =~ m/^[^0]/) || (length($UMASK) != 4)) {
+ printf("UMASK must be a 3-digit mode with an additional leading 0 to indicate octal.\n");
+ printf("The first digit will be corrected to 6, the others may be 0, 2, 4, or 6.\n"); }
+ else {
+ $fmode= substr $UMASK, 2, 2;
+ $fmode= "06${fmode}"; }
+
+ if($fmode != $UMASK) {
+ printf("UMASK corrected from $UMASK to $fmode ...\n"); }
+
+ $fmode= oct($fmode);
+
+ umask($fmode);
+}
+
+
main();
####
diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh
index aaf1936afe1..f49f885bf5a 100644
--- a/scripts/mysqld_safe.sh
+++ b/scripts/mysqld_safe.sh
@@ -32,7 +32,28 @@ syslog_tag_mysqld_safe=mysqld_safe
trap '' 1 2 3 15 # we shouldn't let anyone kill us
-umask 007
+# MySQL-specific environment variable. First off, it's not really a umask,
+# it's the desired mode. Second, it follows umask(2), not umask(3) in that
+# octal needs to be explicit. Our shell might be a proper sh without printf,
+# multiple-base arithmetic, and binary arithmetic, so this will get ugly.
+# We reject decimal values to keep things at least half-sane.
+umask 007 # fallback
+UMASK="${UMASK-0640}"
+fmode=`echo "$UMASK" | sed -e 's/[^0246]//g'`
+octalp=`echo "$fmode"|cut -c1`
+fmlen=`echo "$fmode"|wc -c|sed -e 's/ //g'`
+if [ "x$octalp" != "x0" -o "x$UMASK" != "x$fmode" -o "x$fmlen" != "x5" ]
+then
+ fmode=0640
+ echo "UMASK must be a 3-digit mode with an additional leading 0 to indicate octal." >&2
+ echo "The first digit will be corrected to 6, the others may be 0, 2, 4, or 6." >&2
+fi
+fmode=`echo "$fmode"|cut -c3-4`
+fmode="6$fmode"
+if [ "x$UMASK" != "x0$fmode" ]
+then
+ echo "UMASK corrected from $UMASK to 0$fmode ..."
+fi
defaults=
case "$1" in
@@ -429,29 +450,6 @@ else
DATADIR=@localstatedir@
fi
-#
-# Try to find the plugin directory
-#
-
-# Use user-supplied argument
-if [ -n "${PLUGIN_DIR}" ]; then
- plugin_dir="${PLUGIN_DIR}"
-else
- # Try to find plugin dir relative to basedir
- for dir in lib/mysql/plugin lib/plugin
- do
- if [ -d "${MY_BASEDIR_VERSION}/${dir}" ]; then
- plugin_dir="${MY_BASEDIR_VERSION}/${dir}"
- break
- fi
- done
- # Give up and use compiled-in default
- if [ -z "${plugin_dir}" ]; then
- plugin_dir='@pkgplugindir@'
- fi
-fi
-plugin_dir="${plugin_dir}${PLUGIN_VARIANT}"
-
if test -z "$MYSQL_HOME"
then
if test -r "$MY_BASEDIR_VERSION/my.cnf" && test -r "$DATADIR/my.cnf"
@@ -512,6 +510,31 @@ fi
parse_arguments `$print_defaults $defaults --loose-verbose mysqld_safe safe_mysqld`
parse_arguments PICK-ARGS-FROM-ARGV "$@"
+
+#
+# Try to find the plugin directory
+#
+
+# Use user-supplied argument
+if [ -n "${PLUGIN_DIR}" ]; then
+ plugin_dir="${PLUGIN_DIR}"
+else
+ # Try to find plugin dir relative to basedir
+ for dir in lib/mysql/plugin lib/plugin
+ do
+ if [ -d "${MY_BASEDIR_VERSION}/${dir}" ]; then
+ plugin_dir="${MY_BASEDIR_VERSION}/${dir}"
+ break
+ fi
+ done
+ # Give up and use compiled-in default
+ if [ -z "${plugin_dir}" ]; then
+ plugin_dir='@pkgplugindir@'
+ fi
+fi
+plugin_dir="${plugin_dir}${PLUGIN_VARIANT}"
+
+
# Determine what logging facility to use
# Ensure that 'logger' exists, if it's requested
@@ -561,6 +584,12 @@ then
# Log to err_log file
log_notice "Logging to '$err_log'."
logging=file
+
+ if [ ! -e "$err_log" ]; then # if error log already exists,
+ touch "$err_log" # we just append. otherwise,
+ chmod "$fmode" "$err_log" # fix the permissions here!
+ fi
+
else
if [ -n "$syslog_tag" ]
then
@@ -776,6 +805,12 @@ do
eval_log_error "$cmd"
+ if [ $want_syslog -eq 0 -a ! -e "$err_log" ]; then
+ touch "$err_log" # hypothetical: log was renamed but not
+ chown $user "$err_log" # flushed yet. we'd recreate it with
+ chmod "$fmode" "$err_log" # wrong owner next time we log, so set
+ fi # it up correctly while we can!
+
end_time=`date +%M%S`
if test ! -f "$pid_file" # This is removed if normal shutdown
diff --git a/sql-common/client.c b/sql-common/client.c
index 404d9c8cb17..e03f5236fef 100644
--- a/sql-common/client.c
+++ b/sql-common/client.c
@@ -918,7 +918,8 @@ void free_old_query(MYSQL *mysql)
DBUG_ENTER("free_old_query");
if (mysql->fields)
free_root(&mysql->field_alloc,MYF(0));
- init_alloc_root(&mysql->field_alloc,8192,0); /* Assume rowlength < 8192 */
+ /* Assume rowlength < 8192 */
+ init_alloc_root(&mysql->field_alloc, 8192, 0, MYF(MY_THREAD_SPECIFIC));
mysql->fields= 0;
mysql->field_count= 0; /* For API */
mysql->warning_count= 0;
@@ -1199,7 +1200,7 @@ static int add_init_command(struct st_mysql_options *options, const char *cmd)
{
options->init_commands= (DYNAMIC_ARRAY*)my_malloc(sizeof(DYNAMIC_ARRAY),
MYF(MY_WME));
- init_dynamic_array(options->init_commands,sizeof(char*),5,5);
+ my_init_dynamic_array(options->init_commands,sizeof(char*),5, 5, MYF(0));
}
if (!(tmp= my_strdup(cmd,MYF(MY_WME))) ||
@@ -1609,7 +1610,8 @@ MYSQL_DATA *cli_read_rows(MYSQL *mysql,MYSQL_FIELD *mysql_fields,
set_mysql_error(mysql, CR_OUT_OF_MEMORY, unknown_sqlstate);
DBUG_RETURN(0);
}
- init_alloc_root(&result->alloc,8192,0); /* Assume rowlength < 8192 */
+ /* Assume rowlength < 8192 */
+ init_alloc_root(&result->alloc, 8192, 0, MYF(MY_THREAD_SPECIFIC));
result->alloc.min_malloc=sizeof(MYSQL_ROWS);
prev_ptr= &result->data;
result->rows=0;
@@ -3337,7 +3339,7 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user,
if (mysql->options.extension && mysql->options.extension->async_context)
net->vio->async_context= mysql->options.extension->async_context;
- if (my_net_init(net, net->vio))
+ if (my_net_init(net, net->vio, MYF(0)))
{
vio_delete(net->vio);
net->vio = 0;
@@ -4511,8 +4513,8 @@ static int old_password_auth_client(MYSQL_PLUGIN_VIO *vio, MYSQL *mysql)
DBUG_RETURN(CR_SERVER_HANDSHAKE_ERR);
/* save it in MYSQL */
- memmove(mysql->scramble, pkt, pkt_len);
- mysql->scramble[pkt_len] = 0;
+ memmove(mysql->scramble, pkt, pkt_len - 1);
+ mysql->scramble[pkt_len - 1] = 0;
}
if (mysql->passwd[0])
diff --git a/sql-common/client_plugin.c b/sql-common/client_plugin.c
index b8857cbe8bb..063fc5c6dc6 100644
--- a/sql-common/client_plugin.c
+++ b/sql-common/client_plugin.c
@@ -251,7 +251,7 @@ int mysql_client_plugin_init()
bzero(&mysql, sizeof(mysql)); /* dummy mysql for set_mysql_extended_error */
mysql_mutex_init(0, &LOCK_load_client_plugin, MY_MUTEX_INIT_SLOW);
- init_alloc_root(&mem_root, 128, 128);
+ init_alloc_root(&mem_root, 128, 128, MYF(0));
bzero(&plugin_list, sizeof(plugin_list));
diff --git a/sql/CMakeLists.txt b/sql/CMakeLists.txt
index 98f779a8b60..8c2b6c81755 100644
--- a/sql/CMakeLists.txt
+++ b/sql/CMakeLists.txt
@@ -299,7 +299,6 @@ IF(WIN32 AND MYSQLD_EXECUTABLE)
COMMAND ${CMAKE_COMMAND}
${CONFIG_PARAM} -P ${CMAKE_CURRENT_BINARY_DIR}/create_initial_db.cmake
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/data
- COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR}/initdb.dep
DEPENDS mysqld
)
ADD_CUSTOM_TARGET(initial_database
@@ -326,11 +325,12 @@ IF(WIN32)
ADD_CUSTOM_COMMAND(OUTPUT
${my_bootstrap_sql}
COMMAND ${CMAKE_COMMAND} -E chdir ${CMAKE_SOURCE_DIR}/scripts
- cmd /c copy mysql_system_tables.sql+mysql_system_tables_data.sql+fill_help_tables.sql ${native_outfile}
+ cmd /c copy mysql_system_tables.sql+mysql_system_tables_data.sql+fill_help_tables.sql+mysql_performance_tables.sql ${native_outfile}
DEPENDS
${CMAKE_SOURCE_DIR}/scripts/mysql_system_tables.sql
${CMAKE_SOURCE_DIR}/scripts/mysql_system_tables_data.sql
${CMAKE_SOURCE_DIR}/scripts/fill_help_tables.sql
+ ${CMAKE_SOURCE_DIR}/scripts/mysql_performance_tables.sql
)
ADD_CUSTOM_COMMAND(
diff --git a/sql/debug_sync.cc b/sql/debug_sync.cc
index 6c8eae82a47..25f028e5451 100644
--- a/sql/debug_sync.cc
+++ b/sql/debug_sync.cc
@@ -239,7 +239,8 @@ void debug_sync_init_thread(THD *thd)
if (opt_debug_sync_timeout)
{
thd->debug_sync_control= (st_debug_sync_control*)
- my_malloc(sizeof(st_debug_sync_control), MYF(MY_WME | MY_ZEROFILL));
+ my_malloc(sizeof(st_debug_sync_control),
+ MYF(MY_WME | MY_ZEROFILL | MY_THREAD_SPECIFIC));
if (!thd->debug_sync_control)
{
/*
diff --git a/sql/event_data_objects.cc b/sql/event_data_objects.cc
index 7c7ab4df9ad..2e31d20d54e 100644
--- a/sql/event_data_objects.cc
+++ b/sql/event_data_objects.cc
@@ -209,7 +209,7 @@ Event_basic::Event_basic()
{
DBUG_ENTER("Event_basic::Event_basic");
/* init memory root */
- init_sql_alloc(&mem_root, 256, 512);
+ init_sql_alloc(&mem_root, 256, 512, MYF(0));
dbname.str= name.str= NULL;
dbname.length= name.length= 0;
time_zone= NULL;
diff --git a/sql/event_db_repository.cc b/sql/event_db_repository.cc
index 12d34580d3c..9a943d8bb59 100644
--- a/sql/event_db_repository.cc
+++ b/sql/event_db_repository.cc
@@ -410,7 +410,6 @@ Event_db_repository::index_read_for_db_for_i_s(THD *thd, TABLE *schema_table,
TABLE *event_table,
const char *db)
{
- int ret=0;
CHARSET_INFO *scs= system_charset_info;
KEY *key_info;
uint key_len;
@@ -420,7 +419,14 @@ Event_db_repository::index_read_for_db_for_i_s(THD *thd, TABLE *schema_table,
DBUG_ENTER("Event_db_repository::index_read_for_db_for_i_s");
DBUG_PRINT("info", ("Using prefix scanning on PK"));
- event_table->file->ha_index_init(0, 1);
+
+ int ret= event_table->file->ha_index_init(0, 1);
+ if (ret)
+ {
+ event_table->file->print_error(ret, MYF(0));
+ DBUG_RETURN(true);
+ }
+
key_info= event_table->key_info;
if (key_info->key_parts == 0 ||
diff --git a/sql/event_scheduler.cc b/sql/event_scheduler.cc
index c340384f068..ec96ca45a0e 100644
--- a/sql/event_scheduler.cc
+++ b/sql/event_scheduler.cc
@@ -153,8 +153,6 @@ void
deinit_event_thread(THD *thd)
{
thd->proc_info= "Clearing";
- DBUG_ASSERT(thd->net.buff != 0);
- net_end(&thd->net);
DBUG_PRINT("exit", ("Event thread finishing"));
mysql_mutex_lock(&LOCK_thread_count);
thread_count--;
@@ -182,12 +180,15 @@ deinit_event_thread(THD *thd)
void
pre_init_event_thread(THD* thd)
{
+ THD *orig_thd= current_thd;
DBUG_ENTER("pre_init_event_thread");
+
+ set_current_thd(thd);
thd->client_capabilities= 0;
thd->security_ctx->master_access= 0;
thd->security_ctx->db_access= 0;
thd->security_ctx->host_or_ip= (char*)my_localhost;
- my_net_init(&thd->net, NULL);
+ my_net_init(&thd->net, NULL, MYF(MY_THREAD_SPECIFIC));
thd->security_ctx->set_user((char*)"event_scheduler");
thd->net.read_timeout= slave_net_timeout;
thd->variables.option_bits|= OPTION_AUTO_IS_NULL;
@@ -207,6 +208,7 @@ pre_init_event_thread(THD* thd)
/* Do not use user-supplied timeout value for system threads. */
thd->variables.lock_wait_timeout= LONG_TIMEOUT;
+ set_current_thd(orig_thd);
DBUG_VOID_RETURN;
}
@@ -402,6 +404,7 @@ Event_scheduler::start()
ret= TRUE;
goto end;
}
+
pre_init_event_thread(new_thd);
new_thd->system_thread= SYSTEM_THREAD_EVENT_SCHEDULER;
new_thd->set_command(COM_DAEMON);
@@ -417,6 +420,7 @@ Event_scheduler::start()
new_thd->variables.tx_read_only= false;
new_thd->tx_read_only= false;
+ /* This should not be marked with MY_THREAD_SPECIFIC */
scheduler_param_value=
(struct scheduler_param *)my_malloc(sizeof(struct scheduler_param), MYF(0));
scheduler_param_value->thd= new_thd;
@@ -436,8 +440,6 @@ Event_scheduler::start()
ret= TRUE;
new_thd->proc_info= "Clearing";
- DBUG_ASSERT(new_thd->net.buff != 0);
- net_end(&new_thd->net);
mysql_mutex_lock(&LOCK_thread_count);
thread_count--;
dec_thread_running();
@@ -537,6 +539,7 @@ Event_scheduler::execute_top(Event_queue_element_for_exec *event_name)
pthread_t th;
int res= 0;
DBUG_ENTER("Event_scheduler::execute_top");
+
if (!(new_thd= new THD()))
goto error;
@@ -571,8 +574,6 @@ error:
if (new_thd)
{
new_thd->proc_info= "Clearing";
- DBUG_ASSERT(new_thd->net.buff != 0);
- net_end(&new_thd->net);
mysql_mutex_lock(&LOCK_thread_count);
thread_count--;
dec_thread_running();
@@ -676,7 +677,7 @@ Event_scheduler::stop()
*/
struct timespec top_time;
set_timespec(top_time, 2);
- COND_STATE_WAIT(thd, NULL, &stage_waiting_for_scheduler_to_stop);
+ COND_STATE_WAIT(thd, &top_time, &stage_waiting_for_scheduler_to_stop);
} while (state == STOPPING);
DBUG_PRINT("info", ("Scheduler thread has cleaned up. Set state to INIT"));
sql_print_information("Event Scheduler: Stopped");
diff --git a/sql/events.cc b/sql/events.cc
index cac71697300..b9c51b77f05 100644
--- a/sql/events.cc
+++ b/sql/events.cc
@@ -879,7 +879,7 @@ end:
}
delete thd;
/* Remember that we don't have a THD */
- my_pthread_setspecific_ptr(THR_THD, NULL);
+ set_current_thd(0);
DBUG_RETURN(res);
}
diff --git a/sql/field.cc b/sql/field.cc
index f3e3ee938d6..1769e4e55cb 100644
--- a/sql/field.cc
+++ b/sql/field.cc
@@ -1114,6 +1114,21 @@ bool Field::type_can_have_key_part(enum enum_field_types type)
}
+void Field::make_sort_key(uchar *buff,uint length)
+{
+ if (maybe_null())
+ {
+ if (is_null())
+ {
+ bzero(buff, length + 1);
+ return;
+ }
+ *buff++= 1;
+ }
+ sort_string(buff, length);
+}
+
+
/**
Numeric fields base class constructor.
*/
diff --git a/sql/field.h b/sql/field.h
index f450e596e03..e832928b114 100644
--- a/sql/field.h
+++ b/sql/field.h
@@ -519,6 +519,7 @@ public:
return bytes;
}
+ void make_sort_key(uchar *buff, uint length);
virtual void make_field(Send_field *);
virtual void sort_string(uchar *buff,uint length)=0;
virtual bool optimize_range(uint idx, uint part);
diff --git a/sql/filesort.cc b/sql/filesort.cc
index c612d2c55cb..49aaa0af574 100644
--- a/sql/filesort.cc
+++ b/sql/filesort.cc
@@ -61,7 +61,6 @@ static void make_sortkey(Sort_param *param, uchar *to, uchar *ref_pos);
static void register_used_fields(Sort_param *param);
static bool save_index(Sort_param *param, uint count,
Filesort_info *table_sort);
-static void make_sortkey(Sort_param *param, uchar *to, uchar *ref_pos);
static uint suffix_length(ulong string_length);
static uint sortlength(THD *thd, SORT_FIELD *sortorder, uint s_length,
bool *multi_byte_charset);
@@ -181,6 +180,7 @@ ha_rows filesort(THD *thd, TABLE *table, SORT_FIELD *sortorder, uint s_length,
when index_merge select has finished with it.
*/
table->sort.io_cache= NULL;
+ DBUG_ASSERT(table_sort.record_pointers == NULL);
outfile= table_sort.io_cache;
my_b_clear(&tempfile);
@@ -200,7 +200,8 @@ ha_rows filesort(THD *thd, TABLE *table, SORT_FIELD *sortorder, uint s_length,
table_sort.unpack= unpack_addon_fields;
if (param.addon_field &&
!(table_sort.addon_buf=
- (uchar *) my_malloc(param.addon_length, MYF(MY_WME))))
+ (uchar *) my_malloc(param.addon_length, MYF(MY_WME |
+ MY_THREAD_SPECIFIC))))
goto err;
if (select && select->quick)
@@ -213,7 +214,8 @@ ha_rows filesort(THD *thd, TABLE *table, SORT_FIELD *sortorder, uint s_length,
num_rows= table->file->estimate_rows_upper_bound();
if (multi_byte_charset &&
- !(param.tmp_buffer= (char*) my_malloc(param.sort_length,MYF(MY_WME))))
+ !(param.tmp_buffer= (char*) my_malloc(param.sort_length,
+ MYF(MY_WME | MY_THREAD_SPECIFIC))))
goto err;
if (check_if_pq_applicable(&param, &table_sort,
@@ -452,7 +454,7 @@ static uchar *read_buffpek_from_file(IO_CACHE *buffpek_pointers, uint count,
if (count > UINT_MAX/sizeof(BUFFPEK))
return 0; /* sizeof(BUFFPEK)*count will overflow */
if (!tmp)
- tmp= (uchar *)my_malloc(length, MYF(MY_WME));
+ tmp= (uchar *)my_malloc(length, MYF(MY_WME | MY_THREAD_SPECIFIC));
if (tmp)
{
if (reinit_io_cache(buffpek_pointers,READ_CACHE,0L,0,0) ||
@@ -605,6 +607,8 @@ static ha_rows find_all_keys(Sort_param *param, SQL_SELECT *select,
if (!quick_select)
{
next_pos=(uchar*) 0; /* Find records in sequence */
+ DBUG_EXECUTE_IF("bug14365043_1",
+ DBUG_SET("+d,ha_rnd_init_fail"););
if (file->ha_rnd_init_with_error(1))
DBUG_RETURN(HA_POS_ERROR);
file->extra_opt(HA_EXTRA_CACHE,
@@ -862,21 +866,9 @@ static void make_sortkey(register Sort_param *param,
bool maybe_null=0;
if ((field=sort_field->field))
{ // Field
- if (field->maybe_null())
- {
- if (field->is_null())
- {
- if (sort_field->reverse)
- memset(to, 255, sort_field->length+1);
- else
- memset(to, 0, sort_field->length+1);
- to+= sort_field->length+1;
- continue;
- }
- else
- *to++=1;
- }
- field->sort_string(to, sort_field->length);
+ field->make_sort_key(to, sort_field->length);
+ if ((maybe_null = field->maybe_null()))
+ to++;
}
else
{ // Item
@@ -1036,8 +1028,11 @@ static void make_sortkey(register Sort_param *param,
}
if (sort_field->reverse)
{ /* Revers key */
- if (maybe_null)
- to[-1]= ~to[-1];
+ if (maybe_null && (to[-1]= !to[-1]))
+ {
+ to+= sort_field->length; // don't waste the time reversing all 0's
+ continue;
+ }
length=sort_field->length;
while (length--)
{
@@ -1154,7 +1149,8 @@ static bool save_index(Sort_param *param, uint count, Filesort_info *table_sort)
res_length= param->res_length;
offset= param->rec_length-res_length;
if (!(to= table_sort->record_pointers=
- (uchar*) my_malloc(res_length*count, MYF(MY_WME))))
+ (uchar*) my_malloc(res_length*count,
+ MYF(MY_WME | MY_THREAD_SPECIFIC))))
DBUG_RETURN(1); /* purecov: inspected */
uchar **sort_keys= table_sort->get_sort_keys();
for (uchar **end= sort_keys+count ; sort_keys != end ; sort_keys++)
@@ -1896,7 +1892,9 @@ get_addon_fields(ulong max_length_for_sort_data,
if (length+sortlength > max_length_for_sort_data ||
!(addonf= (SORT_ADDON_FIELD *) my_malloc(sizeof(SORT_ADDON_FIELD)*
- (fields+1), MYF(MY_WME))))
+ (fields+1),
+ MYF(MY_WME |
+ MY_THREAD_SPECIFIC))))
return 0;
*plength= length;
diff --git a/sql/filesort_utils.cc b/sql/filesort_utils.cc
index c4480a6376d..f8f6d5c9420 100644
--- a/sql/filesort_utils.cc
+++ b/sql/filesort_utils.cc
@@ -99,7 +99,7 @@ uchar **Filesort_buffer::alloc_sort_buffer(uint num_records, uint record_length)
sort_buff_sz= num_records * (record_length + sizeof(uchar*));
set_if_bigger(sort_buff_sz, record_length * MERGEBUFF2);
uchar **sort_keys=
- (uchar**) my_malloc(sort_buff_sz, MYF(0));
+ (uchar**) my_malloc(sort_buff_sz, MYF(MY_THREAD_SPECIFIC));
m_idx_array= Idx_array(sort_keys, num_records);
m_record_length= record_length;
uchar **start_of_data= m_idx_array.array() + m_idx_array.size();
@@ -130,7 +130,8 @@ void Filesort_buffer::sort_buffer(const Sort_param *param, uint count)
uchar **keys= get_sort_keys();
uchar **buffer= NULL;
if (radixsort_is_appliccable(count, param->sort_length) &&
- (buffer= (uchar**) my_malloc(count*sizeof(char*), MYF(0))))
+ (buffer= (uchar**) my_malloc(count*sizeof(char*),
+ MYF(MY_THREAD_SPECIFIC))))
{
radixsort_for_str_ptr(keys, count, param->sort_length, buffer);
my_free(buffer);
@@ -140,4 +141,3 @@ void Filesort_buffer::sort_buffer(const Sort_param *param, uint count)
size_t size= param->sort_length;
my_qsort2(keys, count, sizeof(uchar*), get_ptr_compare(size), &size);
}
-
diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc
index 6ba4fe46441..6fc30fa4fa0 100644
--- a/sql/ha_ndbcluster.cc
+++ b/sql/ha_ndbcluster.cc
@@ -8649,7 +8649,7 @@ NDB_SHARE *ndbcluster_get_share(const char *key, TABLE *table,
MEM_ROOT **root_ptr=
my_pthread_getspecific_ptr(MEM_ROOT**, THR_MALLOC);
MEM_ROOT *old_root= *root_ptr;
- init_sql_alloc(&share->mem_root, 1024, 0);
+ init_sql_alloc(&share->mem_root, 1024, 0, MYF(0));
*root_ptr= &share->mem_root; // remember to reset before return
share->state= NSS_INITIAL;
/* enough space for key, db, and table_name */
@@ -9493,7 +9493,7 @@ pthread_handler_t ndb_util_thread_func(void *arg __attribute__((unused)))
thd->init_for_queries();
thd->main_security_ctx.host_or_ip= "";
thd->client_capabilities = 0;
- my_net_init(&thd->net, 0);
+ my_net_init(&thd->net, 0, MYF(MY_THREAD_SPECIFIC));
thd->main_security_ctx.master_access= ~0;
thd->main_security_ctx.priv_user[0] = 0;
/* Do not use user-supplied timeout value for system threads. */
@@ -9730,11 +9730,9 @@ next:
mysql_mutex_lock(&LOCK_ndb_util_thread);
ndb_util_thread_end:
- net_end(&thd->net);
ndb_util_thread_fail:
if (share_list)
delete [] share_list;
- thd->cleanup();
delete thd;
/* signal termination */
diff --git a/sql/ha_ndbcluster_binlog.cc b/sql/ha_ndbcluster_binlog.cc
index 59b9d6eab6b..1544678de38 100644
--- a/sql/ha_ndbcluster_binlog.cc
+++ b/sql/ha_ndbcluster_binlog.cc
@@ -1,4 +1,5 @@
/* Copyright (c) 2006, 2011, Oracle and/or its affiliates.
+ Copyright (c) 2012, 2013, Monty Proram Ab.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -3665,7 +3666,7 @@ pthread_handler_t ndb_binlog_thread_func(void *arg)
thd->system_thread= SYSTEM_THREAD_NDBCLUSTER_BINLOG;
thd->main_security_ctx.host_or_ip= "";
thd->client_capabilities= 0;
- my_net_init(&thd->net, 0);
+ my_net_init(&thd->net, 0, MYF(MY_THREAD_SPECIFIC));
thd->main_security_ctx.master_access= ~0;
thd->main_security_ctx.priv_user[0]= 0;
/* Do not use user-supplied timeout value for system threads. */
@@ -3964,7 +3965,7 @@ restart:
my_pthread_getspecific_ptr(MEM_ROOT**, THR_MALLOC);
MEM_ROOT *old_root= *root_ptr;
MEM_ROOT mem_root;
- init_sql_alloc(&mem_root, 4096, 0);
+ init_sql_alloc(&mem_root, 4096, 0, MYF(0));
List<Cluster_schema> post_epoch_log_list;
List<Cluster_schema> post_epoch_unlock_list;
*root_ptr= &mem_root;
@@ -4364,8 +4365,6 @@ err:
my_hash_free(&ndb_schema_objects);
- net_end(&thd->net);
- thd->cleanup();
delete thd;
ndb_binlog_thread_running= -1;
diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc
index 6ac51b6e380..148a2329660 100644
--- a/sql/ha_partition.cc
+++ b/sql/ha_partition.cc
@@ -168,7 +168,7 @@ ha_partition::ha_partition(handlerton *hton, TABLE_SHARE *share)
:handler(hton, share)
{
DBUG_ENTER("ha_partition::ha_partition(table)");
- init_alloc_root(&m_mem_root, 512, 512);
+ init_alloc_root(&m_mem_root, 512, 512, MYF(0));
init_handler_variables();
DBUG_VOID_RETURN;
}
@@ -190,7 +190,7 @@ ha_partition::ha_partition(handlerton *hton, partition_info *part_info)
{
DBUG_ENTER("ha_partition::ha_partition(part_info)");
DBUG_ASSERT(part_info);
- init_alloc_root(&m_mem_root, 512, 512);
+ init_alloc_root(&m_mem_root, 512, 512, MYF(0));
init_handler_variables();
m_part_info= part_info;
m_create_handler= TRUE;
@@ -217,7 +217,7 @@ ha_partition::ha_partition(handlerton *hton, TABLE_SHARE *share,
:handler(hton, share)
{
DBUG_ENTER("ha_partition::ha_partition(clone)");
- init_alloc_root(&m_mem_root, 512, 512);
+ init_alloc_root(&m_mem_root, 512, 512, MYF(0));
init_handler_variables();
m_part_info= part_info_arg;
m_create_handler= TRUE;
@@ -2850,6 +2850,17 @@ int ha_partition::open(const char *name, int mode, uint test_if_locked)
if (bitmap_init(&m_bulk_insert_started, NULL, m_tot_parts + 1, FALSE))
DBUG_RETURN(error);
bitmap_clear_all(&m_bulk_insert_started);
+ /*
+ Initialize the bitmap we use to keep track of partitions which returned
+ HA_ERR_KEY_NOT_FOUND from index_read_map.
+ */
+ if (bitmap_init(&m_key_not_found_partitions, NULL, m_tot_parts, FALSE))
+ {
+ bitmap_free(&m_bulk_insert_started);
+ DBUG_RETURN(error);
+ }
+ bitmap_clear_all(&m_key_not_found_partitions);
+ m_key_not_found= false;
/* Initialize the bitmap we use to determine what partitions are used */
if (!m_is_clone_of)
{
@@ -2992,6 +3003,7 @@ err_handler:
(*file)->ha_close();
err_alloc:
bitmap_free(&m_bulk_insert_started);
+ bitmap_free(&m_key_not_found_partitions);
if (!m_is_clone_of)
bitmap_free(&(m_part_info->used_partitions));
@@ -3097,6 +3109,7 @@ int ha_partition::close(void)
DBUG_ASSERT(table->s == table_share);
destroy_record_priority_queue();
bitmap_free(&m_bulk_insert_started);
+ bitmap_free(&m_key_not_found_partitions);
if (!m_is_clone_of)
bitmap_free(&(m_part_info->used_partitions));
file= m_file;
@@ -4619,21 +4632,24 @@ int ha_partition::index_read_map(uchar *buf, const uchar *key,
}
-/*
+/**
Common routine for a number of index_read variants
- SYNOPSIS
- ha_partition::common_index_read()
- buf Buffer where the record should be returned
- have_start_key TRUE <=> the left endpoint is available, i.e.
- we're in index_read call or in read_range_first
- call and the range has left endpoint
-
- FALSE <=> there is no left endpoint (we're in
- read_range_first() call and the range has no left
- endpoint)
+ @param buf Buffer where the record should be returned.
+ @param have_start_key TRUE <=> the left endpoint is available, i.e.
+ we're in index_read call or in read_range_first
+ call and the range has left endpoint.
+ FALSE <=> there is no left endpoint (we're in
+ read_range_first() call and the range has no left
+ endpoint).
- DESCRIPTION
+ @return Operation status
+ @retval 0 OK
+ @retval HA_ERR_END_OF_FILE Whole index scanned, without finding the record.
+ @retval HA_ERR_KEY_NOT_FOUND Record not found, but index cursor positioned.
+ @retval other error code.
+
+ @details
Start scanning the range (when invoked from read_range_first()) or doing
an index lookup (when invoked from index_read_XXX):
- If possible, perform partition selection
@@ -4643,10 +4659,6 @@ int ha_partition::index_read_map(uchar *buf, const uchar *key,
handle_unordered_scan_next_partition)
YES: Fill the priority queue and get the record that is the first in
the ordering
-
- RETURN
- 0 OK
- other HA_ERR_END_OF_FILE or other error code.
*/
int ha_partition::common_index_read(uchar *buf, bool have_start_key)
@@ -4656,14 +4668,16 @@ int ha_partition::common_index_read(uchar *buf, bool have_start_key)
bool reverse_order= FALSE;
DBUG_ENTER("ha_partition::common_index_read");
- DBUG_PRINT("info", ("m_ordered: %u have_start_key: %u",
- m_ordered, have_start_key));
+ DBUG_PRINT("info", ("m_ordered %u m_ordered_scan_ong %u",
+ m_ordered, m_ordered_scan_ongoing));
if (have_start_key)
{
m_start_key.length= key_len= calculate_key_len(table, active_index,
m_start_key.key,
m_start_key.keypart_map);
+ DBUG_PRINT("info", ("have_start_key map %lu find_flag %u len %u",
+ m_start_key.keypart_map, m_start_key.flag, key_len));
DBUG_ASSERT(key_len);
}
if ((error= partition_scan_set_up(buf, have_start_key)))
@@ -4681,24 +4695,16 @@ int ha_partition::common_index_read(uchar *buf, bool have_start_key)
}
DBUG_PRINT("info", ("m_ordered %u m_o_scan_ong %u have_start_key %u",
m_ordered, m_ordered_scan_ongoing, have_start_key));
- if (!m_ordered_scan_ongoing ||
- (have_start_key && m_start_key.flag == HA_READ_KEY_EXACT &&
- !m_pkey_is_clustered &&
- key_len >= m_curr_key_info[0]->key_length))
+ if (!m_ordered_scan_ongoing)
{
/*
- We use unordered index scan either when read_range is used and flag
- is set to not use ordered or when an exact key is used and in this
- case all records will be sorted equal and thus the sort order of the
- resulting records doesn't matter.
+ We use unordered index scan when read_range is used and flag
+ is set to not use ordered.
We also use an unordered index scan when the number of partitions to
scan is only one.
The unordered index scan will use the partition set created.
- Need to set unordered scan ongoing since we can come here even when
- it isn't set.
*/
DBUG_PRINT("info", ("doing unordered scan"));
- m_ordered_scan_ongoing= FALSE;
error= handle_unordered_scan_next_partition(buf);
}
else
@@ -4879,6 +4885,8 @@ int ha_partition::index_next(uchar * buf)
TODO(low priority):
If we want partition to work with the HANDLER commands, we
must be able to do index_last() -> index_prev() -> index_next()
+ and if direction changes, we must step back those partitions in
+ the record queue so we don't return a value from the wrong direction.
*/
DBUG_ASSERT(m_index_scan_type != partition_index_last);
if (!m_ordered_scan_ongoing)
@@ -5132,10 +5140,18 @@ int ha_partition::partition_scan_set_up(uchar * buf, bool idx_read_flag)
int ha_partition::handle_unordered_next(uchar *buf, bool is_next_same)
{
- handler *file= m_file[m_part_spec.start_part];
+ handler *file;
int error;
DBUG_ENTER("ha_partition::handle_unordered_next");
+ if (m_part_spec.start_part >= m_tot_parts)
+ {
+ /* Should never happen! */
+ DBUG_ASSERT(0);
+ DBUG_RETURN(HA_ERR_END_OF_FILE);
+ }
+ file= m_file[m_part_spec.start_part];
+
/*
We should consider if this should be split into three functions as
partition_read_range is_next_same are always local constants
@@ -5196,6 +5212,7 @@ int ha_partition::handle_unordered_next(uchar *buf, bool is_next_same)
int ha_partition::handle_unordered_scan_next_partition(uchar * buf)
{
uint i;
+ int saved_error= HA_ERR_END_OF_FILE;
DBUG_ENTER("ha_partition::handle_unordered_scan_next_partition");
for (i= m_part_spec.start_part; i <= m_part_spec.end_part; i++)
@@ -5246,26 +5263,33 @@ int ha_partition::handle_unordered_scan_next_partition(uchar * buf)
}
if ((error != HA_ERR_END_OF_FILE) && (error != HA_ERR_KEY_NOT_FOUND))
DBUG_RETURN(error);
- DBUG_PRINT("info", ("HA_ERR_END_OF_FILE on partition %d", i));
+
+ /*
+ If HA_ERR_KEY_NOT_FOUND, we must return that error instead of
+ HA_ERR_END_OF_FILE, to be able to continue search.
+ */
+ if (saved_error != HA_ERR_KEY_NOT_FOUND)
+ saved_error= error;
+ DBUG_PRINT("info", ("END_OF_FILE/KEY_NOT_FOUND on partition %d", i));
}
- m_part_spec.start_part= NO_CURRENT_PART_ID;
- DBUG_RETURN(HA_ERR_END_OF_FILE);
+ if (saved_error == HA_ERR_END_OF_FILE)
+ m_part_spec.start_part= NO_CURRENT_PART_ID;
+ DBUG_RETURN(saved_error);
}
-/*
- Common routine to start index scan with ordered results
+/**
+ Common routine to start index scan with ordered results.
- SYNOPSIS
- handle_ordered_index_scan()
- out:buf Read row in MySQL Row Format
+ @param[out] buf Read row in MySQL Row Format
- RETURN VALUE
- HA_ERR_END_OF_FILE End of scan
- 0 Success
- other Error code
+ @return Operation status
+ @retval HA_ERR_END_OF_FILE End of scan
+ @retval HA_ERR_KEY_NOT_FOUNE End of scan
+ @retval 0 Success
+ @retval other Error code
- DESCRIPTION
+ @details
This part contains the logic to handle index scans that require ordered
output. This includes all except those started by read_range_first with
the flag ordered set to FALSE. Thus most direct index_read and all
@@ -5287,8 +5311,14 @@ int ha_partition::handle_ordered_index_scan(uchar *buf, bool reverse_order)
uint j= queue_first_element(&m_queue);
bool found= FALSE;
uchar *part_rec_buf_ptr= m_ordered_rec_buffer;
+ int saved_error= HA_ERR_END_OF_FILE;
DBUG_ENTER("ha_partition::handle_ordered_index_scan");
+ if (m_key_not_found)
+ {
+ m_key_not_found= false;
+ bitmap_clear_all(&m_key_not_found_partitions);
+ }
m_top_entry= NO_CURRENT_PART_ID;
queue_remove_all(&m_queue);
@@ -5350,6 +5380,13 @@ int ha_partition::handle_ordered_index_scan(uchar *buf, bool reverse_order)
{
DBUG_RETURN(error);
}
+ else if (error == HA_ERR_KEY_NOT_FOUND)
+ {
+ DBUG_PRINT("info", ("HA_ERR_KEY_NOT_FOUND from partition %u", i));
+ bitmap_set_bit(&m_key_not_found_partitions, i);
+ m_key_not_found= true;
+ saved_error= error;
+ }
part_rec_buf_ptr+= m_rec_length + PARTITION_BYTES_IN_POS;
}
if (found)
@@ -5367,7 +5404,7 @@ int ha_partition::handle_ordered_index_scan(uchar *buf, bool reverse_order)
DBUG_PRINT("info", ("Record returned from partition %d", m_top_entry));
DBUG_RETURN(0);
}
- DBUG_RETURN(HA_ERR_END_OF_FILE);
+ DBUG_RETURN(saved_error);
}
@@ -5395,6 +5432,59 @@ void ha_partition::return_top_record(uchar *buf)
}
+/**
+ Add index_next/prev from partitions without exact match.
+
+ If there where any partitions that returned HA_ERR_KEY_NOT_FOUND when
+ ha_index_read_map was done, those partitions must be included in the
+ following index_next/prev call.
+*/
+
+int ha_partition::handle_ordered_index_scan_key_not_found()
+{
+ int error;
+ uint i;
+ uchar *part_buf= m_ordered_rec_buffer;
+ uchar *curr_rec_buf= NULL;
+ DBUG_ENTER("ha_partition::handle_ordered_index_scan_key_not_found");
+ DBUG_ASSERT(m_key_not_found);
+ /*
+ Loop over all used partitions to get the correct offset
+ into m_ordered_rec_buffer.
+ */
+ for (i= 0; i < m_tot_parts; i++)
+ {
+ if (!bitmap_is_set(&m_part_info->used_partitions, i))
+ continue;
+
+ if (bitmap_is_set(&m_key_not_found_partitions, i))
+ {
+ /*
+ This partition is used and did return HA_ERR_KEY_NOT_FOUND
+ in index_read_map.
+ */
+ curr_rec_buf= part_buf + PARTITION_BYTES_IN_POS;
+ error= m_file[i]->index_next(curr_rec_buf);
+ /* HA_ERR_KEY_NOT_FOUND is not allowed from index_next! */
+ DBUG_ASSERT(error != HA_ERR_KEY_NOT_FOUND);
+ if (!error)
+ queue_insert(&m_queue, part_buf);
+ else if (error != HA_ERR_END_OF_FILE && error != HA_ERR_KEY_NOT_FOUND)
+ DBUG_RETURN(error);
+ }
+ part_buf+= m_rec_length + PARTITION_BYTES_IN_POS;
+ }
+ DBUG_ASSERT(curr_rec_buf);
+ bitmap_clear_all(&m_key_not_found_partitions);
+ m_key_not_found= false;
+
+ /* Update m_top_entry, which may have changed. */
+ uchar *key_buffer= queue_top(&m_queue);
+ m_top_entry= uint2korr(key_buffer);
+ DBUG_RETURN(0);
+}
+
+
/*
Common routine to handle index_next with ordered results
@@ -5414,9 +5504,45 @@ int ha_partition::handle_ordered_next(uchar *buf, bool is_next_same)
int error;
uint part_id= m_top_entry;
uchar *rec_buf= queue_top(&m_queue) + PARTITION_BYTES_IN_POS;
- handler *file= m_file[part_id];
+ handler *file;
DBUG_ENTER("ha_partition::handle_ordered_next");
+ if (m_key_not_found)
+ {
+ if (is_next_same)
+ {
+ /* Only rows which match the key. */
+ m_key_not_found= false;
+ bitmap_clear_all(&m_key_not_found_partitions);
+ }
+ else
+ {
+ /* There are partitions not included in the index record queue. */
+ uint old_elements= m_queue.elements;
+ if ((error= handle_ordered_index_scan_key_not_found()))
+ DBUG_RETURN(error);
+ /*
+ If the queue top changed, i.e. one of the partitions that gave
+ HA_ERR_KEY_NOT_FOUND in index_read_map found the next record,
+ return it.
+ Otherwise replace the old with a call to index_next (fall through).
+ */
+ if (old_elements != m_queue.elements && part_id != m_top_entry)
+ {
+ return_top_record(buf);
+ DBUG_RETURN(0);
+ }
+ }
+ }
+ if (part_id >= m_tot_parts)
+ {
+ /* This should never happen! */
+ DBUG_ASSERT(0);
+ DBUG_RETURN(HA_ERR_END_OF_FILE);
+ }
+
+ file= m_file[part_id];
+
if (m_index_scan_type == partition_read_range)
{
error= file->read_range_next();
diff --git a/sql/ha_partition.h b/sql/ha_partition.h
index b37b0f0b1c3..96e47d3d676 100644
--- a/sql/ha_partition.h
+++ b/sql/ha_partition.h
@@ -182,6 +182,9 @@ private:
static int compare_number_of_records(ha_partition *me,
const uint32 *a,
const uint32 *b);
+ /** partitions that returned HA_ERR_KEY_NOT_FOUND. */
+ MY_BITMAP m_key_not_found_partitions;
+ bool m_key_not_found;
public:
handler *clone(const char *name, MEM_ROOT *mem_root);
virtual void set_part_info(partition_info *part_info)
@@ -518,6 +521,7 @@ private:
int handle_unordered_next(uchar * buf, bool next_same);
int handle_unordered_scan_next_partition(uchar * buf);
int handle_ordered_index_scan(uchar * buf, bool reverse_order);
+ int handle_ordered_index_scan_key_not_found();
int handle_ordered_next(uchar * buf, bool next_same);
int handle_ordered_prev(uchar * buf);
void return_top_record(uchar * buf);
diff --git a/sql/handler.cc b/sql/handler.cc
index bf84b1287d5..5297a8e8cfc 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -698,7 +698,6 @@ static my_bool closecon_handlerton(THD *thd, plugin_ref plugin,
return FALSE;
}
-
/**
@note
don't bother to rollback here, it's done already
@@ -708,6 +707,25 @@ void ha_close_connection(THD* thd)
plugin_foreach(thd, closecon_handlerton, MYSQL_STORAGE_ENGINE_PLUGIN, 0);
}
+static my_bool kill_handlerton(THD *thd, plugin_ref plugin,
+ void *level)
+{
+ handlerton *hton= plugin_data(plugin, handlerton *);
+
+ if (hton->state == SHOW_OPTION_YES && hton->kill_query &&
+ thd_get_ha_data(thd, hton))
+ hton->kill_query(hton, thd, *(enum thd_kill_levels *) level);
+ return FALSE;
+}
+
+void ha_kill_query(THD* thd, enum thd_kill_levels level)
+{
+ DBUG_ENTER("ha_kill_query");
+ plugin_foreach(thd, kill_handlerton, MYSQL_STORAGE_ENGINE_PLUGIN, &level);
+ DBUG_VOID_RETURN;
+}
+
+
/* ========================================================================
======================= TRANSACTIONS ===================================*/
@@ -2561,18 +2579,25 @@ int handler::read_first_row(uchar * buf, uint primary_key)
if (stats.deleted < 10 || primary_key >= MAX_KEY ||
!(index_flags(primary_key, 0, 0) & HA_READ_ORDER))
{
- if ((!(error= ha_rnd_init(1))))
+ if (!(error= ha_rnd_init(1)))
{
- while ((error= ha_rnd_next(buf)) == HA_ERR_RECORD_DELETED) ;
- (void) ha_rnd_end();
+ while ((error= ha_rnd_next(buf)) == HA_ERR_RECORD_DELETED)
+ /* skip deleted row */;
+ const int end_error= ha_rnd_end();
+ if (!error)
+ error= end_error;
}
}
else
{
/* Find the first row through the primary key */
- if (!(error = ha_index_init(primary_key, 0)))
+ if (!(error= ha_index_init(primary_key, 0)))
+ {
error= ha_index_first(buf);
- (void) ha_index_end();
+ const int end_error= ha_index_end();
+ if (!error)
+ error= end_error;
+ }
}
DBUG_RETURN(error);
}
@@ -2970,7 +2995,15 @@ void handler::get_auto_increment(ulonglong offset, ulonglong increment,
table->mark_columns_used_by_index_no_reset(table->s->next_number_index,
table->read_set);
column_bitmaps_signal();
- ha_index_init(table->s->next_number_index, 1);
+
+ if (ha_index_init(table->s->next_number_index, 1))
+ {
+ /* This should never happen, assert in debug, and fail in release build */
+ DBUG_ASSERT(0);
+ *first_value= ULONGLONG_MAX;
+ return;
+ }
+
if (table->s->next_number_keypart == 0)
{ // Autoincrement at key-start
error= ha_index_last(table->record[1]);
@@ -3001,13 +3034,25 @@ void handler::get_auto_increment(ulonglong offset, ulonglong increment,
}
if (error)
- nr=1;
+ {
+ if (error == HA_ERR_END_OF_FILE || error == HA_ERR_KEY_NOT_FOUND)
+ {
+ /* No entry found, start with 1. */
+ nr= 1;
+ }
+ else
+ {
+ DBUG_ASSERT(0);
+ nr= ULONGLONG_MAX;
+ }
+ }
else
nr= ((ulonglong) table->next_number_field->
val_int_offset(table->s->rec_buff_length)+1);
ha_index_end();
(void) extra(HA_EXTRA_NO_KEYREAD);
*first_value= nr;
+ return;
}
@@ -4926,7 +4971,9 @@ extern "C" enum icp_result handler_index_cond_check(void* h_arg)
THD *thd= h->table->in_use;
enum icp_result res;
- if (thd_killed(thd))
+ enum thd_kill_levels abort_at= h->has_transactions() ?
+ THD_ABORT_SOFTLY : THD_ABORT_ASAP;
+ if (thd_kill_level(thd) > abort_at)
return ICP_ABORTED_BY_USER;
if (h->end_range && h->compare_key2(h->end_range) > 0)
@@ -5563,7 +5610,7 @@ fl_log_iterator_buffer_init(struct handler_iterator *iterator)
/* to be able to make my_free without crash in case of error */
iterator->buffer= 0;
- if (!(dirp = my_dir(fl_dir, MYF(0))))
+ if (!(dirp = my_dir(fl_dir, MYF(MY_THREAD_SPECIFIC))))
{
return HA_ITERATOR_ERROR;
}
@@ -5572,7 +5619,7 @@ fl_log_iterator_buffer_init(struct handler_iterator *iterator)
sizeof(enum log_status) +
+ FN_REFLEN + 1) *
(uint) dirp->number_off_files),
- MYF(0))) == 0)
+ MYF(MY_THREAD_SPECIFIC))) == 0)
{
return HA_ITERATOR_ERROR;
}
@@ -5606,6 +5653,7 @@ fl_log_iterator_buffer_init(struct handler_iterator *iterator)
iterator->buffer= buff;
iterator->next= &fl_log_iterator_next;
iterator->destroy= &fl_log_iterator_destroy;
+ my_dirend(dirp);
return HA_ITERATOR_OK;
}
diff --git a/sql/handler.h b/sql/handler.h
index 559648da37c..8ee1044f10c 100644
--- a/sql/handler.h
+++ b/sql/handler.h
@@ -882,6 +882,10 @@ struct handlerton
*/
int (*close_connection)(handlerton *hton, THD *thd);
/*
+ Tell handler that query has been killed.
+ */
+ void (*kill_query)(handlerton *hton, THD *thd, enum thd_kill_levels level);
+ /*
sv points to an uninitialized storage area of requested size
(see savepoint_offset description)
*/
@@ -1934,6 +1938,7 @@ public:
int ha_open(TABLE *table, const char *name, int mode, uint test_if_locked);
int ha_index_init(uint idx, bool sorted)
{
+ DBUG_EXECUTE_IF("ha_index_init_fail", return HA_ERR_TABLE_DEF_CHANGED;);
int result;
DBUG_ENTER("ha_index_init");
DBUG_ASSERT(inited==NONE);
@@ -1958,6 +1963,7 @@ public:
virtual int prepare_index_scan() { return 0; }
int ha_rnd_init(bool scan) __attribute__ ((warn_unused_result))
{
+ DBUG_EXECUTE_IF("ha_rnd_init_fail", return HA_ERR_TABLE_DEF_CHANGED;);
int result;
DBUG_ENTER("ha_rnd_init");
DBUG_ASSERT(inited==NONE || (inited==RND && scan));
@@ -3095,6 +3101,7 @@ int ha_finalize_handlerton(st_plugin_int *plugin);
TYPELIB *ha_known_exts(void);
int ha_panic(enum ha_panic_function flag);
void ha_close_connection(THD* thd);
+void ha_kill_query(THD* thd, enum thd_kill_levels level);
bool ha_flush_logs(handlerton *db_type);
void ha_drop_database(char* path);
void ha_checkpoint_state(bool disable);
diff --git a/sql/hostname.cc b/sql/hostname.cc
index 763c4647532..ee30d071602 100644
--- a/sql/hostname.cc
+++ b/sql/hostname.cc
@@ -367,6 +367,14 @@ bool ip_to_hostname(struct sockaddr_storage *ip_storage,
err_code= vio_getnameinfo(ip, hostname_buffer, NI_MAXHOST, NULL, 0,
NI_NAMEREQD);
+ /* BEGIN : DEBUG */
+ DBUG_EXECUTE_IF("addr_fake_ipv4",
+ {
+ strcpy(hostname_buffer, "santa.claus.ipv4.example.com");
+ err_code= 0;
+ };);
+ /* END : DEBUG */
+
if (err_code)
{
// NOTE: gai_strerror() returns a string ending by a dot.
@@ -439,6 +447,12 @@ bool ip_to_hostname(struct sockaddr_storage *ip_storage,
DBUG_RETURN(err_status);
}
+ /*
+ To avoid crashing the server in DBUG_EXECUTE_IF,
+ Define a variable which depicts state of addr_info_list.
+ */
+ bool free_addr_info_list= false;
+
/* Get IP-addresses for the resolved host name (FCrDNS technique). */
struct addrinfo hints;
@@ -453,6 +467,42 @@ bool ip_to_hostname(struct sockaddr_storage *ip_storage,
(const char *) hostname_buffer));
err_code= getaddrinfo(hostname_buffer, NULL, &hints, &addr_info_list);
+ if (err_code == 0)
+ free_addr_info_list= true;
+
+ /* BEGIN : DEBUG */
+ DBUG_EXECUTE_IF("addr_fake_ipv4",
+ {
+ if (free_addr_info_list)
+ freeaddrinfo(addr_info_list);
+
+ struct sockaddr_in *debug_addr;
+ static struct sockaddr_in debug_sock_addr[2];
+ static struct addrinfo debug_addr_info[2];
+ /* Simulating ipv4 192.0.2.5 */
+ debug_addr= & debug_sock_addr[0];
+ debug_addr->sin_family= AF_INET;
+ debug_addr->sin_addr.s_addr= inet_addr("192.0.2.5");
+
+ /* Simulating ipv4 192.0.2.4 */
+ debug_addr= & debug_sock_addr[1];
+ debug_addr->sin_family= AF_INET;
+ debug_addr->sin_addr.s_addr= inet_addr("192.0.2.4");
+
+ debug_addr_info[0].ai_addr= (struct sockaddr*) & debug_sock_addr[0];
+ debug_addr_info[0].ai_addrlen= sizeof (struct sockaddr_in);
+ debug_addr_info[0].ai_next= & debug_addr_info[1];
+
+ debug_addr_info[1].ai_addr= (struct sockaddr*) & debug_sock_addr[1];
+ debug_addr_info[1].ai_addrlen= sizeof (struct sockaddr_in);
+ debug_addr_info[1].ai_next= NULL;
+
+ addr_info_list= & debug_addr_info[0];
+ err_code= 0;
+ free_addr_info_list= false;
+ };);
+
+ /* END : DEBUG */
if (err_code == EAI_NONAME)
{
@@ -505,7 +555,8 @@ bool ip_to_hostname(struct sockaddr_storage *ip_storage,
{
DBUG_PRINT("error", ("Out of memory."));
- freeaddrinfo(addr_info_list);
+ if (free_addr_info_list)
+ freeaddrinfo(addr_info_list);
DBUG_RETURN(TRUE);
}
@@ -539,7 +590,8 @@ bool ip_to_hostname(struct sockaddr_storage *ip_storage,
/* Free the result of getaddrinfo(). */
- freeaddrinfo(addr_info_list);
+ if (free_addr_info_list)
+ freeaddrinfo(addr_info_list);
/* Add an entry for the IP to the cache. */
diff --git a/sql/item.cc b/sql/item.cc
index 27e6d7052d6..665521c641e 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -5576,7 +5576,7 @@ bool Item::eq_by_collation(Item *item, bool binary_cmp, CHARSET_INFO *cs)
/**
Create a field to hold a string value from an item.
- If max_length > CONVERT_IF_BIGGER_TO_BLOB create a blob @n
+ If too_big_for_varchar() create a blob @n
If max_length > 0 create a varchar @n
If max_length == 0 create a CHAR(0)
@@ -5591,7 +5591,7 @@ Field *Item::make_string_field(TABLE *table)
Note: the following check is repeated in
subquery_types_allow_materialization():
*/
- if (max_length/collation.collation->mbmaxlen > CONVERT_IF_BIGGER_TO_BLOB)
+ if (too_big_for_varchar())
field= new Field_blob(max_length, maybe_null, name,
collation.collation, TRUE);
/* Item_type_holder holds the exact type, do not change it */
@@ -5696,7 +5696,7 @@ Field *Item::tmp_table_field_from_field_type(TABLE *table, bool fixed_length)
DBUG_ASSERT(0);
/* If something goes awfully wrong, it's better to get a string than die */
case MYSQL_TYPE_STRING:
- if (fixed_length && max_length < CONVERT_IF_BIGGER_TO_BLOB)
+ if (fixed_length && !too_big_for_varchar())
{
field= new Field_string(max_length, maybe_null, name,
collation.collation);
@@ -8848,9 +8848,10 @@ int Item_cache_temporal::save_in_field(Field *field, bool no_conversions)
}
-void Item_cache_temporal::store_packed(longlong val_arg)
+void Item_cache_temporal::store_packed(longlong val_arg, Item *example)
{
/* An explicit values is given, save it. */
+ store(example);
value_cached= true;
value= val_arg;
null_value= false;
@@ -9596,11 +9597,18 @@ table_map Item_ref::used_tables() const
void Item_ref::update_used_tables()
-{
+{
if (!get_depended_from())
- (*ref)->update_used_tables();
+ (*ref)->update_used_tables();
+ maybe_null|= (*ref)->maybe_null;
}
+void Item_direct_view_ref::update_used_tables()
+{
+ Item_ref::update_used_tables();
+ if (view->table && view->table->maybe_null)
+ maybe_null= TRUE;
+}
table_map Item_direct_view_ref::used_tables() const
{
diff --git a/sql/item.h b/sql/item.h
index c76b443fe09..8ec701e0255 100644
--- a/sql/item.h
+++ b/sql/item.h
@@ -2,7 +2,7 @@
#define SQL_ITEM_INCLUDED
/* Copyright (c) 2000, 2011, Oracle and/or its affiliates.
- Copyright (c) 2009-2011 Monty Program Ab
+ Copyright (c) 2009, 2013 Monty Program Ab
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -523,7 +523,7 @@ public:
struct st_dyncall_create_def
{
- Item *num, *value;
+ Item *key, *value;
CHARSET_INFO *cs;
uint len, frac;
DYNAMIC_COLUMN_TYPE type;
@@ -611,7 +611,11 @@ public:
@see Query_arena::free_list
*/
Item *next;
- uint32 max_length; /* Maximum length, in bytes */
+ /*
+ The maximum value length in characters multiplied by collation->mbmaxlen.
+ Almost always it's the maximum value length in bytes.
+ */
+ uint32 max_length;
/*
TODO: convert name and name_length fields into LEX_STRING to keep them in
sync (see bug #11829681/60295 etc). Then also remove some strlen(name)
@@ -1424,6 +1428,8 @@ public:
bool eq_by_collation(Item *item, bool binary_cmp, CHARSET_INFO *cs);
uint32 max_char_length() const
{ return max_length / collation.collation->mbmaxlen; }
+ bool too_big_for_varchar() const
+ { return max_char_length() > CONVERT_IF_BIGGER_TO_BLOB; }
void fix_length_and_charset(uint32 max_char_length_arg, CHARSET_INFO *cs)
{
max_length= char_to_byte_length_safe(max_char_length_arg, cs->mbmaxlen);
@@ -1434,24 +1440,11 @@ public:
max_length= char_to_byte_length_safe(max_char_length_arg,
collation.collation->mbmaxlen);
}
- void fix_char_length_ulonglong(ulonglong max_char_length_arg)
- {
- ulonglong max_result_length= max_char_length_arg *
- collation.collation->mbmaxlen;
- if (max_result_length >= MAX_BLOB_WIDTH)
- {
- max_length= MAX_BLOB_WIDTH;
- maybe_null= 1;
- }
- else
- max_length= (uint32) max_result_length;
- }
/*
Return TRUE if the item points to a column of an outer-joined table.
*/
virtual bool is_outer_field() const { DBUG_ASSERT(fixed); return FALSE; }
Item* set_expr_cache(THD *thd);
- virtual Item *get_cached_item() { return NULL; }
virtual Item_equal *get_item_equal() { return NULL; }
virtual void set_item_equal(Item_equal *item_eq) {};
@@ -2057,9 +2050,14 @@ public:
bitmap_fast_test_and_set(tab->read_set, field->field_index);
if (field->vcol_info)
tab->mark_virtual_col(field);
- }
+ }
+ }
+ void update_used_tables()
+ {
+ update_table_bitmaps();
+ if (field && field->table)
+ maybe_null|= field->maybe_null();
}
- void update_used_tables() { update_table_bitmaps(); }
Item *get_tmp_table_item(THD *thd);
bool collect_item_field_processor(uchar * arg);
bool add_field_to_set_processor(uchar * arg);
@@ -3109,7 +3107,11 @@ public:
enum Item_result result_type () const { return orig_item->result_type(); }
enum_field_types field_type() const { return orig_item->field_type(); }
table_map used_tables() const { return orig_item->used_tables(); }
- void update_used_tables() { orig_item->update_used_tables(); }
+ void update_used_tables()
+ {
+ orig_item->update_used_tables();
+ maybe_null|= orig_item->maybe_null;
+ }
bool const_item() const { return orig_item->const_item(); }
table_map not_null_tables() const { return orig_item->not_null_tables(); }
bool walk(Item_processor processor, bool walk_subquery, uchar *arg)
@@ -3201,6 +3203,7 @@ public:
Item *replace_equal_field(uchar *arg);
table_map used_tables() const;
table_map not_null_tables() const;
+ void update_used_tables();
bool walk(Item_processor processor, bool walk_subquery, uchar *arg)
{
return (*ref)->walk(processor, walk_subquery, arg) ||
@@ -4026,7 +4029,7 @@ public:
bool cache_value();
bool get_date(MYSQL_TIME *ltime, ulonglong fuzzydate);
int save_in_field(Field *field, bool no_conversions);
- void store_packed(longlong val_arg);
+ void store_packed(longlong val_arg, Item *example);
/*
Having a clone_item method tells optimizer that this object
is a constant and need not be optimized further.
@@ -4035,7 +4038,7 @@ public:
Item *clone_item()
{
Item_cache_temporal *item= new Item_cache_temporal(cached_field_type);
- item->store_packed(value);
+ item->store_packed(value, example);
return item;
}
};
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc
index d950c0c1443..3b09da68927 100644
--- a/sql/item_cmpfunc.cc
+++ b/sql/item_cmpfunc.cc
@@ -1,5 +1,5 @@
/* Copyright (c) 2000, 2012, Oracle and/or its affiliates.
- Copyright (c) 2009, 2012 Monty Program Ab
+ Copyright (c) 2009, 2013, Monty Program Ab.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -914,7 +914,7 @@ get_datetime_value(THD *thd, Item ***item_arg, Item **cache_arg,
if (save_arena)
thd->set_query_arena(save_arena);
- cache->store_packed(value);
+ cache->store_packed(value, item);
*cache_arg= cache;
*item_arg= cache_arg;
}
@@ -1353,7 +1353,7 @@ int Arg_comparator::compare_e_row()
void Item_func_truth::fix_length_and_dec()
{
- maybe_null= 0;
+ set_persist_maybe_null(0);
null_value= 0;
decimals= 0;
max_length= 1;
@@ -1865,7 +1865,8 @@ longlong Item_func_eq::val_int()
void Item_func_equal::fix_length_and_dec()
{
Item_bool_func2::fix_length_and_dec();
- maybe_null=null_value=0;
+ set_persist_maybe_null(0);
+ null_value= 0;
}
longlong Item_func_equal::val_int()
@@ -2004,7 +2005,7 @@ void Item_func_interval::fix_length_and_dec()
}
}
}
- maybe_null= 0;
+ set_persist_maybe_null(0);
max_length= 2;
used_tables_cache|= row->used_tables();
not_null_tables_cache= row->not_null_tables();
@@ -2685,7 +2686,7 @@ void
Item_func_nullif::fix_length_and_dec()
{
Item_bool_func2::fix_length_and_dec();
- maybe_null=1;
+ set_persist_maybe_null(1);
if (args[0]) // Only false if EOM
{
max_length=args[0]->max_length;
@@ -4546,6 +4547,8 @@ void Item_cond::update_used_tables()
item->update_used_tables();
used_tables_cache|= item->used_tables();
const_item_cache&= item->const_item();
+ if (!persistent_maybe_null && item->maybe_null)
+ maybe_null= 1;
}
}
@@ -4720,10 +4723,9 @@ longlong Item_is_not_null_test::val_int()
*/
void Item_is_not_null_test::update_used_tables()
{
+ args[0]->update_used_tables();
if (!args[0]->maybe_null)
used_tables_cache= 0; /* is always true */
- else
- args[0]->update_used_tables();
}
@@ -5004,7 +5006,7 @@ Item_func_regex::fix_fields(THD *thd, Item **ref)
int comp_res= regcomp(TRUE);
if (comp_res == -1)
{ // Will always return NULL
- maybe_null=1;
+ set_persist_maybe_null(1);
fixed= 1;
return FALSE;
}
@@ -5014,7 +5016,7 @@ Item_func_regex::fix_fields(THD *thd, Item **ref)
maybe_null= args[0]->maybe_null;
}
else
- maybe_null=1;
+ set_persist_maybe_null(1);
fixed= 1;
return FALSE;
}
@@ -5828,6 +5830,8 @@ void Item_equal::update_used_tables()
used_tables_cache|= item->used_tables();
/* see commentary at Item_equal::update_const() */
const_item_cache&= item->const_item() && !item->is_outer_field();
+ if (!persistent_maybe_null && item->maybe_null)
+ maybe_null= 1;
}
}
@@ -6068,23 +6072,87 @@ Item* Item_equal::get_first(JOIN_TAB *context, Item *field_item)
}
-longlong Item_func_dyncol_exists::val_int()
+longlong Item_func_dyncol_check::val_int()
{
char buff[STRING_BUFFER_USUAL_SIZE];
String tmp(buff, sizeof(buff), &my_charset_bin);
DYNAMIC_COLUMN col;
String *str;
- ulonglong num;
enum enum_dyncol_func_result rc;
- num= args[1]->val_int();
+ str= args[0]->val_str(&tmp);
+ if (args[0]->null_value)
+ goto null;
+ col.length= str->length();
+ /* We do not change the string, so could do this trick */
+ col.str= (char *)str->ptr();
+ rc= mariadb_dyncol_check(&col);
+ if (rc < 0 && rc != ER_DYNCOL_FORMAT)
+ {
+ dynamic_column_error_message(rc);
+ goto null;
+ }
+ null_value= FALSE;
+ return rc == ER_DYNCOL_OK;
+
+null:
+ null_value= TRUE;
+ return 0;
+}
+
+longlong Item_func_dyncol_exists::val_int()
+{
+ char buff[STRING_BUFFER_USUAL_SIZE], nmstrbuf[11];
+ String tmp(buff, sizeof(buff), &my_charset_bin),
+ nmbuf(nmstrbuf, sizeof(nmstrbuf), system_charset_info);
+ DYNAMIC_COLUMN col;
+ String *str;
+ LEX_STRING buf, *name= NULL;
+ ulonglong num= 0;
+ enum enum_dyncol_func_result rc;
+
+ if (args[1]->result_type() == INT_RESULT)
+ num= args[1]->val_int();
+ else
+ {
+ String *nm= args[1]->val_str(&nmbuf);
+ if (!nm || args[1]->null_value)
+ {
+ null_value= 1;
+ return 1;
+ }
+ if (my_charset_same(nm->charset(), &my_charset_utf8_general_ci))
+ {
+ buf.str= (char *) nm->ptr();
+ buf.length= nm->length();
+ }
+ else
+ {
+ uint strlen;
+ uint dummy_errors;
+ buf.str= (char *)sql_alloc((strlen= nm->length() *
+ my_charset_utf8_general_ci.mbmaxlen + 1));
+ if (buf.str)
+ {
+ buf.length=
+ copy_and_convert(buf.str, strlen, &my_charset_utf8_general_ci,
+ nm->ptr(), nm->length(), nm->charset(),
+ &dummy_errors);
+ }
+ else
+ buf.length= 0;
+ }
+ name= &buf;
+ }
str= args[0]->val_str(&tmp);
if (args[0]->null_value || args[1]->null_value || num > UINT_MAX16)
goto null;
col.length= str->length();
/* We do not change the string, so could do this trick */
col.str= (char *)str->ptr();
- rc= dynamic_column_exists(&col, (uint) num);
+ rc= ((name == NULL) ?
+ mariadb_dyncol_exists(&col, (uint) num) :
+ mariadb_dyncol_exists_named(&col, name));
if (rc < 0)
{
dynamic_column_error_message(rc);
diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h
index 34d1a0bd0ae..afb7bf005bb 100644
--- a/sql/item_cmpfunc.h
+++ b/sql/item_cmpfunc.h
@@ -767,6 +767,11 @@ public:
my_decimal *decimal_op(my_decimal *);
enum_field_types field_type() const;
void fix_length_and_dec();
+ void update_used_tables()
+ {
+ Item_func_coalesce::update_used_tables();
+ maybe_null|= args[1]->maybe_null;
+ }
const char *func_name() const { return "ifnull"; }
Field *tmp_table_field(TABLE *table);
uint decimal_precision() const;
@@ -789,6 +794,11 @@ public:
enum_field_types field_type() const { return cached_field_type; }
bool fix_fields(THD *, Item **);
void fix_length_and_dec();
+ void update_used_tables()
+ {
+ Item_func::update_used_tables();
+ maybe_null|= args[1]->maybe_null || args[2]->maybe_null;
+ }
uint decimal_precision() const;
const char *func_name() const { return "if"; }
bool eval_not_null_tables(uchar *opt_arg);
@@ -1254,6 +1264,12 @@ public:
my_decimal *val_decimal(my_decimal *);
bool fix_fields(THD *thd, Item **ref);
void fix_length_and_dec();
+ void update_used_tables()
+ {
+ Item_func::update_used_tables();
+ if (else_expr_num == -1 || args[else_expr_num]->maybe_null)
+ maybe_null= 1;
+ }
uint decimal_precision() const;
table_map not_null_tables() const { return 0; }
enum Item_result result_type () const { return cached_result_type; }
@@ -1375,13 +1391,14 @@ public:
enum Functype functype() const { return ISNULL_FUNC; }
void fix_length_and_dec()
{
- decimals=0; max_length=1; maybe_null=0;
+ decimals=0; max_length=1; set_persist_maybe_null(0);
update_used_tables();
}
const char *func_name() const { return "isnull"; }
/* Optimize case of not_null_column IS NULL */
virtual void update_used_tables()
{
+ args[0]->update_used_tables();
if (!args[0]->maybe_null)
{
used_tables_cache= 0; /* is always false */
@@ -1389,7 +1406,6 @@ public:
}
else
{
- args[0]->update_used_tables();
used_tables_cache= args[0]->used_tables();
const_item_cache= args[0]->const_item();
}
@@ -1437,7 +1453,7 @@ public:
enum Functype functype() const { return ISNOTNULL_FUNC; }
void fix_length_and_dec()
{
- decimals=0; max_length=1; maybe_null=0;
+ decimals=0; max_length=1; set_persist_maybe_null(0);
}
const char *func_name() const { return "isnotnull"; }
optimize_type select_optimize() const { return OPTIMIZE_NULL; }
@@ -1505,6 +1521,12 @@ public:
void cleanup();
longlong val_int();
bool fix_fields(THD *thd, Item **ref);
+ void update_used_tables()
+ {
+ Item_bool_func::update_used_tables();
+ if (regex_is_const)
+ maybe_null= 1;
+ }
const char *func_name() const { return "regexp"; }
virtual inline void print(String *str, enum_query_type query_type)
@@ -1861,6 +1883,14 @@ public:
Item *neg_transformer(THD *thd);
};
+class Item_func_dyncol_check :public Item_bool_func
+{
+public:
+ Item_func_dyncol_check(Item *str) :Item_bool_func(str) {}
+ longlong val_int();
+ const char *func_name() const { return "column_check"; }
+};
+
class Item_func_dyncol_exists :public Item_bool_func
{
public:
diff --git a/sql/item_create.cc b/sql/item_create.cc
index 07e7f7b7ff9..fc31b074055 100644
--- a/sql/item_create.cc
+++ b/sql/item_create.cc
@@ -526,6 +526,54 @@ protected:
virtual ~Create_func_coercibility() {}
};
+class Create_func_dyncol_check : public Create_func_arg1
+{
+public:
+ virtual Item *create_1_arg(THD *thd, Item *arg1);
+
+ static Create_func_dyncol_check s_singleton;
+
+protected:
+ Create_func_dyncol_check() {}
+ virtual ~Create_func_dyncol_check() {}
+};
+
+class Create_func_dyncol_exists : public Create_func_arg2
+{
+public:
+ virtual Item *create_2_arg(THD *thd, Item *arg1, Item *arg2);
+
+ static Create_func_dyncol_exists s_singleton;
+
+protected:
+ Create_func_dyncol_exists() {}
+ virtual ~Create_func_dyncol_exists() {}
+};
+
+class Create_func_dyncol_list : public Create_func_arg1
+{
+public:
+ virtual Item *create_1_arg(THD *thd, Item *arg1);
+
+ static Create_func_dyncol_list s_singleton;
+
+protected:
+ Create_func_dyncol_list() {}
+ virtual ~Create_func_dyncol_list() {}
+};
+
+class Create_func_dyncol_json : public Create_func_arg1
+{
+public:
+ virtual Item *create_1_arg(THD *thd, Item *arg1);
+
+ static Create_func_dyncol_json s_singleton;
+
+protected:
+ Create_func_dyncol_json() {}
+ virtual ~Create_func_dyncol_json() {}
+};
+
class Create_func_compress : public Create_func_arg1
{
@@ -3108,6 +3156,38 @@ Create_func_coercibility::create_1_arg(THD *thd, Item *arg1)
}
+Create_func_dyncol_check Create_func_dyncol_check::s_singleton;
+
+Item*
+Create_func_dyncol_check::create_1_arg(THD *thd, Item *arg1)
+{
+ return new (thd->mem_root) Item_func_dyncol_check(arg1);
+}
+
+Create_func_dyncol_exists Create_func_dyncol_exists::s_singleton;
+
+Item*
+Create_func_dyncol_exists::create_2_arg(THD *thd, Item *arg1, Item *arg2)
+{
+ return new (thd->mem_root) Item_func_dyncol_exists(arg1, arg2);
+}
+
+Create_func_dyncol_list Create_func_dyncol_list::s_singleton;
+
+Item*
+Create_func_dyncol_list::create_1_arg(THD *thd, Item *arg1)
+{
+ return new (thd->mem_root) Item_func_dyncol_list(arg1);
+}
+
+Create_func_dyncol_json Create_func_dyncol_json::s_singleton;
+
+Item*
+Create_func_dyncol_json::create_1_arg(THD *thd, Item *arg1)
+{
+ return new (thd->mem_root) Item_func_dyncol_json(arg1);
+}
+
Create_func_concat Create_func_concat::s_singleton;
Item*
@@ -5252,6 +5332,10 @@ static Native_func_registry func_array[] =
{ { C_STRING_WITH_LEN("CHARACTER_LENGTH") }, BUILDER(Create_func_char_length)},
{ { C_STRING_WITH_LEN("CHAR_LENGTH") }, BUILDER(Create_func_char_length)},
{ { C_STRING_WITH_LEN("COERCIBILITY") }, BUILDER(Create_func_coercibility)},
+ { { C_STRING_WITH_LEN("COLUMN_CHECK") }, BUILDER(Create_func_dyncol_check)},
+ { { C_STRING_WITH_LEN("COLUMN_EXISTS") }, BUILDER(Create_func_dyncol_exists)},
+ { { C_STRING_WITH_LEN("COLUMN_LIST") }, BUILDER(Create_func_dyncol_list)},
+ { { C_STRING_WITH_LEN("COLUMN_JSON") }, BUILDER(Create_func_dyncol_json)},
{ { C_STRING_WITH_LEN("COMPRESS") }, BUILDER(Create_func_compress)},
{ { C_STRING_WITH_LEN("CONCAT") }, BUILDER(Create_func_concat)},
{ { C_STRING_WITH_LEN("CONCAT_WS") }, BUILDER(Create_func_concat_ws)},
@@ -5711,7 +5795,7 @@ static List<Item> *create_func_dyncol_prepare(THD *thd,
for (uint i= 0; (def= li++) ;)
{
dfs[0][i++]= *def;
- args->push_back(def->num);
+ args->push_back(def->key);
args->push_back(def->value);
}
return args;
@@ -5727,7 +5811,6 @@ Item *create_func_dyncol_create(THD *thd, List<DYNCALL_CREATE_DEF> &list)
return new (thd->mem_root) Item_func_dyncol_create(*args, dfs);
}
-
Item *create_func_dyncol_add(THD *thd, Item *str,
List<DYNCALL_CREATE_DEF> &list)
{
@@ -5747,7 +5830,7 @@ Item *create_func_dyncol_add(THD *thd, Item *str,
Item *create_func_dyncol_delete(THD *thd, Item *str, List<Item> &nums)
{
DYNCALL_CREATE_DEF *dfs;
- Item *num;
+ Item *key;
List_iterator_fast<Item> it(nums);
List<Item> *args= new (thd->mem_root) List<Item>;
@@ -5757,12 +5840,12 @@ Item *create_func_dyncol_delete(THD *thd, Item *str, List<Item> &nums)
if (!args || !dfs)
return NULL;
- for (uint i= 0; (num= it++); i++)
+ for (uint i= 0; (key= it++); i++)
{
- dfs[i].num= num;
+ dfs[i].key= key;
dfs[i].value= new Item_null();
dfs[i].type= DYN_COL_INT;
- args->push_back(dfs[i].num);
+ args->push_back(dfs[i].key);
args->push_back(dfs[i].value);
}
diff --git a/sql/item_create.h b/sql/item_create.h
index ac6b0f8454f..5ecb45e9eae 100644
--- a/sql/item_create.h
+++ b/sql/item_create.h
@@ -180,5 +180,6 @@ Item *create_func_dyncol_get(THD *thd, Item *num, Item *str,
Cast_target cast_type,
const char *c_len, const char *c_dec,
CHARSET_INFO *cs);
+Item *create_func_dyncol_json(THD *thd, Item *str);
#endif
diff --git a/sql/item_func.cc b/sql/item_func.cc
index 4c9f0a65d8a..390ece724cb 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -1,5 +1,5 @@
/* Copyright (c) 2000, 2011, Oracle and/or its affiliates.
- Copyright (c) 2008-2011 Monty Program Ab
+ Copyright (c) 2009, 2013, Monty Program Ab.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -111,7 +111,7 @@ void Item_func::set_arguments(List<Item> &list)
}
Item_func::Item_func(List<Item> &list)
- :allowed_arg_cols(1)
+ :allowed_arg_cols(1), persistent_maybe_null(0)
{
set_arguments(list);
}
@@ -119,6 +119,7 @@ Item_func::Item_func(List<Item> &list)
Item_func::Item_func(THD *thd, Item_func *item)
:Item_result_field(thd, item),
allowed_arg_cols(item->allowed_arg_cols),
+ persistent_maybe_null(0),
arg_count(item->arg_count),
used_tables_cache(item->used_tables_cache),
not_null_tables_cache(item->not_null_tables_cache),
@@ -446,6 +447,8 @@ void Item_func::update_used_tables()
args[i]->update_used_tables();
used_tables_cache|=args[i]->used_tables();
const_item_cache&=args[i]->const_item();
+ if (!persistent_maybe_null && args[i]->maybe_null)
+ maybe_null= 1;
}
}
@@ -1712,7 +1715,7 @@ void Item_func_div::fix_length_and_dec()
case IMPOSSIBLE_RESULT:
DBUG_ASSERT(0);
}
- maybe_null= 1; // devision by zero
+ set_persist_maybe_null(1); // devision by zero
DBUG_VOID_RETURN;
}
@@ -1796,7 +1799,7 @@ void Item_func_int_div::fix_length_and_dec()
max_length=args[0]->max_length -
(argtype == DECIMAL_RESULT || argtype == INT_RESULT ?
args[0]->decimals : 0);
- maybe_null=1;
+ set_persist_maybe_null(1);
unsigned_flag=args[0]->unsigned_flag | args[1]->unsigned_flag;
}
@@ -1883,7 +1886,7 @@ void Item_func_mod::result_precision()
void Item_func_mod::fix_length_and_dec()
{
Item_num_op::fix_length_and_dec();
- maybe_null= 1;
+ set_persist_maybe_null(1);
unsigned_flag= args[0]->unsigned_flag;
}
@@ -3078,7 +3081,7 @@ longlong Item_func_field::val_int()
void Item_func_field::fix_length_and_dec()
{
- maybe_null=0; max_length=3;
+ set_persist_maybe_null(0); max_length=3;
cmp_type= args[0]->result_type();
for (uint i=1; i < arg_count ; i++)
cmp_type= item_cmp_type(cmp_type, args[i]->result_type());
@@ -4194,7 +4197,8 @@ longlong Item_func_last_insert_id::val_int()
thd->first_successful_insert_id_in_prev_stmt= value;
return value;
}
- return thd->read_first_successful_insert_id_in_prev_stmt();
+ return
+ static_cast<longlong>(thd->read_first_successful_insert_id_in_prev_stmt());
}
@@ -4341,7 +4345,9 @@ user_var_entry *get_variable(HASH *hash, LEX_STRING &name,
uint size=ALIGN_SIZE(sizeof(user_var_entry))+name.length+1+extra_size;
if (!my_hash_inited(hash))
return 0;
- if (!(entry = (user_var_entry*) my_malloc(size,MYF(MY_WME | ME_FATALERROR))))
+ if (!(entry = (user_var_entry*) my_malloc(size,
+ MYF(MY_WME | ME_FATALERROR |
+ MY_THREAD_SPECIFIC))))
return 0;
entry->name.str=(char*) entry+ ALIGN_SIZE(sizeof(user_var_entry))+
extra_size;
@@ -4569,7 +4575,8 @@ update_hash(user_var_entry *entry, bool set_null, void *ptr, uint length,
entry->value=0;
entry->value= (char*) my_realloc(entry->value, length,
MYF(MY_ALLOW_ZERO_PTR | MY_WME |
- ME_FATALERROR));
+ ME_FATALERROR |
+ MY_THREAD_SPECIFIC));
if (!entry->value)
return 1;
}
@@ -5312,7 +5319,7 @@ void Item_func_get_user_var::fix_length_and_dec()
{
THD *thd=current_thd;
int error;
- maybe_null=1;
+ set_persist_maybe_null(1);
decimals=NOT_FIXED_DEC;
max_length=MAX_BLOB_WIDTH;
@@ -5511,7 +5518,7 @@ void Item_func_get_system_var::update_null_value()
void Item_func_get_system_var::fix_length_and_dec()
{
char *cptr;
- maybe_null= TRUE;
+ set_persist_maybe_null(1);
max_length= 0;
if (var->check_type(var_type))
@@ -6078,7 +6085,7 @@ bool Item_func_match::fix_fields(THD *thd, Item **ref)
status_var_increment(thd->status_var.feature_fulltext);
- maybe_null=1;
+ set_persist_maybe_null(1);
join_key=0;
/*
@@ -6412,7 +6419,7 @@ longlong Item_func_row_count::val_int()
Item_func_sp::Item_func_sp(Name_resolution_context *context_arg, sp_name *name)
:Item_func(), context(context_arg), m_name(name), m_sp(NULL), sp_result_field(NULL)
{
- maybe_null= 1;
+ set_persist_maybe_null(1);
m_name->init_qname(current_thd);
dummy_table= (TABLE*) sql_calloc(sizeof(TABLE)+ sizeof(TABLE_SHARE));
dummy_table->s= (TABLE_SHARE*) (dummy_table+1);
@@ -6423,7 +6430,7 @@ Item_func_sp::Item_func_sp(Name_resolution_context *context_arg,
sp_name *name, List<Item> &list)
:Item_func(list), context(context_arg), m_name(name), m_sp(NULL),sp_result_field(NULL)
{
- maybe_null= 1;
+ set_persist_maybe_null(1);
m_name->init_qname(current_thd);
dummy_table= (TABLE*) sql_calloc(sizeof(TABLE)+ sizeof(TABLE_SHARE));
dummy_table->s= (TABLE_SHARE*) (dummy_table+1);
@@ -6551,6 +6558,19 @@ Item_func_sp::init_result_field(THD *thd)
/**
+ @note
+ Deterministic stored procedures are considered inexpensive.
+ Consequently such procedures may be evaluated during optimization,
+ if they are constant (checked by the optimizer).
+*/
+
+bool Item_func_sp::is_expensive()
+{
+ return !(m_sp->m_chistics->detistic);
+}
+
+
+/**
@brief Initialize local members with values from the Field interface.
@note called from Item::fix_fields.
@@ -6564,7 +6584,7 @@ void Item_func_sp::fix_length_and_dec()
decimals= sp_result_field->decimals();
max_length= sp_result_field->field_length;
collation.set(sp_result_field->charset());
- maybe_null= 1;
+ set_persist_maybe_null(1);
unsigned_flag= test(sp_result_field->flags & UNSIGNED_FLAG);
DBUG_VOID_RETURN;
diff --git a/sql/item_func.h b/sql/item_func.h
index 80fa0b5d634..f562c87fe1c 100644
--- a/sql/item_func.h
+++ b/sql/item_func.h
@@ -1,7 +1,7 @@
#ifndef ITEM_FUNC_INCLUDED
#define ITEM_FUNC_INCLUDED
/* Copyright (c) 2000, 2011, Oracle and/or its affiliates.
- Copyright (c) 2009-2011 Monty Program Ab
+ Copyright (c) 2009, 2013, Monty Program Ab.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -39,6 +39,8 @@ protected:
0 means get this number from first argument
*/
uint allowed_arg_cols;
+ /* maybe_null can't be changed by parameters or used table state */
+ bool persistent_maybe_null;
public:
uint arg_count;
table_map used_tables_cache, not_null_tables_cache;
@@ -58,19 +60,19 @@ public:
NOW_FUNC, TRIG_COND_FUNC,
SUSERVAR_FUNC, GUSERVAR_FUNC, COLLATE_FUNC,
EXTRACT_FUNC, CHAR_TYPECAST_FUNC, FUNC_SP, UDF_FUNC,
- NEG_FUNC, GSYSVAR_FUNC };
+ NEG_FUNC, GSYSVAR_FUNC, DYNCOL_FUNC };
enum optimize_type { OPTIMIZE_NONE,OPTIMIZE_KEY,OPTIMIZE_OP, OPTIMIZE_NULL,
OPTIMIZE_EQUAL };
enum Type type() const { return FUNC_ITEM; }
virtual enum Functype functype() const { return UNKNOWN_FUNC; }
Item_func(void):
- allowed_arg_cols(1), arg_count(0)
+ allowed_arg_cols(1), persistent_maybe_null(0), arg_count(0)
{
with_sum_func= 0;
with_field= 0;
}
Item_func(Item *a):
- allowed_arg_cols(1), arg_count(1)
+ allowed_arg_cols(1), persistent_maybe_null(0), arg_count(1)
{
args= tmp_arg;
args[0]= a;
@@ -78,7 +80,7 @@ public:
with_field= a->with_field;
}
Item_func(Item *a,Item *b):
- allowed_arg_cols(1), arg_count(2)
+ allowed_arg_cols(1), persistent_maybe_null(0), arg_count(2)
{
args= tmp_arg;
args[0]= a; args[1]= b;
@@ -86,7 +88,7 @@ public:
with_field= a->with_field || b->with_field;
}
Item_func(Item *a,Item *b,Item *c):
- allowed_arg_cols(1)
+ allowed_arg_cols(1), persistent_maybe_null(0)
{
arg_count= 0;
if ((args= (Item**) sql_alloc(sizeof(Item*)*3)))
@@ -98,7 +100,7 @@ public:
}
}
Item_func(Item *a,Item *b,Item *c,Item *d):
- allowed_arg_cols(1)
+ allowed_arg_cols(1), persistent_maybe_null(0)
{
arg_count= 0;
if ((args= (Item**) sql_alloc(sizeof(Item*)*4)))
@@ -112,7 +114,7 @@ public:
}
}
Item_func(Item *a,Item *b,Item *c,Item *d,Item* e):
- allowed_arg_cols(1)
+ allowed_arg_cols(1), persistent_maybe_null(0)
{
arg_count= 5;
if ((args= (Item**) sql_alloc(sizeof(Item*)*5)))
@@ -170,6 +172,18 @@ public:
my_decimal *val_decimal(my_decimal *);
+ void fix_char_length_ulonglong(ulonglong max_char_length_arg)
+ {
+ ulonglong max_result_length= max_char_length_arg *
+ collation.collation->mbmaxlen;
+ if (max_result_length >= MAX_BLOB_WIDTH)
+ {
+ max_length= MAX_BLOB_WIDTH;
+ set_persist_maybe_null(1);
+ }
+ else
+ max_length= (uint32) max_result_length;
+ }
bool agg_arg_charsets(DTCollation &c, Item **items, uint nitems,
uint flags, int item_sep)
{
@@ -371,6 +385,11 @@ public:
info.bool_function= &Item::restore_to_before_no_rows_in_result;
walk(&Item::call_bool_func_processor, FALSE, (uchar*) &info);
}
+ inline void set_persist_maybe_null(bool mb_null)
+ {
+ maybe_null= mb_null;
+ persistent_maybe_null= 1;
+ }
};
@@ -586,7 +605,7 @@ public:
}
double val_real();
enum_field_types field_type() const { return MYSQL_TYPE_DOUBLE; }
- void fix_length_and_dec() { maybe_null= 1; }
+ void fix_length_and_dec() { set_persist_maybe_null(1); }
const char *func_name() const { return "double_typecast"; }
virtual void print(String *str, enum_query_type query_type);
};
@@ -727,7 +746,7 @@ class Item_dec_func :public Item_real_func
void fix_length_and_dec()
{
decimals=NOT_FIXED_DEC; max_length=float_length(decimals);
- maybe_null=1;
+ set_persist_maybe_null(1);
}
};
@@ -1059,7 +1078,7 @@ public:
Item_func_coercibility(Item *a) :Item_int_func(a) {}
longlong val_int();
const char *func_name() const { return "coercibility"; }
- void fix_length_and_dec() { max_length=10; maybe_null= 0; }
+ void fix_length_and_dec() { max_length=10; set_persist_maybe_null(0); }
table_map not_null_tables() const { return 0; }
};
@@ -1201,6 +1220,7 @@ public:
const char *func_name() const { return "last_insert_id"; }
void fix_length_and_dec()
{
+ unsigned_flag= TRUE;
if (arg_count)
max_length= args[0]->max_length;
unsigned_flag=1;
@@ -1221,7 +1241,7 @@ public:
{}
longlong val_int();
const char *func_name() const { return "benchmark"; }
- void fix_length_and_dec() { max_length=1; maybe_null=0; }
+ void fix_length_and_dec() { max_length=1; set_persist_maybe_null(0); }
virtual void print(String *str, enum_query_type query_type);
bool check_vcol_func_processor(uchar *int_arg)
{
@@ -1474,7 +1494,7 @@ public:
double val_real() { DBUG_ASSERT(fixed == 1); null_value= 1; return 0.0; }
longlong val_int() { DBUG_ASSERT(fixed == 1); null_value=1; return 0; }
enum Item_result result_type () const { return STRING_RESULT; }
- void fix_length_and_dec() { maybe_null=1; max_length=0; }
+ void fix_length_and_dec() { set_persist_maybe_null(1); max_length=0; }
};
#endif /* HAVE_DLOPEN */
@@ -1495,7 +1515,7 @@ class Item_func_get_lock :public Item_int_func
Item_func_get_lock(Item *a,Item *b) :Item_int_func(a,b) {}
longlong val_int();
const char *func_name() const { return "get_lock"; }
- void fix_length_and_dec() { max_length=1; maybe_null=1;}
+ void fix_length_and_dec() { max_length=1; set_persist_maybe_null(1);}
bool check_vcol_func_processor(uchar *int_arg)
{
return trace_unsupported_by_check_vcol_func_processor(func_name());
@@ -1509,7 +1529,7 @@ public:
Item_func_release_lock(Item *a) :Item_int_func(a) {}
longlong val_int();
const char *func_name() const { return "release_lock"; }
- void fix_length_and_dec() { max_length=1; maybe_null=1;}
+ void fix_length_and_dec() { max_length=1; set_persist_maybe_null(1);}
bool check_vcol_func_processor(uchar *int_arg)
{
return trace_unsupported_by_check_vcol_func_processor(func_name());
@@ -1527,7 +1547,7 @@ public:
Item_master_pos_wait(Item *a,Item *b, Item *c, Item *d) :Item_int_func(a,b,c,d) {}
longlong val_int();
const char *func_name() const { return "master_pos_wait"; }
- void fix_length_and_dec() { max_length=21; maybe_null=1;}
+ void fix_length_and_dec() { max_length=21; set_persist_maybe_null(1);}
bool check_vcol_func_processor(uchar *int_arg)
{
return trace_unsupported_by_check_vcol_func_processor(func_name());
@@ -1744,7 +1764,8 @@ public:
Item_func_inet_aton(Item *a) :Item_int_func(a) {}
longlong val_int();
const char *func_name() const { return "inet_aton"; }
- void fix_length_and_dec() { decimals= 0; max_length= 21; maybe_null= 1; unsigned_flag= 1;}
+ void fix_length_and_dec()
+ { decimals= 0; max_length= 21; set_persist_maybe_null(1); unsigned_flag= 1; }
};
@@ -1813,7 +1834,8 @@ public:
Item_func_is_free_lock(Item *a) :Item_int_func(a) {}
longlong val_int();
const char *func_name() const { return "is_free_lock"; }
- void fix_length_and_dec() { decimals=0; max_length=1; maybe_null=1;}
+ void fix_length_and_dec()
+ { decimals= 0; max_length= 1; set_persist_maybe_null(1); }
bool check_vcol_func_processor(uchar *int_arg)
{
return trace_unsupported_by_check_vcol_func_processor(func_name());
@@ -1827,7 +1849,8 @@ public:
Item_func_is_used_lock(Item *a) :Item_int_func(a) {}
longlong val_int();
const char *func_name() const { return "is_used_lock"; }
- void fix_length_and_dec() { decimals=0; max_length=10; maybe_null=1;}
+ void fix_length_and_dec()
+ { decimals= 0; max_length= 10; set_persist_maybe_null(1);}
bool check_vcol_func_processor(uchar *int_arg)
{
return trace_unsupported_by_check_vcol_func_processor(func_name());
@@ -1850,7 +1873,7 @@ public:
Item_func_row_count() :Item_int_func() {}
longlong val_int();
const char *func_name() const { return "row_count"; }
- void fix_length_and_dec() { decimals= 0; maybe_null=0; }
+ void fix_length_and_dec() { decimals= 0; set_persist_maybe_null(0); }
bool check_vcol_func_processor(uchar *int_arg)
{
@@ -1887,7 +1910,8 @@ private:
bool init_result_field(THD *thd);
protected:
- bool is_expensive_processor(uchar *arg) { return TRUE; }
+ bool is_expensive_processor(uchar *arg)
+ { return is_expensive(); }
public:
@@ -1966,7 +1990,7 @@ public:
bool fix_fields(THD *thd, Item **ref);
void fix_length_and_dec(void);
- bool is_expensive() { return 1; }
+ bool is_expensive();
inline Field *get_sp_result_field()
{
@@ -1990,7 +2014,7 @@ public:
Item_func_found_rows() :Item_int_func() {}
longlong val_int();
const char *func_name() const { return "found_rows"; }
- void fix_length_and_dec() { decimals= 0; maybe_null=0; }
+ void fix_length_and_dec() { decimals= 0; set_persist_maybe_null(0); }
bool check_vcol_func_processor(uchar *int_arg)
{
return trace_unsupported_by_check_vcol_func_processor(func_name());
@@ -2033,6 +2057,11 @@ public:
enum_field_types field_type() const { return last_value->field_type(); }
bool const_item() const { return 0; }
void evaluate_sideeffects();
+ void update_used_tables()
+ {
+ Item_func::update_used_tables();
+ maybe_null= last_value->maybe_null;
+ }
};
diff --git a/sql/item_geofunc.cc b/sql/item_geofunc.cc
index bc89a6c14b3..e3e80bdf59f 100644
--- a/sql/item_geofunc.cc
+++ b/sql/item_geofunc.cc
@@ -53,7 +53,7 @@ void Item_geometry_func::fix_length_and_dec()
collation.set(&my_charset_bin);
decimals=0;
max_length= (uint32) 4294967295U;
- maybe_null= 1;
+ set_persist_maybe_null(1);
}
@@ -147,7 +147,7 @@ void Item_func_as_wkt::fix_length_and_dec()
{
collation.set(default_charset(), DERIVATION_COERCIBLE, MY_REPERTOIRE_ASCII);
max_length=MAX_BLOB_WIDTH;
- maybe_null= 1;
+ set_persist_maybe_null(1);
}
diff --git a/sql/item_geofunc.h b/sql/item_geofunc.h
index 3638d9f62e8..ee61f921adb 100644
--- a/sql/item_geofunc.h
+++ b/sql/item_geofunc.h
@@ -89,7 +89,7 @@ public:
{
// "GeometryCollection" is the longest
fix_length_and_charset(20, default_charset());
- maybe_null= 1;
+ set_persist_maybe_null(1);
};
};
@@ -224,7 +224,7 @@ public:
{
Item_func::print(str, query_type);
}
- void fix_length_and_dec() { maybe_null= 1; }
+ void fix_length_and_dec() { set_persist_maybe_null(1); }
bool is_null() { (void) val_int(); return null_value; }
};
@@ -251,7 +251,7 @@ public:
Item_func::print(str, query_type);
}
- void fix_length_and_dec() { maybe_null= 1; }
+ void fix_length_and_dec() { set_persist_maybe_null(1); }
bool is_null() { (void) val_int(); return null_value; }
};
@@ -342,7 +342,7 @@ public:
longlong val_int();
optimize_type select_optimize() const { return OPTIMIZE_NONE; }
const char *func_name() const { return "st_isempty"; }
- void fix_length_and_dec() { maybe_null= 1; }
+ void fix_length_and_dec() { set_persist_maybe_null(1); }
};
class Item_func_issimple: public Item_bool_func
@@ -356,7 +356,7 @@ public:
longlong val_int();
optimize_type select_optimize() const { return OPTIMIZE_NONE; }
const char *func_name() const { return "st_issimple"; }
- void fix_length_and_dec() { maybe_null= 1; }
+ void fix_length_and_dec() { set_persist_maybe_null(1); }
};
class Item_func_isclosed: public Item_bool_func
@@ -366,7 +366,7 @@ public:
longlong val_int();
optimize_type select_optimize() const { return OPTIMIZE_NONE; }
const char *func_name() const { return "st_isclosed"; }
- void fix_length_and_dec() { maybe_null= 1; }
+ void fix_length_and_dec() { set_persist_maybe_null(1); }
};
class Item_func_dimension: public Item_int_func
@@ -376,7 +376,7 @@ public:
Item_func_dimension(Item *a): Item_int_func(a) {}
longlong val_int();
const char *func_name() const { return "st_dimension"; }
- void fix_length_and_dec() { max_length= 10; maybe_null= 1; }
+ void fix_length_and_dec() { max_length= 10; set_persist_maybe_null(1); }
};
class Item_func_x: public Item_real_func
@@ -389,7 +389,7 @@ public:
void fix_length_and_dec()
{
Item_real_func::fix_length_and_dec();
- maybe_null= 1;
+ set_persist_maybe_null(1);
}
};
@@ -404,7 +404,7 @@ public:
void fix_length_and_dec()
{
Item_real_func::fix_length_and_dec();
- maybe_null= 1;
+ set_persist_maybe_null(1);
}
};
@@ -416,7 +416,7 @@ public:
Item_func_numgeometries(Item *a): Item_int_func(a) {}
longlong val_int();
const char *func_name() const { return "st_numgeometries"; }
- void fix_length_and_dec() { max_length= 10; maybe_null= 1; }
+ void fix_length_and_dec() { max_length= 10; set_persist_maybe_null(1); }
};
@@ -427,7 +427,7 @@ public:
Item_func_numinteriorring(Item *a): Item_int_func(a) {}
longlong val_int();
const char *func_name() const { return "st_numinteriorrings"; }
- void fix_length_and_dec() { max_length= 10; maybe_null= 1; }
+ void fix_length_and_dec() { max_length= 10; set_persist_maybe_null(1); }
};
@@ -438,7 +438,7 @@ public:
Item_func_numpoints(Item *a): Item_int_func(a) {}
longlong val_int();
const char *func_name() const { return "st_numpoints"; }
- void fix_length_and_dec() { max_length= 10; maybe_null= 1; }
+ void fix_length_and_dec() { max_length= 10; set_persist_maybe_null(1); }
};
@@ -452,7 +452,7 @@ public:
void fix_length_and_dec()
{
Item_real_func::fix_length_and_dec();
- maybe_null= 1;
+ set_persist_maybe_null(1);
}
};
@@ -467,7 +467,7 @@ public:
void fix_length_and_dec()
{
Item_real_func::fix_length_and_dec();
- maybe_null= 1;
+ set_persist_maybe_null(1);
}
};
@@ -479,7 +479,7 @@ public:
Item_func_srid(Item *a): Item_int_func(a) {}
longlong val_int();
const char *func_name() const { return "srid"; }
- void fix_length_and_dec() { max_length= 10; maybe_null= 1; }
+ void fix_length_and_dec() { max_length= 10; set_persist_maybe_null(1); }
};
diff --git a/sql/item_row.cc b/sql/item_row.cc
index 2c4a628075e..ee7bd837553 100644
--- a/sql/item_row.cc
+++ b/sql/item_row.cc
@@ -74,7 +74,8 @@ bool Item_row::fix_fields(THD *thd, Item **ref)
Item **arg, **arg_end;
for (arg= items, arg_end= items+arg_count; arg != arg_end ; arg++)
{
- if ((*arg)->fix_fields(thd, arg))
+ if (!(*arg)->fixed &&
+ (*arg)->fix_fields(thd, arg))
return TRUE;
// we can't assign 'item' before, because fix_fields() can change arg
Item *item= *arg;
@@ -145,11 +146,13 @@ void Item_row::update_used_tables()
{
used_tables_cache= 0;
const_item_cache= 1;
+ maybe_null= 0;
for (uint i= 0; i < arg_count; i++)
{
items[i]->update_used_tables();
used_tables_cache|= items[i]->used_tables();
const_item_cache&= items[i]->const_item();
+ maybe_null|= items[i]->maybe_null;
}
}
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc
index 021a793618f..5071e494f04 100644
--- a/sql/item_strfunc.cc
+++ b/sql/item_strfunc.cc
@@ -1,5 +1,6 @@
/*
Copyright (c) 2000, 2011, Oracle and/or its affiliates.
+ Copyright (c) 2009, 2013, Monty Program Ab.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -57,6 +58,7 @@
C_MODE_START
#include "../mysys/my_static.h" // For soundex_map
C_MODE_END
+#include "sql_show.h" // append_identifier
/**
@todo Remove this. It is not safe to use a shared String object.
@@ -339,7 +341,7 @@ String *Item_func_sha2::val_str_ascii(String *str)
void Item_func_sha2::fix_length_and_dec()
{
- maybe_null = 1;
+ set_persist_maybe_null(1);
max_length = 0;
#if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY)
@@ -465,7 +467,7 @@ String *Item_func_aes_decrypt::val_str(String *str)
void Item_func_aes_decrypt::fix_length_and_dec()
{
max_length=args[0]->max_length;
- maybe_null= 1;
+ set_persist_maybe_null(1);
}
@@ -1335,7 +1337,7 @@ void Item_str_func::left_right_max_length()
if (args[1]->const_item())
{
int length= (int) args[1]->val_int();
- if (length <= 0)
+ if (args[1]->null_value || length <= 0)
char_length=0;
else
set_if_smaller(char_length, (uint) length);
@@ -1442,7 +1444,9 @@ void Item_func_substr::fix_length_and_dec()
if (args[1]->const_item())
{
int32 start= (int32) args[1]->val_int();
- if (start < 0)
+ if (args[1]->null_value)
+ max_length= 0;
+ else if (start < 0)
max_length= ((uint)(-start) > max_length) ? 0 : (uint)(-start);
else
max_length-= min((uint)(start - 1), max_length);
@@ -1450,7 +1454,7 @@ void Item_func_substr::fix_length_and_dec()
if (arg_count == 3 && args[2]->const_item())
{
int32 length= (int32) args[2]->val_int();
- if (length <= 0)
+ if (args[2]->null_value || length <= 0)
max_length=0; /* purecov: inspected */
else
set_if_smaller(max_length,(uint) length);
@@ -2409,7 +2413,7 @@ void Item_func_elt::fix_length_and_dec()
set_if_bigger(decimals,args[i]->decimals);
}
fix_char_length(char_length);
- maybe_null=1; // NULL if wrong first arg
+ set_persist_maybe_null(1); // NULL if wrong first arg
}
@@ -2648,7 +2652,9 @@ void Item_func_repeat::fix_length_and_dec()
/* Assumes that the maximum length of a String is < INT_MAX32. */
/* Set here so that rest of code sees out-of-bound value as such. */
- if (count > INT_MAX32)
+ if (args[1]->null_value)
+ count= 0;
+ else if (count > INT_MAX32)
count= INT_MAX32;
ulonglong char_length= (ulonglong) args[0]->max_char_length() * count;
@@ -2657,7 +2663,7 @@ void Item_func_repeat::fix_length_and_dec()
else
{
max_length= MAX_BLOB_WIDTH;
- maybe_null= 1;
+ set_persist_maybe_null(1);
}
}
@@ -2727,14 +2733,16 @@ void Item_func_rpad::fix_length_and_dec()
DBUG_ASSERT(collation.collation->mbmaxlen > 0);
/* Assumes that the maximum length of a String is < INT_MAX32. */
/* Set here so that rest of code sees out-of-bound value as such. */
- if (char_length > INT_MAX32)
+ if (args[1]->null_value)
+ char_length= 0;
+ else if (char_length > INT_MAX32)
char_length= INT_MAX32;
fix_char_length_ulonglong(char_length);
}
else
{
max_length= MAX_BLOB_WIDTH;
- maybe_null= 1;
+ set_persist_maybe_null(1);
}
}
@@ -2831,14 +2839,16 @@ void Item_func_lpad::fix_length_and_dec()
DBUG_ASSERT(collation.collation->mbmaxlen > 0);
/* Assumes that the maximum length of a String is < INT_MAX32. */
/* Set here so that rest of code sees out-of-bound value as such. */
- if (char_length > INT_MAX32)
+ if (args[1]->null_value)
+ char_length= 0;
+ else if (char_length > INT_MAX32)
char_length= INT_MAX32;
fix_char_length_ulonglong(char_length);
}
else
{
max_length= MAX_BLOB_WIDTH;
- maybe_null= 1;
+ set_persist_maybe_null(1);
}
}
@@ -3776,7 +3786,8 @@ String *Item_func_uuid::val_str(String *str)
Item_func_dyncol_create::Item_func_dyncol_create(List<Item> &args,
DYNCALL_CREATE_DEF *dfs)
- : Item_str_func(args), defs(dfs), vals(0), nums(0)
+ : Item_str_func(args), defs(dfs), vals(0), keys_num(NULL), keys_str(NULL),
+ names(FALSE), force_names(FALSE)
{
DBUG_ASSERT((args.elements & 0x1) == 0); // even number of arguments
}
@@ -3784,31 +3795,81 @@ Item_func_dyncol_create::Item_func_dyncol_create(List<Item> &args,
bool Item_func_dyncol_create::fix_fields(THD *thd, Item **ref)
{
+ uint i;
bool res= Item_func::fix_fields(thd, ref); // no need Item_str_func here
- vals= (DYNAMIC_COLUMN_VALUE *) alloc_root(thd->mem_root,
- sizeof(DYNAMIC_COLUMN_VALUE) *
- (arg_count / 2));
- nums= (uint *) alloc_root(thd->mem_root,
- sizeof(uint) * (arg_count / 2));
- status_var_increment(thd->status_var.feature_dynamic_columns);
- return res || vals == 0 || nums == 0;
+ if (!res)
+ {
+ vals= (DYNAMIC_COLUMN_VALUE *) alloc_root(thd->mem_root,
+ sizeof(DYNAMIC_COLUMN_VALUE) *
+ (arg_count / 2));
+ for (i= 0; i + 1 < arg_count && args[i]->result_type() == INT_RESULT; i+= 2);
+ if (i + 1 < arg_count)
+ {
+ names= TRUE;
+ }
+
+ keys_num= (uint *) alloc_root(thd->mem_root,
+ (sizeof(LEX_STRING) > sizeof(uint) ?
+ sizeof(LEX_STRING) :
+ sizeof(uint)) *
+ (arg_count / 2));
+ keys_str= (LEX_STRING *) keys_num;
+ status_var_increment(thd->status_var.feature_dynamic_columns);
+ }
+ return res || vals == 0 || keys_num == 0;
}
void Item_func_dyncol_create::fix_length_and_dec()
{
- maybe_null= TRUE;
+ set_persist_maybe_null(1);
collation.set(&my_charset_bin);
decimals= 0;
}
-void Item_func_dyncol_create::prepare_arguments()
+bool Item_func_dyncol_create::prepare_arguments(bool force_names_arg)
{
char buff[STRING_BUFFER_USUAL_SIZE];
String *res, tmp(buff, sizeof(buff), &my_charset_bin);
uint column_count= (arg_count / 2);
uint i;
my_decimal dtmp, *dres;
+ force_names= force_names_arg;
+
+ if (!(names || force_names))
+ {
+ for (i= 0; i < column_count; i++)
+ {
+ uint valpos= i * 2 + 1;
+ DYNAMIC_COLUMN_TYPE type= defs[i].type;
+ if (type == DYN_COL_NULL)
+ switch (args[valpos]->field_type())
+ {
+ case MYSQL_TYPE_VARCHAR:
+ case MYSQL_TYPE_ENUM:
+ case MYSQL_TYPE_SET:
+ case MYSQL_TYPE_TINY_BLOB:
+ case MYSQL_TYPE_MEDIUM_BLOB:
+ case MYSQL_TYPE_LONG_BLOB:
+ case MYSQL_TYPE_BLOB:
+ case MYSQL_TYPE_VAR_STRING:
+ case MYSQL_TYPE_STRING:
+ case MYSQL_TYPE_GEOMETRY:
+ type= DYN_COL_STRING;
+ break;
+ default:
+ break;
+ }
+
+ if (type == DYN_COL_STRING &&
+ args[valpos]->type() == Item::FUNC_ITEM &&
+ ((Item_func *)args[valpos])->functype() == DYNCOL_FUNC)
+ {
+ force_names= 1;
+ break;
+ }
+ }
+ }
/* get values */
for (i= 0; i < column_count; i++)
@@ -3867,7 +3928,59 @@ void Item_func_dyncol_create::prepare_arguments()
break;
}
}
- nums[i]= (uint) args[i * 2]->val_int();
+ if (type == DYN_COL_STRING &&
+ args[valpos]->type() == Item::FUNC_ITEM &&
+ ((Item_func *)args[valpos])->functype() == DYNCOL_FUNC)
+ {
+ DBUG_ASSERT(names || force_names);
+ type= DYN_COL_DYNCOL;
+ }
+ if (names || force_names)
+ {
+ res= args[i * 2]->val_str(&tmp);
+ if (res)
+ {
+ // guaranty UTF-8 string for names
+ if (my_charset_same(res->charset(), &my_charset_utf8_general_ci))
+ {
+ keys_str[i].length= res->length();
+ keys_str[i].str= sql_strmake(res->ptr(), res->length());
+ }
+ else
+ {
+ uint strlen;
+ uint dummy_errors;
+ char *str=
+ (char *)sql_alloc((strlen= res->length() *
+ my_charset_utf8_general_ci.mbmaxlen + 1));
+ if (str)
+ {
+ keys_str[i].length=
+ copy_and_convert(str, strlen, &my_charset_utf8_general_ci,
+ res->ptr(), res->length(), res->charset(),
+ &dummy_errors);
+ keys_str[i].str= str;
+ }
+ else
+ keys_str[i].length= 0;
+
+ }
+ }
+ else
+ {
+ keys_str[i].length= 0;
+ keys_str[i].str= NULL;
+ }
+ }
+ else
+ keys_num[i]= (uint) args[i * 2]->val_int();
+ if (args[i * 2]->null_value)
+ {
+ /* to make cleanup possible */
+ for (; i < column_count; i++)
+ vals[i].type= DYN_COL_NULL;
+ return 1;
+ }
vals[i].type= type;
switch (type) {
case DYN_COL_NULL:
@@ -3882,11 +3995,11 @@ void Item_func_dyncol_create::prepare_arguments()
case DYN_COL_DOUBLE:
vals[i].x.double_value= args[valpos]->val_real();
break;
+ case DYN_COL_DYNCOL:
case DYN_COL_STRING:
res= args[valpos]->val_str(&tmp);
if (res &&
- (vals[i].x.string.value.str= my_strndup(res->ptr(), res->length(),
- MYF(MY_WME))))
+ (vals[i].x.string.value.str= sql_strmake(res->ptr(), res->length())))
{
vals[i].x.string.value.length= res->length();
vals[i].x.string.charset= res->charset();
@@ -3901,7 +4014,7 @@ void Item_func_dyncol_create::prepare_arguments()
case DYN_COL_DECIMAL:
if ((dres= args[valpos]->val_decimal(&dtmp)))
{
- dynamic_column_prepare_decimal(&vals[i]);
+ mariadb_dyncol_prepare_decimal(&vals[i]);
DBUG_ASSERT(vals[i].x.decimal.value.len == dres->len);
vals[i].x.decimal.value.intg= dres->intg;
vals[i].x.decimal.value.frac= dres->frac;
@@ -3911,7 +4024,7 @@ void Item_func_dyncol_create::prepare_arguments()
}
else
{
- dynamic_column_prepare_decimal(&vals[i]); // just to be safe
+ mariadb_dyncol_prepare_decimal(&vals[i]); // just to be safe
DBUG_ASSERT(args[valpos]->null_value);
}
break;
@@ -3930,24 +4043,12 @@ void Item_func_dyncol_create::prepare_arguments()
}
if (vals[i].type != DYN_COL_NULL && args[valpos]->null_value)
{
- if (vals[i].type == DYN_COL_STRING)
- my_free(vals[i].x.string.value.str);
vals[i].type= DYN_COL_NULL;
}
}
+ return FALSE;
}
-void Item_func_dyncol_create::cleanup_arguments()
-{
- uint column_count= (arg_count / 2);
- uint i;
-
- for (i= 0; i < column_count; i++)
- {
- if (vals[i].type == DYN_COL_STRING)
- my_free(vals[i].x.string.value.str);
- }
-}
String *Item_func_dyncol_create::val_str(String *str)
{
@@ -3957,30 +4058,37 @@ String *Item_func_dyncol_create::val_str(String *str)
enum enum_dyncol_func_result rc;
DBUG_ASSERT((arg_count & 0x1) == 0); // even number of arguments
- prepare_arguments();
-
- if ((rc= dynamic_column_create_many(&col, column_count, nums, vals)))
+ if (prepare_arguments(FALSE))
{
- dynamic_column_error_message(rc);
- dynamic_column_column_free(&col);
res= NULL;
- null_value= TRUE;
+ null_value= 1;
}
else
{
- /* Move result from DYNAMIC_COLUMN to str_value */
- char *ptr;
- size_t length, alloc_length;
- dynamic_column_reassociate(&col, &ptr, &length, &alloc_length);
- str_value.reassociate(ptr, (uint32) length, (uint32) alloc_length,
- &my_charset_bin);
- res= &str_value;
- null_value= FALSE;
+ if ((rc= ((names || force_names) ?
+ mariadb_dyncol_create_many_named(&col, column_count, keys_str,
+ vals, TRUE) :
+ mariadb_dyncol_create_many(&col, column_count, keys_num,
+ vals, TRUE))))
+ {
+ dynamic_column_error_message(rc);
+ dynamic_column_column_free(&col);
+ res= NULL;
+ null_value= TRUE;
+ }
+ else
+ {
+ /* Move result from DYNAMIC_COLUMN to str_value */
+ char *ptr;
+ size_t length, alloc_length;
+ dynstr_reassociate(&col, &ptr, &length, &alloc_length);
+ str_value.reassociate(ptr, (uint32) length, (uint32) alloc_length,
+ &my_charset_bin);
+ res= &str_value;
+ null_value= FALSE;
+ }
}
- /* cleanup */
- cleanup_arguments();
-
return res;
}
@@ -4006,6 +4114,7 @@ void Item_func_dyncol_create::print_arguments(String *str,
case DYN_COL_DOUBLE:
str->append(STRING_WITH_LEN(" AS double"));
break;
+ case DYN_COL_DYNCOL:
case DYN_COL_STRING:
str->append(STRING_WITH_LEN(" AS char"));
if (defs[i].cs)
@@ -4043,6 +4152,40 @@ void Item_func_dyncol_create::print(String *str,
str->append(')');
}
+String *Item_func_dyncol_json::val_str(String *str)
+{
+ DYNAMIC_STRING json, col;
+ String *res;
+ enum enum_dyncol_func_result rc;
+
+ res= args[0]->val_str(str);
+ if (args[0]->null_value)
+ goto null;
+
+ col.str= (char *)res->ptr();
+ col.length= res->length();
+ if ((rc= mariadb_dyncol_json(&col, &json)))
+ {
+ dynamic_column_error_message(rc);
+ goto null;
+ }
+ bzero(&col, sizeof(col));
+ {
+ /* Move result from DYNAMIC_COLUMN to str */
+ char *ptr;
+ size_t length, alloc_length;
+ dynstr_reassociate(&json, &ptr, &length, &alloc_length);
+ str->reassociate(ptr, (uint32) length, (uint32) alloc_length,
+ &my_charset_utf8_general_ci);
+ null_value= FALSE;
+ }
+ return str;
+
+null:
+ bzero(&col, sizeof(col));
+ null_value= TRUE;
+ return NULL;
+}
String *Item_func_dyncol_add::val_str(String *str)
{
@@ -4054,21 +4197,25 @@ String *Item_func_dyncol_add::val_str(String *str)
/* We store the packed data last */
res= args[arg_count - 1]->val_str(str);
- if (args[arg_count - 1]->null_value)
+ if (args[arg_count - 1]->null_value ||
+ init_dynamic_string(&col, NULL, res->length() + STRING_BUFFER_USUAL_SIZE,
+ STRING_BUFFER_USUAL_SIZE))
goto null;
- init_dynamic_string(&col, NULL, res->length() + STRING_BUFFER_USUAL_SIZE,
- STRING_BUFFER_USUAL_SIZE);
col.length= res->length();
memcpy(col.str, res->ptr(), col.length);
- prepare_arguments();
+ if (prepare_arguments(mariadb_dyncol_has_names(&col)))
+ goto null;
- if ((rc= dynamic_column_update_many(&col, column_count, nums, vals)))
+ if ((rc= ((names || force_names) ?
+ mariadb_dyncol_update_many_named(&col, column_count,
+ keys_str, vals) :
+ mariadb_dyncol_update_many(&col, column_count,
+ keys_num, vals))))
{
dynamic_column_error_message(rc);
dynamic_column_column_free(&col);
- cleanup_arguments();
goto null;
}
@@ -4076,16 +4223,12 @@ String *Item_func_dyncol_add::val_str(String *str)
/* Move result from DYNAMIC_COLUMN to str */
char *ptr;
size_t length, alloc_length;
- dynamic_column_reassociate(&col, &ptr, &length, &alloc_length);
+ dynstr_reassociate(&col, &ptr, &length, &alloc_length);
str->reassociate(ptr, (uint32) length, (uint32) alloc_length,
&my_charset_bin);
null_value= FALSE;
}
- /* cleanup */
- dynamic_column_column_free(&col);
- cleanup_arguments();
-
return str;
null:
@@ -4117,10 +4260,48 @@ bool Item_dyncol_get::get_dyn_value(DYNAMIC_COLUMN_VALUE *val, String *tmp)
{
DYNAMIC_COLUMN dyn_str;
String *res;
- longlong num;
+ longlong num= 0;
+ LEX_STRING buf, *name= NULL;
+ char nmstrbuf[11];
+ String nmbuf(nmstrbuf, sizeof(nmstrbuf), system_charset_info);
enum enum_dyncol_func_result rc;
- num= args[1]->val_int();
+ if (args[1]->result_type() == INT_RESULT)
+ num= args[1]->val_int();
+ else
+ {
+ String *nm= args[1]->val_str(&nmbuf);
+ if (!nm || args[1]->null_value)
+ {
+ null_value= 1;
+ return 1;
+ }
+
+ if (my_charset_same(nm->charset(), &my_charset_utf8_general_ci))
+ {
+ buf.str= (char *) nm->ptr();
+ buf.length= nm->length();
+ }
+ else
+ {
+ uint strlen;
+ uint dummy_errors;
+ buf.str= (char *)sql_alloc((strlen= nm->length() *
+ my_charset_utf8_general_ci.mbmaxlen + 1));
+ if (buf.str)
+ {
+ buf.length=
+ copy_and_convert(buf.str, strlen, &my_charset_utf8_general_ci,
+ nm->ptr(), nm->length(), nm->charset(),
+ &dummy_errors);
+ }
+ else
+ buf.length= 0;
+ }
+ name= &buf;
+ }
+
+
if (args[1]->null_value || num < 0 || num > INT_MAX)
{
null_value= 1;
@@ -4136,7 +4317,9 @@ bool Item_dyncol_get::get_dyn_value(DYNAMIC_COLUMN_VALUE *val, String *tmp)
dyn_str.str= (char*) res->ptr();
dyn_str.length= res->length();
- if ((rc= dynamic_column_get(&dyn_str, (uint) num, val)))
+ if ((rc= ((name == NULL) ?
+ mariadb_dyncol_get(&dyn_str, (uint) num, val) :
+ mariadb_dyncol_get_named(&dyn_str, name, val))))
{
dynamic_column_error_message(rc);
null_value= 1;
@@ -4168,6 +4351,7 @@ String *Item_dyncol_get::val_str(String *str_result)
case DYN_COL_DOUBLE:
str_result->set_real(val.x.double_value, NOT_FIXED_DEC, &my_charset_latin1);
break;
+ case DYN_COL_DYNCOL:
case DYN_COL_STRING:
if ((char*) tmp.ptr() <= val.x.string.value.str &&
(char*) tmp.ptr() + tmp.length() >= val.x.string.value.str)
@@ -4190,8 +4374,7 @@ String *Item_dyncol_get::val_str(String *str_result)
case DYN_COL_DECIMAL:
{
int res;
- int length=
- my_decimal_string_length((const my_decimal*)&val.x.decimal.value);
+ int length= decimal_string_size(&val.x.decimal.value);
if (str_result->alloc(length))
goto null;
if ((res= decimal2string(&val.x.decimal.value, (char*) str_result->ptr(),
@@ -4244,6 +4427,7 @@ longlong Item_dyncol_get::val_int()
return 0;
switch (val.type) {
+ case DYN_COL_DYNCOL:
case DYN_COL_NULL:
goto null;
case DYN_COL_UINT:
@@ -4324,6 +4508,7 @@ double Item_dyncol_get::val_real()
return 0.0;
switch (val.type) {
+ case DYN_COL_DYNCOL:
case DYN_COL_NULL:
goto null;
case DYN_COL_UINT:
@@ -4381,6 +4566,7 @@ my_decimal *Item_dyncol_get::val_decimal(my_decimal *decimal_value)
return NULL;
switch (val.type) {
+ case DYN_COL_DYNCOL:
case DYN_COL_NULL:
goto null;
case DYN_COL_UINT:
@@ -4437,6 +4623,7 @@ bool Item_dyncol_get::get_date(MYSQL_TIME *ltime, ulonglong fuzzy_date)
return 1; // Error
switch (val.type) {
+ case DYN_COL_DYNCOL:
case DYN_COL_NULL:
goto null;
case DYN_COL_INT:
@@ -4482,7 +4669,6 @@ null:
return 1;
}
-
void Item_dyncol_get::print(String *str, enum_query_type query_type)
{
str->append(STRING_WITH_LEN("column_get("));
@@ -4497,7 +4683,8 @@ String *Item_func_dyncol_list::val_str(String *str)
{
uint i;
enum enum_dyncol_func_result rc;
- DYNAMIC_ARRAY arr;
+ LEX_STRING *names= 0;
+ uint count;
DYNAMIC_COLUMN col;
String *res= args[0]->val_str(str);
@@ -4506,33 +4693,37 @@ String *Item_func_dyncol_list::val_str(String *str)
col.length= res->length();
/* We do not change the string, so could do this trick */
col.str= (char *)res->ptr();
- if ((rc= dynamic_column_list(&col, &arr)))
+ if ((rc= mariadb_dyncol_list_named(&col, &count, &names)))
{
+ bzero(&col, sizeof(col));
dynamic_column_error_message(rc);
- delete_dynamic(&arr);
goto null;
}
+ bzero(&col, sizeof(col));
/*
- We support elements from 0 - 65536, so max size for one element is
- 6 (including ,).
+ We estimate average name length as 10
*/
- if (str->alloc(arr.elements * 6))
+ if (str->alloc(count * 13))
goto null;
str->length(0);
- for (i= 0; i < arr.elements; i++)
+ str->set_charset(&my_charset_utf8_general_ci);
+ for (i= 0; i < count; i++)
{
- str->qs_append(*dynamic_element(&arr, i, uint*));
- if (i < arr.elements - 1)
+ append_identifier(current_thd, str, names[i].str, names[i].length);
+ if (i < count - 1)
str->qs_append(',');
}
-
null_value= FALSE;
- delete_dynamic(&arr);
+ if (names)
+ my_free(names);
return str;
null:
null_value= TRUE;
+ if (names)
+ my_free(names);
return NULL;
}
+
diff --git a/sql/item_strfunc.h b/sql/item_strfunc.h
index 9ed2627a518..a42240f1b35 100644
--- a/sql/item_strfunc.h
+++ b/sql/item_strfunc.h
@@ -3,6 +3,7 @@
/*
Copyright (c) 2000, 2011, Oracle and/or its affiliates.
+ Copyright (c) 2009, 2013, Monty Program Ab.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -354,7 +355,7 @@ public:
String *val_str(String *);
void fix_length_and_dec()
{
- maybe_null=1;
+ set_persist_maybe_null(1);
/* 9 = MAX ((8- (arg_len % 8)) + 1) */
max_length = args[0]->max_length + 9;
}
@@ -370,7 +371,7 @@ public:
String *val_str(String *);
void fix_length_and_dec()
{
- maybe_null=1;
+ set_persist_maybe_null(1);
/* 9 = MAX ((8- (arg_len % 8)) + 1) */
max_length= args[0]->max_length;
if (max_length >= 9U)
@@ -398,7 +399,7 @@ public:
constructor_helper();
}
String *val_str(String *);
- void fix_length_and_dec() { maybe_null=1; max_length = 13; }
+ void fix_length_and_dec() { set_persist_maybe_null(1); max_length = 13; }
const char *func_name() const { return "encrypt"; }
bool check_vcol_func_processor(uchar *int_arg)
{
@@ -468,7 +469,7 @@ public:
void fix_length_and_dec()
{
max_length= MAX_FIELD_NAME * system_charset_info->mbmaxlen;
- maybe_null=1;
+ set_persist_maybe_null(1);
}
const char *func_name() const { return "database"; }
const char *fully_qualified_func_name() const { return "database()"; }
@@ -649,7 +650,7 @@ public:
{
collation.set(default_charset());
max_length=64;
- maybe_null= 1;
+ set_persist_maybe_null(1);
}
};
@@ -676,7 +677,7 @@ public:
Item_func_unhex(Item *a) :Item_str_func(a)
{
/* there can be bad hex strings */
- maybe_null= 1;
+ set_persist_maybe_null(1);
}
const char *func_name() const { return "unhex"; }
String *val_str(String *);
@@ -762,7 +763,7 @@ public:
void fix_length_and_dec()
{
collation.set(&my_charset_bin, DERIVATION_COERCIBLE);
- maybe_null=1;
+ set_persist_maybe_null(1);
max_length=MAX_BLOB_WIDTH;
}
bool check_vcol_func_processor(uchar *int_arg)
@@ -795,7 +796,7 @@ public:
{
decimals= 0;
fix_length_and_charset(3 * 8 + 7, default_charset());
- maybe_null= 1;
+ set_persist_maybe_null(1);
}
};
@@ -910,7 +911,7 @@ public:
{
collation.set(system_charset_info);
max_length= 64 * collation.collation->mbmaxlen; // should be enough
- maybe_null= 0;
+ set_persist_maybe_null(0);
};
table_map not_null_tables() const { return 0; }
};
@@ -925,7 +926,7 @@ public:
{
collation.set(system_charset_info);
max_length= 64 * collation.collation->mbmaxlen; // should be enough
- maybe_null= 0;
+ set_persist_maybe_null(0);
};
table_map not_null_tables() const { return 0; }
};
@@ -971,7 +972,8 @@ class Item_func_uncompress: public Item_str_func
String buffer;
public:
Item_func_uncompress(Item *a): Item_str_func(a){}
- void fix_length_and_dec(){ maybe_null= 1; max_length= MAX_BLOB_WIDTH; }
+ void fix_length_and_dec()
+ { set_persist_maybe_null(1); max_length= MAX_BLOB_WIDTH; }
const char *func_name() const{return "uncompress";}
String *val_str(String *) ZLIB_DEPENDED_FUNCTION
};
@@ -1001,9 +1003,10 @@ class Item_func_dyncol_create: public Item_str_func
protected:
DYNCALL_CREATE_DEF *defs;
DYNAMIC_COLUMN_VALUE *vals;
- uint *nums;
- void prepare_arguments();
- void cleanup_arguments();
+ uint *keys_num;
+ LEX_STRING *keys_str;
+ bool names, force_names;
+ bool prepare_arguments(bool force_names);
void print_arguments(String *str, enum_query_type query_type);
public:
Item_func_dyncol_create(List<Item> &args, DYNCALL_CREATE_DEF *dfs);
@@ -1012,6 +1015,7 @@ public:
const char *func_name() const{ return "column_create"; }
String *val_str(String *);
virtual void print(String *str, enum_query_type query_type);
+ virtual enum Functype functype() const { return DYNCOL_FUNC; }
};
@@ -1026,6 +1030,19 @@ public:
virtual void print(String *str, enum_query_type query_type);
};
+class Item_func_dyncol_json: public Item_str_func
+{
+public:
+ Item_func_dyncol_json(Item *str) :Item_str_func(str) {}
+ const char *func_name() const{ return "column_json"; }
+ String *val_str(String *);
+ void fix_length_and_dec()
+ {
+ maybe_null= TRUE;
+ collation.set(&my_charset_bin);
+ decimals= 0;
+ }
+};
/*
The following functions is always called from an Item_cast function
@@ -1036,11 +1053,9 @@ class Item_dyncol_get: public Item_str_func
public:
Item_dyncol_get(Item *str, Item *num)
:Item_str_func(str, num)
- {
- max_length= MAX_DYNAMIC_COLUMN_LENGTH;
- }
+ {}
void fix_length_and_dec()
- { maybe_null= 1; }
+ { set_persist_maybe_null(1); max_length= MAX_BLOB_WIDTH; }
/* Mark that collation can change between calls */
bool dynamic_result() { return 1; }
@@ -1059,7 +1074,8 @@ class Item_func_dyncol_list: public Item_str_func
{
public:
Item_func_dyncol_list(Item *str) :Item_str_func(str) {};
- void fix_length_and_dec() { maybe_null= 1; max_length= MAX_BLOB_WIDTH; };
+ void fix_length_and_dec()
+ { set_persist_maybe_null(1); max_length= MAX_BLOB_WIDTH; };
const char *func_name() const{ return "column_list"; }
String *val_str(String *);
};
@@ -1067,3 +1083,4 @@ public:
extern String my_empty_string;
#endif /* ITEM_STRFUNC_INCLUDED */
+
diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc
index 1ec1e57e812..f2485fd50a1 100644
--- a/sql/item_subselect.cc
+++ b/sql/item_subselect.cc
@@ -3258,11 +3258,14 @@ int subselect_uniquesubquery_engine::scan_table()
TABLE *table= tab->table;
DBUG_ENTER("subselect_uniquesubquery_engine::scan_table");
- if (table->file->inited)
- table->file->ha_index_end();
-
- if (table->file->ha_rnd_init_with_error(1))
- DBUG_RETURN(1);
+ if ((table->file->inited &&
+ (error= table->file->ha_index_end())) ||
+ (error= table->file->ha_rnd_init(1)))
+ {
+ (void) report_error(table, error);
+ DBUG_RETURN(true);
+ }
+
table->file->extra_opt(HA_EXTRA_CACHE,
current_thd->variables.read_buff_size);
table->null_row= 0;
@@ -3398,8 +3401,13 @@ int subselect_uniquesubquery_engine::exec()
DBUG_RETURN(0);
}
- if (!table->file->inited)
- table->file->ha_index_init(tab->ref.key, 0);
+ if (!table->file->inited &&
+ (error= table->file->ha_index_init(tab->ref.key, 0)))
+ {
+ (void) report_error(table, error);
+ DBUG_RETURN(true);
+ }
+
error= table->file->ha_index_read_map(table->record[0],
tab->ref.key_buff,
make_prev_keypart_map(tab->
@@ -3563,8 +3571,13 @@ int subselect_indexsubquery_engine::exec()
DBUG_RETURN(0);
}
- if (!table->file->inited)
- table->file->ha_index_init(tab->ref.key, 1);
+ if (!table->file->inited &&
+ (error= table->file->ha_index_init(tab->ref.key, 1)))
+ {
+ (void) report_error(table, error);
+ DBUG_RETURN(true);
+ }
+
error= table->file->ha_index_read_map(table->record[0],
tab->ref.key_buff,
make_prev_keypart_map(tab->
@@ -5053,7 +5066,7 @@ bool Ordered_key::alloc_keys_buffers()
DBUG_ASSERT(key_buff_elements > 0);
if (!(key_buff= (rownum_t*) my_malloc((size_t)(key_buff_elements *
- sizeof(rownum_t)), MYF(MY_WME))))
+ sizeof(rownum_t)), MYF(MY_WME | MY_THREAD_SPECIFIC))))
return TRUE;
/*
@@ -5480,7 +5493,7 @@ subselect_rowid_merge_engine::init(MY_BITMAP *non_null_key_parts,
!(null_bitmaps= (MY_BITMAP**) thd->alloc(merge_keys_count *
sizeof(MY_BITMAP*))) ||
!(row_num_to_rowid= (uchar*) my_malloc((size_t)(row_count * rowid_length),
- MYF(MY_WME))))
+ MYF(MY_WME | MY_THREAD_SPECIFIC))))
return TRUE;
/* Create the only non-NULL key if there is any. */
diff --git a/sql/item_sum.cc b/sql/item_sum.cc
index 217e65e401f..8816e1352a9 100644
--- a/sql/item_sum.cc
+++ b/sql/item_sum.cc
@@ -1,5 +1,5 @@
/* Copyright (c) 2000, 2011, Oracle and/or its affiliates.
- Copyright (c) 2008-2011 Monty Program Ab
+ Copyright (c) 2008, 2013 Monty Program Ab
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -1097,7 +1097,7 @@ void Aggregator_distinct::endup()
{
/* go over the tree of distinct keys and calculate the aggregate value */
use_distinct_values= TRUE;
- tree->walk(item_sum_distinct_walk, (void*) this);
+ tree->walk(table, item_sum_distinct_walk, (void*) this);
use_distinct_values= FALSE;
}
/* prevent consecutive recalculations */
@@ -2916,13 +2916,12 @@ int group_concat_key_cmp_with_distinct(void* arg, const void* key1,
const void* key2)
{
Item_func_group_concat *item_func= (Item_func_group_concat*)arg;
- TABLE *table= item_func->table;
for (uint i= 0; i < item_func->arg_count_field; i++)
{
Item *item= item_func->args[i];
/*
- If field_item is a const item then either get_tp_table_field returns 0
+ If field_item is a const item then either get_tmp_table_field returns 0
or it is an item over a const table.
*/
if (item->const_item())
@@ -2934,7 +2933,8 @@ int group_concat_key_cmp_with_distinct(void* arg, const void* key1,
*/
Field *field= item->get_tmp_table_field();
int res;
- uint offset= field->offset(field->table->record[0])-table->s->null_bytes;
+ uint offset= (field->offset(field->table->record[0]) -
+ field->table->s->null_bytes);
if((res= field->cmp((uchar*)key1 + offset, (uchar*)key2 + offset)))
return res;
}
@@ -2952,28 +2952,37 @@ int group_concat_key_cmp_with_order(void* arg, const void* key1,
{
Item_func_group_concat* grp_item= (Item_func_group_concat*) arg;
ORDER **order_item, **end;
- TABLE *table= grp_item->table;
for (order_item= grp_item->order, end=order_item+ grp_item->arg_count_order;
order_item < end;
order_item++)
{
Item *item= *(*order_item)->item;
+ /*
+ If field_item is a const item then either get_tmp_table_field returns 0
+ or it is an item over a const table.
+ */
+ if (item->const_item())
+ continue;
/*
We have to use get_tmp_table_field() instead of
real_item()->get_tmp_table_field() because we want the field in
the temporary table, not the original field
+
+ Note that for the case of ROLLUP, field may point to another table
+ tham grp_item->table. This is howver ok as the table definitions are
+ the same.
*/
Field *field= item->get_tmp_table_field();
/*
- If item is a const item then either get_tp_table_field returns 0
+ If item is a const item then either get_tmp_table_field returns 0
or it is an item over a const table.
*/
- if (field && !item->const_item())
+ if (field)
{
int res;
uint offset= (field->offset(field->table->record[0]) -
- table->s->null_bytes);
+ field->table->s->null_bytes);
if ((res= field->cmp((uchar*)key1 + offset, (uchar*)key2 + offset)))
return (*order_item)->asc ? res : -res;
}
@@ -2997,6 +3006,7 @@ int dump_leaf_key(void* key_arg, element_count count __attribute__((unused)),
{
Item_func_group_concat *item= (Item_func_group_concat *) item_arg;
TABLE *table= item->table;
+ uint max_length= table->in_use->variables.group_concat_max_len;
String tmp((char *)table->record[1], table->s->reclength,
default_charset_info);
String tmp2;
@@ -3039,7 +3049,7 @@ int dump_leaf_key(void* key_arg, element_count count __attribute__((unused)),
item->row_count++;
/* stop if length of result more than max_length */
- if (result->length() > item->max_length)
+ if (result->length() > max_length)
{
int well_formed_error;
CHARSET_INFO *cs= item->collation.collation;
@@ -3052,7 +3062,7 @@ int dump_leaf_key(void* key_arg, element_count count __attribute__((unused)),
*/
add_length= cs->cset->well_formed_len(cs,
ptr + old_length,
- ptr + item->max_length,
+ ptr + max_length,
result->length(),
&well_formed_error);
result->length(old_length + add_length);
@@ -3166,12 +3176,13 @@ Item_func_group_concat::Item_func_group_concat(THD *thd,
*/
ORDER *tmp;
if (!(tmp= (ORDER *) thd->alloc(sizeof(ORDER *) * arg_count_order +
- sizeof(ORDER) * arg_count_order)))
+ sizeof(ORDER) * arg_count_order)))
return;
order= (ORDER **)(tmp + arg_count_order);
for (uint i= 0; i < arg_count_order; i++, tmp++)
{
memcpy(tmp, item->order[i], sizeof(ORDER));
+ tmp->next= i == arg_count_order-1 ? 0 : tmp+1;
order[i]= tmp;
}
}
@@ -3216,19 +3227,11 @@ Field *Item_func_group_concat::make_string_field(TABLE *table)
{
Field *field;
DBUG_ASSERT(collation.collation);
- /*
- max_characters is maximum number of characters
- what can fit into max_length size. It's necessary
- to use field size what allows to store group_concat
- result without truncation. For this purpose we use
- max_characters * CS->mbmaxlen.
- */
- const uint32 max_characters= max_length / collation.collation->mbminlen;
- if (max_characters > CONVERT_IF_BIGGER_TO_BLOB)
- field= new Field_blob(max_characters * collation.collation->mbmaxlen,
+ if (too_big_for_varchar())
+ field= new Field_blob(max_length,
maybe_null, name, collation.collation, TRUE);
else
- field= new Field_varstring(max_characters * collation.collation->mbmaxlen,
+ field= new Field_varstring(max_length,
maybe_null, name, table->s, collation.collation);
if (field)
@@ -3343,7 +3346,9 @@ Item_func_group_concat::fix_fields(THD *thd, Item **ref)
result.set_charset(collation.collation);
result_field= 0;
null_value= 1;
- max_length= thd->variables.group_concat_max_len;
+ max_length= thd->variables.group_concat_max_len
+ / collation.collation->mbminlen
+ * collation.collation->mbmaxlen;
uint32 offset;
if (separator->needs_conversion(separator->length(), separator->charset(),
@@ -3461,7 +3466,8 @@ bool Item_func_group_concat::setup(THD *thd)
*/
if (!(table= create_tmp_table(thd, tmp_table_param, all_fields,
(ORDER*) 0, 0, TRUE,
- (select_lex->options | thd->variables.option_bits),
+ (select_lex->options |
+ thd->variables.option_bits),
HA_POS_ERROR, (char*) "")))
DBUG_RETURN(TRUE);
table->file->extra(HA_EXTRA_NO_ROWS);
@@ -3485,7 +3491,8 @@ bool Item_func_group_concat::setup(THD *thd)
init_tree(tree, (uint) min(thd->variables.max_heap_table_size,
thd->variables.sortbuff_size/16), 0,
tree_key_length,
- group_concat_key_cmp_with_order , 0, NULL, (void*) this);
+ group_concat_key_cmp_with_order, NULL, (void*) this,
+ MYF(MY_THREAD_SPECIFIC));
}
if (distinct)
diff --git a/sql/item_sum.h b/sql/item_sum.h
index c8dce60c7d4..40a28d8beae 100644
--- a/sql/item_sum.h
+++ b/sql/item_sum.h
@@ -1439,7 +1439,7 @@ public:
virtual Field *make_string_field(TABLE *table);
enum_field_types field_type() const
{
- if (max_length/collation.collation->mbmaxlen > CONVERT_IF_BIGGER_TO_BLOB )
+ if (too_big_for_varchar())
return MYSQL_TYPE_BLOB;
else
return MYSQL_TYPE_VARCHAR;
diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc
index 117276e488b..02a7b8511af 100644
--- a/sql/item_timefunc.cc
+++ b/sql/item_timefunc.cc
@@ -1,6 +1,6 @@
/*
Copyright (c) 2000, 2012, Oracle and/or its affiliates.
- Copyright (c) 2009, 2011, Monty Program Ab
+ Copyright (c) 2009, 2013, Monty Program Ab
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -945,7 +945,7 @@ void Item_func_monthname::fix_length_and_dec()
collation.set(cs, DERIVATION_COERCIBLE, repertoire);
decimals=0;
max_length= locale->max_month_name_length * collation.collation->mbmaxlen;
- maybe_null=1;
+ set_persist_maybe_null(1);
}
@@ -1095,7 +1095,7 @@ void Item_func_dayname::fix_length_and_dec()
collation.set(cs, DERIVATION_COERCIBLE, repertoire);
decimals=0;
max_length= locale->max_day_name_length * collation.collation->mbmaxlen;
- maybe_null=1;
+ set_persist_maybe_null(1);
}
@@ -1446,7 +1446,7 @@ void Item_temporal_func::fix_length_and_dec()
{ MAX_DATETIME_WIDTH, MAX_DATETIME_WIDTH, MAX_DATE_WIDTH,
MAX_DATETIME_WIDTH, MIN_TIME_WIDTH };
- maybe_null= true;
+ set_persist_maybe_null(1);
max_length= max_time_type_width[mysql_type_to_time_type(field_type())+2];
if (decimals)
{
@@ -1501,13 +1501,10 @@ bool Item_func_from_days::get_date(MYSQL_TIME *ltime, ulonglong fuzzy_date)
bzero(ltime, sizeof(MYSQL_TIME));
if (get_date_from_daynr((long) value, &ltime->year, &ltime->month,
&ltime->day))
- return (null_value= 1);
-
- if ((fuzzy_date & TIME_NO_ZERO_DATE) && ltime->year == 0)
- return (null_value= 1);
+ return 0;
ltime->time_type= MYSQL_TIMESTAMP_DATE;
- return (null_value= 0);
+ return 0;
}
@@ -1519,7 +1516,7 @@ void Item_func_curdate::fix_length_and_dec()
ltime.hour= ltime.minute= ltime.second= 0;
ltime.time_type= MYSQL_TIMESTAMP_DATE;
Item_datefunc::fix_length_and_dec();
- maybe_null= false;
+ set_persist_maybe_null(0);
}
/**
@@ -1758,7 +1755,7 @@ void Item_func_date_format::fix_length_and_dec()
collation.collation->mbmaxlen;
set_if_smaller(max_length,MAX_BLOB_WIDTH);
}
- maybe_null=1; // If wrong date
+ set_persist_maybe_null(1); // If wrong date
}
@@ -2102,7 +2099,7 @@ void Item_extract::print(String *str, enum_query_type query_type)
void Item_extract::fix_length_and_dec()
{
- maybe_null=1; // If wrong date
+ set_persist_maybe_null(1); // If wrong date
switch (int_type) {
case INTERVAL_YEAR: max_length=4; date_value=1; break;
case INTERVAL_YEAR_MONTH: max_length=6; date_value=1; break;
diff --git a/sql/item_timefunc.h b/sql/item_timefunc.h
index 3af08a8168e..3e3cd698efc 100644
--- a/sql/item_timefunc.h
+++ b/sql/item_timefunc.h
@@ -82,7 +82,7 @@ public:
{
decimals=0;
max_length=6*MY_CHARSET_BIN_MB_MAXLEN;
- maybe_null=1;
+ set_persist_maybe_null(1);
}
enum_monotonicity_info get_monotonicity_info() const;
longlong val_int_endpoint(bool left_endp, bool *incl_endp);
@@ -105,7 +105,7 @@ public:
{
decimals=0;
max_length=6*MY_CHARSET_BIN_MB_MAXLEN;
- maybe_null=1;
+ set_persist_maybe_null(1);
}
enum_monotonicity_info get_monotonicity_info() const;
longlong val_int_endpoint(bool left_endp, bool *incl_endp);
@@ -138,7 +138,7 @@ public:
{
decimals=0;
max_length=2*MY_CHARSET_BIN_MB_MAXLEN;
- maybe_null=1;
+ set_persist_maybe_null(1);
}
bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
bool check_vcol_func_processor(uchar *int_arg) { return FALSE;}
@@ -170,7 +170,7 @@ public:
{
decimals= 0;
fix_char_length(2);
- maybe_null= 1;
+ set_persist_maybe_null(1);
}
bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
bool check_vcol_func_processor(uchar *int_arg) { return FALSE;}
@@ -208,7 +208,7 @@ public:
{
decimals= 0;
fix_char_length(3);
- maybe_null= 1;
+ set_persist_maybe_null(1);
}
bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
bool check_vcol_func_processor(uchar *int_arg) { return FALSE;}
@@ -229,7 +229,7 @@ public:
{
decimals=0;
max_length=2*MY_CHARSET_BIN_MB_MAXLEN;
- maybe_null=1;
+ set_persist_maybe_null(1);
}
bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
bool check_vcol_func_processor(uchar *int_arg) { return FALSE;}
@@ -250,7 +250,7 @@ public:
{
decimals=0;
max_length=2*MY_CHARSET_BIN_MB_MAXLEN;
- maybe_null=1;
+ set_persist_maybe_null(1);
}
bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
bool check_vcol_func_processor(uchar *int_arg) { return FALSE;}
@@ -271,7 +271,7 @@ public:
{
decimals=0;
max_length=1*MY_CHARSET_BIN_MB_MAXLEN;
- maybe_null=1;
+ set_persist_maybe_null(1);
}
bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
bool check_vcol_func_processor(uchar *int_arg) { return FALSE;}
@@ -292,7 +292,7 @@ public:
{
decimals=0;
max_length=2*MY_CHARSET_BIN_MB_MAXLEN;
- maybe_null=1;
+ set_persist_maybe_null(1);
}
bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
bool check_vcol_func_processor(uchar *int_arg) { return FALSE;}
@@ -313,7 +313,7 @@ public:
{
decimals=0;
max_length=2*MY_CHARSET_BIN_MB_MAXLEN;
- maybe_null=1;
+ set_persist_maybe_null(1);
}
};
@@ -327,7 +327,7 @@ public:
{
decimals=0;
max_length=6*MY_CHARSET_BIN_MB_MAXLEN;
- maybe_null=1;
+ set_persist_maybe_null(1);
}
bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
bool check_vcol_func_processor(uchar *int_arg) { return FALSE;}
@@ -350,7 +350,7 @@ public:
{
decimals=0;
max_length=4*MY_CHARSET_BIN_MB_MAXLEN;
- maybe_null=1;
+ set_persist_maybe_null(1);
}
bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
bool check_vcol_func_processor(uchar *int_arg) { return FALSE;}
@@ -384,7 +384,7 @@ public:
{
decimals= 0;
fix_char_length(1);
- maybe_null= 1;
+ set_persist_maybe_null(1);
}
bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
bool check_vcol_func_processor(uchar *int_arg) { return FALSE;}
@@ -419,7 +419,7 @@ public:
decimals= args[0]->decimals;
set_if_smaller(decimals, TIME_SECOND_PART_DIGITS);
max_length=17 + (decimals ? decimals + 1 : 0);
- maybe_null= 1;
+ set_persist_maybe_null(1);
}
void find_num_type() { hybrid_type= decimals ? DECIMAL_RESULT : INT_RESULT; }
double real_op() { DBUG_ASSERT(0); return 0; }
@@ -466,7 +466,7 @@ public:
const char *func_name() const { return "time_to_sec"; }
void fix_num_length_and_dec()
{
- maybe_null= true;
+ set_persist_maybe_null(1);
Item_func_seconds_hybrid::fix_num_length_and_dec();
}
bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
@@ -537,7 +537,7 @@ public:
{
store_now_in_TIME(&ltime);
Item_timefunc::fix_length_and_dec();
- maybe_null= false;
+ set_persist_maybe_null(0);
}
bool get_date(MYSQL_TIME *res, ulonglong fuzzy_date);
/*
@@ -619,7 +619,7 @@ public:
{
store_now_in_TIME(&ltime);
Item_temporal_func::fix_length_and_dec();
- maybe_null= false;
+ set_persist_maybe_null(0);
}
bool get_date(MYSQL_TIME *res, ulonglong fuzzy_date);
virtual void store_now_in_TIME(MYSQL_TIME *now_time)=0;
@@ -664,7 +664,7 @@ public:
void update_used_tables()
{
Item_func_now::update_used_tables();
- maybe_null= false;
+ set_persist_maybe_null(0);
used_tables_cache|= RAND_TABLE_BIT;
}
};
@@ -959,7 +959,7 @@ public:
void fix_length_and_dec()
{
decimals=0;
- maybe_null=1;
+ set_persist_maybe_null(1);
}
bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
bool check_vcol_func_processor(uchar *int_arg) { return FALSE;}
@@ -981,7 +981,7 @@ public:
void fix_length_and_dec()
{
decimals=0;
- maybe_null=1;
+ set_persist_maybe_null(1);
}
virtual void print(String *str, enum_query_type query_type);
};
@@ -1003,7 +1003,7 @@ public:
const char *func_name() const { return "get_format"; }
void fix_length_and_dec()
{
- maybe_null= 1;
+ set_persist_maybe_null(1);
decimals=0;
fix_length_and_charset(17, default_charset());
}
diff --git a/sql/item_xmlfunc.cc b/sql/item_xmlfunc.cc
index ae0a74c5ba6..5a824e48b7b 100644
--- a/sql/item_xmlfunc.cc
+++ b/sql/item_xmlfunc.cc
@@ -2604,6 +2604,7 @@ void Item_xml_str_func::fix_length_and_dec()
status_var_increment(current_thd->status_var.feature_xml);
nodeset_func= 0;
+ set_persist_maybe_null(1);
if (agg_arg_charsets_for_comparison(collation, args, arg_count))
return;
diff --git a/sql/item_xmlfunc.h b/sql/item_xmlfunc.h
index 800cf6ed760..3356b4ac902 100644
--- a/sql/item_xmlfunc.h
+++ b/sql/item_xmlfunc.h
@@ -34,14 +34,10 @@ protected:
public:
Item_xml_str_func(Item *a, Item *b):
Item_str_func(a,b)
- {
- maybe_null= TRUE;
- }
+ {}
Item_xml_str_func(Item *a, Item *b, Item *c):
Item_str_func(a,b,c)
- {
- maybe_null= TRUE;
- }
+ {}
void fix_length_and_dec();
String *parse_xml(String *raw_xml, String *parsed_xml_buf);
bool check_vcol_func_processor(uchar *int_arg)
diff --git a/sql/lex.h b/sql/lex.h
index 0af44234fca..101880597d5 100644
--- a/sql/lex.h
+++ b/sql/lex.h
@@ -123,11 +123,10 @@ static SYMBOL symbols[] = {
{ "COLUMN_NAME", SYM(COLUMN_NAME_SYM)},
{ "COLUMNS", SYM(COLUMNS)},
{ "COLUMN_ADD", SYM(COLUMN_ADD_SYM)},
+ { "COLUMN_CHECK", SYM(COLUMN_CHECK_SYM)},
{ "COLUMN_CREATE", SYM(COLUMN_CREATE_SYM)},
{ "COLUMN_DELETE", SYM(COLUMN_DELETE_SYM)},
- { "COLUMN_EXISTS", SYM(COLUMN_EXISTS_SYM)},
{ "COLUMN_GET", SYM(COLUMN_GET_SYM)},
- { "COLUMN_LIST", SYM(COLUMN_LIST_SYM)},
{ "COMMENT", SYM(COMMENT_SYM)},
{ "COMMIT", SYM(COMMIT_SYM)},
{ "COMMITTED", SYM(COMMITTED_SYM)},
diff --git a/sql/log.cc b/sql/log.cc
index 1813120dd81..254449da05a 100644
--- a/sql/log.cc
+++ b/sql/log.cc
@@ -1,5 +1,5 @@
/* Copyright (c) 2000, 2011, Oracle and/or its affiliates.
- Copyright (c) 2010-2011 Monty Program Ab
+ Copyright (c) 2009, 2013, Monty Program Ab
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -1552,10 +1552,7 @@ binlog_trans_log_savepos(THD *thd, my_off_t *pos)
{
DBUG_ENTER("binlog_trans_log_savepos");
DBUG_ASSERT(pos != NULL);
- if (thd_get_ha_data(thd, binlog_hton) == NULL)
- thd->binlog_setup_trx_data();
- binlog_cache_mngr *const cache_mngr=
- (binlog_cache_mngr*) thd_get_ha_data(thd, binlog_hton);
+ binlog_cache_mngr *const cache_mngr= thd->binlog_setup_trx_data();
DBUG_ASSERT(mysql_bin_log.is_open());
*pos= cache_mngr->trx_cache.get_byte_position();
DBUG_PRINT("return", ("*pos: %lu", (ulong) *pos));
@@ -2103,8 +2100,9 @@ static int binlog_savepoint_set(handlerton *hton, THD *thd, void *sv)
DBUG_ENTER("binlog_savepoint_set");
int error= 1;
- String log_query;
- if (log_query.append(STRING_WITH_LEN("SAVEPOINT ")) ||
+ char buf[1024];
+ String log_query(buf, sizeof(buf), &my_charset_bin);
+ if (log_query.copy(STRING_WITH_LEN("SAVEPOINT "), &my_charset_bin) ||
append_identifier(thd, &log_query,
thd->lex->ident.str, thd->lex->ident.length))
DBUG_RETURN(1);
@@ -2142,8 +2140,9 @@ static int binlog_savepoint_rollback(handlerton *hton, THD *thd, void *sv)
if (unlikely(trans_has_updated_non_trans_table(thd) ||
(thd->variables.option_bits & OPTION_KEEP_LOG)))
{
- String log_query;
- if (log_query.append(STRING_WITH_LEN("ROLLBACK TO ")) ||
+ char buf[1024];
+ String log_query(buf, sizeof(buf), &my_charset_bin);
+ if (log_query.copy(STRING_WITH_LEN("ROLLBACK TO "), &my_charset_bin) ||
append_identifier(thd, &log_query,
thd->lex->ident.str, thd->lex->ident.length))
DBUG_RETURN(1);
@@ -4967,14 +4966,14 @@ bool stmt_has_updated_non_trans_table(const THD* thd)
binlog_hton, which has internal linkage.
*/
-int THD::binlog_setup_trx_data()
+binlog_cache_mngr *THD::binlog_setup_trx_data()
{
DBUG_ENTER("THD::binlog_setup_trx_data");
binlog_cache_mngr *cache_mngr=
(binlog_cache_mngr*) thd_get_ha_data(this, binlog_hton);
if (cache_mngr)
- DBUG_RETURN(0); // Already set up
+ DBUG_RETURN(cache_mngr); // Already set up
cache_mngr= (binlog_cache_mngr*) my_malloc(sizeof(binlog_cache_mngr), MYF(MY_ZEROFILL));
if (!cache_mngr ||
@@ -4984,18 +4983,18 @@ int THD::binlog_setup_trx_data()
LOG_PREFIX, binlog_cache_size, MYF(MY_WME)))
{
my_free(cache_mngr);
- DBUG_RETURN(1); // Didn't manage to set it up
+ DBUG_RETURN(0); // Didn't manage to set it up
}
thd_set_ha_data(this, binlog_hton, cache_mngr);
- cache_mngr= new (thd_get_ha_data(this, binlog_hton))
+ cache_mngr= new (cache_mngr)
binlog_cache_mngr(max_binlog_stmt_cache_size,
max_binlog_cache_size,
&binlog_stmt_cache_use,
&binlog_stmt_cache_disk_use,
&binlog_cache_use,
&binlog_cache_disk_use);
- DBUG_RETURN(0);
+ DBUG_RETURN(cache_mngr);
}
/*
@@ -5078,9 +5077,7 @@ binlog_start_consistent_snapshot(handlerton *hton, THD *thd)
int err= 0;
DBUG_ENTER("binlog_start_consistent_snapshot");
- thd->binlog_setup_trx_data();
- binlog_cache_mngr *const cache_mngr=
- (binlog_cache_mngr*) thd_get_ha_data(thd, binlog_hton);
+ binlog_cache_mngr *const cache_mngr= thd->binlog_setup_trx_data();
/* Server layer calls us with LOCK_commit_ordered locked, so this is safe. */
strmake(cache_mngr->last_commit_pos_file, mysql_bin_log.last_commit_pos_file,
@@ -5192,11 +5189,7 @@ THD::binlog_get_pending_rows_event(bool is_transactional) const
void
THD::binlog_set_pending_rows_event(Rows_log_event* ev, bool is_transactional)
{
- if (thd_get_ha_data(this, binlog_hton) == NULL)
- binlog_setup_trx_data();
-
- binlog_cache_mngr *const cache_mngr=
- (binlog_cache_mngr*) thd_get_ha_data(this, binlog_hton);
+ binlog_cache_mngr *const cache_mngr= binlog_setup_trx_data();
DBUG_ASSERT(cache_mngr);
@@ -5275,12 +5268,18 @@ MYSQL_BIN_LOG::flush_and_set_pending_rows_event(THD *thd,
/*
Write pending event to the cache.
*/
+ DBUG_EXECUTE_IF("simulate_disk_full_at_flush_pending",
+ {DBUG_SET("+d,simulate_file_write_error");});
if (pending->write(file))
{
set_write_error(thd, is_transactional);
if (check_write_error(thd) && cache_data &&
stmt_has_updated_non_trans_table(thd))
cache_data->set_incident();
+ delete pending;
+ cache_data->set_pending(NULL);
+ DBUG_EXECUTE_IF("simulate_disk_full_at_flush_pending",
+ {DBUG_SET("-d,simulate_file_write_error");});
DBUG_RETURN(1);
}
@@ -5364,12 +5363,10 @@ bool MYSQL_BIN_LOG::write(Log_event *event_info, my_bool *with_annotate)
}
else
{
- if (thd->binlog_setup_trx_data())
+ binlog_cache_mngr *const cache_mngr= thd->binlog_setup_trx_data();
+ if (!cache_mngr)
goto err;
- binlog_cache_mngr *const cache_mngr=
- (binlog_cache_mngr*) thd_get_ha_data(thd, binlog_hton);
-
is_trans_cache= use_trans_cache(thd, using_trans);
file= cache_mngr->get_binlog_cache_log(is_trans_cache);
cache_data= cache_mngr->get_binlog_cache_data(is_trans_cache);
@@ -6393,8 +6390,6 @@ MYSQL_BIN_LOG::trx_group_commit_leader(group_commit_entry *leader)
DBUG_ENTER("MYSQL_BIN_LOG::trx_group_commit_leader");
LINT_INIT(binlog_id);
- DBUG_ASSERT(is_open());
- if (likely(is_open())) // Should always be true
{
/*
Lock the LOCK_log(), and once we get it, collect any additional writes
@@ -6421,7 +6416,11 @@ MYSQL_BIN_LOG::trx_group_commit_leader(group_commit_entry *leader)
DBUG_ASSERT(leader == queue /* the leader should be first in queue */);
/* Now we have in queue the list of transactions to be committed in order. */
+ }
+ DBUG_ASSERT(is_open());
+ if (likely(is_open())) // Should always be true
+ {
/*
Commit every transaction in the queue.
@@ -7998,8 +7997,9 @@ TC_LOG_BINLOG::log_and_order(THD *thd, my_xid xid, bool all,
int err;
DBUG_ENTER("TC_LOG_BINLOG::log_and_order");
- binlog_cache_mngr *cache_mngr=
- (binlog_cache_mngr*) thd_get_ha_data(thd, binlog_hton);
+ binlog_cache_mngr *cache_mngr= thd->binlog_setup_trx_data();
+ if (!cache_mngr)
+ DBUG_RETURN(0);
cache_mngr->using_xa= TRUE;
cache_mngr->xa_xid= xid;
@@ -8205,8 +8205,9 @@ binlog_background_thread(void *arg __attribute__((unused)))
bool stop;
MYSQL_BIN_LOG::xid_count_per_binlog *queue, *next;
THD *thd;
-
my_thread_init();
+ DBUG_ENTER("binlog_background_thread");
+
thd= new THD;
thd->system_thread= SYSTEM_THREAD_BINLOG_BACKGROUND;
thd->thread_stack= (char*) &thd; /* Set approximate stack start */
@@ -8270,7 +8271,7 @@ binlog_background_thread(void *arg __attribute__((unused)))
mysql_cond_signal(&mysql_bin_log.COND_binlog_background_thread_end);
mysql_mutex_unlock(&mysql_bin_log.LOCK_binlog_background_thread);
- return 0;
+ DBUG_RETURN(0);
}
#ifdef HAVE_PSI_INTERFACE
@@ -8321,7 +8322,7 @@ int TC_LOG_BINLOG::recover(LOG_INFO *linfo, const char *last_log_name,
sizeof(my_xid), 0, 0, MYF(0)))
goto err1;
- init_alloc_root(&mem_root, TC_LOG_PAGE_SIZE, TC_LOG_PAGE_SIZE);
+ init_alloc_root(&mem_root, TC_LOG_PAGE_SIZE, TC_LOG_PAGE_SIZE, MYF(0));
fdle->flags&= ~LOG_EVENT_BINLOG_IN_USE_F; // abort on the first error
@@ -8546,7 +8547,7 @@ static int show_binlog_vars(THD *thd, SHOW_VAR *var, char *buff)
}
static SHOW_VAR binlog_status_vars_top[]= {
- {"binlog", (char *) &show_binlog_vars, SHOW_FUNC},
+ {"Binlog", (char *) &show_binlog_vars, SHOW_FUNC},
{NullS, NullS, SHOW_LONG}
};
diff --git a/sql/log_event.cc b/sql/log_event.cc
index fb9e6b7107f..7de72338d97 100644
--- a/sql/log_event.cc
+++ b/sql/log_event.cc
@@ -1,6 +1,6 @@
/*
Copyright (c) 2000, 2012, Oracle and/or its affiliates.
- Copyright (c) 2010, 2012, Monty Program Ab
+ Copyright (c) 2009, 2013, Monty Program Ab.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -46,7 +46,7 @@
#include "rpl_record.h"
#include "transaction.h"
#include <my_dir.h>
-#include "sql_show.h"
+#include "sql_show.h" // append_identifier
#endif /* MYSQL_CLIENT */
@@ -92,6 +92,23 @@ TYPELIB binlog_checksum_typelib=
*/
#define FMT_G_BUFSIZE(PREC) (3 + (PREC) + 5 + 1)
+/*
+ Explicit instantiation to unsigned int of template available_buffer
+ function.
+*/
+template unsigned int available_buffer<unsigned int>(const char*,
+ const char*,
+ unsigned int);
+
+/*
+ Explicit instantiation to unsigned int of template valid_buffer_range
+ function.
+*/
+template bool valid_buffer_range<unsigned int>(unsigned int,
+ const char*,
+ const char*,
+ unsigned int);
+
/*
replication event checksum is introduced in the following "checksum-home" version.
The checksum-aware servers extract FD's version to decide whether the FD event
@@ -1576,7 +1593,7 @@ Log_event* Log_event::read_log_event(const char* buf, uint event_len,
ev = new Rand_log_event(buf, description_event);
break;
case USER_VAR_EVENT:
- ev = new User_var_log_event(buf, description_event);
+ ev = new User_var_log_event(buf, event_len, description_event);
break;
case FORMAT_DESCRIPTION_EVENT:
ev = new Format_description_log_event(buf, event_len, description_event);
@@ -2301,7 +2318,7 @@ void Rows_log_event::print_verbose(IO_CACHE *file,
for (const uchar *value= m_rows_buf; value < m_rows_end; )
{
size_t length;
- my_b_printf(file, "### %s %s.%s\n",
+ my_b_printf(file, "### %s %`s.%`s\n",
sql_command,
map->get_db_name(), map->get_table_name());
/* Print the first image */
@@ -2467,7 +2484,7 @@ void Query_log_event::pack_info(THD *thd, Protocol *protocol)
{
buf.append(STRING_WITH_LEN("use "));
append_identifier(thd, &buf, db, db_len);
- buf.append("; ");
+ buf.append(STRING_WITH_LEN("; "));
}
if (query && q_len)
buf.append(query, q_len);
@@ -3446,17 +3463,11 @@ void Query_log_event::print_query_header(IO_CACHE* file,
}
else if (db)
{
- /* Room for expand ` to `` + initial/final ` + \0 */
- char buf[FN_REFLEN*2+3];
-
different_db= memcmp(print_event_info->db, db, db_len + 1);
if (different_db)
memcpy(print_event_info->db, db, db_len + 1);
if (db[0] && different_db)
- {
- my_snprintf(buf, sizeof(buf), "%`s", db);
- my_b_printf(file, "use %s%s\n", buf, print_event_info->delimiter);
- }
+ my_b_printf(file, "use %`s%s\n", db, print_event_info->delimiter);
}
end=int10_to_str((long) when, strmov(buff,"SET TIMESTAMP="),10);
@@ -3997,7 +4008,7 @@ Default database: '%s'. Query: '%s'",
{
DBUG_PRINT("info",("error ignored"));
clear_all_errors(thd, const_cast<Relay_log_info*>(rli));
- thd->killed= NOT_KILLED;
+ thd->reset_killed();
}
/*
Other cases: mostly we expected no error and get one.
@@ -5290,7 +5301,7 @@ void Load_log_event::print(FILE* file_arg, PRINT_EVENT_INFO* print_event_info,
}
if (db && db[0] && different_db)
- my_b_printf(&cache, "%suse %s%s\n",
+ my_b_printf(&cache, "%suse %`s%s\n",
commented ? "# " : "",
db, print_event_info->delimiter);
@@ -5342,7 +5353,7 @@ void Load_log_event::print(FILE* file_arg, PRINT_EVENT_INFO* print_event_info,
{
if (i)
my_b_printf(&cache, ",");
- my_b_printf(&cache, "%s", field);
+ my_b_printf(&cache, "%`s", field);
field += field_lens[i] + 1;
}
@@ -6482,19 +6493,35 @@ void User_var_log_event::pack_info(THD *thd, Protocol* protocol)
User_var_log_event::
-User_var_log_event(const char* buf,
+User_var_log_event(const char* buf, uint event_len,
const Format_description_log_event* description_event)
:Log_event(buf, description_event)
#ifndef MYSQL_CLIENT
, deferred(false)
#endif
{
+ bool error= false;
+ const char* buf_start= buf;
/* The Post-Header is empty. The Variable Data part begins immediately. */
const char *start= buf;
buf+= description_event->common_header_len +
description_event->post_header_len[USER_VAR_EVENT-1];
name_len= uint4korr(buf);
name= (char *) buf + UV_NAME_LEN_SIZE;
+
+ /*
+ We don't know yet is_null value, so we must assume that name_len
+ may have the bigger value possible, is_null= True and there is no
+ payload for val.
+ */
+ if (0 == name_len ||
+ !valid_buffer_range<uint>(name_len, buf_start, name,
+ event_len - UV_VAL_IS_NULL))
+ {
+ error= true;
+ goto err;
+ }
+
buf+= UV_NAME_LEN_SIZE + name_len;
is_null= (bool) *buf;
flags= User_var_log_event::UNDEF_F; // defaults to UNDEF_F
@@ -6507,6 +6534,14 @@ User_var_log_event(const char* buf,
}
else
{
+ if (!valid_buffer_range<uint>(UV_VAL_IS_NULL + UV_VAL_TYPE_SIZE
+ + UV_CHARSET_NUMBER_SIZE + UV_VAL_LEN_SIZE,
+ buf_start, buf, event_len))
+ {
+ error= true;
+ goto err;
+ }
+
type= (Item_result) buf[UV_VAL_IS_NULL];
charset_number= uint4korr(buf + UV_VAL_IS_NULL + UV_VAL_TYPE_SIZE);
val_len= uint4korr(buf + UV_VAL_IS_NULL + UV_VAL_TYPE_SIZE +
@@ -6514,6 +6549,12 @@ User_var_log_event(const char* buf,
val= (char *) (buf + UV_VAL_IS_NULL + UV_VAL_TYPE_SIZE +
UV_CHARSET_NUMBER_SIZE + UV_VAL_LEN_SIZE);
+ if (!valid_buffer_range<uint>(val_len, buf_start, val, event_len))
+ {
+ error= true;
+ goto err;
+ }
+
/**
We need to check if this is from an old server
that did not pack information for flags.
@@ -6548,6 +6589,10 @@ User_var_log_event(const char* buf,
val_len);
}
}
+
+err:
+ if (error)
+ name= 0;
}
@@ -6693,8 +6738,9 @@ void User_var_log_event::print(FILE* file, PRINT_EVENT_INFO* print_event_info)
char *hex_str;
CHARSET_INFO *cs;
- if (!(hex_str= (char *)my_alloca(2*val_len+1+2))) // 2 hex digits / byte
- break; // no error, as we are 'void'
+ hex_str= (char *)my_malloc(2*val_len+1+2,MYF(MY_WME)); // 2 hex digits / byte
+ if (!hex_str)
+ return;
str_to_hex(hex_str, val, val_len);
/*
For proper behaviour when mysqlbinlog|mysql, we need to explicitely
@@ -6712,7 +6758,7 @@ void User_var_log_event::print(FILE* file, PRINT_EVENT_INFO* print_event_info)
my_b_printf(&cache, ":=_%s %s COLLATE `%s`%s\n",
cs->csname, hex_str, cs->name,
print_event_info->delimiter);
- my_afree(hex_str);
+ my_free(hex_str);
}
break;
case ROW_RESULT:
@@ -7947,9 +7993,9 @@ void Execute_load_query_log_event::pack_info(THD *thd, Protocol *protocol)
buf.real_alloc(9 + db_len + q_len + 10 + 21);
if (db && db_len)
{
- if (buf.append("use ") ||
+ if (buf.append(STRING_WITH_LEN("use ")) ||
append_identifier(thd, &buf, db, db_len) ||
- buf.append("; "))
+ buf.append(STRING_WITH_LEN("; ")))
return;
}
if (query && q_len && buf.append(query, q_len))
diff --git a/sql/log_event.h b/sql/log_event.h
index dfbefdb359e..ff13cab9cd5 100644
--- a/sql/log_event.h
+++ b/sql/log_event.h
@@ -2740,7 +2740,7 @@ public:
void print(FILE* file, PRINT_EVENT_INFO* print_event_info);
#endif
- User_var_log_event(const char* buf,
+ User_var_log_event(const char* buf, uint event_len,
const Format_description_log_event *description_event);
~User_var_log_event() {}
Log_event_type get_type_code() { return USER_VAR_EVENT;}
@@ -2752,9 +2752,9 @@ public:
and which case the applier adjusts execution path.
*/
bool is_deferred() { return deferred; }
- void set_deferred() { deferred= val; }
+ void set_deferred() { deferred= true; }
#endif
- bool is_valid() const { return 1; }
+ bool is_valid() const { return name != 0; }
private:
#if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION)
diff --git a/sql/log_event_old.cc b/sql/log_event_old.cc
index bd837adc9d9..e9afe474418 100644
--- a/sql/log_event_old.cc
+++ b/sql/log_event_old.cc
@@ -725,7 +725,10 @@ static int find_and_fetch_row(TABLE *table, uchar *key)
int error;
/* We have a key: search the table using the index */
if (!table->file->inited && (error= table->file->ha_index_init(0, FALSE)))
+ {
+ table->file->print_error(error, MYF(0));
DBUG_RETURN(error);
+ }
/*
Don't print debug messages when running valgrind since they can
@@ -858,7 +861,7 @@ static int find_and_fetch_row(TABLE *table, uchar *key)
default:
table->file->print_error(error, MYF(0));
DBUG_PRINT("info", ("Record not found"));
- table->file->ha_rnd_end();
+ (void) table->file->ha_rnd_end();
DBUG_RETURN(error);
}
}
@@ -2410,7 +2413,7 @@ int Old_rows_log_event::find_row(const Relay_log_info *rli)
continue;
DBUG_PRINT("info",("no record matching the given row found"));
table->file->print_error(error, MYF(0));
- table->file->ha_index_end();
+ (void) table->file->ha_index_end();
DBUG_RETURN(error);
}
}
diff --git a/sql/mdl.cc b/sql/mdl.cc
index ce37f10128b..a18df0fede1 100644
--- a/sql/mdl.cc
+++ b/sql/mdl.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2007, 2011, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -1202,7 +1202,7 @@ MDL_wait::timed_wait(THD *thd, struct timespec *abs_timeout,
THD_ENTER_COND(thd, &m_COND_wait_status, &m_LOCK_wait_status,
wait_state_name, & old_stage);
thd_wait_begin(thd, THD_WAIT_META_DATA_LOCK);
- while (!m_wait_status && !thd_killed(thd) &&
+ while (!m_wait_status && !thd->killed &&
wait_result != ETIMEDOUT && wait_result != ETIME)
{
wait_result= mysql_cond_timedwait(&m_COND_wait_status, &m_LOCK_wait_status,
@@ -1224,7 +1224,7 @@ MDL_wait::timed_wait(THD *thd, struct timespec *abs_timeout,
false, which means that the caller intends to restart the
wait.
*/
- if (thd_killed(thd))
+ if (thd->killed)
m_wait_status= KILLED;
else if (set_status_on_timeout)
m_wait_status= TIMEOUT;
@@ -2095,7 +2095,11 @@ MDL_context::acquire_lock(MDL_request *mdl_request, ulong lock_wait_timeout)
*/
m_wait.reset_status();
- if (lock->needs_notification(ticket))
+ /*
+ Don't break conflicting locks if timeout is 0 as 0 is used
+ To check if there is any conflicting locks...
+ */
+ if (lock->needs_notification(ticket) && lock_wait_timeout)
lock->notify_conflicting_locks(this);
mysql_prlock_unlock(&lock->m_rwlock);
@@ -2217,7 +2221,8 @@ bool MDL_context::acquire_locks(MDL_request_list *mdl_requests,
/* Sort requests according to MDL_key. */
if (! (sort_buf= (MDL_request **)my_malloc(req_count *
sizeof(MDL_request*),
- MYF(MY_WME))))
+ MYF(MY_WME |
+ MY_THREAD_SPECIFIC))))
DBUG_RETURN(TRUE);
for (p_req= sort_buf; p_req < sort_buf + req_count; p_req++)
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 2507b29baca..75c4094324b 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -713,8 +713,8 @@ char *opt_logname, *opt_slow_logname, *opt_bin_logname;
static volatile sig_atomic_t kill_in_progress;
my_bool opt_stack_trace;
-my_bool opt_expect_abort= 0;
-static my_bool opt_bootstrap, opt_myisam_log;
+my_bool opt_expect_abort= 0, opt_bootstrap= 0;
+static my_bool opt_myisam_log;
static int cleanup_done;
static ulong opt_specialflag;
static char *opt_binlog_index_name;
@@ -1150,7 +1150,7 @@ private:
void Buffered_logs::init()
{
- init_alloc_root(&m_root, 1024, 0);
+ init_alloc_root(&m_root, 1024, 0, MYF(0));
}
void Buffered_logs::cleanup()
@@ -1788,6 +1788,7 @@ extern "C" void unireg_abort(int exit_code)
static void mysqld_exit(int exit_code)
{
+ DBUG_ENTER("mysqld_exit");
/*
Important note: we wait for the signal thread to end,
but if a kill -15 signal was sent, the signal thread did
@@ -1801,6 +1802,7 @@ static void mysqld_exit(int exit_code)
#ifdef WITH_PERFSCHEMA_STORAGE_ENGINE
shutdown_performance_schema();
#endif
+ DBUG_LEAVE;
exit(exit_code); /* purecov: inspected */
}
@@ -2519,9 +2521,13 @@ void unlink_thd(THD *thd)
sync feature has been shut down at this point.
*/
DBUG_EXECUTE_IF("sleep_after_lock_thread_count_before_delete_thd", sleep(5););
+ /*
+ We must delete thd inside the lock to ensure that we don't start cleanup
+ before THD is deleted
+ */
+ delete thd;
mysql_mutex_unlock(&LOCK_thread_count);
- delete thd;
DBUG_VOID_RETURN;
}
@@ -2623,7 +2629,7 @@ bool one_thread_per_connection_end(THD *thd, bool put_in_cache)
DBUG_ENTER("one_thread_per_connection_end");
unlink_thd(thd);
/* Mark that current_thd is not valid anymore */
- my_pthread_setspecific_ptr(THR_THD, 0);
+ set_current_thd(0);
if (put_in_cache)
{
mysql_mutex_lock(&LOCK_thread_count);
@@ -2635,9 +2641,10 @@ bool one_thread_per_connection_end(THD *thd, bool put_in_cache)
/* It's safe to broadcast outside a lock (COND... is not deleted here) */
DBUG_PRINT("signal", ("Broadcasting COND_thread_count"));
+ mysql_cond_broadcast(&COND_thread_count);
+
DBUG_LEAVE; // Must match DBUG_ENTER()
my_thread_end();
- mysql_cond_broadcast(&COND_thread_count);
pthread_exit(0);
return 0; // Avoid compiler warnings
@@ -3170,9 +3177,9 @@ void my_message_sql(uint error, const char *str, myf MyFlags)
THD *thd= current_thd;
MYSQL_ERROR::enum_warning_level level;
sql_print_message_func func;
-
DBUG_ENTER("my_message_sql");
- DBUG_PRINT("error", ("error: %u message: '%s' Flag: %d", error, str, MyFlags));
+ DBUG_PRINT("error", ("error: %u message: '%s' Flag: %lu", error, str,
+ MyFlags));
DBUG_ASSERT(str != NULL);
DBUG_ASSERT(error != 0);
@@ -3458,6 +3465,7 @@ SHOW_VAR com_status_vars[]= {
{NullS, NullS, SHOW_LONG}
};
+
#ifdef HAVE_PSI_STATEMENT_INTERFACE
PSI_statement_info sql_statement_info[(uint) SQLCOM_END + 1];
PSI_statement_info com_statement_info[(uint) COM_END + 1];
@@ -3520,14 +3528,69 @@ void init_com_statement_info()
#endif
+#ifdef SAFEMALLOC
+/*
+ Return the id for the current THD, to allow safemalloc to associate
+ the memory with the right id.
+*/
+
+extern "C" my_thread_id mariadb_dbug_id()
+{
+ THD *thd;
+ if ((thd= current_thd))
+ {
+ return thd->thread_id;
+ }
+ return my_thread_dbug_id();
+}
+#endif /* SAFEMALLOC */
+
+/* Thread Mem Usage By P.Linux */
+extern "C" {
+static void my_malloc_size_cb_func(long long size, my_bool is_thread_specific)
+{
+ /* If thread specific memory */
+ if (is_thread_specific)
+ {
+ THD *thd= current_thd;
+ if (mysqld_server_initialized || thd)
+ {
+ /*
+ THD may not be set if we are called from my_net_init() before THD
+ thread has started.
+ However, this should never happen, so better to assert and
+ fix this.
+ */
+ DBUG_ASSERT(thd);
+ if (thd)
+ {
+ DBUG_PRINT("info", ("memory_used: %lld size: %lld",
+ (longlong) thd->status_var.memory_used, size));
+ thd->status_var.memory_used+= size;
+ DBUG_ASSERT((longlong) thd->status_var.memory_used >= 0);
+ }
+ }
+ }
+ // workaround for gcc 4.2.4-1ubuntu4 -fPIE (from DEB_BUILD_HARDENING=1)
+ int64 volatile * volatile ptr=&global_status_var.memory_used;
+ my_atomic_add64(ptr, size);
+}
+}
+
+
static int init_common_variables()
{
umask(((~my_umask) & 0666));
my_decimal_set_zero(&decimal_zero); // set decimal_zero constant;
+ set_malloc_size_cb(my_malloc_size_cb_func);
+
tzset(); // Set tzname
sf_leaking_memory= 0; // no memory leaks from now on
+#ifdef SAFEMALLOC
+ sf_malloc_dbug_id= mariadb_dbug_id;
+#endif
max_system_variables.pseudo_thread_id= (ulong)~0;
server_start_time= flush_status_time= my_time(0);
@@ -3992,6 +4055,7 @@ You should consider changing lower_case_table_names to 1 or 2",
static int init_thread_environment()
{
+ DBUG_ENTER("init_thread_environment");
mysql_mutex_init(key_LOCK_thread_count, &LOCK_thread_count, MY_MUTEX_INIT_FAST);
mysql_mutex_init(key_LOCK_status, &LOCK_status, MY_MUTEX_INIT_FAST);
mysql_mutex_init(key_LOCK_delayed_insert,
@@ -4069,9 +4133,9 @@ static int init_thread_environment()
pthread_key_create(&THR_MALLOC,NULL))
{
sql_print_error("Can't create thread-keys");
- return 1;
+ DBUG_RETURN(1);
}
- return 0;
+ DBUG_RETURN(0);
}
@@ -4736,6 +4800,7 @@ static void test_lc_time_sz()
}
#endif//DBUG_OFF
+
#ifdef __WIN__
int win_main(int argc, char **argv)
#else
@@ -4748,6 +4813,8 @@ int mysqld_main(int argc, char **argv)
*/
my_progname= argv[0];
sf_leaking_memory= 1; // no safemalloc memory leak reports if we exit early
+ mysqld_server_started= mysqld_server_initialized= 0;
+
#ifdef HAVE_NPTL
ld_assume_kernel_is_set= (getenv("LD_ASSUME_KERNEL") != 0);
#endif
@@ -4760,7 +4827,6 @@ int mysqld_main(int argc, char **argv)
}
#endif
- mysqld_server_started= mysqld_server_initialized= 0;
orig_argc= argc;
orig_argv= argv;
my_getopt_use_args_separator= TRUE;
@@ -4790,7 +4856,7 @@ int mysqld_main(int argc, char **argv)
my_getopt_skip_unknown= TRUE;
/* prepare all_early_options array */
- my_init_dynamic_array(&all_early_options, sizeof(my_option), 100, 25);
+ my_init_dynamic_array(&all_early_options, sizeof(my_option), 100, 25, MYF(0));
sys_var_add_options(&all_early_options, sys_var::PARSE_EARLY);
add_terminator(&all_early_options);
@@ -5060,8 +5126,6 @@ int mysqld_main(int argc, char **argv)
if (Events::init(opt_noacl || opt_bootstrap))
unireg_abort(1);
- mysqld_server_initialized= 1;
-
if (opt_bootstrap)
{
select_thread_in_use= 0; // Allow 'kill' to work
@@ -5075,6 +5139,9 @@ int mysqld_main(int argc, char **argv)
}
}
+ /* It's now safe to use thread specific memory */
+ mysqld_server_initialized= 1;
+
create_shutdown_thread();
start_handle_manager();
@@ -5104,7 +5171,6 @@ int mysqld_main(int argc, char **argv)
Service.SetRunning();
#endif
-
/* Signal threads waiting for server to be started */
mysql_mutex_lock(&LOCK_server_started);
mysqld_server_started= 1;
@@ -5391,7 +5457,7 @@ static void bootstrap(MYSQL_FILE *file)
THD *thd= new THD;
thd->bootstrap=1;
- my_net_init(&thd->net,(st_vio*) 0);
+ my_net_init(&thd->net,(st_vio*) 0, MYF(0));
thd->max_client_packet_length= thd->net.max_packet;
thd->security_ctx->master_access= ~(ulong)0;
thd->thread_id= thd->variables.pseudo_thread_id= thread_id++;
@@ -5479,7 +5545,7 @@ void create_thread_to_handle_connection(THD *thd)
if (cached_thread_count > wake_thread)
{
/* Get thread from cache */
- thread_cache.append(thd);
+ thread_cache.push_back(thd);
wake_thread++;
mysql_cond_signal(&COND_thread_cache);
}
@@ -5818,12 +5884,16 @@ void handle_connections_sockets()
** Don't allow too many connections
*/
+ DBUG_PRINT("info", ("Creating THD for new connection"));
if (!(thd= new THD))
{
(void) mysql_socket_shutdown(new_sock, SHUT_RDWR);
(void) mysql_socket_close(new_sock);
continue;
}
+ /* Set to get io buffers to be part of THD */
+ set_current_thd(thd);
+
is_unix_sock= (mysql_socket_getfd(sock) ==
mysql_socket_getfd(unix_sock));
@@ -5831,7 +5901,7 @@ void handle_connections_sockets()
mysql_socket_vio_new(new_sock,
is_unix_sock ? VIO_TYPE_SOCKET : VIO_TYPE_TCPIP,
is_unix_sock ? VIO_LOCALHOST: 0)) ||
- my_net_init(&thd->net, vio_tmp))
+ my_net_init(&thd->net, vio_tmp, MYF(MY_THREAD_SPECIFIC)))
{
/*
Only delete the temporary vio if we didn't already attach it to the
@@ -5846,6 +5916,7 @@ void handle_connections_sockets()
(void) mysql_socket_close(new_sock);
}
delete thd;
+ set_current_thd(0);
continue;
}
@@ -5859,6 +5930,7 @@ void handle_connections_sockets()
thd->scheduler= extra_thread_scheduler;
}
create_new_thread(thd);
+ set_current_thd(0);
}
DBUG_VOID_RETURN;
}
@@ -5952,16 +6024,19 @@ pthread_handler_t handle_connections_namedpipes(void *arg)
CloseHandle(hConnectedPipe);
continue;
}
+ set_current_thd(thd);
if (!(thd->net.vio= vio_new_win32pipe(hConnectedPipe)) ||
- my_net_init(&thd->net, thd->net.vio))
+ my_net_init(&thd->net, thd->net.vio, MYF(MY_THREAD_SPECIFIC)))
{
close_connection(thd, ER_OUT_OF_RESOURCES);
delete thd;
+ set_current_thd(0);
continue;
}
/* Host is unknown */
thd->security_ctx->host= my_strdup(my_localhost, MYF(0));
create_new_thread(thd);
+ set_current_thd(0);
}
CloseHandle(connectOverlapped.hEvent);
DBUG_LEAVE;
@@ -6141,6 +6216,7 @@ pthread_handler_t handle_connections_shared_memory(void *arg)
errmsg= "Could not set client to read mode";
goto errorconn;
}
+ set_current_thd(thd);
if (!(thd->net.vio= vio_new_win32shared_memory(handle_client_file_map,
handle_client_map,
event_client_wrote,
@@ -6148,7 +6224,7 @@ pthread_handler_t handle_connections_shared_memory(void *arg)
event_server_wrote,
event_server_read,
event_conn_closed)) ||
- my_net_init(&thd->net, thd->net.vio))
+ my_net_init(&thd->net, thd->net.vio, MYF(MY_THREAD_SPECIFIC)))
{
close_connection(thd, ER_OUT_OF_RESOURCES);
errmsg= 0;
@@ -6157,6 +6233,7 @@ pthread_handler_t handle_connections_shared_memory(void *arg)
thd->security_ctx->host= my_strdup(my_localhost, MYF(0)); /* Host is unknown */
create_new_thread(thd);
connect_number++;
+ set_current_thd(thd);
continue;
errorconn:
@@ -6184,6 +6261,7 @@ errorconn:
CloseHandle(event_conn_closed);
delete thd;
}
+ set_current_thd(0);
/* End shared memory handling */
error:
@@ -7256,6 +7334,7 @@ SHOW_VAR status_vars[]= {
{"Key", (char*) &show_default_keycache, SHOW_FUNC},
{"Last_query_cost", (char*) offsetof(STATUS_VAR, last_query_cost), SHOW_DOUBLE_STATUS},
{"Max_used_connections", (char*) &max_used_connections, SHOW_LONG},
+ {"Memory_used", (char*) offsetof(STATUS_VAR, memory_used), SHOW_LONGLONG_STATUS},
{"Not_flushed_delayed_rows", (char*) &delayed_rows_in_use, SHOW_LONG_NOFLUSH},
{"Open_files", (char*) &my_file_opened, SHOW_LONG_NOFLUSH},
{"Open_streams", (char*) &my_stream_opened, SHOW_LONG_NOFLUSH},
@@ -7404,7 +7483,7 @@ static int option_cmp(my_option *a, my_option *b)
static void print_help()
{
MEM_ROOT mem_root;
- init_alloc_root(&mem_root, 4096, 4096);
+ init_alloc_root(&mem_root, 4096, 4096, MYF(0));
pop_dynamic(&all_options);
sys_var_add_options(&all_options, sys_var::PARSE_EARLY);
@@ -8168,7 +8247,7 @@ static int get_options(int *argc_ptr, char ***argv_ptr)
/* prepare all_options array */
my_init_dynamic_array(&all_options, sizeof(my_option),
array_elements(my_long_options),
- array_elements(my_long_options)/4);
+ array_elements(my_long_options)/4, MYF(0));
for (my_option *opt= my_long_options;
opt < my_long_options + array_elements(my_long_options) - 1;
opt++)
@@ -8670,7 +8749,7 @@ void refresh_status(THD *thd)
add_to_status(&global_status_var, &thd->status_var);
/* Reset thread's status variables */
- bzero((uchar*) &thd->status_var, sizeof(thd->status_var));
+ thd->set_status_var_init();
bzero((uchar*) &thd->org_status_var, sizeof(thd->org_status_var));
thd->start_bytes_received= 0;
diff --git a/sql/mysqld.h b/sql/mysqld.h
index e0efbe60390..716423f9bd2 100644
--- a/sql/mysqld.h
+++ b/sql/mysqld.h
@@ -78,7 +78,7 @@ extern CHARSET_INFO *character_set_filesystem;
extern MY_BITMAP temp_pool;
extern bool opt_large_files, server_id_supplied;
extern bool opt_update_log, opt_bin_log, opt_error_log;
-extern my_bool opt_log, opt_slow_log;
+extern my_bool opt_log, opt_slow_log, opt_bootstrap;
extern my_bool opt_backup_history_log;
extern my_bool opt_backup_progress_log;
extern ulonglong log_output_options;
@@ -670,6 +670,10 @@ inline THD *_current_thd(void)
}
#endif
#define current_thd _current_thd()
+inline int set_current_thd(THD *thd)
+{
+ return my_pthread_setspecific_ptr(THR_THD, thd);
+}
/*
@todo remove, make it static in ha_maria.cc
diff --git a/sql/net_serv.cc b/sql/net_serv.cc
index 7e9425f51f2..b6890ab9fda 100644
--- a/sql/net_serv.cc
+++ b/sql/net_serv.cc
@@ -124,14 +124,15 @@ static my_bool net_write_buff(NET *, const uchar *, ulong);
/** Init with packet info. */
-my_bool my_net_init(NET *net, Vio* vio)
+my_bool my_net_init(NET *net, Vio* vio, uint my_flags)
{
DBUG_ENTER("my_net_init");
+ DBUG_PRINT("enter", ("my_flags: %u", my_flags));
net->vio = vio;
my_net_local_init(net); /* Set some limits */
if (!(net->buff=(uchar*) my_malloc((size_t) net->max_packet+
NET_HEADER_SIZE + COMP_HEADER_SIZE +1,
- MYF(MY_WME))))
+ MYF(MY_WME | my_flags))))
DBUG_RETURN(1);
net->buff_end=net->buff+net->max_packet;
net->error=0; net->return_status=0;
@@ -143,6 +144,7 @@ my_bool my_net_init(NET *net, Vio* vio)
net->net_skip_rest_factor= 0;
net->last_errno=0;
net->unused= 0;
+ net->thread_specific_malloc= test(my_flags & MY_THREAD_SPECIFIC);
#ifdef MYSQL_SERVER
net->extension= NULL;
#endif
@@ -201,7 +203,9 @@ my_bool net_realloc(NET *net, size_t length)
*/
if (!(buff= (uchar*) my_realloc((char*) net->buff, pkt_length +
NET_HEADER_SIZE + COMP_HEADER_SIZE + 1,
- MYF(MY_WME))))
+ MYF(MY_WME |
+ (net->thread_specific_malloc ?
+ MY_THREAD_SPECIFIC : 0)))))
{
/* @todo: 1 and 2 codes are identical. */
net->error= 1;
@@ -613,7 +617,10 @@ net_real_write(NET *net,const uchar *packet, size_t len)
uchar *b;
uint header_length=NET_HEADER_SIZE+COMP_HEADER_SIZE;
if (!(b= (uchar*) my_malloc(len + NET_HEADER_SIZE +
- COMP_HEADER_SIZE + 1, MYF(MY_WME))))
+ COMP_HEADER_SIZE + 1,
+ MYF(MY_WME |
+ (net->thread_specific_malloc ?
+ MY_THREAD_SPECIFIC : 0)))))
{
net->error= 2;
net->last_errno= ER_OUT_OF_RESOURCES;
diff --git a/sql/opt_range.cc b/sql/opt_range.cc
index 72eb8460496..2205d2fcab4 100644
--- a/sql/opt_range.cc
+++ b/sql/opt_range.cc
@@ -117,6 +117,7 @@
#include "records.h" // init_read_record, end_read_record
#include <m_ctype.h>
#include "sql_select.h"
+#include "filesort.h" // filesort_free_buffers
#ifndef EXTRA_DEBUG
#define test_rb_tree(A,B) {}
@@ -1772,7 +1773,8 @@ QUICK_RANGE_SELECT::QUICK_RANGE_SELECT(THD *thd, TABLE *table, uint key_nr,
index= key_nr;
head= table;
key_part_info= head->key_info[index].key_part;
- my_init_dynamic_array(&ranges, sizeof(QUICK_RANGE*), 16, 16);
+ my_init_dynamic_array(&ranges, sizeof(QUICK_RANGE*), 16, 16,
+ MYF(MY_THREAD_SPECIFIC));
/* 'thd' is not accessible in QUICK_RANGE_SELECT::reset(). */
mrr_buf_size= thd->variables.mrr_buff_size;
@@ -1781,7 +1783,8 @@ QUICK_RANGE_SELECT::QUICK_RANGE_SELECT(THD *thd, TABLE *table, uint key_nr,
if (!no_alloc && !parent_alloc)
{
// Allocates everything through the internal memroot
- init_sql_alloc(&alloc, thd->variables.range_alloc_block_size, 0);
+ init_sql_alloc(&alloc, thd->variables.range_alloc_block_size, 0,
+ MYF(MY_THREAD_SPECIFIC));
thd->mem_root= &alloc;
}
else
@@ -1791,7 +1794,7 @@ QUICK_RANGE_SELECT::QUICK_RANGE_SELECT(THD *thd, TABLE *table, uint key_nr,
/* Allocate a bitmap for used columns (Q: why not on MEM_ROOT?) */
if (!(bitmap= (my_bitmap_map*) my_malloc(head->s->column_bitmap_size,
- MYF(MY_WME))))
+ MYF(MY_WME | MY_THREAD_SPECIFIC))))
{
column_bitmap.bitmap= 0;
*create_error= 1;
@@ -1876,7 +1879,8 @@ QUICK_INDEX_SORT_SELECT::QUICK_INDEX_SORT_SELECT(THD *thd_param,
index= MAX_KEY;
head= table;
bzero(&read_record, sizeof(read_record));
- init_sql_alloc(&alloc, thd->variables.range_alloc_block_size, 0);
+ init_sql_alloc(&alloc, thd->variables.range_alloc_block_size, 0,
+ MYF(MY_THREAD_SPECIFIC));
DBUG_VOID_RETURN;
}
@@ -1889,7 +1893,8 @@ int QUICK_INDEX_SORT_SELECT::init()
int QUICK_INDEX_SORT_SELECT::reset()
{
DBUG_ENTER("QUICK_INDEX_SORT_SELECT::reset");
- DBUG_RETURN(read_keys_and_merge());
+ const int retval= read_keys_and_merge();
+ DBUG_RETURN(retval);
}
bool
@@ -1946,7 +1951,8 @@ QUICK_ROR_INTERSECT_SELECT::QUICK_ROR_INTERSECT_SELECT(THD *thd_param,
head= table;
record= head->record[0];
if (!parent_alloc)
- init_sql_alloc(&alloc, thd->variables.range_alloc_block_size, 0);
+ init_sql_alloc(&alloc, thd->variables.range_alloc_block_size, 0,
+ MYF(MY_THREAD_SPECIFIC));
else
bzero(&alloc, sizeof(MEM_ROOT));
last_rowid= (uchar*) alloc_root(parent_alloc? parent_alloc : &alloc,
@@ -2140,8 +2146,9 @@ int QUICK_ROR_INTERSECT_SELECT::init_ror_merged_scan(bool reuse_handler)
There is no use of this->file. Use it for the first of merged range
selects.
*/
- if (quick->init_ror_merged_scan(TRUE))
- DBUG_RETURN(1);
+ int error= quick->init_ror_merged_scan(TRUE);
+ if (error)
+ DBUG_RETURN(error);
quick->file->extra(HA_EXTRA_KEYREAD_PRESERVE_FIELDS);
}
while ((cur= quick_it++))
@@ -2244,7 +2251,8 @@ QUICK_ROR_UNION_SELECT::QUICK_ROR_UNION_SELECT(THD *thd_param,
head= table;
rowid_length= table->file->ref_length;
record= head->record[0];
- init_sql_alloc(&alloc, thd->variables.range_alloc_block_size, 0);
+ init_sql_alloc(&alloc, thd->variables.range_alloc_block_size, 0,
+ MYF(MY_THREAD_SPECIFIC));
thd_param->mem_root= &alloc;
}
@@ -2334,8 +2342,8 @@ int QUICK_ROR_UNION_SELECT::reset()
List_iterator_fast<QUICK_SELECT_I> it(quick_selects);
while ((quick= it++))
{
- if (quick->reset())
- DBUG_RETURN(1);
+ if ((error= quick->reset()))
+ DBUG_RETURN(error);
if ((error= quick->get_next()))
{
if (error == HA_ERR_END_OF_FILE)
@@ -2346,10 +2354,10 @@ int QUICK_ROR_UNION_SELECT::reset()
queue_insert(&queue, (uchar*)quick);
}
- if (head->file->ha_rnd_init_with_error(1))
+ if ((error= head->file->ha_rnd_init(1)))
{
DBUG_PRINT("error", ("ROR index_merge rnd_init call failed"));
- DBUG_RETURN(1);
+ DBUG_RETURN(error);
}
DBUG_RETURN(0);
@@ -2978,7 +2986,8 @@ int SQL_SELECT::test_quick_select(THD *thd, key_map keys_to_use,
param.force_default_mrr= ordered_output;
thd->no_errors=1; // Don't warn about NULL
- init_sql_alloc(&alloc, thd->variables.range_alloc_block_size, 0);
+ init_sql_alloc(&alloc, thd->variables.range_alloc_block_size, 0,
+ MYF(MY_THREAD_SPECIFIC));
if (!(param.key_parts=
(KEY_PART*) alloc_root(&alloc,
sizeof(KEY_PART) *
@@ -3423,7 +3432,8 @@ bool prune_partitions(THD *thd, TABLE *table, Item *pprune_cond)
my_bitmap_map *old_sets[2];
prune_param.part_info= part_info;
- init_sql_alloc(&alloc, thd->variables.range_alloc_block_size, 0);
+ init_sql_alloc(&alloc, thd->variables.range_alloc_block_size, 0,
+ MYF(MY_THREAD_SPECIFIC));
range_par->mem_root= &alloc;
range_par->old_root= thd->mem_root;
@@ -10615,7 +10625,10 @@ int read_keys_and_merge_scans(THD *thd,
*unique_ptr= unique;
}
else
+ {
unique->reset();
+ filesort_free_buffers(head, false);
+ }
DBUG_ASSERT(file->ref_length == unique->get_size());
DBUG_ASSERT(thd->variables.sortbuff_size == unique->get_max_in_memory_size());
@@ -10774,6 +10787,13 @@ int QUICK_INDEX_INTERSECT_SELECT::get_next()
If a Clustered PK scan is present, it is used only to check if row
satisfies its condition (and never used for row retrieval).
+ Locking: to ensure that exclusive locks are only set on records that
+ are included in the final result we must release the lock
+ on all rows we read but do not include in the final result. This
+ must be done on each index that reads the record and the lock
+ must be released using the same handler (the same quick object) as
+ used when reading the record.
+
RETURN
0 - Ok
other - Error code if any error occurred.
@@ -10784,6 +10804,12 @@ int QUICK_ROR_INTERSECT_SELECT::get_next()
List_iterator_fast<QUICK_SELECT_WITH_RECORD> quick_it(quick_selects);
QUICK_SELECT_WITH_RECORD *qr;
QUICK_RANGE_SELECT* quick;
+
+ /* quick that reads the given rowid first. This is needed in order
+ to be able to unlock the row using the same handler object that locked
+ it */
+ QUICK_RANGE_SELECT* quick_with_last_rowid;
+
int error, cmp;
uint last_rowid_count=0;
DBUG_ENTER("QUICK_ROR_INTERSECT_SELECT::get_next");
@@ -10797,7 +10823,10 @@ int QUICK_ROR_INTERSECT_SELECT::get_next()
if (cpk_quick)
{
while (!error && !cpk_quick->row_in_ranges())
+ {
+ quick->file->unlock_row(); /* row not in range; unlock */
error= quick->get_next();
+ }
}
if (error)
DBUG_RETURN(error);
@@ -10809,6 +10838,7 @@ int QUICK_ROR_INTERSECT_SELECT::get_next()
quick->file->position(quick->record);
memcpy(last_rowid, quick->file->ref, head->file->ref_length);
last_rowid_count= 1;
+ quick_with_last_rowid= quick;
while (last_rowid_count < quick_selects.elements)
{
@@ -10822,9 +10852,17 @@ int QUICK_ROR_INTERSECT_SELECT::get_next()
do
{
if ((error= quick->get_next()))
+ {
+ quick_with_last_rowid->file->unlock_row();
DBUG_RETURN(error);
+ }
quick->file->position(quick->record);
cmp= head->file->cmp_ref(quick->file->ref, last_rowid);
+ if (cmp < 0)
+ {
+ /* This row is being skipped. Release lock on it. */
+ quick->file->unlock_row();
+ }
} while (cmp < 0);
key_copy(qr->key_tuple, record, head->key_info + quick->index,
@@ -10838,13 +10876,19 @@ int QUICK_ROR_INTERSECT_SELECT::get_next()
{
while (!cpk_quick->row_in_ranges())
{
+ quick->file->unlock_row(); /* row not in range; unlock */
if ((error= quick->get_next()))
+ {
+ quick_with_last_rowid->file->unlock_row();
DBUG_RETURN(error);
+ }
}
quick->file->position(quick->record);
}
memcpy(last_rowid, quick->file->ref, head->file->ref_length);
+ quick_with_last_rowid->file->unlock_row();
last_rowid_count= 1;
+ quick_with_last_rowid= quick;
//save the fields here
key_copy(qr->key_tuple, record, head->key_info + quick->index,
@@ -10971,8 +11015,13 @@ int QUICK_RANGE_SELECT::reset()
if (file->inited == handler::NONE)
{
+ DBUG_EXECUTE_IF("bug14365043_2",
+ DBUG_SET("+d,ha_index_init_fail"););
if ((error= file->ha_index_init(index,1)))
- goto err;
+ {
+ file->print_error(error, MYF(0));
+ goto err;
+ }
}
/* Allocate buffer if we need one but haven't allocated it yet */
@@ -11014,7 +11063,7 @@ err:
/* Restore bitmaps set on entry */
if (in_ror_merged_scan)
head->column_bitmaps_set_no_signal(save_read_set, save_write_set);
-
+
DBUG_RETURN(error);
}
@@ -12882,7 +12931,8 @@ QUICK_GROUP_MIN_MAX_SELECT(TABLE *table, JOIN *join_arg, bool have_min_arg,
DBUG_ASSERT(!parent_alloc);
if (!parent_alloc)
{
- init_sql_alloc(&alloc, join->thd->variables.range_alloc_block_size, 0);
+ init_sql_alloc(&alloc, join->thd->variables.range_alloc_block_size, 0,
+ MYF(MY_THREAD_SPECIFIC));
join->thd->mem_root= &alloc;
}
else
@@ -12937,7 +12987,8 @@ int QUICK_GROUP_MIN_MAX_SELECT::init()
if (min_max_arg_part)
{
- if (my_init_dynamic_array(&min_max_ranges, sizeof(QUICK_RANGE*), 16, 16))
+ if (my_init_dynamic_array(&min_max_ranges, sizeof(QUICK_RANGE*), 16, 16,
+ MYF(MY_THREAD_SPECIFIC)))
return 1;
if (have_min)
@@ -13183,7 +13234,10 @@ int QUICK_GROUP_MIN_MAX_SELECT::reset(void)
head->enable_keyread(); /* We need only the key attributes */
}
if ((result= file->ha_index_init(index,1)))
+ {
+ head->file->print_error(result, MYF(0));
DBUG_RETURN(result);
+ }
if (quick_prefix_select && quick_prefix_select->reset())
DBUG_RETURN(1);
result= file->ha_index_last(record);
@@ -13358,9 +13412,10 @@ int QUICK_GROUP_MIN_MAX_SELECT::next_min()
*/
if (min_max_arg_part && min_max_arg_part->field->is_null())
{
+ uchar *tmp_key_buff= (uchar*)my_alloca(max_used_key_length);
/* Find the first subsequent record without NULL in the MIN/MAX field. */
- key_copy(tmp_record, record, index_info, max_used_key_length);
- result= file->ha_index_read_map(record, tmp_record,
+ key_copy(tmp_key_buff, record, index_info, max_used_key_length);
+ result= file->ha_index_read_map(record, tmp_key_buff,
make_keypart_map(real_key_parts),
HA_READ_AFTER_KEY);
/*
@@ -13376,10 +13431,11 @@ int QUICK_GROUP_MIN_MAX_SELECT::next_min()
if (!result)
{
if (key_cmp(index_info->key_part, group_prefix, real_prefix_len))
- key_restore(record, tmp_record, index_info, 0);
+ key_restore(record, tmp_key_buff, index_info, 0);
}
else if (result == HA_ERR_KEY_NOT_FOUND || result == HA_ERR_END_OF_FILE)
result= 0; /* There is a result in any case. */
+ my_afree(tmp_key_buff);
}
}
diff --git a/sql/opt_range_mrr.cc b/sql/opt_range_mrr.cc
index a4345059f85..1f4e36178db 100644
--- a/sql/opt_range_mrr.cc
+++ b/sql/opt_range_mrr.cc
@@ -248,6 +248,7 @@ walk_up_n_right:
/* Here minimum contains also function code bits, and maximum is +inf */
range->start_key.key= seq->param->min_key;
range->start_key.length= min_key_length;
+ range->start_key.keypart_map= make_prev_keypart_map(cur->min_key_parts);
range->start_key.flag= (ha_rkey_function) (cur->min_key_flag ^ GEOM_FLAG);
}
else
diff --git a/sql/opt_subselect.cc b/sql/opt_subselect.cc
index da7d3dff74d..8cd4ba08ff3 100644
--- a/sql/opt_subselect.cc
+++ b/sql/opt_subselect.cc
@@ -853,8 +853,7 @@ bool subquery_types_allow_materialization(Item_in_subselect *in_subs)
create a blob column because item->max_length is too big.
The following check is copied from Item::make_string_field():
*/
- if (inner->max_length / inner->collation.collation->mbmaxlen >
- CONVERT_IF_BIGGER_TO_BLOB)
+ if (inner->too_big_for_varchar())
{
DBUG_RETURN(FALSE);
}
@@ -3868,11 +3867,12 @@ SJ_TMP_TABLE::create_sj_weedout_tmp_table(THD *thd)
fn_format(path, path, mysql_tmpdir, "", MY_REPLACE_EXT|MY_UNPACK_FILENAME);
/* STEP 2: Figure if we'll be using a key or blob+constraint */
+ /* it always has my_charset_bin, so mbmaxlen==1 */
if (uniq_tuple_length_arg >= CONVERT_IF_BIGGER_TO_BLOB)
using_unique_constraint= TRUE;
/* STEP 3: Allocate memory for temptable description */
- init_sql_alloc(&own_root, TABLE_ALLOC_BLOCK_SIZE, 0);
+ init_sql_alloc(&own_root, TABLE_ALLOC_BLOCK_SIZE, 0, MYF(MY_THREAD_SPECIFIC));
if (!multi_alloc_root(&own_root,
&table, sizeof(*table),
&share, sizeof(*share),
diff --git a/sql/protocol.cc b/sql/protocol.cc
index 3af7dc88b88..f6e9e9e62e1 100644
--- a/sql/protocol.cc
+++ b/sql/protocol.cc
@@ -776,7 +776,7 @@ bool Protocol::send_result_set_metadata(List<Item> *list, uint flags)
pos= (char*) local_packet->ptr()+local_packet->length();
*pos++= 12; // Length of packed fields
/* inject a NULL to test the client */
- DBUG_EXECUTE_IF("poison_rs_fields", pos[-1]= 0xfb;);
+ DBUG_EXECUTE_IF("poison_rs_fields", pos[-1]= (char) 0xfb;);
if (item->charset_for_protocol() == &my_charset_bin || thd_charset == NULL)
{
/* No conversion */
diff --git a/sql/records.cc b/sql/records.cc
index d52481c36f5..d28799ea9d2 100644
--- a/sql/records.cc
+++ b/sql/records.cc
@@ -68,6 +68,7 @@ static int rr_index_desc(READ_RECORD *info);
void init_read_record_idx(READ_RECORD *info, THD *thd, TABLE *table,
bool print_error, uint idx, bool reverse)
{
+ int error;
empty_record(table);
bzero((char*) info,sizeof(*info));
info->thd= thd;
@@ -77,8 +78,13 @@ void init_read_record_idx(READ_RECORD *info, THD *thd, TABLE *table,
info->unlock_row= rr_unlock_row;
table->status=0; /* And it's always found */
- if (!table->file->inited)
- table->file->ha_index_init(idx, 1);
+ if (!table->file->inited &&
+ (error= table->file->ha_index_init(idx, 1)))
+ {
+ if (print_error)
+ table->file->print_error(error, MYF(0));
+ }
+
/* read_record will be changed to rr_index in rr_index_first */
info->read_record= reverse ? rr_index_last : rr_index_first;
}
@@ -588,7 +594,7 @@ static int init_rr_cache(THD *thd, READ_RECORD *info)
if (info->cache_records <= 2 ||
!(info->cache=(uchar*) my_malloc_lock(rec_cache_size+info->cache_records*
info->struct_length+1,
- MYF(0))))
+ MYF(MY_THREAD_SPECIFIC))))
DBUG_RETURN(1);
#ifdef HAVE_valgrind
// Avoid warnings in qsort
diff --git a/sql/rpl_filter.cc b/sql/rpl_filter.cc
index 0380bc323a3..f2bd036896d 100644
--- a/sql/rpl_filter.cc
+++ b/sql/rpl_filter.cc
@@ -573,7 +573,7 @@ void
Rpl_filter::init_table_rule_array(DYNAMIC_ARRAY* a, bool* a_inited)
{
my_init_dynamic_array(a, sizeof(TABLE_RULE_ENT*), TABLE_RULE_ARR_SIZE,
- TABLE_RULE_ARR_SIZE);
+ TABLE_RULE_ARR_SIZE, MYF(0));
*a_inited = 1;
}
diff --git a/sql/rpl_handler.cc b/sql/rpl_handler.cc
index 9267190605c..258dae0edb2 100644
--- a/sql/rpl_handler.cc
+++ b/sql/rpl_handler.cc
@@ -189,7 +189,7 @@ void delegates_destroy()
DYNAMIC_ARRAY *plugins= &s.plugins; \
plugin_ref *plugins_buffer= s.plugins_buffer; \
my_init_dynamic_array2(plugins, sizeof(plugin_ref), \
- plugins_buffer, 8, 8); \
+ plugins_buffer, 8, 8, MYF(0)); \
read_lock(); \
Observer_info_iterator iter= observer_info_iter(); \
Observer_info *info= iter++; \
diff --git a/sql/rpl_handler.h b/sql/rpl_handler.h
index 4743fffb9a0..e028fb49808 100644
--- a/sql/rpl_handler.h
+++ b/sql/rpl_handler.h
@@ -124,7 +124,7 @@ public:
inited= FALSE;
if (my_rwlock_init(&lock, NULL))
return;
- init_sql_alloc(&memroot, 1024, 0);
+ init_sql_alloc(&memroot, 1024, 0, MYF(0));
inited= TRUE;
}
~Delegate()
diff --git a/sql/rpl_mi.cc b/sql/rpl_mi.cc
index 2ca700a123a..3e02b555dc0 100644
--- a/sql/rpl_mi.cc
+++ b/sql/rpl_mi.cc
@@ -62,7 +62,7 @@ Master_info::Master_info(LEX_STRING *connection_name_arg,
my_casedn_str(system_charset_info, cmp_connection_name.str);
}
- my_init_dynamic_array(&ignore_server_ids, sizeof(::server_id), 16, 16);
+ my_init_dynamic_array(&ignore_server_ids, sizeof(::server_id), 16, 16, MYF(0));
bzero((char*) &file, sizeof(file));
mysql_mutex_init(key_master_info_run_lock, &run_lock, MY_MUTEX_INIT_FAST);
mysql_mutex_init(key_master_info_data_lock, &data_lock, MY_MUTEX_INIT_FAST);
diff --git a/sql/rpl_mi.h b/sql/rpl_mi.h
index c91699662c8..108bd51ff47 100644
--- a/sql/rpl_mi.h
+++ b/sql/rpl_mi.h
@@ -71,9 +71,9 @@ class Master_info : public Slave_reporting_capability
/* the variables below are needed because we can change masters on the fly */
char master_log_name[FN_REFLEN+6]; /* Room for multi-*/
- char host[HOSTNAME_LENGTH+1];
- char user[USERNAME_LENGTH+1];
- char password[MAX_PASSWORD_LENGTH+1];
+ char host[HOSTNAME_LENGTH*SYSTEM_CHARSET_MBMAXLEN+1];
+ char user[USERNAME_LENGTH*+1];
+ char password[MAX_PASSWORD_LENGTH*SYSTEM_CHARSET_MBMAXLEN+1];
LEX_STRING connection_name; /* User supplied connection name */
LEX_STRING cmp_connection_name; /* Connection name in lower case */
bool ssl; // enables use of SSL connection if true
diff --git a/sql/rpl_rli.cc b/sql/rpl_rli.cc
index 364dfb3bc20..2e74acc0345 100644
--- a/sql/rpl_rli.cc
+++ b/sql/rpl_rli.cc
@@ -182,7 +182,8 @@ a file name for --relay-log-index option", opt_relaylog_index_name);
ln= rli->relay_log.generate_name(opt_relay_logname, "-relay-bin",
1, buf);
/* We send the warning only at startup, not after every RESET SLAVE */
- if (!opt_relay_logname && !opt_relaylog_index_name && !name_warning_sent)
+ if (!opt_relay_logname && !opt_relaylog_index_name && !name_warning_sent &&
+ !opt_bootstrap)
{
/*
User didn't give us info to name the relay log index file.
diff --git a/sql/rpl_tblmap.cc b/sql/rpl_tblmap.cc
index b7ac1b2d091..7b55911d887 100644
--- a/sql/rpl_tblmap.cc
+++ b/sql/rpl_tblmap.cc
@@ -46,7 +46,7 @@ table_mapping::table_mapping()
offsetof(entry,table_id),sizeof(ulong),
0,0,0);
/* We don't preallocate any block, this is consistent with m_free=0 above */
- init_alloc_root(&m_mem_root, TABLE_ID_HASH_SIZE*sizeof(entry), 0);
+ init_alloc_root(&m_mem_root, TABLE_ID_HASH_SIZE*sizeof(entry), 0, MYF(0));
DBUG_VOID_RETURN;
}
diff --git a/sql/rpl_utility.cc b/sql/rpl_utility.cc
index 069fac1c3ec..1b9e744bcc1 100644
--- a/sql/rpl_utility.cc
+++ b/sql/rpl_utility.cc
@@ -1117,7 +1117,7 @@ bool event_checksum_test(uchar *event_buf, ulong event_len, uint8 alg)
Deferred_log_events::Deferred_log_events(Relay_log_info *rli) : last_added(NULL)
{
- my_init_dynamic_array(&array, sizeof(Log_event *), 32, 16);
+ my_init_dynamic_array(&array, sizeof(Log_event *), 32, 16, MYF(0));
}
Deferred_log_events::~Deferred_log_events()
diff --git a/sql/slave.cc b/sql/slave.cc
index 95818e60426..78fa7998012 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -1793,7 +1793,9 @@ past_checksum:
}
}
}
+#ifndef DBUG_OFF
after_set_capability:
+#endif
err:
if (errmsg)
@@ -2446,13 +2448,23 @@ static int init_slave_thread(THD* thd, Master_info *mi,
SLAVE_THD_TYPE thd_type)
{
DBUG_ENTER("init_slave_thread");
-#if !defined(DBUG_OFF)
- int simulate_error= 0;
-#endif
+ int simulate_error __attribute__((unused))= 0;
+ DBUG_EXECUTE_IF("simulate_io_slave_error_on_init",
+ simulate_error|= (1 << SLAVE_THD_IO););
+ DBUG_EXECUTE_IF("simulate_sql_slave_error_on_init",
+ simulate_error|= (1 << SLAVE_THD_SQL););
+ /* We must call store_globals() before doing my_net_init() */
+ if (init_thr_lock() || thd->store_globals() ||
+ my_net_init(&thd->net, 0, MYF(MY_THREAD_SPECIFIC)) ||
+ IF_DBUG(simulate_error & (1<< thd_type), 0))
+ {
+ thd->cleanup();
+ DBUG_RETURN(-1);
+ }
+
thd->system_thread = (thd_type == SLAVE_THD_SQL) ?
SYSTEM_THREAD_SLAVE_SQL : SYSTEM_THREAD_SLAVE_IO;
thd->security_ctx->skip_grants();
- my_net_init(&thd->net, 0);
/*
Adding MAX_LOG_EVENT_HEADER_LEN to the max_allowed_packet on all
slave threads, since a replication event can become this much larger
@@ -2469,17 +2481,6 @@ static int init_slave_thread(THD* thd, Master_info *mi,
thd->thread_id= thd->variables.pseudo_thread_id= thread_id++;
mysql_mutex_unlock(&LOCK_thread_count);
- DBUG_EXECUTE_IF("simulate_io_slave_error_on_init",
- simulate_error|= (1 << SLAVE_THD_IO););
- DBUG_EXECUTE_IF("simulate_sql_slave_error_on_init",
- simulate_error|= (1 << SLAVE_THD_SQL););
- if (init_thr_lock() || thd->store_globals() ||
- IF_DBUG(simulate_error & (1<< thd_type), 0))
- {
- thd->cleanup();
- DBUG_RETURN(-1);
- }
-
if (thd_type == SLAVE_THD_SQL)
THD_STAGE_INFO(thd, stage_waiting_for_the_next_event_in_relay_log);
else
@@ -3516,8 +3517,6 @@ err_during_init:
mi->rli.relay_log.description_event_for_queue= 0;
// TODO: make rpl_status part of Master_info
change_rpl_status(RPL_ACTIVE_SLAVE,RPL_IDLE_SLAVE);
- DBUG_ASSERT(thd->net.buff != 0);
- net_end(&thd->net); // destructor will not free it, because net.vio is 0
mysql_mutex_lock(&LOCK_thread_count);
THD_CHECK_SENTRY(thd);
delete thd;
@@ -3923,8 +3922,6 @@ err_during_init:
to avoid unneeded position re-init
*/
thd->temporary_tables = 0; // remove tempation from destructor to close them
- DBUG_ASSERT(thd->net.buff != 0);
- net_end(&thd->net); // destructor will not free it, because we are weird
DBUG_ASSERT(rli->sql_thd == thd);
THD_CHECK_SENTRY(thd);
rli->sql_thd= 0;
diff --git a/sql/sp.cc b/sql/sp.cc
index f6f5d640bc0..9cc68339d6f 100644
--- a/sql/sp.cc
+++ b/sql/sp.cc
@@ -1418,7 +1418,6 @@ bool lock_db_routines(THD *thd, char *db)
{
TABLE *table;
uint key_len;
- int nxtres= 0;
Open_tables_backup open_tables_state_backup;
MDL_request_list mdl_requests;
Lock_db_routines_error_handler err_handler;
@@ -1446,7 +1445,13 @@ bool lock_db_routines(THD *thd, char *db)
table->field[MYSQL_PROC_FIELD_DB]->store(db, strlen(db), system_charset_info);
key_len= table->key_info->key_part[0].store_length;
table->field[MYSQL_PROC_FIELD_DB]->get_key_image(keybuf, key_len, Field::itRAW);
- table->file->ha_index_init(0, 1);
+ int nxtres= table->file->ha_index_init(0, 1);
+ if (nxtres)
+ {
+ table->file->print_error(nxtres, MYF(0));
+ close_system_tables(thd, &open_tables_state_backup);
+ DBUG_RETURN(true);
+ }
if (! table->file->ha_index_read_map(table->record[0], keybuf, (key_part_map)1,
HA_READ_KEY_EXACT))
@@ -1509,7 +1514,11 @@ sp_drop_db_routines(THD *thd, char *db)
table->field[MYSQL_PROC_FIELD_DB]->get_key_image(keybuf, key_len, Field::itRAW);
ret= SP_OK;
- table->file->ha_index_init(0, 1);
+ if (table->file->ha_index_init(0, 1))
+ {
+ ret= SP_KEY_NOT_FOUND;
+ goto err_idx_init;
+ }
if (!table->file->ha_index_read_map(table->record[0], keybuf, (key_part_map)1,
HA_READ_KEY_EXACT))
{
@@ -1535,6 +1544,7 @@ sp_drop_db_routines(THD *thd, char *db)
}
table->file->ha_index_end();
+err_idx_init:
close_thread_tables(thd);
/*
Make sure to only release the MDL lock on mysql.proc, not other
diff --git a/sql/sp_head.cc b/sql/sp_head.cc
index b725f6d7fcc..7cd2e789351 100644
--- a/sql/sp_head.cc
+++ b/sql/sp_head.cc
@@ -508,7 +508,7 @@ sp_head::operator new(size_t size) throw()
MEM_ROOT own_root;
sp_head *sp;
- init_sql_alloc(&own_root, MEM_ROOT_BLOCK_SIZE, MEM_ROOT_PREALLOC);
+ init_sql_alloc(&own_root, MEM_ROOT_BLOCK_SIZE, MEM_ROOT_PREALLOC, MYF(0));
sp= (sp_head *) alloc_root(&own_root, size);
if (sp == NULL)
DBUG_RETURN(NULL);
@@ -592,7 +592,7 @@ sp_head::init(LEX *lex)
types of stored procedures to simplify reset_lex()/restore_lex() code.
*/
lex->trg_table_fields.empty();
- my_init_dynamic_array(&m_instr, sizeof(sp_instr *), 16, 8);
+ my_init_dynamic_array(&m_instr, sizeof(sp_instr *), 16, 8, MYF(0));
m_param_begin= NULL;
m_param_end= NULL;
@@ -1252,7 +1252,7 @@ sp_head::execute(THD *thd, bool merge_da_on_success)
DBUG_RETURN(TRUE);
/* init per-instruction memroot */
- init_sql_alloc(&execute_mem_root, MEM_ROOT_BLOCK_SIZE, 0);
+ init_sql_alloc(&execute_mem_root, MEM_ROOT_BLOCK_SIZE, 0, MYF(0));
DBUG_ASSERT(!(m_flags & IS_INVOKED));
m_flags|= IS_INVOKED;
@@ -1709,7 +1709,7 @@ sp_head::execute_trigger(THD *thd,
TODO: we should create sp_rcontext once per command and reuse it
on subsequent executions of a trigger.
*/
- init_sql_alloc(&call_mem_root, MEM_ROOT_BLOCK_SIZE, 0);
+ init_sql_alloc(&call_mem_root, MEM_ROOT_BLOCK_SIZE, 0, MYF(0));
thd->set_n_backup_active_arena(&call_arena, &backup_arena);
if (!(nctx= new sp_rcontext(m_pcont, 0, octx)) ||
@@ -1826,7 +1826,7 @@ sp_head::execute_function(THD *thd, Item **argp, uint argcount,
TODO: we should create sp_rcontext once per command and reuse
it on subsequent executions of a function/trigger.
*/
- init_sql_alloc(&call_mem_root, MEM_ROOT_BLOCK_SIZE, 0);
+ init_sql_alloc(&call_mem_root, MEM_ROOT_BLOCK_SIZE, 0, MYF(0));
thd->set_n_backup_active_arena(&call_arena, &backup_arena);
if (!(nctx= new sp_rcontext(m_pcont, return_value_fld, octx)) ||
@@ -4017,8 +4017,6 @@ typedef struct st_sp_table
Multi-set key:
db_name\0table_name\0alias\0 - for normal tables
db_name\0table_name\0 - for temporary tables
- Note that in both cases we don't take last '\0' into account when
- we count length of key.
*/
LEX_STRING qname;
uint db_length, table_name_length;
@@ -4075,19 +4073,26 @@ sp_head::merge_table_list(THD *thd, TABLE_LIST *table, LEX *lex_for_tmp_check)
for (; table ; table= table->next_global)
if (!table->derived && !table->schema_table)
{
- char tname[(SAFE_NAME_LEN + 1) * 3]; // db\0table\0alias\0
- uint tlen, alen;
-
- tlen= table->db_length;
- memcpy(tname, table->db, tlen);
- tname[tlen++]= '\0';
- memcpy(tname+tlen, table->table_name, table->table_name_length);
- tlen+= table->table_name_length;
- tname[tlen++]= '\0';
- alen= strlen(table->alias);
- memcpy(tname+tlen, table->alias, alen);
- tlen+= alen;
- tname[tlen]= '\0';
+ /*
+ Structure of key for the multi-set is "db\0table\0alias\0".
+ Since "alias" part can have arbitrary length we use String
+ object to construct the key. By default String will use
+ buffer allocated on stack with NAME_LEN bytes reserved for
+ alias, since in most cases it is going to be smaller than
+ NAME_LEN bytes.
+ */
+ char tname_buff[(SAFE_NAME_LEN + 1) * 3];
+ String tname(tname_buff, sizeof(tname_buff), &my_charset_bin);
+ uint temp_table_key_length;
+
+ tname.length(0);
+ tname.append(table->db, table->db_length);
+ tname.append('\0');
+ tname.append(table->table_name, table->table_name_length);
+ tname.append('\0');
+ temp_table_key_length= tname.length();
+ tname.append(table->alias);
+ tname.append('\0');
/*
Upgrade the lock type because this table list will be used
@@ -4102,9 +4107,10 @@ sp_head::merge_table_list(THD *thd, TABLE_LIST *table, LEX *lex_for_tmp_check)
(and therefore should not be prelocked). Otherwise we will erroneously
treat table with same name but with different alias as non-temporary.
*/
- if ((tab= (SP_TABLE*) my_hash_search(&m_sptabs, (uchar *)tname, tlen)) ||
- ((tab= (SP_TABLE*) my_hash_search(&m_sptabs, (uchar *)tname,
- tlen - alen - 1)) &&
+ if ((tab= (SP_TABLE*) my_hash_search(&m_sptabs, (uchar *)tname.ptr(),
+ tname.length())) ||
+ ((tab= (SP_TABLE*) my_hash_search(&m_sptabs, (uchar *)tname.ptr(),
+ temp_table_key_length)) &&
tab->temp))
{
if (tab->lock_type < table->lock_type)
@@ -4123,11 +4129,11 @@ sp_head::merge_table_list(THD *thd, TABLE_LIST *table, LEX *lex_for_tmp_check)
lex_for_tmp_check->create_info.options & HA_LEX_CREATE_TMP_TABLE)
{
tab->temp= TRUE;
- tab->qname.length= tlen - alen - 1;
+ tab->qname.length= temp_table_key_length;
}
else
- tab->qname.length= tlen;
- tab->qname.str= (char*) thd->memdup(tname, tab->qname.length + 1);
+ tab->qname.length= tname.length();
+ tab->qname.str= (char*) thd->memdup(tname.ptr(), tab->qname.length);
if (!tab->qname.str)
return FALSE;
tab->table_name_length= table->table_name_length;
@@ -4196,7 +4202,7 @@ sp_head::add_used_tables_to_table_list(THD *thd,
if (!(tab_buff= (char *)thd->calloc(ALIGN_SIZE(sizeof(TABLE_LIST)) *
stab->lock_count)) ||
!(key_buff= (char*)thd->memdup(stab->qname.str,
- stab->qname.length + 1)))
+ stab->qname.length)))
DBUG_RETURN(FALSE);
for (uint j= 0; j < stab->lock_count; j++)
diff --git a/sql/sp_pcontext.cc b/sql/sp_pcontext.cc
index 4c5087eaf27..f11daeecb7b 100644
--- a/sql/sp_pcontext.cc
+++ b/sql/sp_pcontext.cc
@@ -61,20 +61,20 @@ sp_pcontext::sp_pcontext()
m_label_scope(LABEL_DEFAULT_SCOPE)
{
(void) my_init_dynamic_array(&m_vars, sizeof(sp_variable_t *),
- PCONTEXT_ARRAY_INIT_ALLOC,
- PCONTEXT_ARRAY_INCREMENT_ALLOC);
+ PCONTEXT_ARRAY_INIT_ALLOC,
+ PCONTEXT_ARRAY_INCREMENT_ALLOC, MYF(0));
(void) my_init_dynamic_array(&m_case_expr_id_lst, sizeof(int),
- PCONTEXT_ARRAY_INIT_ALLOC,
- PCONTEXT_ARRAY_INCREMENT_ALLOC);
+ PCONTEXT_ARRAY_INIT_ALLOC,
+ PCONTEXT_ARRAY_INCREMENT_ALLOC, MYF(0));
(void) my_init_dynamic_array(&m_conds, sizeof(sp_cond_type_t *),
- PCONTEXT_ARRAY_INIT_ALLOC,
- PCONTEXT_ARRAY_INCREMENT_ALLOC);
+ PCONTEXT_ARRAY_INIT_ALLOC,
+ PCONTEXT_ARRAY_INCREMENT_ALLOC, MYF(0));
(void) my_init_dynamic_array(&m_cursors, sizeof(LEX_STRING),
- PCONTEXT_ARRAY_INIT_ALLOC,
- PCONTEXT_ARRAY_INCREMENT_ALLOC);
+ PCONTEXT_ARRAY_INIT_ALLOC,
+ PCONTEXT_ARRAY_INCREMENT_ALLOC, MYF(0));
(void) my_init_dynamic_array(&m_handlers, sizeof(sp_cond_type_t *),
- PCONTEXT_ARRAY_INIT_ALLOC,
- PCONTEXT_ARRAY_INCREMENT_ALLOC);
+ PCONTEXT_ARRAY_INIT_ALLOC,
+ PCONTEXT_ARRAY_INCREMENT_ALLOC, MYF(0));
m_label.empty();
m_children.empty();
@@ -89,20 +89,20 @@ sp_pcontext::sp_pcontext(sp_pcontext *prev, label_scope_type label_scope)
m_label_scope(label_scope)
{
(void) my_init_dynamic_array(&m_vars, sizeof(sp_variable_t *),
- PCONTEXT_ARRAY_INIT_ALLOC,
- PCONTEXT_ARRAY_INCREMENT_ALLOC);
+ PCONTEXT_ARRAY_INIT_ALLOC,
+ PCONTEXT_ARRAY_INCREMENT_ALLOC, MYF(0));
(void) my_init_dynamic_array(&m_case_expr_id_lst, sizeof(int),
- PCONTEXT_ARRAY_INIT_ALLOC,
- PCONTEXT_ARRAY_INCREMENT_ALLOC);
+ PCONTEXT_ARRAY_INIT_ALLOC,
+ PCONTEXT_ARRAY_INCREMENT_ALLOC, MYF(0));
(void) my_init_dynamic_array(&m_conds, sizeof(sp_cond_type_t *),
- PCONTEXT_ARRAY_INIT_ALLOC,
- PCONTEXT_ARRAY_INCREMENT_ALLOC);
+ PCONTEXT_ARRAY_INIT_ALLOC,
+ PCONTEXT_ARRAY_INCREMENT_ALLOC, MYF(0));
(void) my_init_dynamic_array(&m_cursors, sizeof(LEX_STRING),
- PCONTEXT_ARRAY_INIT_ALLOC,
- PCONTEXT_ARRAY_INCREMENT_ALLOC);
+ PCONTEXT_ARRAY_INIT_ALLOC,
+ PCONTEXT_ARRAY_INCREMENT_ALLOC, MYF(0));
(void) my_init_dynamic_array(&m_handlers, sizeof(sp_cond_type_t *),
- PCONTEXT_ARRAY_INIT_ALLOC,
- PCONTEXT_ARRAY_INCREMENT_ALLOC);
+ PCONTEXT_ARRAY_INIT_ALLOC,
+ PCONTEXT_ARRAY_INCREMENT_ALLOC, MYF(0));
m_label.empty();
m_children.empty();
diff --git a/sql/sp_rcontext.cc b/sql/sp_rcontext.cc
index 6fe4be989db..30acfebabb2 100644
--- a/sql/sp_rcontext.cc
+++ b/sql/sp_rcontext.cc
@@ -67,19 +67,15 @@ sp_rcontext::~sp_rcontext()
bool sp_rcontext::init(THD *thd)
{
uint handler_count= m_root_parsing_ctx->max_handler_index();
- uint i;
in_sub_stmt= thd->in_sub_stmt;
if (init_var_table(thd) || init_var_items())
return TRUE;
- if (!(m_raised_conditions= new (thd->mem_root) MYSQL_ERROR[handler_count]))
+ if (!(m_raised_conditions= new (thd->mem_root) Sql_condition_info[handler_count]))
return TRUE;
- for (i= 0; i<handler_count; i++)
- m_raised_conditions[i].init(thd->mem_root);
-
return
!(m_handler=
(sp_handler_t*)thd->alloc(handler_count * sizeof(sp_handler_t))) ||
@@ -419,7 +415,7 @@ sp_rcontext::activate_handler(THD *thd,
/* Reset error state. */
thd->clear_error();
- thd->killed= NOT_KILLED; // Some errors set thd->killed
+ thd->reset_killed(); // Some errors set thd->killed
// (e.g. "bad data").
/* Return IP of the activated SQL handler. */
@@ -446,13 +442,12 @@ sp_rcontext::exit_handler()
DBUG_VOID_RETURN;
}
-MYSQL_ERROR*
-sp_rcontext::raised_condition() const
+Sql_condition_info* sp_rcontext::raised_condition() const
{
if (m_ihsp > 0)
{
uint hindex= m_in_handler[m_ihsp - 1].index;
- MYSQL_ERROR *raised= & m_raised_conditions[hindex];
+ Sql_condition_info *raised= & m_raised_conditions[hindex];
return raised;
}
diff --git a/sql/sp_rcontext.h b/sql/sp_rcontext.h
index 3d976f94381..5008a73d96c 100644
--- a/sql/sp_rcontext.h
+++ b/sql/sp_rcontext.h
@@ -58,6 +58,46 @@ typedef struct
uint index;
} sp_active_handler_t;
+
+class Sql_condition_info : public Sql_alloc
+{
+public:
+ /** SQL error code. */
+ uint m_sql_errno;
+
+ /** Error level. */
+ MYSQL_ERROR::enum_warning_level m_level;
+
+ /** SQLSTATE. */
+ char m_sql_state[SQLSTATE_LENGTH + 1];
+
+ /** Text message. */
+ char m_message[MYSQL_ERRMSG_SIZE];
+
+ void set(uint sql_errno, const char* sqlstate,
+ MYSQL_ERROR::enum_warning_level level,
+ const char* msg)
+ {
+ m_sql_errno= sql_errno;
+ m_level= level;
+
+ memcpy(m_sql_state, sqlstate, SQLSTATE_LENGTH);
+ m_sql_state[SQLSTATE_LENGTH]= '\0';
+
+ strncpy(m_message, msg, MYSQL_ERRMSG_SIZE);
+ }
+
+ void clear()
+ {
+ m_sql_errno= 0;
+ m_level= MYSQL_ERROR::WARN_LEVEL_ERROR;
+
+ m_sql_state[0]= '\0';
+ m_message[0]= '\0';
+ }
+};
+
+
/*
This class is a runtime context of a Stored Routine. It is used in an
execution and is intended to contain all dynamic objects (i.e. objects, which
@@ -146,8 +186,7 @@ class sp_rcontext : public Sql_alloc
MYSQL_ERROR::enum_warning_level level,
const char *msg);
- MYSQL_ERROR *
- raised_condition() const;
+ Sql_condition_info *raised_condition() const;
void
push_hstack(uint h);
@@ -232,7 +271,7 @@ private:
SQL conditions caught by each handler.
This is an array indexed by handler index.
*/
- MYSQL_ERROR *m_raised_conditions;
+ Sql_condition_info *m_raised_conditions;
uint m_hcount; // Stack pointer for m_handler
uint *m_hstack; // Return stack for continue handlers
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
index 723d825de17..cb7e35fae09 100644
--- a/sql/sql_acl.cc
+++ b/sql/sql_acl.cc
@@ -1,5 +1,5 @@
/* Copyright (c) 2000, 2011, Oracle and/or its affiliates.
- Copyright (c) 2009, 2011, Monty Program Ab
+ Copyright (c) 2009, 2013, Monty Program Ab
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -50,6 +50,7 @@
#include "sql_connect.h"
#include "hostname.h"
#include "sql_db.h"
+#include "sql_array.h"
bool mysql_user_table_is_in_short_password_format= false;
@@ -560,6 +561,18 @@ static bool update_user_table(THD *thd, TABLE *table, const char *host,
static my_bool acl_load(THD *thd, TABLE_LIST *tables);
static my_bool grant_load(THD *thd, TABLE_LIST *tables);
static inline void get_grantor(THD *thd, char* grantor);
+/*
+ Enumeration of various ACL's and Hashes used in handle_grant_struct()
+*/
+enum enum_acl_lists
+{
+ USER_ACL= 0,
+ DB_ACL,
+ COLUMN_PRIVILEGES_HASH,
+ PROC_PRIVILEGES_HASH,
+ FUNC_PRIVILEGES_HASH,
+ PROXY_USERS_ACL
+};
/*
Convert scrambled password to binary form, according to scramble type,
@@ -688,7 +701,7 @@ my_bool acl_init(bool dont_read_acl_tables)
return_val= acl_reload(thd);
delete thd;
/* Remember that we don't have a THD */
- my_pthread_setspecific_ptr(THR_THD, 0);
+ set_current_thd(0);
DBUG_RETURN(return_val);
}
@@ -749,8 +762,8 @@ static my_bool acl_load(THD *thd, TABLE_LIST *tables)
acl_cache->clear(1); // Clear locked hostname cache
- init_sql_alloc(&mem, ACL_ALLOC_BLOCK_SIZE, 0);
- (void) my_init_dynamic_array(&acl_hosts,sizeof(ACL_HOST),20,50);
+ init_sql_alloc(&mem, ACL_ALLOC_BLOCK_SIZE, 0, MYF(0));
+ (void) my_init_dynamic_array(&acl_hosts,sizeof(ACL_HOST), 20, 50, MYF(0));
if (tables[0].table) // "host" table may not exist (e.g. in MySQL 5.6.7+)
{
if (init_read_record(&read_record_info, thd, table= tables[0].table,
@@ -768,7 +781,12 @@ static my_bool acl_load(THD *thd, TABLE_LIST *tables)
convert db to lower case and give a warning if the db wasn't
already in lower case
*/
- (void) strmov(tmp_name, host.db);
+ char *end = strnmov(tmp_name, host.db, sizeof(tmp_name));
+ if (end >= tmp_name + sizeof(tmp_name))
+ {
+ sql_print_warning(ER(ER_WRONG_DB_NAME), host.db);
+ continue;
+ }
my_casedn_str(files_charset_info, host.db);
if (strcmp(host.db, tmp_name) != 0)
sql_print_warning("'host' entry '%s|%s' had database in mixed "
@@ -808,7 +826,7 @@ static my_bool acl_load(THD *thd, TABLE_LIST *tables)
NULL, 1, 1, FALSE))
goto end;
table->use_all_columns();
- (void) my_init_dynamic_array(&acl_users,sizeof(ACL_USER),50,100);
+ (void) my_init_dynamic_array(&acl_users,sizeof(ACL_USER), 50, 100, MYF(0));
password_length= table->field[2]->field_length /
table->field[2]->charset()->mbmaxlen;
if (password_length < SCRAMBLED_PASSWORD_CHAR_LENGTH_323)
@@ -1009,7 +1027,7 @@ static my_bool acl_load(THD *thd, TABLE_LIST *tables)
NULL, 1, 1, FALSE))
goto end;
table->use_all_columns();
- (void) my_init_dynamic_array(&acl_dbs,sizeof(ACL_DB),50,100);
+ (void) my_init_dynamic_array(&acl_dbs,sizeof(ACL_DB), 50, 100, MYF(0));
while (!(read_record_info.read_record(&read_record_info)))
{
ACL_DB db;
@@ -1038,7 +1056,12 @@ static my_bool acl_load(THD *thd, TABLE_LIST *tables)
convert db to lower case and give a warning if the db wasn't
already in lower case
*/
- (void)strmov(tmp_name, db.db);
+ char *end = strnmov(tmp_name, db.db, sizeof(tmp_name));
+ if (end >= tmp_name + sizeof(tmp_name))
+ {
+ sql_print_warning(ER(ER_WRONG_DB_NAME), db.db);
+ continue;
+ }
my_casedn_str(files_charset_info, db.db);
if (strcmp(db.db, tmp_name) != 0)
{
@@ -1067,7 +1090,7 @@ static my_bool acl_load(THD *thd, TABLE_LIST *tables)
freeze_size(&acl_dbs);
(void) my_init_dynamic_array(&acl_proxy_users, sizeof(ACL_PROXY_USER),
- 50, 100);
+ 50, 100, MYF(0));
if (tables[3].table)
{
if (init_read_record(&read_record_info, thd, table= tables[3].table,
@@ -1723,7 +1746,7 @@ static void init_check_host(void)
{
DBUG_ENTER("init_check_host");
(void) my_init_dynamic_array(&acl_wild_hosts,sizeof(struct acl_host_and_ip),
- acl_users.elements,1);
+ acl_users.elements, 1, MYF(0));
(void) my_hash_init(&acl_check_hosts,system_charset_info,
acl_users.elements, 0, 0,
(my_hash_get_key) check_get_key, 0, 0);
@@ -2699,7 +2722,13 @@ replace_proxies_priv_table(THD *thd, TABLE *table, const LEX_USER *user,
get_grantor(thd, grantor);
- table->file->ha_index_init(0, 1);
+ if ((error= table->file->ha_index_init(0, 1)))
+ {
+ table->file->print_error(error, MYF(0));
+ DBUG_PRINT("info", ("ha_index_init error"));
+ DBUG_RETURN(-1);
+ }
+
if (table->file->ha_index_read_map(table->record[0], user_key,
HA_WHOLE_KEY,
HA_READ_KEY_EXACT))
@@ -2941,7 +2970,12 @@ GRANT_TABLE::GRANT_TABLE(TABLE *form, TABLE *col_privs)
key_copy(key, col_privs->record[0], col_privs->key_info, key_prefix_len);
col_privs->field[4]->store("",0, &my_charset_latin1);
- col_privs->file->ha_index_init(0, 1);
+ if (col_privs->file->ha_index_init(0, 1))
+ {
+ cols= 0;
+ return;
+ }
+
if (col_privs->file->ha_index_read_map(col_privs->record[0], (uchar*) key,
(key_part_map)15,
HA_READ_KEY_EXACT))
@@ -3005,15 +3039,23 @@ static GRANT_NAME *name_hash_search(HASH *name_hash,
const char *user, const char *tname,
bool exact, bool name_tolower)
{
- char helping [SAFE_NAME_LEN*2+USERNAME_LENGTH+3], *name_ptr;
+ char helping[SAFE_NAME_LEN*2+USERNAME_LENGTH+3];
+ char *hend = helping + sizeof(helping);
uint len;
GRANT_NAME *grant_name,*found=0;
HASH_SEARCH_STATE state;
- name_ptr= strmov(strmov(helping, user) + 1, db) + 1;
- len = (uint) (strmov(name_ptr, tname) - helping) + 1;
+ char *db_ptr= strmov(helping, user) + 1;
+ char *tname_ptr= strnmov(db_ptr, db, hend - db_ptr) + 1;
+ if (tname_ptr > hend)
+ return 0; // invalid name = not found
+ char *end= strnmov(tname_ptr, tname, hend - tname_ptr) + 1;
+ if (end > hend)
+ return 0; // invalid name = not found
+
+ len = (uint) (end - helping);
if (name_tolower)
- my_casedn_str(files_charset_info, name_ptr);
+ my_casedn_str(files_charset_info, tname_ptr);
for (grant_name= (GRANT_NAME*) my_hash_first(name_hash, (uchar*) helping,
len, &state);
grant_name ;
@@ -3073,7 +3115,7 @@ static int replace_column_table(GRANT_TABLE *g_t,
const char *db, const char *table_name,
ulong rights, bool revoke_grant)
{
- int error=0,result=0;
+ int result=0;
uchar key[MAX_KEY_LENGTH];
uint key_prefix_length;
KEY_PART_INFO *key_part= table->key_info->key_part;
@@ -3100,7 +3142,13 @@ static int replace_column_table(GRANT_TABLE *g_t,
List_iterator <LEX_COLUMN> iter(columns);
class LEX_COLUMN *column;
- table->file->ha_index_init(0, 1);
+ int error= table->file->ha_index_init(0, 1);
+ if (error)
+ {
+ table->file->print_error(error, MYF(0));
+ DBUG_RETURN(-1);
+ }
+
while ((column= iter++))
{
ulong privileges= column->rights;
@@ -3970,7 +4018,12 @@ bool mysql_grant(THD *thd, const char *db, List <LEX_USER> &list,
if (lower_case_table_names && db)
{
- strmov(tmp_db,db);
+ char *end= strnmov(tmp_db,db, sizeof(tmp_db));
+ if (end >= tmp_db + sizeof(tmp_db))
+ {
+ my_error(ER_WRONG_DB_NAME ,MYF(0), db);
+ DBUG_RETURN(TRUE);
+ }
my_casedn_str(files_charset_info, tmp_db);
db=tmp_db;
}
@@ -4123,7 +4176,7 @@ my_bool grant_init()
return_val= grant_reload(thd);
delete thd;
/* Remember that we don't have a THD */
- my_pthread_setspecific_ptr(THR_THD, 0);
+ set_current_thd(0);
DBUG_RETURN(return_val);
}
@@ -4157,7 +4210,10 @@ static my_bool grant_load_procs_priv(TABLE *p_table)
(void) my_hash_init(&func_priv_hash, &my_charset_utf8_bin,
0,0,0, (my_hash_get_key) get_grant_table,
0,0);
- p_table->file->ha_index_init(0, 1);
+
+ if (p_table->file->ha_index_init(0, 1))
+ DBUG_RETURN(TRUE);
+
p_table->use_all_columns();
if (!p_table->file->ha_index_first(p_table->record[0]))
@@ -4258,7 +4314,10 @@ static my_bool grant_load(THD *thd, TABLE_LIST *tables)
t_table = tables[0].table;
c_table = tables[1].table;
- t_table->file->ha_index_init(0, 1);
+
+ if (t_table->file->ha_index_init(0, 1))
+ goto end_index_init;
+
t_table->use_all_columns();
c_table->use_all_columns();
@@ -4303,9 +4362,10 @@ static my_bool grant_load(THD *thd, TABLE_LIST *tables)
return_val=0; // Return ok
end_unlock:
- thd->variables.sql_mode= old_sql_mode;
t_table->file->ha_index_end();
my_pthread_setspecific_ptr(THR_MALLOC, save_mem_root_ptr);
+end_index_init:
+ thd->variables.sql_mode= old_sql_mode;
DBUG_RETURN(return_val);
}
@@ -4414,7 +4474,7 @@ my_bool grant_reload(THD *thd)
opertion possible in case of failure.
*/
old_mem= memex;
- init_sql_alloc(&memex, ACL_ALLOC_BLOCK_SIZE, 0);
+ init_sql_alloc(&memex, ACL_ALLOC_BLOCK_SIZE, 0, MYF(0));
if ((return_val= grant_load(thd, tables)))
{ // Error. Revert to old hash
@@ -5994,20 +6054,19 @@ static int handle_grant_table(TABLE_LIST *tables, uint table_no, bool drop,
Delete from grant structure if drop is true.
Update in grant structure if drop is false and user_to is not NULL.
Search in grant structure if drop is false and user_to is NULL.
- Structures are numbered as follows:
- 0 acl_users
- 1 acl_dbs
- 2 column_priv_hash
- 3 proc_priv_hash
- 4 func_priv_hash
- 5 acl_proxy_users
+ Structures are enumerated as follows:
+ 0 ACL_USER
+ 1 ACL_DB
+ 2 COLUMN_PRIVILEGES_HASH
+ 3 PROC_PRIVILEGES_HASH
+ 4 FUNC_PRIVILEGES_HASH
+ 5 PROXY_USERS_ACL
@retval > 0 At least one element matched.
@retval 0 OK, but no element matched.
- @retval -1 Wrong arguments to function.
*/
-static int handle_grant_struct(uint struct_no, bool drop,
+static int handle_grant_struct(enum enum_acl_lists struct_no, bool drop,
LEX_USER *user_from, LEX_USER *user_to)
{
int result= 0;
@@ -6031,28 +6090,29 @@ static int handle_grant_struct(uint struct_no, bool drop,
/* Get the number of elements in the in-memory structure. */
switch (struct_no) {
- case 0:
+ case USER_ACL:
elements= acl_users.elements;
break;
- case 1:
+ case DB_ACL:
elements= acl_dbs.elements;
break;
- case 2:
+ case COLUMN_PRIVILEGES_HASH:
grant_name_hash= &column_priv_hash;
elements= grant_name_hash->records;
break;
- case 3:
+ case PROC_PRIVILEGES_HASH:
grant_name_hash= &proc_priv_hash;
elements= grant_name_hash->records;
break;
- case 4:
+ case FUNC_PRIVILEGES_HASH:
grant_name_hash= &func_priv_hash;
elements= grant_name_hash->records;
break;
- case 5:
+ case PROXY_USERS_ACL:
elements= acl_proxy_users.elements;
break;
default:
+ DBUG_ASSERT(0);
return -1;
}
@@ -6067,27 +6127,27 @@ static int handle_grant_struct(uint struct_no, bool drop,
Get a pointer to the element.
*/
switch (struct_no) {
- case 0:
+ case USER_ACL:
acl_user= dynamic_element(&acl_users, idx, ACL_USER*);
user= acl_user->user;
host= acl_user->host.hostname;
break;
- case 1:
+ case DB_ACL:
acl_db= dynamic_element(&acl_dbs, idx, ACL_DB*);
user= acl_db->user;
host= acl_db->host.hostname;
break;
- case 2:
- case 3:
- case 4:
+ case COLUMN_PRIVILEGES_HASH:
+ case PROC_PRIVILEGES_HASH:
+ case FUNC_PRIVILEGES_HASH:
grant_name= (GRANT_NAME*) my_hash_element(grant_name_hash, idx);
user= grant_name->user;
host= grant_name->host.hostname;
break;
- case 5:
+ case PROXY_USERS_ACL:
acl_proxy_user= dynamic_element(&acl_proxy_users, idx, ACL_PROXY_USER*);
user= acl_proxy_user->get_user();
host= acl_proxy_user->get_host();
@@ -6113,21 +6173,21 @@ static int handle_grant_struct(uint struct_no, bool drop,
if ( drop )
{
switch ( struct_no ) {
- case 0:
+ case USER_ACL:
delete_dynamic_element(&acl_users, idx);
break;
- case 1:
+ case DB_ACL:
delete_dynamic_element(&acl_dbs, idx);
break;
- case 2:
- case 3:
- case 4:
+ case COLUMN_PRIVILEGES_HASH:
+ case PROC_PRIVILEGES_HASH:
+ case FUNC_PRIVILEGES_HASH:
my_hash_delete(grant_name_hash, (uchar*) grant_name);
break;
- case 5:
+ case PROXY_USERS_ACL:
delete_dynamic_element(&acl_proxy_users, idx);
break;
@@ -6151,19 +6211,19 @@ static int handle_grant_struct(uint struct_no, bool drop,
else if ( user_to )
{
switch ( struct_no ) {
- case 0:
+ case USER_ACL:
acl_user->user= strdup_root(&mem, user_to->user.str);
acl_user->host.hostname= strdup_root(&mem, user_to->host.str);
break;
- case 1:
+ case DB_ACL:
acl_db->user= strdup_root(&mem, user_to->user.str);
acl_db->host.hostname= strdup_root(&mem, user_to->host.str);
break;
- case 2:
- case 3:
- case 4:
+ case COLUMN_PRIVILEGES_HASH:
+ case PROC_PRIVILEGES_HASH:
+ case FUNC_PRIVILEGES_HASH:
{
/*
Save old hash key and its length to be able properly update
@@ -6199,11 +6259,10 @@ static int handle_grant_struct(uint struct_no, bool drop,
break;
}
- case 5:
+ case PROXY_USERS_ACL:
acl_proxy_user->set_user (&mem, user_to->user.str);
acl_proxy_user->set_host (&mem, user_to->host.str);
break;
-
}
}
else
@@ -6260,7 +6319,7 @@ static int handle_grant_data(TABLE_LIST *tables, bool drop,
else
{
/* Handle user array. */
- if ((handle_grant_struct(0, drop, user_from, user_to)) || found)
+ if ((handle_grant_struct(USER_ACL, drop, user_from, user_to)) || found)
{
result= 1; /* At least one record/element found. */
/* If search is requested, we do not need to search further. */
@@ -6278,7 +6337,7 @@ static int handle_grant_data(TABLE_LIST *tables, bool drop,
else
{
/* Handle db array. */
- if (((handle_grant_struct(1, drop, user_from, user_to) && ! result) ||
+ if (((handle_grant_struct(DB_ACL, drop, user_from, user_to) && ! result) ||
found) && ! result)
{
result= 1; /* At least one record/element found. */
@@ -6297,7 +6356,7 @@ static int handle_grant_data(TABLE_LIST *tables, bool drop,
else
{
/* Handle procs array. */
- if (((handle_grant_struct(3, drop, user_from, user_to) && ! result) ||
+ if (((handle_grant_struct(PROC_PRIVILEGES_HASH, drop, user_from, user_to) && ! result) ||
found) && ! result)
{
result= 1; /* At least one record/element found. */
@@ -6306,7 +6365,7 @@ static int handle_grant_data(TABLE_LIST *tables, bool drop,
goto end;
}
/* Handle funcs array. */
- if (((handle_grant_struct(4, drop, user_from, user_to) && ! result) ||
+ if (((handle_grant_struct(FUNC_PRIVILEGES_HASH, drop, user_from, user_to) && ! result) ||
found) && ! result)
{
result= 1; /* At least one record/element found. */
@@ -6341,7 +6400,7 @@ static int handle_grant_data(TABLE_LIST *tables, bool drop,
else
{
/* Handle columns hash. */
- if (((handle_grant_struct(2, drop, user_from, user_to) && ! result) ||
+ if (((handle_grant_struct(COLUMN_PRIVILEGES_HASH, drop, user_from, user_to) && ! result) ||
found) && ! result)
result= 1; /* At least one record/element found. */
}
@@ -6358,7 +6417,7 @@ static int handle_grant_data(TABLE_LIST *tables, bool drop,
else
{
/* Handle proxies_priv array. */
- if ((handle_grant_struct(5, drop, user_from, user_to) && !result) ||
+ if ((handle_grant_struct(PROXY_USERS_ACL, drop, user_from, user_to) && !result) ||
found)
result= 1; /* At least one record/element found. */
}
@@ -7086,14 +7145,25 @@ acl_check_proxy_grant_access(THD *thd, const char *host, const char *user,
DBUG_RETURN(FALSE);
}
- /* one can grant proxy to himself to others */
- if (!strcmp(thd->security_ctx->user, user) &&
+ /*
+ one can grant proxy for self to others.
+ Security context in THD contains two pairs of (user,host):
+ 1. (user,host) pair referring to inbound connection.
+ 2. (priv_user,priv_host) pair obtained from mysql.user table after doing
+ authnetication of incoming connection.
+ Privileges should be checked wrt (priv_user, priv_host) tuple, because
+ (user,host) pair obtained from inbound connection may have different
+ values than what is actually stored in mysql.user table and while granting
+ or revoking proxy privilege, user is expected to provide entries mentioned
+ in mysql.user table.
+ */
+ if (!strcmp(thd->security_ctx->priv_user, user) &&
!my_strcasecmp(system_charset_info, host,
- thd->security_ctx->host))
+ thd->security_ctx->priv_host))
{
DBUG_PRINT("info", ("strcmp (%s, %s) my_casestrcmp (%s, %s) equal",
- thd->security_ctx->user, user,
- host, thd->security_ctx->host));
+ thd->security_ctx->priv_user, user,
+ host, thd->security_ctx->priv_host));
DBUG_RETURN(FALSE);
}
@@ -7759,6 +7829,7 @@ struct MPVIO_EXT :public MYSQL_PLUGIN_VIO
} cached_server_packet;
int packets_read, packets_written; ///< counters for send/received packets
uint connect_errors; ///< if there were connect errors for this host
+ bool make_it_fail;
/** when plugin returns a failure this tells us what really happened */
enum { SUCCESS, FAILURE, RESTART } status;
};
@@ -8024,14 +8095,14 @@ static bool send_plugin_request_packet(MPVIO_EXT *mpvio,
/**
Finds acl entry in user database for authentication purposes.
- Finds a user and copies it into mpvio. Reports an authentication
- failure if a user is not found.
+ Finds a user and copies it into mpvio. Creates a fake user
+ if no matching user account is found.
@note find_acl_user is not the same, because it doesn't take into
account the case when user is not empty, but acl_user->user is empty
@retval 0 found
- @retval 1 not found
+ @retval 1 error
*/
static bool find_mpvio_user(MPVIO_EXT *mpvio)
{
@@ -8054,8 +8125,27 @@ static bool find_mpvio_user(MPVIO_EXT *mpvio)
if (!mpvio->acl_user)
{
- login_failed_error(mpvio->thd);
- DBUG_RETURN (1);
+ /*
+ A matching user was not found. Fake it. Take any user, make the
+ authentication fail later.
+ This way we get a realistically looking failure, with occasional
+ "change auth plugin" requests even for nonexistent users. The ratio
+ of "change auth plugin" request will be the same for real and
+ nonexistent users.
+ Note, that we cannot pick any user at random, it must always be
+ the same user account for the incoming sctx->user name.
+ */
+ ulong nr1=1, nr2=4;
+ CHARSET_INFO *cs= &my_charset_latin1;
+ cs->coll->hash_sort(cs, (uchar*) sctx->user, strlen(sctx->user), &nr1, &nr2);
+
+ mysql_mutex_lock(&acl_cache->lock);
+ uint i= nr1 % acl_users.elements;
+ ACL_USER *acl_user_tmp= dynamic_element(&acl_users, i, ACL_USER*);
+ mpvio->acl_user= acl_user_tmp->copy(mpvio->thd->mem_root);
+ mysql_mutex_unlock(&acl_cache->lock);
+
+ mpvio->make_it_fail= true;
}
/* user account requires non-default plugin and the client is too old */
@@ -8182,6 +8272,7 @@ static bool parse_com_change_user_packet(MPVIO_EXT *mpvio, uint packet_length)
}
#ifndef NO_EMBEDDED_ACCESS_CHECKS
+ thd->password= passwd_len > 0;
if (find_mpvio_user(mpvio))
DBUG_RETURN(1);
@@ -8477,8 +8568,8 @@ static ulong parse_client_handshake_packet(MPVIO_EXT *mpvio,
mpvio->cached_server_packet.pkt_len))
return packet_error;
- passwd_len= my_net_read(&mpvio->thd->net);
- passwd= (char*)mpvio->thd->net.read_pos;
+ passwd_len= my_net_read(&thd->net);
+ passwd= (char*)thd->net.read_pos;
}
*buff= (uchar*) passwd;
@@ -8580,6 +8671,10 @@ static int server_mpvio_read_packet(MYSQL_PLUGIN_VIO *param, uchar **buf)
*buf= (uchar*) mpvio->cached_client_reply.pkt;
mpvio->cached_client_reply.pkt= 0;
mpvio->packets_read++;
+
+ if (mpvio->make_it_fail)
+ goto err;
+
DBUG_RETURN ((int) mpvio->cached_client_reply.pkt_len);
}
@@ -8614,6 +8709,9 @@ static int server_mpvio_read_packet(MYSQL_PLUGIN_VIO *param, uchar **buf)
else
*buf= mpvio->thd->net.read_pos;
+ if (mpvio->make_it_fail)
+ goto err;
+
DBUG_RETURN((int)pkt_len);
err:
@@ -8621,7 +8719,12 @@ err:
{
inc_host_errors(mpvio->thd->security_ctx->ip);
if (!mpvio->thd->is_error())
- my_error(ER_HANDSHAKE_ERROR, MYF(0));
+ {
+ if (mpvio->make_it_fail)
+ login_failed_error(mpvio->thd);
+ else
+ my_error(ER_HANDSHAKE_ERROR, MYF(0));
+ }
}
DBUG_RETURN(-1);
}
@@ -8826,6 +8929,7 @@ bool acl_authenticate(THD *thd, uint connect_errors,
mpvio.thd= thd;
mpvio.connect_errors= connect_errors;
mpvio.status= MPVIO_EXT::FAILURE;
+ mpvio.make_it_fail= false;
mpvio.auth_info.host_or_ip= thd->security_ctx->host_or_ip;
mpvio.auth_info.host_or_ip_length=
(unsigned int) strlen(thd->security_ctx->host_or_ip);
diff --git a/sql/sql_analyse.h b/sql/sql_analyse.h
index 34c8e2da3d4..8bac29de5a3 100644
--- a/sql/sql_analyse.h
+++ b/sql/sql_analyse.h
@@ -121,7 +121,8 @@ public:
must_be_blob(0), was_zero_fill(0),
was_maybe_zerofill(0), can_be_still_num(1)
{ init_tree(&tree, 0, 0, sizeof(String), (qsort_cmp2) sortcmp2,
- 0, (tree_element_free) free_string, NULL); };
+ (tree_element_free) free_string, NULL,
+ MYF(MY_THREAD_SPECIFIC)); };
void add();
void get_opt_type(String*, ha_rows);
@@ -162,7 +163,7 @@ public:
{
bin_size= my_decimal_get_binary_size(a->max_length, a->decimals);
init_tree(&tree, 0, 0, bin_size, (qsort_cmp2)compare_decimal2,
- 0, 0, (void *)&bin_size);
+ 0, (void *)&bin_size, MYF(MY_THREAD_SPECIFIC));
};
void add();
@@ -190,7 +191,8 @@ public:
field_real(Item* a, analyse* b) :field_info(a,b),
min_arg(0), max_arg(0), sum(0), sum_sqr(0), max_notzero_dec_len(0)
{ init_tree(&tree, 0, 0, sizeof(double),
- (qsort_cmp2) compare_double2, 0, NULL, NULL); }
+ (qsort_cmp2) compare_double2, NULL, NULL,
+ MYF(MY_THREAD_SPECIFIC)); }
void add();
void get_opt_type(String*, ha_rows);
@@ -244,7 +246,8 @@ public:
field_longlong(Item* a, analyse* b) :field_info(a,b),
min_arg(0), max_arg(0), sum(0), sum_sqr(0)
{ init_tree(&tree, 0, 0, sizeof(longlong),
- (qsort_cmp2) compare_longlong2, 0, NULL, NULL); }
+ (qsort_cmp2) compare_longlong2, NULL, NULL,
+ MYF(MY_THREAD_SPECIFIC)); }
void add();
void get_opt_type(String*, ha_rows);
@@ -289,7 +292,8 @@ public:
field_ulonglong(Item* a, analyse * b) :field_info(a,b),
min_arg(0), max_arg(0), sum(0),sum_sqr(0)
{ init_tree(&tree, 0, 0, sizeof(ulonglong),
- (qsort_cmp2) compare_ulonglong2, 0, NULL, NULL); }
+ (qsort_cmp2) compare_ulonglong2, NULL, NULL,
+ MYF(MY_THREAD_SPECIFIC)); }
void add();
void get_opt_type(String*, ha_rows);
String *get_min_arg(String *s) { s->set(min_arg,my_thd_charset); return s; }
diff --git a/sql/sql_array.h b/sql/sql_array.h
index 98a4a4815af..f07126bc0ef 100644
--- a/sql/sql_array.h
+++ b/sql/sql_array.h
@@ -100,7 +100,8 @@ template <class Elem> class Dynamic_array
public:
Dynamic_array(uint prealloc=16, uint increment=16)
{
- my_init_dynamic_array(&array, sizeof(Elem), prealloc, increment);
+ my_init_dynamic_array(&array, sizeof(Elem), prealloc, increment,
+ MYF(MY_THREAD_SPECIFIC));
}
Elem& at(int idx)
diff --git a/sql/sql_audit.cc b/sql/sql_audit.cc
index 131a71c1d6b..793eead9869 100644
--- a/sql/sql_audit.cc
+++ b/sql/sql_audit.cc
@@ -132,12 +132,9 @@ static const uint audit_handlers_count=
static my_bool acquire_plugins(THD *thd, plugin_ref plugin, void *arg)
{
- uint event_class= *(uint*) arg;
- unsigned long event_class_mask[MYSQL_AUDIT_CLASS_MASK_SIZE];
+ ulong *event_class_mask= (ulong*) arg;
st_mysql_audit *data= plugin_data(plugin, struct st_mysql_audit *);
- set_audit_mask(event_class_mask, event_class);
-
/* Check if this plugin is interested in the event */
if (check_audit_mask(data->class_mask, event_class_mask))
return 0;
@@ -156,7 +153,7 @@ static my_bool acquire_plugins(THD *thd, plugin_ref plugin, void *arg)
{
/* specify some reasonable initialization defaults */
my_init_dynamic_array(&thd->audit_class_plugins,
- sizeof(plugin_ref), 16, 16);
+ sizeof(plugin_ref), 16, 16, MYF(0));
}
/* lock the plugin and add it to the list */
@@ -176,15 +173,13 @@ static my_bool acquire_plugins(THD *thd, plugin_ref plugin, void *arg)
@details Ensure that audit plugins interested in given event
class are locked by current thread.
*/
-void mysql_audit_acquire_plugins(THD *thd, uint event_class)
+void mysql_audit_acquire_plugins(THD *thd, ulong *event_class_mask)
{
- unsigned long event_class_mask[MYSQL_AUDIT_CLASS_MASK_SIZE];
DBUG_ENTER("mysql_audit_acquire_plugins");
- set_audit_mask(event_class_mask, event_class);
if (thd && !check_audit_mask(mysql_global_audit_mask, event_class_mask) &&
check_audit_mask(thd->audit_class_mask, event_class_mask))
{
- plugin_foreach(thd, acquire_plugins, MYSQL_AUDIT_PLUGIN, &event_class);
+ plugin_foreach(thd, acquire_plugins, MYSQL_AUDIT_PLUGIN, event_class_mask);
add_audit_mask(thd->audit_class_mask, event_class_mask);
}
DBUG_VOID_RETURN;
@@ -206,7 +201,9 @@ void mysql_audit_notify(THD *thd, uint event_class, uint event_subtype, ...)
va_list ap;
audit_handler_t *handlers= audit_handlers + event_class;
DBUG_ASSERT(event_class < audit_handlers_count);
- mysql_audit_acquire_plugins(thd, event_class);
+ unsigned long event_class_mask[MYSQL_AUDIT_CLASS_MASK_SIZE];
+ set_audit_mask(event_class_mask, event_class);
+ mysql_audit_acquire_plugins(thd, event_class_mask);
va_start(ap, event_subtype);
(*handlers)(thd, event_subtype, ap);
va_end(ap);
@@ -364,6 +361,34 @@ int initialize_audit_plugin(st_plugin_int *plugin)
add_audit_mask(mysql_global_audit_mask, data->class_mask);
mysql_mutex_unlock(&LOCK_audit_mask);
+ /*
+ Pre-acquire the newly inslalled audit plugin for events that
+ may potentially occur further during INSTALL PLUGIN.
+
+ When audit event is triggered, audit subsystem acquires interested
+ plugins by walking through plugin list. Evidently plugin list
+ iterator protects plugin list by acquiring LOCK_plugin, see
+ plugin_foreach_with_mask().
+
+ On the other hand [UN]INSTALL PLUGIN is acquiring LOCK_plugin
+ rather for a long time.
+
+ When audit event is triggered during [UN]INSTALL PLUGIN, plugin
+ list iterator acquires the same lock (within the same thread)
+ second time.
+
+ This hack should be removed when LOCK_plugin is fixed so it
+ protects only what it supposed to protect.
+
+ See also mysql_install_plugin() and mysql_uninstall_plugin()
+ */
+ THD *thd= current_thd;
+ if (thd)
+ {
+ acquire_plugins(thd, plugin_int_to_ref(plugin), data->class_mask);
+ add_audit_mask(thd->audit_class_mask, data->class_mask);
+ }
+
return 0;
}
@@ -494,7 +519,7 @@ static void event_class_dispatch(THD *thd, unsigned int event_class,
#else /* EMBEDDED_LIBRARY */
-void mysql_audit_acquire_plugins(THD *thd, uint event_class)
+void mysql_audit_acquire_plugins(THD *thd, ulong *event_class_mask)
{
}
diff --git a/sql/sql_audit.h b/sql/sql_audit.h
index b2ce31f1d26..46afe4b7596 100644
--- a/sql/sql_audit.h
+++ b/sql/sql_audit.h
@@ -31,7 +31,7 @@ extern void mysql_audit_finalize();
extern void mysql_audit_init_thd(THD *thd);
extern void mysql_audit_free_thd(THD *thd);
-extern void mysql_audit_acquire_plugins(THD *thd, uint event_class);
+extern void mysql_audit_acquire_plugins(THD *thd, ulong *event_class_mask);
#ifndef EMBEDDED_LIBRARY
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index ec0438946c6..969e2f2c7e4 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -4700,6 +4700,7 @@ open_and_process_table(THD *thd, LEX *lex, TABLE_LIST *tables,
Field **table_field_ptr= tables->table->field;
for ( ; *field_ptr; field_ptr++, table_field_ptr++)
(*table_field_ptr)->read_stats= (*field_ptr)->read_stats;
+ tables->table->stats_is_read= table_share->stats_cb.stats_is_read;
}
}
}
@@ -5022,7 +5023,7 @@ bool open_tables(THD *thd, TABLE_LIST **start, uint *counter, uint flags,
anything yet, to avoid penalty for statements which don't use views
and thus new .FRM format.
*/
- init_sql_alloc(&new_frm_mem, 8024, 0);
+ init_sql_alloc(&new_frm_mem, 8024, 0, MYF(0));
thd->current_tablenr= 0;
restart:
@@ -9033,7 +9034,8 @@ fill_record(THD * thd, TABLE *table_arg, List<Item> &fields, List<Item> &values,
ER(ER_WARNING_NON_DEFAULT_VALUE_FOR_VIRTUAL_COLUMN),
rfield->field_name, table->s->table_name.str);
}
- if ((value->save_in_field(rfield, 0) < 0) && !ignore_errors)
+ if ((!rfield->vcol_info || rfield->stored_in_db) &&
+ (value->save_in_field(rfield, 0)) < 0 && !ignore_errors)
{
my_message(ER_UNKNOWN_ERROR, ER(ER_UNKNOWN_ERROR), MYF(0));
goto err;
@@ -9325,7 +9327,7 @@ my_bool mysql_rm_tmp_tables(void)
my_dirend(dirp);
}
delete thd;
- my_pthread_setspecific_ptr(THR_THD, 0);
+ set_current_thd(0);
DBUG_RETURN(0);
}
@@ -9389,7 +9391,11 @@ bool mysql_notify_thread_having_shared_lock(THD *thd, THD *in_use,
in_use->killed= KILL_SYSTEM_THREAD;
mysql_mutex_lock(&in_use->mysys_var->mutex);
if (in_use->mysys_var->current_cond)
+ {
+ mysql_mutex_lock(in_use->mysys_var->current_mutex);
mysql_cond_broadcast(in_use->mysys_var->current_cond);
+ mysql_mutex_unlock(in_use->mysys_var->current_mutex);
+ }
mysql_mutex_unlock(&in_use->mysys_var->mutex);
signalled= TRUE;
}
@@ -9949,6 +9955,7 @@ int dynamic_column_error_message(enum_dyncol_func_result rc)
switch (rc) {
case ER_DYNCOL_YES:
case ER_DYNCOL_OK:
+ case ER_DYNCOL_TRUNCATED:
break; // it is not an error
case ER_DYNCOL_FORMAT:
my_error(ER_DYN_COL_WRONG_FORMAT, MYF(0));
diff --git a/sql/sql_base.h b/sql/sql_base.h
index 5bbccc87cdc..78ab8c7df24 100644
--- a/sql/sql_base.h
+++ b/sql/sql_base.h
@@ -272,6 +272,7 @@ bool rename_temporary_table(THD* thd, TABLE *table, const char *new_db,
const char *table_name);
bool is_equal(const LEX_STRING *a, const LEX_STRING *b);
+class Open_tables_backup;
/* Functions to work with system tables. */
bool open_system_tables_for_read(THD *thd, TABLE_LIST *table_list,
Open_tables_backup *backup);
diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc
index 256a51b9575..f5e1deab546 100644
--- a/sql/sql_cache.cc
+++ b/sql/sql_cache.cc
@@ -1041,8 +1041,8 @@ void query_cache_insert(const char *packet, ulong length,
/*
Current_thd can be NULL when a new connection is immediately ended
due to "Too many connections". thd->store_globals() has not been
- called at this time and hence my_pthread_setspecific_ptr(THR_THD,
- this) has not been called for this thread.
+ called at this time and hence set_current_thd(this) has not been
+ called for this thread.
*/
if (!thd)
diff --git a/sql/sql_class.cc b/sql/sql_class.cc
index 0709509a740..a068cdc8f88 100644
--- a/sql/sql_class.cc
+++ b/sql/sql_class.cc
@@ -739,7 +739,7 @@ char *thd_security_context(THD *thd, char *buffer, unsigned int length,
values doesn't have to very accurate and the memory it points to is static,
but we need to attempt a snapshot on the pointer values to avoid using NULL
values. The pointer to thd->query however, doesn't point to static memory
- and has to be protected by LOCK_thread_count or risk pointing to
+ and has to be protected by thd->LOCK_thd_data or risk pointing to
uninitialized memory.
*/
const char *proc_info= thd->proc_info;
@@ -774,20 +774,21 @@ char *thd_security_context(THD *thd, char *buffer, unsigned int length,
str.append(proc_info);
}
- mysql_mutex_lock(&thd->LOCK_thd_data);
-
- if (thd->query())
+ /* Don't wait if LOCK_thd_data is used as this could cause a deadlock */
+ if (!mysql_mutex_trylock(&thd->LOCK_thd_data))
{
- if (max_query_len < 1)
- len= thd->query_length();
- else
- len= min(thd->query_length(), max_query_len);
- str.append('\n');
- str.append(thd->query(), len);
+ if (thd->query())
+ {
+ if (max_query_len < 1)
+ len= thd->query_length();
+ else
+ len= min(thd->query_length(), max_query_len);
+ str.append('\n');
+ str.append(thd->query(), len);
+ }
+ mysql_mutex_unlock(&thd->LOCK_thd_data);
}
- mysql_mutex_unlock(&thd->LOCK_thd_data);
-
if (str.c_ptr_safe() == buffer)
return buffer;
@@ -851,7 +852,9 @@ THD::THD()
m_statement_psi(NULL),
m_idle_psi(NULL),
m_server_idle(false),
+ thread_id(0),
global_disable_checkpoint(0),
+ failed_com_change_user(0),
is_fatal_error(0),
transaction_rollback_request(0),
is_fatal_sub_stmt_error(0),
@@ -865,17 +868,28 @@ THD::THD()
#if defined(ENABLED_DEBUG_SYNC)
debug_sync_control(0),
#endif /* defined(ENABLED_DEBUG_SYNC) */
- main_warning_info(0, false)
+ main_warning_info(0, false, false)
{
ulong tmp;
mdl_context.init(this);
/*
+ We set THR_THD to temporally point to this THD to register all the
+ variables that allocates memory for this THD
+ */
+ THD *old_THR_THD= current_thd;
+ set_current_thd(this);
+ status_var.memory_used= 0;
+
+ main_warning_info.init();
+ /*
Pass nominal parameters to init_alloc_root only to ensure that
the destructor works OK in case of an error. The main_mem_root
will be re-initialized in init_for_queries().
*/
- init_sql_alloc(&main_mem_root, ALLOC_ROOT_MIN_BLOCK_SIZE, 0);
+ init_sql_alloc(&main_mem_root, ALLOC_ROOT_MIN_BLOCK_SIZE, 0,
+ MYF(MY_THREAD_SPECIFIC));
+
stmt_arena= this;
thread_stack= 0;
scheduler= thread_scheduler; // Will be fixed later
@@ -914,7 +928,6 @@ THD::THD()
connection_name.length= 0;
bzero(&variables, sizeof(variables));
- thread_id= 0;
one_shot_set= 0;
file_id = 0;
query_id= 0;
@@ -932,6 +945,7 @@ THD::THD()
mysql_audit_init_thd(this);
#endif
net.vio=0;
+ net.buff= 0;
client_capabilities= 0; // minimalistic client
ull=0;
system_thread= NON_SYSTEM_THREAD;
@@ -973,7 +987,7 @@ THD::THD()
user_connect=(USER_CONN *)0;
my_hash_init(&user_vars, system_charset_info, USER_VARS_HASH_SIZE, 0, 0,
(my_hash_get_key) get_var_key,
- (my_hash_free_key) free_user_var, 0);
+ (my_hash_free_key) free_user_var, HASH_THREAD_SPECIFIC);
sp_proc_cache= NULL;
sp_func_cache= NULL;
@@ -981,7 +995,7 @@ THD::THD()
/* For user vars replication*/
if (opt_bin_log)
my_init_dynamic_array(&user_var_events,
- sizeof(BINLOG_USER_VAR_EVENT *), 16, 16);
+ sizeof(BINLOG_USER_VAR_EVENT *), 16, 16, MYF(0));
else
bzero((char*) &user_var_events, sizeof(user_var_events));
@@ -1004,6 +1018,8 @@ THD::THD()
prepare_derived_at_open= FALSE;
create_tmp_table_for_derived= FALSE;
save_prep_leaf_list= FALSE;
+ /* Restore THR_THD */
+ set_current_thd(old_THR_THD);
}
@@ -1272,6 +1288,7 @@ extern "C" THD *_current_thd_noinline(void)
void THD::init(void)
{
+ DBUG_ENTER("thd::init");
mysql_mutex_lock(&LOCK_global_system_variables);
plugin_thdvar_init(this);
/*
@@ -1302,7 +1319,7 @@ void THD::init(void)
tx_read_only= variables.tx_read_only;
update_charset();
reset_current_stmt_binlog_format_row();
- bzero((char *) &status_var, sizeof(status_var));
+ set_status_var_init();
bzero((char *) &org_status_var, sizeof(org_status_var));
if (variables.sql_log_bin)
@@ -1319,6 +1336,7 @@ void THD::init(void)
debug_sync_init_thread(this);
#endif /* defined(ENABLED_DEBUG_SYNC) */
apc_target.init(&LOCK_thd_data);
+ DBUG_VOID_RETURN;
}
@@ -1408,7 +1426,7 @@ void THD::change_user(void)
mysql_mutex_unlock(&LOCK_status);
cleanup();
- killed= NOT_KILLED;
+ reset_killed();
cleanup_done= 0;
init();
stmt_map.reset();
@@ -1492,8 +1510,16 @@ void THD::cleanup(void)
THD::~THD()
{
+ THD *orig_thd= current_thd;
THD_CHECK_SENTRY(this);
DBUG_ENTER("~THD()");
+
+ /*
+ In error cases, thd may not be current thd. We have to fix this so
+ that memory allocation counting is done correctly
+ */
+ set_current_thd(this);
+
/* Ensure that no one is using THD */
mysql_mutex_lock(&LOCK_thd_data);
mysys_var=0; // Safety (shouldn't be needed)
@@ -1502,10 +1528,8 @@ THD::~THD()
/* Close connection */
#ifndef EMBEDDED_LIBRARY
if (net.vio)
- {
vio_delete(net.vio);
- net_end(&net);
- }
+ net_end(&net);
#endif
stmt_map.reset(); /* close all prepared statements */
if (!cleanup_done)
@@ -1540,6 +1564,15 @@ THD::~THD()
#endif
free_root(&main_mem_root, MYF(0));
+ main_warning_info.free_memory();
+ if (status_var.memory_used != 0)
+ {
+ DBUG_PRINT("error", ("memory_used: %lld", status_var.memory_used));
+ SAFEMALLOC_REPORT_MEMORY(my_thread_dbug_id());
+ DBUG_ASSERT(status_var.memory_used == 0); // Ensure everything is freed
+ }
+
+ set_current_thd(orig_thd);
DBUG_VOID_RETURN;
}
@@ -1664,6 +1697,10 @@ void THD::awake(killed_state state_to_set)
MYSQL_CALLBACK(scheduler, post_kill_notification, (this));
}
+ /* Interrupt target waiting inside a storage engine. */
+ if (state_to_set != NOT_KILLED)
+ ha_kill_query(this, thd_kill_level(this));
+
/* Broadcast a condition to kick the target if it is waiting on it. */
if (mysys_var)
{
@@ -1811,7 +1848,7 @@ bool THD::store_globals()
*/
DBUG_ASSERT(thread_stack);
- if (my_pthread_setspecific_ptr(THR_THD, this) ||
+ if (set_current_thd(this) ||
my_pthread_setspecific_ptr(THR_MALLOC, &mem_root))
return 1;
/*
@@ -1855,7 +1892,7 @@ void THD::reset_globals()
mysql_mutex_unlock(&LOCK_thd_data);
/* Undocking the thread specific data. */
- my_pthread_setspecific_ptr(THR_THD, NULL);
+ set_current_thd(0);
my_pthread_setspecific_ptr(THR_MALLOC, NULL);
}
@@ -3711,7 +3748,8 @@ void thd_increment_net_big_packet_count(ulong length)
void THD::set_status_var_init()
{
- bzero((char*) &status_var, sizeof(status_var));
+ bzero((char*) &status_var, offsetof(STATUS_VAR,
+ last_cleared_system_status_var));
}
@@ -3907,19 +3945,29 @@ void THD::restore_backup_open_tables_state(Open_tables_backup *backup)
DBUG_VOID_RETURN;
}
+#if MARIA_PLUGIN_INTERFACE_VERSION < 0x0200
/**
- Check the killed state of a user thread
- @param thd user thread
- @retval 0 the user thread is active
- @retval 1 the user thread has been killed
-
- This is used to signal a storage engine if it should be killed.
- See also THD::check_killed().
+ This is a backward compatibility method, made obsolete
+ by the thd_kill_statement service. Keep it here to avoid breaking the
+ ABI in case some binary plugins still use it.
*/
-
+#undef thd_killed
extern "C" int thd_killed(const MYSQL_THD thd)
{
+ return thd_kill_level(thd) > THD_ABORT_SOFTLY;
+}
+#else
+#error now thd_killed() function can go away
+#endif
+
+/*
+ return thd->killed status to the client,
+ mapped to the API enum thd_kill_levels values.
+*/
+extern "C" enum thd_kill_levels thd_kill_level(const MYSQL_THD thd)
+{
THD* current= current_thd;
+
if (!thd)
thd= current;
@@ -3930,9 +3978,10 @@ extern "C" int thd_killed(const MYSQL_THD thd)
apc_target->process_apc_requests();
}
- if (!(thd->killed & KILL_HARD_BIT))
- return 0;
- return thd->killed;
+ if (likely(thd->killed == NOT_KILLED))
+ return THD_IS_NOT_KILLED;
+
+ return thd->killed & KILL_HARD_BIT ? THD_ABORT_ASAP : THD_ABORT_SOFTLY;
}
@@ -5115,7 +5164,7 @@ THD::binlog_prepare_pending_rows_event(TABLE* table, uint32 serv_id,
There is no good place to set up the transactional data, so we
have to do it here.
*/
- if (binlog_setup_trx_data())
+ if (binlog_setup_trx_data() == NULL)
DBUG_RETURN(NULL);
Rows_log_event* pending= binlog_get_pending_rows_event(is_transactional);
@@ -5808,4 +5857,3 @@ bool Discrete_intervals_list::append(Discrete_interval *new_interval)
}
#endif /* !defined(MYSQL_CLIENT) */
-
diff --git a/sql/sql_class.h b/sql/sql_class.h
index c50d8c9aba6..fccca9e8cbf 100644
--- a/sql/sql_class.h
+++ b/sql/sql_class.h
@@ -700,6 +700,8 @@ typedef struct system_status_var
ulonglong binlog_bytes_written;
double last_query_cost;
double cpu_time, busy_time;
+ /* Don't initialize */
+ volatile int64 memory_used; /* This shouldn't be accumulated */
} STATUS_VAR;
/*
@@ -709,6 +711,7 @@ typedef struct system_status_var
*/
#define last_system_status_var questions
+#define last_cleared_system_status_var memory_used
void mark_transaction_to_rollback(THD *thd, bool all);
@@ -1442,7 +1445,8 @@ public:
m_reopen_array(NULL),
m_locked_tables_count(0)
{
- init_sql_alloc(&m_locked_tables_root, MEM_ROOT_BLOCK_SIZE, 0);
+ init_sql_alloc(&m_locked_tables_root, MEM_ROOT_BLOCK_SIZE, 0,
+ MYF(MY_THREAD_SPECIFIC));
}
void unlock_locked_tables(THD *thd);
~Locked_tables_list()
@@ -1782,7 +1786,7 @@ public:
bool save_prep_leaf_list;
#ifndef MYSQL_CLIENT
- int binlog_setup_trx_data();
+ binlog_cache_mngr * binlog_setup_trx_data();
/*
Public interface to write RBR events to the binlog
@@ -1916,7 +1920,8 @@ public:
{
bzero((char*)this, sizeof(*this));
xid_state.xid.null();
- init_sql_alloc(&mem_root, ALLOC_ROOT_MIN_BLOCK_SIZE, 0);
+ init_sql_alloc(&mem_root, ALLOC_ROOT_MIN_BLOCK_SIZE, 0,
+ MYF(MY_THREAD_SPECIFIC));
}
} transaction;
Global_read_lock global_read_lock;
@@ -2315,6 +2320,7 @@ public:
bool no_errors;
uint8 password;
+ uint8 failed_com_change_user;
/**
Set to TRUE if execution of the current compound statement
@@ -2848,6 +2854,19 @@ public:
{
return ::killed_errno(killed);
}
+ inline void reset_killed()
+ {
+ /*
+ Resetting killed has to be done under a mutex to ensure
+ its not done during an awake() call.
+ */
+ if (killed != NOT_KILLED)
+ {
+ mysql_mutex_lock(&LOCK_thd_data);
+ killed= NOT_KILLED;
+ mysql_mutex_unlock(&LOCK_thd_data);
+ }
+ }
inline void send_kill_message() const
{
int err= killed_errno();
@@ -4092,6 +4111,8 @@ class Unique :public Sql_alloc
uint full_size;
uint min_dupl_count; /* always 0 for unions, > 0 for intersections */
+ bool merge(TABLE *table, uchar *buff, bool without_last_merge);
+
public:
ulong elements;
Unique(qsort_cmp2 comp_func, void *comp_func_fixed_arg,
@@ -4132,7 +4153,7 @@ public:
}
void reset();
- bool walk(tree_walk_action action, void *walk_action_arg);
+ bool walk(TABLE *table, tree_walk_action action, void *walk_action_arg);
uint get_size() const { return size; }
ulonglong get_max_in_memory_size() const { return max_in_memory_size; }
diff --git a/sql/sql_connect.cc b/sql/sql_connect.cc
index dcc63a80b25..59aa51916fb 100644
--- a/sql/sql_connect.cc
+++ b/sql/sql_connect.cc
@@ -905,6 +905,19 @@ static int check_connection(THD *thd)
my_error(ER_BAD_HOST_ERROR, MYF(0));
return 1;
}
+ /* BEGIN : DEBUG */
+ DBUG_EXECUTE_IF("addr_fake_ipv4",
+ {
+ struct sockaddr *sa= (sockaddr *) &net->vio->remote;
+ sa->sa_family= AF_INET;
+ struct in_addr *ip4= &((struct sockaddr_in *)sa)->sin_addr;
+ /* See RFC 5737, 192.0.2.0/23 is reserved */
+ const char* fake= "192.0.2.4";
+ ip4->s_addr= inet_addr(fake);
+ strcpy(ip, fake);
+ };);
+ /* END : DEBUG */
+
if (!(thd->main_security_ctx.ip= my_strdup(ip,MYF(MY_WME))))
return 1; /* The error is set by my_strdup(). */
thd->main_security_ctx.host_or_ip= thd->main_security_ctx.ip;
diff --git a/sql/sql_const.h b/sql/sql_const.h
index 255a0162e93..c6aa52197d5 100644
--- a/sql/sql_const.h
+++ b/sql/sql_const.h
@@ -43,8 +43,8 @@
#define MAX_MBWIDTH 3 /* Max multibyte sequence */
#define MAX_FIELD_CHARLENGTH 255
#define MAX_FIELD_VARCHARLENGTH 65535
-#define MAX_FIELD_BLOBLENGTH UINT_MAX32 /* cf field_blob::get_length() */
-#define CONVERT_IF_BIGGER_TO_BLOB 512 /* Used for CREATE ... SELECT */
+#define MAX_FIELD_BLOBLENGTH UINT_MAX32 /* cf field_blob::get_length() */
+#define CONVERT_IF_BIGGER_TO_BLOB 512 /* Threshold *in characters* */
/* Max column width +1 */
#define MAX_FIELD_WIDTH (MAX_FIELD_CHARLENGTH*MAX_MBWIDTH+1)
diff --git a/sql/sql_db.cc b/sql/sql_db.cc
index dc8a2e9f057..87650e643f2 100644
--- a/sql/sql_db.cc
+++ b/sql/sql_db.cc
@@ -1,5 +1,6 @@
/*
Copyright (c) 2000, 2011, Oracle and/or its affiliates.
+ Copyright (c) 2009, 2013, Monty Program Ab.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -755,7 +756,7 @@ bool mysql_rm_db(THD *thd,char *db,bool if_exists, bool silent)
{
ulong deleted_tables= 0;
bool error= true;
- char path[FN_REFLEN+16];
+ char path[FN_REFLEN + 16];
MY_DIR *dirp;
uint length;
bool found_other_files= false;
@@ -928,7 +929,7 @@ update_binlog:
if (!(query= (char*) thd->alloc(MAX_DROP_TABLE_Q_LEN)))
goto exit; /* not much else we can do */
- query_pos= query_data_start= strmov(query,"drop table ");
+ query_pos= query_data_start= strmov(query,"DROP TABLE ");
query_end= query + MAX_DROP_TABLE_Q_LEN;
db_len= strlen(db);
diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc
index 8a1b5f46bce..d0a83eac189 100644
--- a/sql/sql_delete.cc
+++ b/sql/sql_delete.cc
@@ -264,7 +264,8 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds,
{
DBUG_ASSERT(usable_index == MAX_KEY);
table->sort.io_cache= (IO_CACHE *) my_malloc(sizeof(IO_CACHE),
- MYF(MY_FAE | MY_ZEROFILL));
+ MYF(MY_FAE | MY_ZEROFILL |
+ MY_THREAD_SPECIFIC));
if (!(sortorder= make_unireg_sortorder(order, &length, NULL)) ||
(table->sort.found_records= filesort(thd, table, sortorder, length,
diff --git a/sql/sql_error.cc b/sql/sql_error.cc
index 06da6250e71..23a60267737 100644
--- a/sql/sql_error.cc
+++ b/sql/sql_error.cc
@@ -457,23 +457,38 @@ Diagnostics_area::disable_status()
m_status= DA_DISABLED;
}
-Warning_info::Warning_info(ulonglong warn_id_arg, bool allow_unlimited_warnings)
+Warning_info::Warning_info(ulonglong warn_id_arg,
+ bool allow_unlimited_warnings, bool initialize)
:m_statement_warn_count(0),
m_current_row_for_warning(1),
m_warn_id(warn_id_arg),
m_allow_unlimited_warnings(allow_unlimited_warnings),
+ initialized(0),
m_read_only(FALSE)
{
- /* Initialize sub structures */
- init_sql_alloc(&m_warn_root, WARN_ALLOC_BLOCK_SIZE, WARN_ALLOC_PREALLOC_SIZE);
m_warn_list.empty();
bzero((char*) m_warn_count, sizeof(m_warn_count));
+ if (initialize)
+ init();
}
+void Warning_info::init()
+{
+ /* Initialize sub structures */
+ init_sql_alloc(&m_warn_root, WARN_ALLOC_BLOCK_SIZE,
+ WARN_ALLOC_PREALLOC_SIZE, MYF(MY_THREAD_SPECIFIC));
+ initialized= 1;
+}
+
+void Warning_info::free_memory()
+{
+ if (initialized)
+ free_root(&m_warn_root,MYF(0));
+}
Warning_info::~Warning_info()
{
- free_root(&m_warn_root,MYF(0));
+ free_memory();
}
@@ -484,7 +499,7 @@ Warning_info::~Warning_info()
void Warning_info::clear_warning_info(ulonglong warn_id_arg)
{
m_warn_id= warn_id_arg;
- free_root(&m_warn_root, MYF(0));
+ free_memory();
bzero((char*) m_warn_count, sizeof(m_warn_count));
m_warn_list.empty();
m_statement_warn_count= 0;
diff --git a/sql/sql_error.h b/sql/sql_error.h
index f11ce6dcf0d..fadd3b51ec6 100644
--- a/sql/sql_error.h
+++ b/sql/sql_error.h
@@ -367,15 +367,21 @@ class Warning_info
/** Indicates if push_warning() allows unlimited number of warnings. */
bool m_allow_unlimited_warnings;
+ bool initialized; /* Set to 1 if init() has been called */
private:
Warning_info(const Warning_info &rhs); /* Not implemented */
Warning_info& operator=(const Warning_info &rhs); /* Not implemented */
public:
- Warning_info(ulonglong warn_id_arg, bool allow_unlimited_warnings);
+ Warning_info(ulonglong warn_id_arg, bool allow_unlimited_warnings,
+ bool initialize=true);
~Warning_info();
+ /* Allocate memory for structures */
+ void init();
+ void free_memory();
+
/**
Reset the warning information. Clear all warnings,
the number of warnings, reset current row counter
diff --git a/sql/sql_handler.cc b/sql/sql_handler.cc
index d03b38171fc..1c93a59904c 100644
--- a/sql/sql_handler.cc
+++ b/sql/sql_handler.cc
@@ -323,7 +323,7 @@ bool mysql_ha_open(THD *thd, TABLE_LIST *tables, SQL_HANDLER *reopen)
/* copy data to sql_handler */
if (!(sql_handler= new SQL_HANDLER(thd)))
goto err;
- init_alloc_root(&sql_handler->mem_root, 1024, 0);
+ init_alloc_root(&sql_handler->mem_root, 1024, 0, MYF(MY_THREAD_SPECIFIC));
sql_handler->db.length= strlen(tables->db);
sql_handler->table_name.length= strlen(tables->table_name);
@@ -846,14 +846,14 @@ retry:
case RFIRST:
if (keyname)
{
- table->file->ha_index_or_rnd_end();
- table->file->ha_index_init(keyno, 1);
- error= table->file->ha_index_first(table->record[0]);
+ if (!(error= table->file->ha_index_or_rnd_end()) &&
+ !(error= table->file->ha_index_init(keyno, 1)))
+ error= table->file->ha_index_first(table->record[0]);
}
else
{
- table->file->ha_index_or_rnd_end();
- if (!(error= table->file->ha_rnd_init(1)))
+ if (!(error= table->file->ha_index_or_rnd_end()) &&
+ !(error= table->file->ha_rnd_init(1)))
error= table->file->ha_rnd_next(table->record[0]);
}
mode= RNEXT;
@@ -872,10 +872,10 @@ retry:
/* else fall through */
case RLAST:
DBUG_ASSERT(keyname != 0);
- table->file->ha_index_or_rnd_end();
- table->file->ha_index_init(keyno, 1);
- error= table->file->ha_index_last(table->record[0]);
- mode= RPREV;
+ if (!(error= table->file->ha_index_or_rnd_end()) &&
+ !(error= table->file->ha_index_init(keyno, 1)))
+ error= table->file->ha_index_last(table->record[0]);
+ mode=RPREV;
break;
case RNEXT_SAME:
/* Continue scan on "(keypart1,keypart2,...)=(c1, c2, ...) */
@@ -889,13 +889,14 @@ retry:
if (!(key= (uchar*) thd->calloc(ALIGN_SIZE(handler->key_len))))
goto err;
- table->file->ha_index_or_rnd_end();
- table->file->ha_index_init(keyno, 1);
+ if ((error= table->file->ha_index_or_rnd_end()))
+ break;
key_copy(key, table->record[0], table->key_info + keyno,
handler->key_len);
- error= table->file->ha_index_read_map(table->record[0],
- key, handler->keypart_map,
- ha_rkey_mode);
+ if (!(error= table->file->ha_index_init(keyno, 1)))
+ error= table->file->ha_index_read_map(table->record[0],
+ key, handler->keypart_map,
+ ha_rkey_mode);
mode= rkey_to_rnext[(int)ha_rkey_mode];
break;
}
diff --git a/sql/sql_help.cc b/sql/sql_help.cc
index c352272e95c..458904ebe1d 100644
--- a/sql/sql_help.cc
+++ b/sql/sql_help.cc
@@ -303,8 +303,14 @@ int get_topics_for_keyword(THD *thd, TABLE *topics, TABLE *relations,
rtopic_id= find_fields[help_relation_help_topic_id].field;
rkey_id= find_fields[help_relation_help_keyword_id].field;
- topics->file->ha_index_init(iindex_topic,1);
- relations->file->ha_index_init(iindex_relations,1);
+ if (topics->file->ha_index_init(iindex_topic,1) ||
+ relations->file->ha_index_init(iindex_relations,1))
+ {
+ if (topics->file->inited)
+ topics->file->ha_index_end();
+ my_message(ER_CORRUPT_HELP_DB, ER(ER_CORRUPT_HELP_DB), MYF(0));
+ DBUG_RETURN(-1);
+ }
rkey_id->store((longlong) key_id, TRUE);
rkey_id->get_key_image(buff, rkey_id->pack_length(), Field::itRAW);
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc
index 67f3955ea61..09e4953cdc4 100644
--- a/sql/sql_insert.cc
+++ b/sql/sql_insert.cc
@@ -1,5 +1,6 @@
/*
Copyright (c) 2000, 2011, Oracle and/or its affiliates.
+ Copyright (c) 2009, 2013, Monty Program Ab.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -2252,11 +2253,8 @@ bool delayed_get_table(THD *thd, MDL_request *grl_protection_request,
want to send "Server shutdown in progress" in the
INSERT THREAD.
*/
- if (di->thd.stmt_da->sql_errno() == ER_SERVER_SHUTDOWN)
- my_message(ER_QUERY_INTERRUPTED, ER(ER_QUERY_INTERRUPTED), MYF(0));
- else
- my_message(di->thd.stmt_da->sql_errno(), di->thd.stmt_da->message(),
- MYF(0));
+ my_message(di->thd.stmt_da->sql_errno(), di->thd.stmt_da->message(),
+ MYF(0));
}
di->unlock();
goto end_create;
@@ -2305,7 +2303,8 @@ end_create:
TABLE *Delayed_insert::get_local_table(THD* client_thd)
{
my_ptrdiff_t adjust_ptrs;
- Field **field,**org_field, *found_next_number_field, **dfield_ptr= 0;
+ Field **field,**org_field, *found_next_number_field;
+ Field **UNINIT_VAR(vfield), **UNINIT_VAR(dfield_ptr);
TABLE *copy;
TABLE_SHARE *share;
uchar *bitmap;
@@ -2341,7 +2340,7 @@ TABLE *Delayed_insert::get_local_table(THD* client_thd)
killed using mysql_notify_thread_having_shared_lock() or
kill_delayed_threads_for_table().
*/
- if (!thd.is_error() || thd.stmt_da->sql_errno() == ER_SERVER_SHUTDOWN)
+ if (!thd.is_error())
my_message(ER_QUERY_INTERRUPTED, ER(ER_QUERY_INTERRUPTED), MYF(0));
else
my_message(thd.stmt_da->sql_errno(), thd.stmt_da->message(), MYF(0));
@@ -2365,6 +2364,13 @@ TABLE *Delayed_insert::get_local_table(THD* client_thd)
if (!copy_tmp)
goto error;
+ if (share->vfields)
+ {
+ vfield= (Field **) client_thd->alloc((share->vfields+1)*sizeof(Field*));
+ if (!vfield)
+ goto error;
+ }
+
/* Copy the TABLE object. */
copy= new (copy_tmp) TABLE;
*copy= *table;
@@ -2410,6 +2416,28 @@ TABLE *Delayed_insert::get_local_table(THD* client_thd)
}
}
*field=0;
+
+ if (share->vfields)
+ {
+ copy->vfield= vfield;
+ for (field= copy->field; *field; field++)
+ {
+ if ((*field)->vcol_info)
+ {
+ bool error_reported= FALSE;
+ if (unpack_vcol_info_from_frm(client_thd,
+ client_thd->mem_root,
+ copy,
+ *field,
+ &(*field)->vcol_info->expr_str,
+ &error_reported))
+ goto error;
+ *vfield++= *field;
+ }
+ }
+ *vfield= 0;
+ }
+
if (share->default_fields)
*dfield_ptr= NULL;
@@ -2484,7 +2512,9 @@ int write_delayed(THD *thd, TABLE *table, enum_duplicates duplic,
goto err;
}
- if (!(row->record= (char*) my_malloc(table->s->reclength, MYF(MY_WME))))
+ /* This can't be THREAD_SPECIFIC as it's freed in delayed thread */
+ if (!(row->record= (char*) my_malloc(table->s->reclength,
+ MYF(MY_WME))))
goto err;
memcpy(row->record, table->record[0], table->s->reclength);
row->start_time= thd->start_time;
@@ -2715,7 +2745,10 @@ pthread_handler_t handle_delayed_insert(void *arg)
thd->thread_id= thd->variables.pseudo_thread_id= thread_id++;
thd->set_current_time();
threads.append(thd);
- thd->killed=abort_loop ? KILL_CONNECTION : NOT_KILLED;
+ if (abort_loop)
+ thd->killed= KILL_CONNECTION;
+ else
+ thd->reset_killed();
mysql_mutex_unlock(&LOCK_thread_count);
mysql_thread_set_psi_id(thd->thread_id);
@@ -2814,8 +2847,12 @@ pthread_handler_t handle_delayed_insert(void *arg)
set_timespec(abstime, delayed_insert_timeout);
/* Information for pthread_kill */
+ mysql_mutex_unlock(&di->mutex);
+ mysql_mutex_lock(&di->thd.mysys_var->mutex);
di->thd.mysys_var->current_mutex= &di->mutex;
di->thd.mysys_var->current_cond= &di->cond;
+ mysql_mutex_unlock(&di->thd.mysys_var->mutex);
+ mysql_mutex_lock(&di->mutex);
THD_STAGE_INFO(&(di->thd), stage_waiting_for_insert);
DBUG_PRINT("info",("Waiting for someone to insert rows"));
@@ -2900,24 +2937,28 @@ pthread_handler_t handle_delayed_insert(void *arg)
DBUG_LEAVE;
}
- di->table=0;
- thd->killed= KILL_CONNECTION; // If error
- mysql_mutex_unlock(&di->mutex);
+ {
+ DBUG_ENTER("handle_delayed_insert-cleanup");
+ di->table=0;
+ thd->killed= KILL_CONNECTION; // If error
+ mysql_mutex_unlock(&di->mutex);
- close_thread_tables(thd); // Free the table
- thd->mdl_context.release_transactional_locks();
- mysql_cond_broadcast(&di->cond_client); // Safety
+ close_thread_tables(thd); // Free the table
+ thd->mdl_context.release_transactional_locks();
+ mysql_cond_broadcast(&di->cond_client); // Safety
- mysql_mutex_lock(&LOCK_delayed_create); // Because of delayed_get_table
- mysql_mutex_lock(&LOCK_delayed_insert);
- /*
- di should be unlinked from the thread handler list and have no active
- clients
- */
- delete di;
- mysql_mutex_unlock(&LOCK_delayed_insert);
- mysql_mutex_unlock(&LOCK_delayed_create);
+ mysql_mutex_lock(&LOCK_delayed_create); // Because of delayed_get_table
+ mysql_mutex_lock(&LOCK_delayed_insert);
+ /*
+ di should be unlinked from the thread handler list and have no active
+ clients
+ */
+ delete di;
+ mysql_mutex_unlock(&LOCK_delayed_insert);
+ mysql_mutex_unlock(&LOCK_delayed_create);
+ DBUG_LEAVE;
+ }
my_thread_end();
pthread_exit(0);
diff --git a/sql/sql_join_cache.cc b/sql/sql_join_cache.cc
index 07266cc9cbe..fde9f70fa79 100644
--- a/sql/sql_join_cache.cc
+++ b/sql/sql_join_cache.cc
@@ -934,7 +934,7 @@ int JOIN_CACHE::alloc_buffer()
{
ulong next_buff_size;
- if ((buff= (uchar*) my_malloc(buff_size, MYF(0))))
+ if ((buff= (uchar*) my_malloc(buff_size, MYF(MY_THREAD_SPECIFIC))))
break;
next_buff_size= buff_size > buff_size_decr ? buff_size-buff_size_decr : 0;
@@ -1012,7 +1012,7 @@ int JOIN_CACHE::realloc_buffer()
{
int rc;
free();
- rc= test(!(buff= (uchar*) my_malloc(buff_size, MYF(0))));
+ rc= test(!(buff= (uchar*) my_malloc(buff_size, MYF(MY_THREAD_SPECIFIC))));
reset(TRUE);
return rc;
}
@@ -2801,7 +2801,7 @@ int JOIN_CACHE_HASHED::realloc_buffer()
{
int rc;
free();
- rc= test(!(buff= (uchar*) my_malloc(buff_size, MYF(0))));
+ rc= test(!(buff= (uchar*) my_malloc(buff_size, MYF(MY_THREAD_SPECIFIC))));
init_hash_table();
reset(TRUE);
return rc;
@@ -3894,13 +3894,15 @@ int JOIN_TAB_SCAN_MRR::next()
int rc= join_tab->table->file->multi_range_read_next((range_id_t*)ptr) ? -1 : 0;
if (!rc)
{
- /*
+ /*
If a record in in an incremental cache contains no fields then the
association for the last record in cache will be equal to cache->end_pos
- */
- DBUG_ASSERT((!(mrr_mode & HA_MRR_NO_ASSOCIATION))?
- (cache->buff <= (uchar *) (*ptr) &&
- (uchar *) (*ptr) <= cache->end_pos): TRUE);
+ */
+ /*
+ psergey: this makes no sense where HA_MRR_NO_ASSOC is used.
+ DBUG_ASSERT(cache->buff <= (uchar *) (*ptr) &&
+ (uchar *) (*ptr) <= cache->end_pos);
+ */
if (join_tab->table->vfield)
update_virtual_fields(join->thd, join_tab->table);
}
@@ -3910,663 +3912,663 @@ int JOIN_TAB_SCAN_MRR::next()
static
void bka_range_seq_key_info(void *init_params, uint *length,
- key_part_map *map)
+ key_part_map *map)
{
- TABLE_REF *ref= &(((JOIN_CACHE*)init_params)->join_tab->ref);
- *length= ref->key_length;
- *map= (key_part_map(1) << ref->key_parts) - 1;
+TABLE_REF *ref= &(((JOIN_CACHE*)init_params)->join_tab->ref);
+*length= ref->key_length;
+*map= (key_part_map(1) << ref->key_parts) - 1;
}
/*
- Initialize retrieval of range sequence for BKA join algorithm
-
- SYNOPSIS
- bka_range_seq_init()
- init_params pointer to the BKA join cache object
- n_ranges the number of ranges obtained
- flags combination of MRR flags
-
- DESCRIPTION
- The function interprets init_param as a pointer to a JOIN_CACHE_BKA
- object. The function prepares for an iteration over the join keys
- built for all records from the cache join buffer.
-
- NOTE
- This function are used only as a callback function.
-
- RETURN VALUE
- init_param value that is to be used as a parameter of bka_range_seq_next()
+Initialize retrieval of range sequence for BKA join algorithm
+
+SYNOPSIS
+ bka_range_seq_init()
+ init_params pointer to the BKA join cache object
+ n_ranges the number of ranges obtained
+ flags combination of MRR flags
+
+DESCRIPTION
+ The function interprets init_param as a pointer to a JOIN_CACHE_BKA
+ object. The function prepares for an iteration over the join keys
+ built for all records from the cache join buffer.
+
+NOTE
+ This function are used only as a callback function.
+
+RETURN VALUE
+ init_param value that is to be used as a parameter of bka_range_seq_next()
*/
static
range_seq_t bka_range_seq_init(void *init_param, uint n_ranges, uint flags)
{
- DBUG_ENTER("bka_range_seq_init");
- JOIN_CACHE_BKA *cache= (JOIN_CACHE_BKA *) init_param;
- cache->reset(0);
- DBUG_RETURN((range_seq_t) init_param);
+DBUG_ENTER("bka_range_seq_init");
+JOIN_CACHE_BKA *cache= (JOIN_CACHE_BKA *) init_param;
+cache->reset(0);
+DBUG_RETURN((range_seq_t) init_param);
}
/*
- Get the next range/key over records from the join buffer used by a BKA cache
-
- SYNOPSIS
- bka_range_seq_next()
- seq the value returned by bka_range_seq_init
- range OUT reference to the next range
+Get the next range/key over records from the join buffer used by a BKA cache
- DESCRIPTION
- The function interprets seq as a pointer to a JOIN_CACHE_BKA
- object. The function returns a pointer to the range descriptor
- for the key built over the next record from the join buffer.
-
- NOTE
- This function are used only as a callback function.
-
- RETURN VALUE
- FALSE ok, the range structure filled with info about the next range/key
- TRUE no more ranges
+SYNOPSIS
+ bka_range_seq_next()
+ seq the value returned by bka_range_seq_init
+ range OUT reference to the next range
+
+DESCRIPTION
+ The function interprets seq as a pointer to a JOIN_CACHE_BKA
+ object. The function returns a pointer to the range descriptor
+ for the key built over the next record from the join buffer.
+
+NOTE
+ This function are used only as a callback function.
+
+RETURN VALUE
+ FALSE ok, the range structure filled with info about the next range/key
+ TRUE no more ranges
*/
static
bool bka_range_seq_next(range_seq_t rseq, KEY_MULTI_RANGE *range)
{
- DBUG_ENTER("bka_range_seq_next");
- JOIN_CACHE_BKA *cache= (JOIN_CACHE_BKA *) rseq;
- TABLE_REF *ref= &cache->join_tab->ref;
- key_range *start_key= &range->start_key;
- if ((start_key->length= cache->get_next_key((uchar **) &start_key->key)))
- {
- start_key->keypart_map= (1 << ref->key_parts) - 1;
- start_key->flag= HA_READ_KEY_EXACT;
- range->end_key= *start_key;
- range->end_key.flag= HA_READ_AFTER_KEY;
- range->ptr= (char *) cache->get_curr_rec();
- range->range_flag= EQ_RANGE;
- DBUG_RETURN(0);
- }
- DBUG_RETURN(1);
+DBUG_ENTER("bka_range_seq_next");
+JOIN_CACHE_BKA *cache= (JOIN_CACHE_BKA *) rseq;
+TABLE_REF *ref= &cache->join_tab->ref;
+key_range *start_key= &range->start_key;
+if ((start_key->length= cache->get_next_key((uchar **) &start_key->key)))
+{
+ start_key->keypart_map= (1 << ref->key_parts) - 1;
+ start_key->flag= HA_READ_KEY_EXACT;
+ range->end_key= *start_key;
+ range->end_key.flag= HA_READ_AFTER_KEY;
+ range->ptr= (char *) cache->get_curr_rec();
+ range->range_flag= EQ_RANGE;
+ DBUG_RETURN(0);
+}
+DBUG_RETURN(1);
}
/*
- Check whether range_info orders to skip the next record from BKA buffer
-
- SYNOPSIS
- bka_range_seq_skip_record()
- seq value returned by bka_range_seq_init()
- range_info information about the next range
- rowid [NOT USED] rowid of the record to be checked
+Check whether range_info orders to skip the next record from BKA buffer
-
- DESCRIPTION
- The function interprets seq as a pointer to a JOIN_CACHE_BKA object.
- The function returns TRUE if the record with this range_info
- is to be filtered out from the stream of records returned by
- multi_range_read_next().
-
- NOTE
- This function are used only as a callback function.
+SYNOPSIS
+ bka_range_seq_skip_record()
+ seq value returned by bka_range_seq_init()
+ range_info information about the next range
+ rowid [NOT USED] rowid of the record to be checked
- RETURN VALUE
- 1 record with this range_info is to be filtered out from the stream
- of records returned by multi_range_read_next()
- 0 the record is to be left in the stream
+
+DESCRIPTION
+ The function interprets seq as a pointer to a JOIN_CACHE_BKA object.
+ The function returns TRUE if the record with this range_info
+ is to be filtered out from the stream of records returned by
+ multi_range_read_next().
+
+NOTE
+ This function are used only as a callback function.
+
+RETURN VALUE
+ 1 record with this range_info is to be filtered out from the stream
+ of records returned by multi_range_read_next()
+ 0 the record is to be left in the stream
*/
static
bool bka_range_seq_skip_record(range_seq_t rseq, range_id_t range_info, uchar *rowid)
{
- DBUG_ENTER("bka_range_seq_skip_record");
- JOIN_CACHE_BKA *cache= (JOIN_CACHE_BKA *) rseq;
- bool res= cache->get_match_flag_by_pos((uchar *) range_info) ==
- JOIN_CACHE::MATCH_FOUND;
- DBUG_RETURN(res);
+DBUG_ENTER("bka_range_seq_skip_record");
+JOIN_CACHE_BKA *cache= (JOIN_CACHE_BKA *) rseq;
+bool res= cache->get_match_flag_by_pos((uchar *) range_info) ==
+ JOIN_CACHE::MATCH_FOUND;
+DBUG_RETURN(res);
}
/*
- Check if the record combination from BKA cache matches the index condition
+Check if the record combination from BKA cache matches the index condition
- SYNOPSIS
- bka_skip_index_tuple()
- rseq value returned by bka_range_seq_init()
- range_info record chain for the next range/key returned by MRR
-
- DESCRIPTION
- This is wrapper for JOIN_CACHE_BKA::skip_index_tuple method,
- see comments there.
+SYNOPSIS
+ bka_skip_index_tuple()
+ rseq value returned by bka_range_seq_init()
+ range_info record chain for the next range/key returned by MRR
+
+DESCRIPTION
+ This is wrapper for JOIN_CACHE_BKA::skip_index_tuple method,
+ see comments there.
- NOTE
- This function is used as a RANGE_SEQ_IF::skip_index_tuple callback.
-
- RETURN VALUE
- 0 The record combination satisfies the index condition
- 1 Otherwise
+NOTE
+ This function is used as a RANGE_SEQ_IF::skip_index_tuple callback.
+
+RETURN VALUE
+ 0 The record combination satisfies the index condition
+ 1 Otherwise
*/
static
bool bka_skip_index_tuple(range_seq_t rseq, range_id_t range_info)
{
- DBUG_ENTER("bka_skip_index_tuple");
- JOIN_CACHE_BKA *cache= (JOIN_CACHE_BKA *) rseq;
- THD *thd= cache->thd();
- bool res;
- status_var_increment(thd->status_var.ha_icp_attempts);
- if (!(res= cache->skip_index_tuple(range_info)))
- status_var_increment(thd->status_var.ha_icp_match);
- DBUG_RETURN(res);
+DBUG_ENTER("bka_skip_index_tuple");
+JOIN_CACHE_BKA *cache= (JOIN_CACHE_BKA *) rseq;
+THD *thd= cache->thd();
+bool res;
+status_var_increment(thd->status_var.ha_icp_attempts);
+if (!(res= cache->skip_index_tuple(range_info)))
+ status_var_increment(thd->status_var.ha_icp_match);
+DBUG_RETURN(res);
}
/*
- Prepare to read the record from BKA cache matching the current joined record
-
- SYNOPSIS
- prepare_look_for_matches()
- skip_last <-> ignore the last record in the buffer (always unused here)
-
- DESCRIPTION
- The function prepares to iterate over records in the join cache buffer
- matching the record loaded into the record buffer for join_tab when
- performing join operation by BKA join algorithm. With BKA algorithms the
- record loaded into the record buffer for join_tab always has a direct
- reference to the matching records from the join buffer. When the regular
- BKA join algorithm is employed the record from join_tab can refer to
- only one such record.
- The function sets the counter of the remaining records from the cache
- buffer that would match the current join_tab record to 1.
-
- RETURN VALUE
- TRUE there are no records in the buffer to iterate over
- FALSE otherwise
+Prepare to read the record from BKA cache matching the current joined record
+
+SYNOPSIS
+ prepare_look_for_matches()
+ skip_last <-> ignore the last record in the buffer (always unused here)
+
+DESCRIPTION
+ The function prepares to iterate over records in the join cache buffer
+ matching the record loaded into the record buffer for join_tab when
+ performing join operation by BKA join algorithm. With BKA algorithms the
+ record loaded into the record buffer for join_tab always has a direct
+ reference to the matching records from the join buffer. When the regular
+ BKA join algorithm is employed the record from join_tab can refer to
+ only one such record.
+ The function sets the counter of the remaining records from the cache
+ buffer that would match the current join_tab record to 1.
+
+RETURN VALUE
+ TRUE there are no records in the buffer to iterate over
+ FALSE otherwise
*/
-
+
bool JOIN_CACHE_BKA::prepare_look_for_matches(bool skip_last)
{
- if (!records)
- return TRUE;
- rem_records= 1;
- return FALSE;
+if (!records)
+ return TRUE;
+rem_records= 1;
+return FALSE;
}
/*
- Get the record from the BKA cache matching the current joined record
-
- SYNOPSIS
- get_next_candidate_for_match
-
- DESCRIPTION
- This method is used for iterations over the records from the join
- cache buffer when looking for matches for records from join_tab.
- The method performs the necessary preparations to read the next record
- from the join buffer into the record buffer by the method
- read_next_candidate_for_match, or, to skip the next record from the join
- buffer by the method skip_if_not_needed_match.
- This implementation of the virtual method get_next_candidate_for_match
- just decrements the counter of the records that are to be iterated over
- and returns the value of curr_association as a reference to the position
- of the beginning of the record fields in the buffer.
-
- RETURN VALUE
- pointer to the start of the record fields in the join buffer
- if the there is another record to iterate over, 0 - otherwise.
+Get the record from the BKA cache matching the current joined record
+
+SYNOPSIS
+ get_next_candidate_for_match
+
+DESCRIPTION
+ This method is used for iterations over the records from the join
+ cache buffer when looking for matches for records from join_tab.
+ The method performs the necessary preparations to read the next record
+ from the join buffer into the record buffer by the method
+ read_next_candidate_for_match, or, to skip the next record from the join
+ buffer by the method skip_if_not_needed_match.
+ This implementation of the virtual method get_next_candidate_for_match
+ just decrements the counter of the records that are to be iterated over
+ and returns the value of curr_association as a reference to the position
+ of the beginning of the record fields in the buffer.
+
+RETURN VALUE
+ pointer to the start of the record fields in the join buffer
+ if the there is another record to iterate over, 0 - otherwise.
*/
uchar *JOIN_CACHE_BKA::get_next_candidate_for_match()
{
- if (!rem_records)
- return 0;
- rem_records--;
- return curr_association;
+if (!rem_records)
+ return 0;
+rem_records--;
+return curr_association;
}
/*
- Check whether the matching record from the BKA cache is to be skipped
-
- SYNOPSIS
- skip_next_candidate_for_match
- rec_ptr pointer to the position in the join buffer right after
- the previous record
-
- DESCRIPTION
- This implementation of the virtual function just calls the
- method get_match_flag_by_pos to check whether the record referenced
- by ref_ptr has its match flag set to MATCH_FOUND.
-
- RETURN VALUE
- TRUE the record referenced by rec_ptr has its match flag set to
- MATCH_FOUND
- FALSE otherwise
+Check whether the matching record from the BKA cache is to be skipped
+
+SYNOPSIS
+ skip_next_candidate_for_match
+ rec_ptr pointer to the position in the join buffer right after
+ the previous record
+
+DESCRIPTION
+ This implementation of the virtual function just calls the
+ method get_match_flag_by_pos to check whether the record referenced
+ by ref_ptr has its match flag set to MATCH_FOUND.
+
+RETURN VALUE
+ TRUE the record referenced by rec_ptr has its match flag set to
+ MATCH_FOUND
+ FALSE otherwise
*/
bool JOIN_CACHE_BKA::skip_next_candidate_for_match(uchar *rec_ptr)
{
- return join_tab->check_only_first_match() &&
- (get_match_flag_by_pos(rec_ptr) == MATCH_FOUND);
+return join_tab->check_only_first_match() &&
+ (get_match_flag_by_pos(rec_ptr) == MATCH_FOUND);
}
/*
- Read the next record from the BKA join cache buffer when looking for matches
-
- SYNOPSIS
- read_next_candidate_for_match
- rec_ptr pointer to the position in the join buffer right after
- the previous record
-
- DESCRIPTION
- This implementation of the virtual method read_next_candidate_for_match
- calls the method get_record_by_pos to read the record referenced by rec_ptr
- from the join buffer into the record buffer. If this record refers to
- fields in the other join buffers the call of get_record_by_po ensures that
- these fields are read into the corresponding record buffers as well.
- This function is supposed to be called after a successful call of
- the method get_next_candidate_for_match.
-
- RETURN VALUE
- none
+Read the next record from the BKA join cache buffer when looking for matches
+
+SYNOPSIS
+ read_next_candidate_for_match
+ rec_ptr pointer to the position in the join buffer right after
+ the previous record
+
+DESCRIPTION
+ This implementation of the virtual method read_next_candidate_for_match
+ calls the method get_record_by_pos to read the record referenced by rec_ptr
+ from the join buffer into the record buffer. If this record refers to
+ fields in the other join buffers the call of get_record_by_po ensures that
+ these fields are read into the corresponding record buffers as well.
+ This function is supposed to be called after a successful call of
+ the method get_next_candidate_for_match.
+
+RETURN VALUE
+ none
*/
void JOIN_CACHE_BKA::read_next_candidate_for_match(uchar *rec_ptr)
{
- get_record_by_pos(rec_ptr);
+get_record_by_pos(rec_ptr);
}
/*
- Initialize the BKA join cache
+Initialize the BKA join cache
- SYNOPSIS
- init
+SYNOPSIS
+ init
- DESCRIPTION
- The function initializes the cache structure. It is supposed to be called
- right after a constructor for the JOIN_CACHE_BKA.
+DESCRIPTION
+ The function initializes the cache structure. It is supposed to be called
+ right after a constructor for the JOIN_CACHE_BKA.
- NOTES
- The function first constructs a companion object of the type
- JOIN_TAB_SCAN_MRR, then it calls the init method of the parent class.
-
- RETURN VALUE
- 0 initialization with buffer allocations has been succeeded
- 1 otherwise
+NOTES
+ The function first constructs a companion object of the type
+ JOIN_TAB_SCAN_MRR, then it calls the init method of the parent class.
+
+RETURN VALUE
+ 0 initialization with buffer allocations has been succeeded
+ 1 otherwise
*/
int JOIN_CACHE_BKA::init()
{
- int res;
- bool check_only_first_match= join_tab->check_only_first_match();
+int res;
+bool check_only_first_match= join_tab->check_only_first_match();
- RANGE_SEQ_IF rs_funcs= { bka_range_seq_key_info,
- bka_range_seq_init,
- bka_range_seq_next,
- check_only_first_match ?
- bka_range_seq_skip_record : 0,
- bka_skip_index_tuple };
+RANGE_SEQ_IF rs_funcs= { bka_range_seq_key_info,
+ bka_range_seq_init,
+ bka_range_seq_next,
+ check_only_first_match ?
+ bka_range_seq_skip_record : 0,
+ bka_skip_index_tuple };
- DBUG_ENTER("JOIN_CACHE_BKA::init");
+DBUG_ENTER("JOIN_CACHE_BKA::init");
- JOIN_TAB_SCAN_MRR *jsm;
- if (!(join_tab_scan= jsm= new JOIN_TAB_SCAN_MRR(join, join_tab,
- mrr_mode, rs_funcs)))
- DBUG_RETURN(1);
+JOIN_TAB_SCAN_MRR *jsm;
+if (!(join_tab_scan= jsm= new JOIN_TAB_SCAN_MRR(join, join_tab,
+ mrr_mode, rs_funcs)))
+ DBUG_RETURN(1);
- if ((res= JOIN_CACHE::init()))
- DBUG_RETURN(res);
+if ((res= JOIN_CACHE::init()))
+ DBUG_RETURN(res);
- if (use_emb_key)
- jsm->mrr_mode |= HA_MRR_MATERIALIZED_KEYS;
+if (use_emb_key)
+ jsm->mrr_mode |= HA_MRR_MATERIALIZED_KEYS;
- DBUG_RETURN(0);
+DBUG_RETURN(0);
}
/*
- Get the key built over the next record from BKA join buffer
-
- SYNOPSIS
- get_next_key()
- key pointer to the buffer where the key value is to be placed
-
- DESCRIPTION
- The function reads key fields from the current record in the join buffer.
- and builds the key value out of these fields that will be used to access
- the 'join_tab' table. Some of key fields may belong to previous caches.
- They are accessed via record references to the record parts stored in the
- previous join buffers. The other key fields always are placed right after
- the flag fields of the record.
- If the key is embedded, which means that its value can be read directly
- from the join buffer, then *key is set to the beginning of the key in
- this buffer. Otherwise the key is built in the join_tab->ref->key_buff.
- The function returns the length of the key if it succeeds ro read it.
- If is assumed that the functions starts reading at the position of
- the record length which is provided for each records in a BKA cache.
- After the key is built the 'pos' value points to the first position after
- the current record.
- The function just skips the records with MATCH_IMPOSSIBLE in the
- match flag field if there is any.
- The function returns 0 if the initial position is after the beginning
- of the record fields for last record from the join buffer.
-
- RETURN VALUE
- length of the key value - if the starting value of 'pos' points to
- the position before the fields for the last record,
- 0 - otherwise.
+Get the key built over the next record from BKA join buffer
+
+SYNOPSIS
+ get_next_key()
+ key pointer to the buffer where the key value is to be placed
+
+DESCRIPTION
+ The function reads key fields from the current record in the join buffer.
+ and builds the key value out of these fields that will be used to access
+ the 'join_tab' table. Some of key fields may belong to previous caches.
+ They are accessed via record references to the record parts stored in the
+ previous join buffers. The other key fields always are placed right after
+ the flag fields of the record.
+ If the key is embedded, which means that its value can be read directly
+ from the join buffer, then *key is set to the beginning of the key in
+ this buffer. Otherwise the key is built in the join_tab->ref->key_buff.
+ The function returns the length of the key if it succeeds ro read it.
+ If is assumed that the functions starts reading at the position of
+ the record length which is provided for each records in a BKA cache.
+ After the key is built the 'pos' value points to the first position after
+ the current record.
+ The function just skips the records with MATCH_IMPOSSIBLE in the
+ match flag field if there is any.
+ The function returns 0 if the initial position is after the beginning
+ of the record fields for last record from the join buffer.
+
+RETURN VALUE
+ length of the key value - if the starting value of 'pos' points to
+ the position before the fields for the last record,
+ 0 - otherwise.
*/
uint JOIN_CACHE_BKA::get_next_key(uchar ** key)
{
- uint len;
- uint32 rec_len;
- uchar *init_pos;
- JOIN_CACHE *cache;
-
+uint len;
+uint32 rec_len;
+uchar *init_pos;
+JOIN_CACHE *cache;
+
start:
- /* Any record in a BKA cache is prepended with its length */
- DBUG_ASSERT(with_length);
-
- if ((pos+size_of_rec_len) > last_rec_pos || !records)
- return 0;
+/* Any record in a BKA cache is prepended with its length */
+DBUG_ASSERT(with_length);
+
+if ((pos+size_of_rec_len) > last_rec_pos || !records)
+ return 0;
- /* Read the length of the record */
- rec_len= get_rec_length(pos);
- pos+= size_of_rec_len;
- init_pos= pos;
+/* Read the length of the record */
+rec_len= get_rec_length(pos);
+pos+= size_of_rec_len;
+init_pos= pos;
- /* Read a reference to the previous cache if any */
- if (prev_cache)
- pos+= prev_cache->get_size_of_rec_offset();
+/* Read a reference to the previous cache if any */
+if (prev_cache)
+ pos+= prev_cache->get_size_of_rec_offset();
- curr_rec_pos= pos;
+curr_rec_pos= pos;
- /* Read all flag fields of the record */
- read_flag_fields();
+/* Read all flag fields of the record */
+read_flag_fields();
- if (with_match_flag &&
- (Match_flag) curr_rec_pos[0] == MATCH_IMPOSSIBLE )
- {
- pos= init_pos+rec_len;
- goto start;
- }
-
- if (use_emb_key)
- {
- /* An embedded key is taken directly from the join buffer */
- *key= pos;
- len= emb_key_length;
- }
- else
+if (with_match_flag &&
+ (Match_flag) curr_rec_pos[0] == MATCH_IMPOSSIBLE )
+{
+ pos= init_pos+rec_len;
+ goto start;
+}
+
+if (use_emb_key)
+{
+ /* An embedded key is taken directly from the join buffer */
+ *key= pos;
+ len= emb_key_length;
+}
+else
+{
+ /* Read key arguments from previous caches if there are any such fields */
+ if (external_key_arg_fields)
{
- /* Read key arguments from previous caches if there are any such fields */
- if (external_key_arg_fields)
- {
- uchar *rec_ptr= curr_rec_pos;
- uint key_arg_count= external_key_arg_fields;
- CACHE_FIELD **copy_ptr= blob_ptr-key_arg_count;
- for (cache= prev_cache; key_arg_count; cache= cache->prev_cache)
- {
- uint len= 0;
+ uchar *rec_ptr= curr_rec_pos;
+ uint key_arg_count= external_key_arg_fields;
+ CACHE_FIELD **copy_ptr= blob_ptr-key_arg_count;
+ for (cache= prev_cache; key_arg_count; cache= cache->prev_cache)
+ {
+ uint len= 0;
+ DBUG_ASSERT(cache);
+ rec_ptr= cache->get_rec_ref(rec_ptr);
+ while (!cache->referenced_fields)
+ {
+ cache= cache->prev_cache;
DBUG_ASSERT(cache);
rec_ptr= cache->get_rec_ref(rec_ptr);
- while (!cache->referenced_fields)
- {
- cache= cache->prev_cache;
- DBUG_ASSERT(cache);
- rec_ptr= cache->get_rec_ref(rec_ptr);
- }
- while (key_arg_count &&
- cache->read_referenced_field(*copy_ptr, rec_ptr, &len))
- {
- copy_ptr++;
- --key_arg_count;
- }
+ }
+ while (key_arg_count &&
+ cache->read_referenced_field(*copy_ptr, rec_ptr, &len))
+ {
+ copy_ptr++;
+ --key_arg_count;
}
}
-
- /*
- Read the other key arguments from the current record. The fields for
- these arguments are always first in the sequence of the record's fields.
- */
- CACHE_FIELD *copy= field_descr+flag_fields;
- CACHE_FIELD *copy_end= copy+local_key_arg_fields;
- bool blob_in_rec_buff= blob_data_is_in_rec_buff(curr_rec_pos);
- for ( ; copy < copy_end; copy++)
- read_record_field(copy, blob_in_rec_buff);
-
- /* Build the key over the fields read into the record buffers */
- TABLE_REF *ref= &join_tab->ref;
- cp_buffer_from_ref(join->thd, join_tab->table, ref);
- *key= ref->key_buff;
- len= ref->key_length;
}
+
+ /*
+ Read the other key arguments from the current record. The fields for
+ these arguments are always first in the sequence of the record's fields.
+ */
+ CACHE_FIELD *copy= field_descr+flag_fields;
+ CACHE_FIELD *copy_end= copy+local_key_arg_fields;
+ bool blob_in_rec_buff= blob_data_is_in_rec_buff(curr_rec_pos);
+ for ( ; copy < copy_end; copy++)
+ read_record_field(copy, blob_in_rec_buff);
+
+ /* Build the key over the fields read into the record buffers */
+ TABLE_REF *ref= &join_tab->ref;
+ cp_buffer_from_ref(join->thd, join_tab->table, ref);
+ *key= ref->key_buff;
+ len= ref->key_length;
+}
- pos= init_pos+rec_len;
+pos= init_pos+rec_len;
- return len;
+return len;
}
/*
- Check the index condition of the joined table for a record from the BKA cache
-
- SYNOPSIS
- skip_index_tuple()
- range_info pointer to the record returned by MRR
-
- DESCRIPTION
- This function is invoked from MRR implementation to check if an index
- tuple matches the index condition. It is used in the case where the index
- condition actually depends on both columns of the used index and columns
- from previous tables.
-
- NOTES
- Accessing columns of the previous tables requires special handling with
- BKA. The idea of BKA is to collect record combinations in a buffer and
- then do a batch of ref access lookups, i.e. by the time we're doing a
- lookup its previous-records-combination is not in prev_table->record[0]
- but somewhere in the join buffer.
- We need to get it from there back into prev_table(s)->record[0] before we
- can evaluate the index condition, and that's why we need this function
- instead of regular IndexConditionPushdown.
-
- NOTES
- Possible optimization:
- Before we unpack the record from a previous table
- check if this table is used in the condition.
- If so then unpack the record otherwise skip the unpacking.
- This should be done by a special virtual method
- get_partial_record_by_pos().
+Check the index condition of the joined table for a record from the BKA cache
- RETURN VALUE
- 1 the record combination does not satisfies the index condition
- 0 otherwise
+SYNOPSIS
+ skip_index_tuple()
+ range_info pointer to the record returned by MRR
+
+DESCRIPTION
+ This function is invoked from MRR implementation to check if an index
+ tuple matches the index condition. It is used in the case where the index
+ condition actually depends on both columns of the used index and columns
+ from previous tables.
+
+NOTES
+ Accessing columns of the previous tables requires special handling with
+ BKA. The idea of BKA is to collect record combinations in a buffer and
+ then do a batch of ref access lookups, i.e. by the time we're doing a
+ lookup its previous-records-combination is not in prev_table->record[0]
+ but somewhere in the join buffer.
+ We need to get it from there back into prev_table(s)->record[0] before we
+ can evaluate the index condition, and that's why we need this function
+ instead of regular IndexConditionPushdown.
+
+NOTES
+ Possible optimization:
+ Before we unpack the record from a previous table
+ check if this table is used in the condition.
+ If so then unpack the record otherwise skip the unpacking.
+ This should be done by a special virtual method
+ get_partial_record_by_pos().
+
+RETURN VALUE
+ 1 the record combination does not satisfies the index condition
+ 0 otherwise
*/
bool JOIN_CACHE_BKA::skip_index_tuple(range_id_t range_info)
{
- DBUG_ENTER("JOIN_CACHE_BKA::skip_index_tuple");
- get_record_by_pos((uchar*)range_info);
- DBUG_RETURN(!join_tab->cache_idx_cond->val_int());
+DBUG_ENTER("JOIN_CACHE_BKA::skip_index_tuple");
+get_record_by_pos((uchar*)range_info);
+DBUG_RETURN(!join_tab->cache_idx_cond->val_int());
}
/*
- Initialize retrieval of range sequence for the BKAH join algorithm
-
- SYNOPSIS
- bkah_range_seq_init()
- init_params pointer to the BKAH join cache object
- n_ranges the number of ranges obtained
- flags combination of MRR flags
-
- DESCRIPTION
- The function interprets init_param as a pointer to a JOIN_CACHE_BKAH
- object. The function prepares for an iteration over distinct join keys
- built over the records from the cache join buffer.
-
- NOTE
- This function are used only as a callback function.
-
- RETURN VALUE
- init_param value that is to be used as a parameter of
- bkah_range_seq_next()
+Initialize retrieval of range sequence for the BKAH join algorithm
+
+SYNOPSIS
+ bkah_range_seq_init()
+ init_params pointer to the BKAH join cache object
+ n_ranges the number of ranges obtained
+ flags combination of MRR flags
+
+DESCRIPTION
+ The function interprets init_param as a pointer to a JOIN_CACHE_BKAH
+ object. The function prepares for an iteration over distinct join keys
+ built over the records from the cache join buffer.
+
+NOTE
+ This function are used only as a callback function.
+
+RETURN VALUE
+ init_param value that is to be used as a parameter of
+ bkah_range_seq_next()
*/
static
range_seq_t bkah_range_seq_init(void *init_param, uint n_ranges, uint flags)
{
- DBUG_ENTER("bkah_range_seq_init");
- JOIN_CACHE_BKAH *cache= (JOIN_CACHE_BKAH *) init_param;
- cache->reset(0);
- DBUG_RETURN((range_seq_t) init_param);
+DBUG_ENTER("bkah_range_seq_init");
+JOIN_CACHE_BKAH *cache= (JOIN_CACHE_BKAH *) init_param;
+cache->reset(0);
+DBUG_RETURN((range_seq_t) init_param);
}
/*
- Get the next range/key over records from the join buffer of a BKAH cache
-
- SYNOPSIS
- bkah_range_seq_next()
- seq value returned by bkah_range_seq_init()
- range OUT reference to the next range
+Get the next range/key over records from the join buffer of a BKAH cache
- DESCRIPTION
- The function interprets seq as a pointer to a JOIN_CACHE_BKAH
- object. The function returns a pointer to the range descriptor
- for the next unique key built over records from the join buffer.
-
- NOTE
- This function are used only as a callback function.
-
- RETURN VALUE
- FALSE ok, the range structure filled with info about the next range/key
- TRUE no more ranges
+SYNOPSIS
+ bkah_range_seq_next()
+ seq value returned by bkah_range_seq_init()
+ range OUT reference to the next range
+
+DESCRIPTION
+ The function interprets seq as a pointer to a JOIN_CACHE_BKAH
+ object. The function returns a pointer to the range descriptor
+ for the next unique key built over records from the join buffer.
+
+NOTE
+ This function are used only as a callback function.
+
+RETURN VALUE
+ FALSE ok, the range structure filled with info about the next range/key
+ TRUE no more ranges
*/
static
bool bkah_range_seq_next(range_seq_t rseq, KEY_MULTI_RANGE *range)
{
- DBUG_ENTER("bkah_range_seq_next");
- JOIN_CACHE_BKAH *cache= (JOIN_CACHE_BKAH *) rseq;
- TABLE_REF *ref= &cache->join_tab->ref;
- key_range *start_key= &range->start_key;
- if ((start_key->length= cache->get_next_key((uchar **) &start_key->key)))
- {
- start_key->keypart_map= (1 << ref->key_parts) - 1;
- start_key->flag= HA_READ_KEY_EXACT;
- range->end_key= *start_key;
- range->end_key.flag= HA_READ_AFTER_KEY;
- range->ptr= (char *) cache->get_curr_key_chain();
- range->range_flag= EQ_RANGE;
- DBUG_RETURN(0);
- }
- DBUG_RETURN(1);
+DBUG_ENTER("bkah_range_seq_next");
+JOIN_CACHE_BKAH *cache= (JOIN_CACHE_BKAH *) rseq;
+TABLE_REF *ref= &cache->join_tab->ref;
+key_range *start_key= &range->start_key;
+if ((start_key->length= cache->get_next_key((uchar **) &start_key->key)))
+{
+ start_key->keypart_map= (1 << ref->key_parts) - 1;
+ start_key->flag= HA_READ_KEY_EXACT;
+ range->end_key= *start_key;
+ range->end_key.flag= HA_READ_AFTER_KEY;
+ range->ptr= (char *) cache->get_curr_key_chain();
+ range->range_flag= EQ_RANGE;
+ DBUG_RETURN(0);
+}
+DBUG_RETURN(1);
}
/*
- Check whether range_info orders to skip the next record from BKAH join buffer
+Check whether range_info orders to skip the next record from BKAH join buffer
- SYNOPSIS
- bkah_range_seq_skip_record()
- seq value returned by bkah_range_seq_init()
- range_info information about the next range/key returned by MRR
- rowid [NOT USED] rowid of the record to be checked (not used)
-
- DESCRIPTION
- The function interprets seq as a pointer to a JOIN_CACHE_BKAH
- object. The function returns TRUE if the record with this range_info
- is to be filtered out from the stream of records returned by
- multi_range_read_next().
-
- NOTE
- This function are used only as a callback function.
-
- RETURN VALUE
- 1 record with this range_info is to be filtered out from the stream
- of records returned by multi_range_read_next()
- 0 the record is to be left in the stream
+SYNOPSIS
+ bkah_range_seq_skip_record()
+ seq value returned by bkah_range_seq_init()
+ range_info information about the next range/key returned by MRR
+ rowid [NOT USED] rowid of the record to be checked (not used)
+
+DESCRIPTION
+ The function interprets seq as a pointer to a JOIN_CACHE_BKAH
+ object. The function returns TRUE if the record with this range_info
+ is to be filtered out from the stream of records returned by
+ multi_range_read_next().
+
+NOTE
+ This function are used only as a callback function.
+
+RETURN VALUE
+ 1 record with this range_info is to be filtered out from the stream
+ of records returned by multi_range_read_next()
+ 0 the record is to be left in the stream
*/
static
bool bkah_range_seq_skip_record(range_seq_t rseq, range_id_t range_info,
- uchar *rowid)
+ uchar *rowid)
{
- DBUG_ENTER("bkah_range_seq_skip_record");
- JOIN_CACHE_BKAH *cache= (JOIN_CACHE_BKAH *) rseq;
- bool res= cache->check_all_match_flags_for_key((uchar *) range_info);
- DBUG_RETURN(res);
+DBUG_ENTER("bkah_range_seq_skip_record");
+JOIN_CACHE_BKAH *cache= (JOIN_CACHE_BKAH *) rseq;
+bool res= cache->check_all_match_flags_for_key((uchar *) range_info);
+DBUG_RETURN(res);
}
-
+
/*
- Check if the record combination from BKAH cache matches the index condition
+Check if the record combination from BKAH cache matches the index condition
- SYNOPSIS
- bkah_skip_index_tuple()
- rseq value returned by bka_range_seq_init()
- range_info record chain for the next range/key returned by MRR
-
- DESCRIPTION
- This is wrapper for JOIN_CACHE_BKA_UNIQUE::skip_index_tuple method,
- see comments there.
+SYNOPSIS
+ bkah_skip_index_tuple()
+ rseq value returned by bka_range_seq_init()
+ range_info record chain for the next range/key returned by MRR
+
+DESCRIPTION
+ This is wrapper for JOIN_CACHE_BKA_UNIQUE::skip_index_tuple method,
+ see comments there.
- NOTE
- This function is used as a RANGE_SEQ_IF::skip_index_tuple callback.
-
- RETURN VALUE
- 0 some records from the chain satisfy the index condition
- 1 otherwise
+NOTE
+ This function is used as a RANGE_SEQ_IF::skip_index_tuple callback.
+
+RETURN VALUE
+ 0 some records from the chain satisfy the index condition
+ 1 otherwise
*/
static
bool bkah_skip_index_tuple(range_seq_t rseq, range_id_t range_info)
{
- DBUG_ENTER("bka_unique_skip_index_tuple");
- JOIN_CACHE_BKAH *cache= (JOIN_CACHE_BKAH *) rseq;
- THD *thd= cache->thd();
- bool res;
- status_var_increment(thd->status_var.ha_icp_attempts);
- if (!(res= cache->skip_index_tuple(range_info)))
- status_var_increment(thd->status_var.ha_icp_match);
- DBUG_RETURN(res);
+DBUG_ENTER("bka_unique_skip_index_tuple");
+JOIN_CACHE_BKAH *cache= (JOIN_CACHE_BKAH *) rseq;
+THD *thd= cache->thd();
+bool res;
+status_var_increment(thd->status_var.ha_icp_attempts);
+if (!(res= cache->skip_index_tuple(range_info)))
+ status_var_increment(thd->status_var.ha_icp_match);
+DBUG_RETURN(res);
}
/*
- Prepare to read record from BKAH cache matching the current joined record
-
- SYNOPSIS
- prepare_look_for_matches()
- skip_last <-> ignore the last record in the buffer (always unused here)
-
- DESCRIPTION
- The function prepares to iterate over records in the join cache buffer
- matching the record loaded into the record buffer for join_tab when
- performing join operation by BKAH join algorithm. With BKAH algorithm, if
- association labels are used, then record loaded into the record buffer
- for join_tab always has a direct reference to the chain of the mathing
- records from the join buffer. If association labels are not used then
- then the chain of the matching records is obtained by the call of the
- get_key_chain_by_join_key function.
-
- RETURN VALUE
- TRUE there are no records in the buffer to iterate over
- FALSE otherwise
+Prepare to read record from BKAH cache matching the current joined record
+
+SYNOPSIS
+ prepare_look_for_matches()
+ skip_last <-> ignore the last record in the buffer (always unused here)
+
+DESCRIPTION
+ The function prepares to iterate over records in the join cache buffer
+ matching the record loaded into the record buffer for join_tab when
+ performing join operation by BKAH join algorithm. With BKAH algorithm, if
+ association labels are used, then record loaded into the record buffer
+ for join_tab always has a direct reference to the chain of the mathing
+ records from the join buffer. If association labels are not used then
+ then the chain of the matching records is obtained by the call of the
+ get_key_chain_by_join_key function.
+
+RETURN VALUE
+ TRUE there are no records in the buffer to iterate over
+ FALSE otherwise
*/
-
+
bool JOIN_CACHE_BKAH::prepare_look_for_matches(bool skip_last)
{
- last_matching_rec_ref_ptr= next_matching_rec_ref_ptr= 0;
- if (no_association &&
- !(curr_matching_chain= get_matching_chain_by_join_key()))
+last_matching_rec_ref_ptr= next_matching_rec_ref_ptr= 0;
+if (no_association &&
+ !(curr_matching_chain= get_matching_chain_by_join_key())) //psergey: added '!'
return 1;
last_matching_rec_ref_ptr= get_next_rec_ref(curr_matching_chain);
return 0;
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc
index 1c07f0e23c2..82cdd4ead7b 100644
--- a/sql/sql_lex.cc
+++ b/sql/sql_lex.cc
@@ -1,4 +1,5 @@
/* Copyright (c) 2000, 2012, Oracle and/or its affiliates.
+ Copyright (c) 2009, 2013, Monty Program Ab.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -1883,6 +1884,7 @@ void st_select_lex::init_query()
ref_pointer_array= 0;
select_n_where_fields= 0;
select_n_having_items= 0;
+ n_child_sum_items= 0;
subquery_in_having= explicit_limit= 0;
is_item_list_lookup= 0;
first_execution= 1;
@@ -2559,7 +2561,7 @@ LEX::LEX()
my_init_dynamic_array2(&plugins, sizeof(plugin_ref),
plugins_static_buffer,
INITIAL_LEX_PLUGIN_LIST_SIZE,
- INITIAL_LEX_PLUGIN_LIST_SIZE);
+ INITIAL_LEX_PLUGIN_LIST_SIZE, 0);
reset_query_tables_list(TRUE);
mi.init();
}
diff --git a/sql/sql_lex.h b/sql/sql_lex.h
index 2390f207aa4..cc117e18d1e 100644
--- a/sql/sql_lex.h
+++ b/sql/sql_lex.h
@@ -226,7 +226,7 @@ struct LEX_MASTER_INFO
{
bzero(this, sizeof(*this));
my_init_dynamic_array(&repl_ignore_server_ids,
- sizeof(::server_id), 0, 16);
+ sizeof(::server_id), 0, 16, MYF(0));
}
void reset()
{
diff --git a/sql/sql_list.h b/sql/sql_list.h
index 2b2d9e59771..b4e0ab84aab 100644
--- a/sql/sql_list.h
+++ b/sql/sql_list.h
@@ -1,7 +1,6 @@
#ifndef INCLUDES_MYSQL_SQL_LIST_H
#define INCLUDES_MYSQL_SQL_LIST_H
-/*
- Copyright (c) 2000, 2010, Oracle and/or its affiliates.
+/* Copyright (c) 2000, 2012, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -169,6 +168,14 @@ protected:
public:
uint elements;
+ bool operator==(const base_list &rhs) const
+ {
+ return
+ elements == rhs.elements &&
+ first == rhs.first &&
+ last == rhs.last;
+ }
+
inline void empty() { elements=0; first= &end_of_list; last=&first;}
inline base_list() { empty(); }
/**
diff --git a/sql/sql_load.cc b/sql/sql_load.cc
index 38853eb8b6d..11e23b56f71 100644
--- a/sql/sql_load.cc
+++ b/sql/sql_load.cc
@@ -725,14 +725,14 @@ static bool write_execute_load_query_log_event(THD *thd, sql_exchange* ex,
List_iterator<Item> lu(thd->lex->update_list);
List_iterator<Item> lv(thd->lex->value_list);
- query_str.append(" SET ");
+ query_str.append(STRING_WITH_LEN(" SET "));
n= 0;
while ((item= lu++))
{
val= lv++;
if (n++)
- query_str.append(", ");
+ query_str.append(STRING_WITH_LEN(", "));
append_identifier(thd, &query_str, item->name, strlen(item->name));
query_str.append(val->name);
}
@@ -1368,7 +1368,7 @@ READ_INFO::READ_INFO(File file_par, uint tot_length, CHARSET_INFO *cs,
set_if_bigger(length,line_start.length());
stack=stack_pos=(int*) sql_alloc(sizeof(int)*length);
- if (!(buffer=(uchar*) my_malloc(buff_length+1,MYF(0))))
+ if (!(buffer=(uchar*) my_malloc(buff_length+1,MYF(MY_THREAD_SPECIFIC))))
error=1; /* purecov: inspected */
else
{
@@ -1376,7 +1376,7 @@ READ_INFO::READ_INFO(File file_par, uint tot_length, CHARSET_INFO *cs,
if (init_io_cache(&cache,(get_it_from_net) ? -1 : file, 0,
(get_it_from_net) ? READ_NET :
(is_fifo ? READ_FIFO : READ_CACHE),0L,1,
- MYF(MY_WME)))
+ MYF(MY_WME | MY_THREAD_SPECIFIC)))
{
my_free(buffer); /* purecov: inspected */
buffer= NULL;
@@ -1602,7 +1602,7 @@ int READ_INFO::read_field()
** We come here if buffer is too small. Enlarge it and continue
*/
if (!(new_buffer=(uchar*) my_realloc((char*) buffer,buff_length+1+IO_SIZE,
- MYF(MY_WME))))
+ MYF(MY_WME | MY_THREAD_SPECIFIC))))
return (error=1);
to=new_buffer + (to-buffer);
buffer=new_buffer;
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 0690810a6dc..f1362674d0c 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -801,8 +801,6 @@ void do_handle_bootstrap(THD *thd)
handle_bootstrap_impl(thd);
end:
- net_end(&thd->net);
- thd->cleanup();
delete thd;
#ifndef EMBEDDED_LIBRARY
@@ -1173,7 +1171,18 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
thd->security_ctx->user= 0;
thd->user_connect= 0;
- rc= acl_authenticate(thd, 0, packet_length);
+ /*
+ to limit COM_CHANGE_USER ability to brute-force passwords,
+ we only allow three unsuccessful COM_CHANGE_USER per connection.
+ */
+ if (thd->failed_com_change_user >= 3)
+ {
+ my_message(ER_UNKNOWN_COM_ERROR, ER(ER_UNKNOWN_COM_ERROR), MYF(0));
+ rc= 1;
+ }
+ else
+ rc= acl_authenticate(thd, 0, packet_length);
+
MYSQL_AUDIT_NOTIFY_CONNECTION_CHANGE_USER(thd);
if (rc)
{
@@ -1188,6 +1197,8 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
thd->variables.collation_connection= save_collation_connection;
thd->variables.character_set_results= save_character_set_results;
thd->update_charset();
+ thd->failed_com_change_user++;
+ my_sleep(1000000);
}
else
{
@@ -1489,10 +1500,10 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
and flushes tables.
*/
bool res;
- my_pthread_setspecific_ptr(THR_THD, NULL);
+ set_current_thd(0);
res= reload_acl_and_cache(NULL, options | REFRESH_FAST,
NULL, &not_used);
- my_pthread_setspecific_ptr(THR_THD, thd);
+ set_current_thd(thd);
if (res)
break;
}
@@ -1663,6 +1674,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
THD_STAGE_INFO(thd, stage_cleaning_up);
thd->reset_query();
+ thd->set_examined_row_count(0); // For processlist
thd->set_command(COM_SLEEP);
/* Performance Schema Interface instrumentation, end */
@@ -2595,6 +2607,7 @@ case SQLCOM_PREPARE:
LEX_MASTER_INFO *lex_mi= &thd->lex->mi;
Master_info *mi;
bool new_master= 0;
+ bool master_info_added;
if (check_global_access(thd, SUPER_ACL))
goto error;
@@ -2617,15 +2630,19 @@ case SQLCOM_PREPARE:
new_master= 1;
}
- res= change_master(thd, mi);
+ res= change_master(thd, mi, &master_info_added);
if (res && new_master)
{
/*
- The new master was added by change_master(). Remove it as it didn't
- work.
+ If the new master was added by change_master(), remove it as it didn't
+ work (this will free mi as well).
+
+ If new master was not added, we still need to free mi.
*/
- master_info_index->remove_master_info(&lex_mi->connection_name);
- delete mi;
+ if (master_info_added)
+ master_info_index->remove_master_info(&lex_mi->connection_name);
+ else
+ delete mi;
}
mysql_mutex_unlock(&LOCK_active_mi);
@@ -4852,16 +4869,20 @@ finish:
if (! thd->in_sub_stmt)
{
- /* report error issued during command execution */
- if (thd->killed_errno())
+ if (thd->killed != NOT_KILLED)
{
- if (! thd->stmt_da->is_set())
- thd->send_kill_message();
- }
- if (thd->killed < KILL_CONNECTION)
- {
- thd->killed= NOT_KILLED;
- thd->mysys_var->abort= 0;
+ /* report error issued during command execution */
+ if (thd->killed_errno())
+ {
+ /* If we already sent 'ok', we can ignore any kill query statements */
+ if (! thd->stmt_da->is_set())
+ thd->send_kill_message();
+ }
+ if (thd->killed < KILL_CONNECTION)
+ {
+ thd->reset_killed();
+ thd->mysys_var->abort= 0;
+ }
}
if (thd->is_error() || (thd->variables.option_bits & OPTION_MASTER_SQL_ERROR))
trans_rollback_stmt(thd);
@@ -5011,7 +5032,8 @@ static bool execute_show_status(THD *thd, TABLE_LIST *all_tables)
mysql_mutex_lock(&LOCK_status);
add_diff_to_status(&global_status_var, &thd->status_var,
&old_status_var);
- thd->status_var= old_status_var;
+ memcpy(&thd->status_var, &old_status_var,
+ offsetof(STATUS_VAR, last_cleared_system_status_var));
mysql_mutex_unlock(&LOCK_status);
return res;
}
@@ -6494,8 +6516,13 @@ TABLE_LIST *st_select_lex::add_table_to_list(THD *thd,
ptr->next_name_resolution_table= NULL;
/* Link table in global list (all used tables) */
lex->add_to_query_tables(ptr);
- ptr->mdl_request.init(MDL_key::TABLE, ptr->db, ptr->table_name, mdl_type,
- MDL_TRANSACTION);
+
+ // Pure table aliases do not need to be locked:
+ if (!test(table_options & TL_OPTION_ALIAS))
+ {
+ ptr->mdl_request.init(MDL_key::TABLE, ptr->db, ptr->table_name, mdl_type,
+ MDL_TRANSACTION);
+ }
DBUG_RETURN(ptr);
}
@@ -7071,7 +7098,7 @@ static uint kill_threads_for_user(THD *thd, LEX_USER *user,
mysql_mutex_unlock(&LOCK_thread_count);
DBUG_RETURN(ER_KILL_DENIED_ERROR);
}
- if (!threads_to_kill.push_back(tmp, tmp->mem_root))
+ if (!threads_to_kill.push_back(tmp, thd->mem_root))
mysql_mutex_lock(&tmp->LOCK_thd_data); // Lock from delete
}
}
diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc
index 73539f70762..8778713d7e7 100644
--- a/sql/sql_plugin.cc
+++ b/sql/sql_plugin.cc
@@ -1,6 +1,6 @@
/*
Copyright (c) 2005, 2012, Oracle and/or its affiliates.
- Copyright (c) 2010, 2011, Monty Program Ab
+ Copyright (c) 2010, 2013, Monty Program Ab
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -1116,7 +1116,7 @@ static bool plugin_add(MEM_ROOT *tmp_root,
plugin_array_version++;
if (my_hash_insert(&plugin_hash[plugin->type], (uchar*)tmp_plugin_ptr))
tmp_plugin_ptr->state= PLUGIN_IS_FREED;
- init_alloc_root(&tmp_plugin_ptr->mem_root, 4096, 4096);
+ init_alloc_root(&tmp_plugin_ptr->mem_root, 4096, 4096, MYF(0));
if (name->str)
DBUG_RETURN(FALSE); // all done
@@ -1511,8 +1511,8 @@ int plugin_init(int *argc, char **argv, int flags)
init_plugin_psi_keys();
#endif
- init_alloc_root(&plugin_mem_root, 4096, 4096);
- init_alloc_root(&tmp_root, 4096, 4096);
+ init_alloc_root(&plugin_mem_root, 4096, 4096, MYF(0));
+ init_alloc_root(&tmp_root, 4096, 4096, MYF(0));
if (my_hash_init(&bookmark_hash, &my_charset_bin, 16, 0, 0,
get_bookmark_hash_key, NULL, HASH_UNIQUE))
@@ -1522,9 +1522,9 @@ int plugin_init(int *argc, char **argv, int flags)
mysql_mutex_init(key_LOCK_plugin, &LOCK_plugin, MY_MUTEX_INIT_FAST);
if (my_init_dynamic_array(&plugin_dl_array,
- sizeof(struct st_plugin_dl *),16,16) ||
+ sizeof(struct st_plugin_dl *), 16, 16, MYF(0)) ||
my_init_dynamic_array(&plugin_array,
- sizeof(struct st_plugin_int *),16,16))
+ sizeof(struct st_plugin_int *), 16, 16, MYF(0)))
goto err;
for (i= 0; i < MYSQL_MAX_PLUGIN_TYPE_NUM; i++)
@@ -1723,12 +1723,11 @@ static bool register_builtin(struct st_maria_plugin *plugin,
*/
static void plugin_load(MEM_ROOT *tmp_root, int *argc, char **argv)
{
- THD thd;
TABLE_LIST tables;
TABLE *table;
READ_RECORD read_record_info;
int error;
- THD *new_thd= &thd;
+ THD *new_thd= new THD;
bool result;
#ifdef EMBEDDED_LIBRARY
No_such_table_error_handler error_handler;
@@ -1739,7 +1738,7 @@ static void plugin_load(MEM_ROOT *tmp_root, int *argc, char **argv)
new_thd->store_globals();
new_thd->db= my_strdup("mysql", MYF(0));
new_thd->db_length= 5;
- bzero((char*) &thd.net, sizeof(thd.net));
+ bzero((char*) &new_thd->net, sizeof(new_thd->net));
tables.init_one_table("mysql", 5, "plugin", 6, "plugin", TL_READ);
#ifdef EMBEDDED_LIBRARY
@@ -1806,7 +1805,8 @@ static void plugin_load(MEM_ROOT *tmp_root, int *argc, char **argv)
close_mysql_tables(new_thd);
end:
/* Remember that we don't have a THD */
- my_pthread_setspecific_ptr(THR_THD, 0);
+ delete new_thd;
+ set_current_thd(0);
DBUG_VOID_RETURN;
}
@@ -1882,8 +1882,11 @@ static bool plugin_load_list(MEM_ROOT *tmp_root, int *argc, char **argv,
DBUG_RETURN(FALSE);
error:
mysql_mutex_unlock(&LOCK_plugin);
- sql_print_error("Couldn't load plugin named '%s' with soname '%s'.",
- name.str, dl.str);
+ if (name.str)
+ sql_print_error("Couldn't load plugin '%s' from '%s'.",
+ name.str, dl.str);
+ else
+ sql_print_error("Couldn't load plugins from '%s'.", dl.str);
DBUG_RETURN(TRUE);
}
@@ -2028,7 +2031,7 @@ static bool finalize_install(THD *thd, TABLE *table, const LEX_STRING *name)
struct st_plugin_int *tmp= plugin_find_internal(name, MYSQL_ANY_PLUGIN);
int error;
DBUG_ASSERT(tmp);
- mysql_mutex_assert_owner(&LOCK_plugin);
+ mysql_mutex_assert_owner(&LOCK_plugin); // because of tmp->state
if (tmp->state == PLUGIN_IS_DISABLED)
{
@@ -2115,8 +2118,12 @@ bool mysql_install_plugin(THD *thd, const LEX_STRING *name,
This hack should be removed when LOCK_plugin is fixed so it
protects only what it supposed to protect.
+
+ See also mysql_uninstall_plugin() and initialize_audit_plugin()
*/
- mysql_audit_acquire_plugins(thd, MYSQL_AUDIT_GENERAL_CLASS);
+ unsigned long event_class_mask[MYSQL_AUDIT_CLASS_MASK_SIZE] =
+ { MYSQL_AUDIT_GENERAL_CLASSMASK };
+ mysql_audit_acquire_plugins(thd, event_class_mask);
mysql_mutex_lock(&LOCK_plugin);
mysql_rwlock_wrlock(&LOCK_system_variables_hash);
@@ -2259,8 +2266,15 @@ bool mysql_uninstall_plugin(THD *thd, const LEX_STRING *name,
When audit event is triggered during [UN]INSTALL PLUGIN, plugin
list iterator acquires the same lock (within the same thread)
second time.
+
+ This hack should be removed when LOCK_plugin is fixed so it
+ protects only what it supposed to protect.
+
+ See also mysql_install_plugin() and initialize_audit_plugin()
*/
- mysql_audit_acquire_plugins(thd, MYSQL_AUDIT_GENERAL_CLASS);
+ unsigned long event_class_mask[MYSQL_AUDIT_CLASS_MASK_SIZE] =
+ { MYSQL_AUDIT_GENERAL_CLASSMASK };
+ mysql_audit_acquire_plugins(thd, event_class_mask);
mysql_mutex_lock(&LOCK_plugin);
@@ -2270,11 +2284,19 @@ bool mysql_uninstall_plugin(THD *thd, const LEX_STRING *name,
{
fix_dl_name(thd->mem_root, &dl);
st_plugin_dl *plugin_dl= plugin_dl_find(&dl);
- struct st_maria_plugin *plugin;
- for (plugin= plugin_dl->plugins; plugin->info; plugin++)
+ if (plugin_dl)
{
- LEX_STRING str= { const_cast<char*>(plugin->name), strlen(plugin->name) };
- error|= do_uninstall(thd, table, &str);
+ for (struct st_maria_plugin *plugin= plugin_dl->plugins;
+ plugin->info; plugin++)
+ {
+ LEX_STRING str= { const_cast<char*>(plugin->name), strlen(plugin->name) };
+ error|= do_uninstall(thd, table, &str);
+ }
+ }
+ else
+ {
+ my_error(ER_SP_DOES_NOT_EXIST, MYF(0), "SONAME", dl.str);
+ error= true;
}
}
reap_plugins();
diff --git a/sql/sql_plugin_services.h b/sql/sql_plugin_services.h
index c779547059d..e3ef338eaad 100644
--- a/sql/sql_plugin_services.h
+++ b/sql/sql_plugin_services.h
@@ -54,13 +54,18 @@ static struct progress_report_service_st progress_report_handler= {
set_thd_proc_info
};
+static struct kill_statement_service_st thd_kill_statement_handler= {
+ thd_kill_level
+};
+
static struct st_service_ref list_of_services[]=
{
- { "my_snprintf_service", VERSION_my_snprintf, &my_snprintf_handler },
- { "thd_alloc_service", VERSION_thd_alloc, &thd_alloc_handler },
- { "thd_wait_service", VERSION_thd_wait, &thd_wait_handler },
+ { "my_snprintf_service", VERSION_my_snprintf, &my_snprintf_handler },
+ { "thd_alloc_service", VERSION_thd_alloc, &thd_alloc_handler },
+ { "thd_wait_service", VERSION_thd_wait, &thd_wait_handler },
{ "my_thread_scheduler_service", VERSION_my_thread_scheduler, &my_thread_scheduler_handler },
- { "progress_report_service", VERSION_progress_report, &progress_report_handler },
- { "debug_sync_service", VERSION_debug_sync, 0 } // updated in plugin_init()
+ { "progress_report_service", VERSION_progress_report, &progress_report_handler },
+ { "debug_sync_service", VERSION_debug_sync, 0 }, // updated in plugin_init()
+ { "thd_kill_statement_service", VERSION_kill_statement, &thd_kill_statement_handler }
};
diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc
index 24dde140a8a..025ff8820e6 100644
--- a/sql/sql_prepare.cc
+++ b/sql/sql_prepare.cc
@@ -3145,7 +3145,7 @@ Prepared_statement::Prepared_statement(THD *thd_arg)
flags((uint) IS_IN_USE)
{
init_sql_alloc(&main_mem_root, thd_arg->variables.query_alloc_block_size,
- thd_arg->variables.query_prealloc_size);
+ thd_arg->variables.query_prealloc_size, MYF(MY_THREAD_SPECIFIC));
*last_error= '\0';
}
@@ -4039,7 +4039,7 @@ Ed_result_set::Ed_result_set(List<Ed_row> *rows_arg,
*/
Ed_connection::Ed_connection(THD *thd)
- :m_warning_info(thd->query_id, false),
+ :m_warning_info(thd->query_id, false, true),
m_thd(thd),
m_rsets(0),
m_current_rset(0)
@@ -4463,7 +4463,7 @@ bool Protocol_local::send_result_set_metadata(List<Item> *columns, uint)
{
DBUG_ASSERT(m_rset == 0 && !alloc_root_inited(&m_rset_root));
- init_sql_alloc(&m_rset_root, MEM_ROOT_BLOCK_SIZE, 0);
+ init_sql_alloc(&m_rset_root, MEM_ROOT_BLOCK_SIZE, 0, MYF(MY_THREAD_SPECIFIC));
if (! (m_rset= new (&m_rset_root) List<Ed_row>))
return TRUE;
diff --git a/sql/sql_priv.h b/sql/sql_priv.h
index 39976e1a430..345556a0b7f 100644
--- a/sql/sql_priv.h
+++ b/sql/sql_priv.h
@@ -153,6 +153,41 @@
#define OPTION_ALLOW_BATCH (ULL(1) << 36) // THD, intern (slave)
#define OPTION_SKIP_REPLICATION (ULL(1) << 37) // THD, user
+/*
+ Check how many bytes are available on buffer.
+
+ @param buf_start Pointer to buffer start.
+ @param buf_current Pointer to the current position on buffer.
+ @param buf_len Buffer length.
+
+ @return Number of bytes available on event buffer.
+*/
+template <class T> T available_buffer(const char* buf_start,
+ const char* buf_current,
+ T buf_len)
+{
+ return buf_len - (buf_current - buf_start);
+}
+
+/*
+ Check if jump value is within buffer limits.
+
+ @param jump Number of positions we want to advance.
+ @param buf_start Pointer to buffer start
+ @param buf_current Pointer to the current position on buffer.
+ @param buf_len Buffer length.
+
+ @return True If jump value is within buffer limits.
+ False Otherwise.
+*/
+template <class T> bool valid_buffer_range(T jump,
+ const char* buf_start,
+ const char* buf_current,
+ T buf_len)
+{
+ return (jump <= available_buffer(buf_start, buf_current, buf_len));
+}
+
/* The rest of the file is included in the server only */
#ifndef MYSQL_CLIENT
diff --git a/sql/sql_profile.cc b/sql/sql_profile.cc
index 2d00a19870b..feb7810fa28 100644
--- a/sql/sql_profile.cc
+++ b/sql/sql_profile.cc
@@ -46,6 +46,7 @@
#define TIME_I_S_DECIMAL_SIZE (TIME_FLOAT_DIGITS*100)+(TIME_FLOAT_DIGITS-3)
#define MAX_QUERY_LENGTH 300
+#define MAX_QUERY_HISTORY 101
/**
Connects Information_Schema and Profiling.
@@ -264,9 +265,12 @@ void PROF_MEASUREMENT::collect()
QUERY_PROFILE::QUERY_PROFILE(PROFILING *profiling_arg, const char *status_arg)
:profiling(profiling_arg), profiling_query_id(0), query_source(NULL)
{
- profile_start= new PROF_MEASUREMENT(this, status_arg);
- entries.push_back(profile_start);
- profile_end= profile_start;
+ m_seq_counter= 1;
+ PROF_MEASUREMENT *prof= new PROF_MEASUREMENT(this, status_arg);
+ prof->m_seq= m_seq_counter++;
+ m_start_time_usecs= prof->time_usecs;
+ m_end_time_usecs= m_start_time_usecs;
+ entries.push_back(prof);
}
QUERY_PROFILE::~QUERY_PROFILE()
@@ -305,9 +309,14 @@ void QUERY_PROFILE::new_status(const char *status_arg,
else
prof= new PROF_MEASUREMENT(this, status_arg);
- profile_end= prof;
+ prof->m_seq= m_seq_counter++;
+ m_end_time_usecs= prof->time_usecs;
entries.push_back(prof);
+ /* Maintain the query history size. */
+ while (entries.elements > MAX_QUERY_HISTORY)
+ delete entries.pop();
+
DBUG_VOID_RETURN;
}
@@ -467,8 +476,7 @@ bool PROFILING::show_profiles()
String elapsed;
- PROF_MEASUREMENT *ps= prof->profile_start;
- PROF_MEASUREMENT *pe= prof->profile_end;
+ double query_time_usecs= prof->m_end_time_usecs - prof->m_start_time_usecs;
if (++idx <= unit->offset_limit_cnt)
continue;
@@ -477,7 +485,7 @@ bool PROFILING::show_profiles()
protocol->prepare_for_resend();
protocol->store((uint32)(prof->profiling_query_id));
- protocol->store((double)(pe->time_usecs - ps->time_usecs)/(1000.0*1000),
+ protocol->store((double)(query_time_usecs/(1000.0*1000)),
(uint32) TIME_FLOAT_DIGITS-1, &elapsed);
if (prof->query_source != NULL)
protocol->store(prof->query_source, strlen(prof->query_source),
@@ -537,17 +545,18 @@ int PROFILING::fill_statistics_info(THD *thd_arg, TABLE_LIST *tables, Item *cond
us also include a numbering of each state per query. The query_id and
the "seq" together are unique.
*/
- ulonglong seq;
+ ulong seq;
void *entry_iterator;
PROF_MEASUREMENT *entry, *previous= NULL;
/* ...and for each query, go through all its state-change steps. */
- for (seq= 0, entry_iterator= query->entries.new_iterator();
+ for (entry_iterator= query->entries.new_iterator();
entry_iterator != NULL;
entry_iterator= query->entries.iterator_next(entry_iterator),
- seq++, previous=entry, row_number++)
+ previous=entry, row_number++)
{
entry= query->entries.iterator_value(entry_iterator);
+ seq= entry->m_seq;
/* Skip the first. We count spans of fence, not fence-posts. */
if (previous == NULL) continue;
diff --git a/sql/sql_profile.h b/sql/sql_profile.h
index 7705f6ca476..f8970bb162a 100644
--- a/sql/sql_profile.h
+++ b/sql/sql_profile.h
@@ -186,6 +186,7 @@ private:
char *file;
unsigned int line;
+ ulong m_seq;
double time_usecs;
char *allocated_status_memory;
@@ -217,8 +218,9 @@ private:
query_id_t profiling_query_id; /* Session-specific id. */
char *query_source;
- PROF_MEASUREMENT *profile_start;
- PROF_MEASUREMENT *profile_end;
+ double m_start_time_usecs;
+ double m_end_time_usecs;
+ ulong m_seq_counter;
Queue<PROF_MEASUREMENT> entries;
diff --git a/sql/sql_reload.cc b/sql/sql_reload.cc
index 99fe9267589..2720dc7cd74 100644
--- a/sql/sql_reload.cc
+++ b/sql/sql_reload.cc
@@ -97,7 +97,7 @@ bool reload_acl_and_cache(THD *thd, unsigned long options,
{
delete tmp_thd;
/* Remember that we don't have a THD */
- my_pthread_setspecific_ptr(THR_THD, 0);
+ set_current_thd(0);
thd= 0;
}
reset_mqh((LEX_USER *)NULL, TRUE);
diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc
index db8dc694502..917f4ea1a80 100644
--- a/sql/sql_repl.cc
+++ b/sql/sql_repl.cc
@@ -1641,6 +1641,31 @@ void kill_zombie_dump_threads(uint32 slave_server_id)
}
}
+/**
+ Get value for a string parameter with error checking
+
+ Note that in case of error the original string should not be updated!
+
+ @ret 0 ok
+ @ret 1 error
+*/
+
+static bool get_string_parameter(char *to, const char *from, size_t length,
+ const char *name)
+{
+ if (from) // Empty paramaters allowed
+ {
+ size_t from_length;
+ if ((from_length= strlen(from)) > length)
+ {
+ my_error(ER_WRONG_STRING_LENGTH, MYF(0), from, name, (int) length);
+ return 1;
+ }
+ memcpy(to, from, from_length+1);
+ }
+ return 0;
+}
+
/**
Execute a CHANGE MASTER statement.
@@ -1651,10 +1676,14 @@ void kill_zombie_dump_threads(uint32 slave_server_id)
@param mi Pointer to Master_info object belonging to the slave's IO
thread.
+ @param master_info_added Out parameter saying if the Master_info *mi was
+ added to the global list of masters. This is useful in error conditions
+ to know if caller should free Master_info *mi.
+
@retval FALSE success
@retval TRUE error
*/
-bool change_master(THD* thd, Master_info* mi)
+bool change_master(THD* thd, Master_info* mi, bool *master_info_added)
{
int thread_mask;
const char* errmsg= 0;
@@ -1669,6 +1698,7 @@ bool change_master(THD* thd, Master_info* mi)
LEX_MASTER_INFO* lex_mi= &thd->lex->mi;
DBUG_ENTER("change_master");
+ *master_info_added= false;
/*
We need to check if there is an empty master_host. Otherwise
change master succeeds, a master.info file is created containing
@@ -1717,6 +1747,7 @@ bool change_master(THD* thd, Master_info* mi)
ret= TRUE;
goto err;
}
+ *master_info_added= true;
}
if (global_system_variables.log_warnings > 1)
sql_print_information("Master: '%.*s' Master_info_file: '%s' "
@@ -1769,12 +1800,17 @@ bool change_master(THD* thd, Master_info* mi)
}
DBUG_PRINT("info", ("master_log_pos: %lu", (ulong) mi->master_log_pos));
- if (lex_mi->host)
- strmake(mi->host, lex_mi->host, sizeof(mi->host)-1);
- if (lex_mi->user)
- strmake(mi->user, lex_mi->user, sizeof(mi->user)-1);
- if (lex_mi->password)
- strmake(mi->password, lex_mi->password, sizeof(mi->password)-1);
+ if (get_string_parameter(mi->host, lex_mi->host, sizeof(mi->host)-1,
+ "MASTER_HOST") ||
+ get_string_parameter(mi->user, lex_mi->user, sizeof(mi->user)-1,
+ "MASTER_USER") ||
+ get_string_parameter(mi->password, lex_mi->password,
+ sizeof(mi->password)-1, "MASTER_PASSWORD"))
+ {
+ ret= TRUE;
+ goto err;
+ }
+
if (lex_mi->port)
mi->port = lex_mi->port;
if (lex_mi->connect_retry)
diff --git a/sql/sql_repl.h b/sql/sql_repl.h
index 7dc58c47d52..9ca7e6b00b1 100644
--- a/sql/sql_repl.h
+++ b/sql/sql_repl.h
@@ -25,9 +25,9 @@ typedef struct st_slave_info
{
uint32 server_id;
uint32 rpl_recovery_rank, master_id;
- char host[HOSTNAME_LENGTH+1];
+ char host[HOSTNAME_LENGTH*SYSTEM_CHARSET_MBMAXLEN+1];
char user[USERNAME_LENGTH+1];
- char password[MAX_PASSWORD_LENGTH+1];
+ char password[MAX_PASSWORD_LENGTH*SYSTEM_CHARSET_MBMAXLEN+1];
uint16 port;
THD* thd;
} SLAVE_INFO;
@@ -41,7 +41,7 @@ extern my_bool opt_sporadic_binlog_dump_fail;
int start_slave(THD* thd, Master_info* mi, bool net_report);
int stop_slave(THD* thd, Master_info* mi, bool net_report);
-bool change_master(THD* thd, Master_info* mi);
+bool change_master(THD* thd, Master_info* mi, bool *master_info_added);
bool mysql_show_binlog_events(THD* thd);
int reset_slave(THD *thd, Master_info* mi);
int reset_master(THD* thd);
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index 86a4168867b..27b93cff189 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -1,5 +1,5 @@
/* Copyright (c) 2000, 2012 Oracle and/or its affiliates.
- Copyright (c) 2009, 2012, Monty Program Ab
+ Copyright (c) 2009, 2013 Monty Program Ab.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -223,7 +223,7 @@ static int create_sort_index(THD *thd, JOIN *join, ORDER *order,
static int remove_duplicates(JOIN *join,TABLE *entry,List<Item> &fields,
Item *having);
static int remove_dup_with_compare(THD *thd, TABLE *entry, Field **field,
- ulong offset,Item *having);
+ Item *having);
static int remove_dup_with_hash_index(THD *thd,TABLE *table,
uint field_count, Field **first_field,
ulong key_length,Item *having);
@@ -378,7 +378,7 @@ bool handle_select(THD *thd, LEX *lex, select_result *result,
ER(ER_QUERY_EXCEEDED_ROWS_EXAMINED_LIMIT),
thd->accessed_rows_and_keys,
thd->lex->limit_rows_examined->val_uint());
- thd->killed= NOT_KILLED;
+ thd->reset_killed();
}
/* Disable LIMIT ROWS EXAMINED after query execution. */
thd->lex->limit_rows_examined_cnt= ULONGLONG_MAX;
@@ -2072,6 +2072,8 @@ bool JOIN::setup_subquery_caches()
*/
void JOIN::restore_tmp()
{
+ DBUG_PRINT("info", ("restore_tmp this %p tmp_join %p", this, tmp_join));
+ DBUG_ASSERT(tmp_join != this);
memcpy(tmp_join, this, (size_t) sizeof(JOIN));
}
@@ -4943,7 +4945,8 @@ update_ref_and_keys(THD *thd, DYNAMIC_ARRAY *keyuse,JOIN_TAB *join_tab,
/* set a barrier for the array of SARGABLE_PARAM */
(*sargables)[0].field= 0;
- if (my_init_dynamic_array(keyuse,sizeof(KEYUSE),20,64))
+ if (my_init_dynamic_array(keyuse,sizeof(KEYUSE),20,64,
+ MYF(MY_THREAD_SPECIFIC)))
return TRUE;
if (cond)
@@ -7746,8 +7749,9 @@ get_best_combination(JOIN *join)
if ( !(keyuse= join->best_positions[tablenr].key))
{
j->type=JT_ALL;
- if (tablenr != join->const_tables)
- join->full_join=1;
+ if (join->best_positions[tablenr].use_join_buffer &&
+ tablenr != join->const_tables)
+ join->full_join= 1;
}
/*if (join->best_positions[tablenr].sj_strategy == SJ_OPT_LOOSE_SCAN)
@@ -8740,7 +8744,9 @@ make_join_select(JOIN *join,SQL_SELECT *select,COND *cond)
We will use join cache here : prevent sorting of the first
table only and sort at the end.
*/
- if (i != join->const_tables && join->table_count > join->const_tables + 1)
+ if (i != join->const_tables &&
+ join->table_count > join->const_tables + 1 &&
+ join->best_positions[i].use_join_buffer)
join->full_join= 1;
}
@@ -10763,7 +10769,6 @@ void JOIN::cleanup(bool full)
filesort_free_buffers(first_tab->table, full);
}
}
-
if (full)
{
JOIN_TAB *sort_tab= first_linear_tab(this, WITHOUT_CONST_TABLES);
@@ -10798,21 +10803,19 @@ void JOIN::cleanup(bool full)
}
}
}
- /*
- We are not using tables anymore
- Unlock all tables. We may be in an INSERT .... SELECT statement.
- */
if (full)
{
- if (tmp_join)
- tmp_table_param.copy_field= 0;
- group_fields.delete_elements();
/*
- Ensure that the above delete_elements() would not be called
+ Ensure that the following delete_elements() would not be called
twice for the same list.
*/
- if (tmp_join && tmp_join != this)
- tmp_join->group_fields= group_fields;
+ if (tmp_join && tmp_join != this &&
+ tmp_join->group_fields == this->group_fields)
+ tmp_join->group_fields.empty();
+
+ // Run Cached_item DTORs!
+ group_fields.delete_elements();
+
/*
We can't call delete_elements() on copy_funcs as this will cause
problems in free_elements() as some of the elements are then deleted.
@@ -14325,10 +14328,20 @@ create_tmp_table(THD *thd, TMP_TABLE_PARAM *param, List<Item> &fields,
if (group)
{
+ ORDER **prev= &group;
if (!param->quick_group)
group=0; // Can't use group key
else for (ORDER *tmp=group ; tmp ; tmp=tmp->next)
{
+ /* Exclude found constant from the list */
+ if ((*tmp->item)->const_item())
+ {
+ *prev= tmp->next;
+ param->group_parts--;
+ continue;
+ }
+ else
+ prev= &(tmp->next);
/*
marker == 4 means two things:
- store NULLs in the key, and
@@ -14336,7 +14349,7 @@ create_tmp_table(THD *thd, TMP_TABLE_PARAM *param, List<Item> &fields,
can't index BIT fields.
*/
(*tmp->item)->marker=4; // Store null in key
- if ((*tmp->item)->max_length >= CONVERT_IF_BIGGER_TO_BLOB)
+ if ((*tmp->item)->too_big_for_varchar())
using_unique_constraint=1;
}
if (param->group_length >= MAX_BLOB_WIDTH)
@@ -14358,7 +14371,7 @@ create_tmp_table(THD *thd, TMP_TABLE_PARAM *param, List<Item> &fields,
if (param->precomputed_group_by)
copy_func_count+= param->sum_func_count;
- init_sql_alloc(&own_root, TABLE_ALLOC_BLOCK_SIZE, 0);
+ init_sql_alloc(&own_root, TABLE_ALLOC_BLOCK_SIZE, 0, MYF(MY_THREAD_SPECIFIC));
if (!multi_alloc_root(&own_root,
&table, sizeof(*table),
@@ -15841,11 +15854,11 @@ do_select(JOIN *join,List<Item> *fields,TABLE *table,Procedure *procedure)
if (table->group && join->tmp_table_param.sum_func_count &&
table->s->keys && !table->file->inited)
{
- int tmp_error;
- if ((tmp_error= table->file->ha_index_init(0, 0)))
+ rc= table->file->ha_index_init(0, 0);
+ if (rc)
{
- table->file->print_error(tmp_error, MYF(0)); /* purecov: inspected */
- DBUG_RETURN(-1); /* purecov: inspected */
+ table->file->print_error(rc, MYF(0));
+ DBUG_RETURN(-1);
}
}
}
@@ -16879,7 +16892,12 @@ int join_read_key2(THD *thd, JOIN_TAB *tab, TABLE *table, TABLE_REF *table_ref)
int error;
if (!table->file->inited)
{
- table->file->ha_index_init(table_ref->key, (tab ? tab->sorted : TRUE));
+ error= table->file->ha_index_init(table_ref->key, tab ? tab->sorted : TRUE);
+ if (error)
+ {
+ (void) report_error(table, error);
+ return 1;
+ }
}
/* TODO: Why don't we do "Late NULLs Filtering" here? */
@@ -16970,8 +16988,8 @@ join_read_always_key(JOIN_TAB *tab)
{
if ((error= table->file->ha_index_init(tab->ref.key, tab->sorted)))
{
- table->file->print_error(error, MYF(0));/* purecov: inspected */
- return(1); /* purecov: inspected */
+ (void) report_error(table, error);
+ return 1;
}
}
@@ -17001,14 +17019,13 @@ join_read_last_key(JOIN_TAB *tab)
int error;
TABLE *table= tab->table;
- if (!table->file->inited)
+ if (!table->file->inited &&
+ (error= table->file->ha_index_init(tab->ref.key, tab->sorted)))
{
- if ((error= table->file->ha_index_init(tab->ref.key, tab->sorted)))
- {
- table->file->print_error(error, MYF(0));/* purecov: inspected */
- return(1); /* purecov: inspected */
- }
+ (void) report_error(table, error);
+ return 1;
}
+
if (cp_buffer_from_ref(tab->join->thd, table, &tab->ref))
return -1;
if ((error= table->file->ha_index_read_map(table->record[0],
@@ -17227,9 +17244,10 @@ join_ft_read_first(JOIN_TAB *tab)
if (!table->file->inited &&
(error= table->file->ha_index_init(tab->ref.key, 1)))
{
- table->file->print_error(error, MYF(0)); /* purecov: inspected */
- return(1); /* purecov: inspected */
+ (void) report_error(table, error);
+ return 1;
}
+
table->file->ft_init();
if ((error= table->file->ha_ft_read(table->record[0])))
@@ -17652,9 +17670,10 @@ end_update(JOIN *join, JOIN_TAB *join_tab __attribute__((unused)),
/* Change method to update rows */
if ((error= table->file->ha_index_init(0, 0)))
{
- table->file->print_error(error, MYF(0));/* purecov: inspected */
- DBUG_RETURN(NESTED_LOOP_ERROR); /* purecov: inspected */
+ table->file->print_error(error, MYF(0));
+ DBUG_RETURN(NESTED_LOOP_ERROR);
}
+
join->join_tab[join->top_join_tab_count-1].next_select=end_unique_update;
}
join->send_records++;
@@ -18296,18 +18315,36 @@ static int test_if_order_by_key(ORDER *order, TABLE *table, uint idx,
table->s->primary_key != MAX_KEY &&
table->s->primary_key != idx)
{
+ KEY_PART_INFO *start,*end;
+ uint pk_part_idx= 0;
on_pk_suffix= TRUE;
- key_part= table->key_info[table->s->primary_key].key_part;
- key_part_end=key_part+table->key_info[table->s->primary_key].key_parts;
+ start= key_part= table->key_info[table->s->primary_key].key_part;
const_key_parts=table->const_key_parts[table->s->primary_key];
- for (; const_key_parts & 1 ; const_key_parts>>= 1)
- key_part++;
/*
- The primary and secondary key parts were all const (i.e. there's
- one row). The sorting doesn't matter.
+ Calculate true key_part_end and const_key_parts
+ (we have to stop as first not continous primary key part)
*/
- if (key_part == key_part_end && reverse == 0)
+ for (key_part_end= key_part,
+ end= key_part+table->key_info[table->s->primary_key].key_parts;
+ key_part_end < end; key_part_end++, pk_part_idx++)
+ {
+ /* Found hole in the pk_parts; Abort */
+ if (!(table->key_info[idx].ext_key_part_map &
+ (((key_part_map) 1) << pk_part_idx)))
+ break;
+ }
+ /* Adjust const_key_parts */
+ const_key_parts&= (((key_part_map) 1) << pk_part_idx) -1;
+
+ for (; const_key_parts & 1 ; const_key_parts>>= 1)
+ key_part++;
+ /*
+ Test if the primary key parts were all const (i.e. there's one row).
+ The sorting doesn't matter.
+ */
+ if (key_part == start+table->key_info[table->s->primary_key].key_parts &&
+ reverse == 0)
{
key_parts= 0;
reverse= 1;
@@ -18327,7 +18364,8 @@ static int test_if_order_by_key(ORDER *order, TABLE *table, uint idx,
if (reverse && flag != reverse)
DBUG_RETURN(0);
reverse=flag; // Remember if reverse
- key_part++;
+ if (key_part < key_part_end)
+ key_part++;
}
if (on_pk_suffix)
{
@@ -19133,7 +19171,8 @@ create_sort_index(THD *thd, JOIN *join, ORDER *order,
goto err; /* purecov: inspected */
table->sort.io_cache=(IO_CACHE*) my_malloc(sizeof(IO_CACHE),
- MYF(MY_WME | MY_ZEROFILL));
+ MYF(MY_WME | MY_ZEROFILL|
+ MY_THREAD_SPECIFIC));
table->status=0; // May be wrong if quick_select
// If table has a range, move it to select
@@ -19229,19 +19268,24 @@ void JOIN::clean_pre_sort_join_tab()
}
-/*****************************************************************************
- Remove duplicates from tmp table
- This should be recoded to add a unique index to the table and remove
- duplicates
- Table is a locked single thread table
- fields is the number of fields to check (from the end)
-*****************************************************************************/
+/**
+ Compare fields from table->record[0] and table->record[1],
+ possibly skipping few first fields.
+
+ @param table
+ @param ptr field to start the comparison from,
+ somewhere in the table->field[] array
+ @retval 1 different
+ @retval 0 identical
+*/
static bool compare_record(TABLE *table, Field **ptr)
{
for (; *ptr ; ptr++)
{
- if ((*ptr)->cmp_offset(table->s->rec_buff_length))
+ Field *f= *ptr;
+ if (f->is_null() != f->is_null(table->s->rec_buff_length) ||
+ (!f->is_null() && f->cmp_offset(table->s->rec_buff_length)))
return 1;
}
return 0;
@@ -19269,16 +19313,16 @@ static void free_blobs(Field **ptr)
static int
-remove_duplicates(JOIN *join, TABLE *entry,List<Item> &fields, Item *having)
+remove_duplicates(JOIN *join, TABLE *table, List<Item> &fields, Item *having)
{
int error;
- ulong reclength,offset;
+ ulong keylength= 0;
uint field_count;
THD *thd= join->thd;
DBUG_ENTER("remove_duplicates");
- entry->reginfo.lock_type=TL_WRITE;
+ table->reginfo.lock_type=TL_WRITE;
/* Calculate how many saved fields there is in list */
field_count=0;
@@ -19295,11 +19339,10 @@ remove_duplicates(JOIN *join, TABLE *entry,List<Item> &fields, Item *having)
join->unit->select_limit_cnt= 1; // Only send first row
DBUG_RETURN(0);
}
- Field **first_field=entry->field+entry->s->fields - field_count;
- offset= (field_count ?
- entry->field[entry->s->fields - field_count]->
- offset(entry->record[0]) : 0);
- reclength=entry->s->reclength-offset;
+
+ Field **first_field=table->field+table->s->fields - field_count;
+ for (Field **ptr=first_field; *ptr; ptr++)
+ keylength+= (*ptr)->sort_length() + (*ptr)->maybe_null();
/*
Disable LIMIT ROWS EXAMINED in order to avoid interrupting prematurely
@@ -19307,19 +19350,18 @@ remove_duplicates(JOIN *join, TABLE *entry,List<Item> &fields, Item *having)
*/
thd->lex->limit_rows_examined_cnt= ULONGLONG_MAX;
if (thd->killed == ABORT_QUERY)
- thd->killed= NOT_KILLED;
- free_io_cache(entry); // Safety
- entry->file->info(HA_STATUS_VARIABLE);
- if (entry->s->db_type() == heap_hton ||
- (!entry->s->blob_fields &&
- ((ALIGN_SIZE(reclength) + HASH_OVERHEAD) * entry->file->stats.records <
+ thd->reset_killed();
+
+ free_io_cache(table); // Safety
+ table->file->info(HA_STATUS_VARIABLE);
+ if (table->s->db_type() == heap_hton ||
+ (!table->s->blob_fields &&
+ ((ALIGN_SIZE(keylength) + HASH_OVERHEAD) * table->file->stats.records <
thd->variables.sortbuff_size)))
- error=remove_dup_with_hash_index(join->thd, entry,
- field_count, first_field,
- reclength, having);
+ error=remove_dup_with_hash_index(join->thd, table, field_count, first_field,
+ keylength, having);
else
- error=remove_dup_with_compare(join->thd, entry, first_field, offset,
- having);
+ error=remove_dup_with_compare(join->thd, table, first_field, having);
if (join->select_lex != join->select_lex->master_unit()->fake_select_lex)
thd->lex->set_limit_rows_examined();
@@ -19329,18 +19371,13 @@ remove_duplicates(JOIN *join, TABLE *entry,List<Item> &fields, Item *having)
static int remove_dup_with_compare(THD *thd, TABLE *table, Field **first_field,
- ulong offset, Item *having)
+ Item *having)
{
handler *file=table->file;
- char *org_record,*new_record;
- uchar *record;
+ uchar *record=table->record[0];
int error;
- ulong reclength= table->s->reclength-offset;
DBUG_ENTER("remove_dup_with_compare");
- org_record=(char*) (record=table->record[0])+offset;
- new_record=(char*) table->record[1]+offset;
-
if (file->ha_rnd_init_with_error(1))
DBUG_RETURN(1);
@@ -19377,7 +19414,7 @@ static int remove_dup_with_compare(THD *thd, TABLE *table, Field **first_field,
error=0;
goto err;
}
- memcpy(new_record,org_record,reclength);
+ store_record(table,record[1]);
/* Read through rest of file and mark duplicated rows deleted */
bool found=0;
@@ -19436,8 +19473,9 @@ static int remove_dup_with_hash_index(THD *thd, TABLE *table,
int error;
handler *file= table->file;
ulong extra_length= ALIGN_SIZE(key_length)-key_length;
- uint *field_lengths,*field_length;
+ uint *field_lengths, *field_length;
HASH hash;
+ Field **ptr;
DBUG_ENTER("remove_dup_with_hash_index");
if (!my_multi_malloc(MYF(MY_WME),
@@ -19449,21 +19487,8 @@ static int remove_dup_with_hash_index(THD *thd, TABLE *table,
NullS))
DBUG_RETURN(1);
- {
- Field **ptr;
- ulong total_length= 0;
- for (ptr= first_field, field_length=field_lengths ; *ptr ; ptr++)
- {
- uint length= (*ptr)->sort_length();
- (*field_length++)= length;
- total_length+= length;
- }
- DBUG_PRINT("info",("field_count: %u key_length: %lu total_length: %lu",
- field_count, key_length, total_length));
- DBUG_ASSERT(total_length <= key_length);
- key_length= total_length;
- extra_length= ALIGN_SIZE(key_length)-key_length;
- }
+ for (ptr= first_field, field_length=field_lengths ; *ptr ; ptr++)
+ (*field_length++)= (*ptr)->sort_length();
if (my_hash_init(&hash, &my_charset_bin, (uint) file->stats.records, 0,
key_length, (my_hash_get_key) 0, 0, 0))
@@ -19503,10 +19528,10 @@ static int remove_dup_with_hash_index(THD *thd, TABLE *table,
/* copy fields to key buffer */
org_key_pos= key_pos;
field_length=field_lengths;
- for (Field **ptr= first_field ; *ptr ; ptr++)
+ for (ptr= first_field ; *ptr ; ptr++)
{
- (*ptr)->sort_string(key_pos,*field_length);
- key_pos+= *field_length++;
+ (*ptr)->make_sort_key(key_pos, *field_length);
+ key_pos+= (*ptr)->maybe_null() + *field_length++;
}
/* Check if it exists before */
if (my_hash_search(&hash, org_key_pos, key_length))
@@ -22380,6 +22405,7 @@ static void print_join(THD *thd,
List_iterator_fast<TABLE_LIST> ti(*tables);
TABLE_LIST **table;
uint non_const_tables= 0;
+ DBUG_ENTER("print_join");
for (TABLE_LIST *t= ti++; t ; t= ti++)
{
@@ -22393,13 +22419,13 @@ static void print_join(THD *thd,
if (!non_const_tables)
{
str->append(STRING_WITH_LEN("dual"));
- return; // all tables were optimized away
+ DBUG_VOID_RETURN; // all tables were optimized away
}
ti.rewind();
if (!(table= (TABLE_LIST **)thd->alloc(sizeof(TABLE_LIST*) *
non_const_tables)))
- return; // out of memory
+ DBUG_VOID_RETURN; // out of memory
TABLE_LIST *tmp, **t= table + (non_const_tables - 1);
while ((tmp= ti++))
@@ -22438,6 +22464,7 @@ static void print_join(THD *thd,
}
print_table_array(thd, eliminated_tables, str, table,
table + non_const_tables, query_type);
+ DBUG_VOID_RETURN;
}
/**
@@ -22946,7 +22973,8 @@ JOIN::reoptimize(Item *added_where, table_map join_tables,
reset_query_plan();
if (!keyuse.buffer &&
- my_init_dynamic_array(&keyuse, sizeof(KEYUSE), 20, 64))
+ my_init_dynamic_array(&keyuse, sizeof(KEYUSE), 20, 64,
+ MYF(MY_THREAD_SPECIFIC)))
{
delete_dynamic(&added_keyuse);
return REOPT_ERROR;
@@ -23125,7 +23153,7 @@ test_if_cheaper_ordering(const JOIN_TAB *tab, ORDER *order, TABLE *table,
{
int direction;
ha_rows select_limit= select_limit_arg;
- uint used_key_parts;
+ uint used_key_parts= 0;
if (keys.is_set(nr) &&
(direction= test_if_order_by_key(order, table, nr, &used_key_parts)))
@@ -23193,7 +23221,7 @@ test_if_cheaper_ordering(const JOIN_TAB *tab, ORDER *order, TABLE *table,
to be adjusted accordingly if some components of
the secondary key are included in the primary key.
*/
- for(uint i= 0; i < used_pk_parts; i++)
+ for(uint i= 1; i < used_pk_parts; i++)
{
if (pkinfo->key_part[i].field->key_start.is_set(nr))
{
diff --git a/sql/sql_servers.cc b/sql/sql_servers.cc
index dce679a883f..b5b7f9866c5 100644
--- a/sql/sql_servers.cc
+++ b/sql/sql_servers.cc
@@ -158,7 +158,7 @@ bool servers_init(bool dont_read_servers_table)
}
/* Initialize the mem root for data */
- init_sql_alloc(&mem, ACL_ALLOC_BLOCK_SIZE, 0);
+ init_sql_alloc(&mem, ACL_ALLOC_BLOCK_SIZE, 0, MYF(MY_THREAD_SPECIFIC));
if (dont_read_servers_table)
goto end;
@@ -178,7 +178,7 @@ bool servers_init(bool dont_read_servers_table)
return_val= servers_reload(thd);
delete thd;
/* Remember that we don't have a THD */
- my_pthread_setspecific_ptr(THR_THD, 0);
+ set_current_thd(0);
end:
DBUG_RETURN(return_val);
@@ -209,7 +209,7 @@ static bool servers_load(THD *thd, TABLE_LIST *tables)
my_hash_reset(&servers_cache);
free_root(&mem, MYF(0));
- init_sql_alloc(&mem, ACL_ALLOC_BLOCK_SIZE, 0);
+ init_sql_alloc(&mem, ACL_ALLOC_BLOCK_SIZE, 0, MYF(0));
if (init_read_record(&read_record_info,thd,table=tables[0].table,NULL,1,0,
FALSE))
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index 1ef3ce2e40a..1f860fe23db 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -458,7 +458,7 @@ bool
ignore_db_dirs_init()
{
return my_init_dynamic_array(&ignore_db_dirs_array, sizeof(LEX_STRING *),
- 0, 0);
+ 0, 0, MYF(0));
}
@@ -737,7 +737,8 @@ find_files(THD *thd, List<LEX_STRING> *files, const char *db,
bzero((char*) &table_list,sizeof(table_list));
- if (!(dirp = my_dir(path,MYF(dir ? MY_WANT_STAT : 0))))
+ if (!(dirp = my_dir(path,MYF((dir ? MY_WANT_STAT : 0) |
+ MY_THREAD_SPECIFIC))))
{
if (my_errno == ENOENT)
my_error(ER_BAD_DB_ERROR, MYF(ME_BELL+ME_WAITTANG), db);
@@ -2334,11 +2335,14 @@ void Show_explain_request::call_in_target_thread()
target_thd->query_length(),
target_thd->query_charset());
+ DBUG_ASSERT(current_thd == target_thd);
+ set_current_thd(request_thd);
if (target_thd->lex->unit.print_explain(explain_buf, 0 /* explain flags*/,
&printed_anything))
{
failed_to_produce= TRUE;
}
+ set_current_thd(target_thd);
if (!printed_anything)
failed_to_produce= TRUE;
@@ -2349,10 +2353,20 @@ void Show_explain_request::call_in_target_thread()
int select_result_explain_buffer::send_data(List<Item> &items)
{
+ int res;
+ THD *cur_thd= current_thd;
+ DBUG_ENTER("select_result_explain_buffer::send_data");
+
+ /*
+ Switch to the recieveing thread, so that we correctly count memory used
+ by it. This is needed as it's the receiving thread that will free the
+ memory.
+ */
+ set_current_thd(thd);
fill_record(thd, dst_table, dst_table->field, items, TRUE, FALSE);
- if ((dst_table->file->ha_write_tmp_row(dst_table->record[0])))
- return 1;
- return 0;
+ res= dst_table->file->ha_write_tmp_row(dst_table->record[0]);
+ set_current_thd(cur_thd);
+ DBUG_RETURN(test(res));
}
@@ -2578,6 +2592,18 @@ int fill_schema_processlist(THD* thd, TABLE_LIST* tables, COND* cond)
}
mysql_mutex_unlock(&tmp->LOCK_thd_data);
+ /*
+ This may become negative if we free a memory allocated by another
+ thread in this thread. However it's better that we notice it eventually
+ than hide it.
+ */
+ table->field[12]->store((longlong) (tmp->status_var.memory_used +
+ sizeof(THD)),
+ FALSE);
+ table->field[12]->set_notnull();
+ table->field[13]->store((longlong) tmp->get_examined_row_count(), TRUE);
+ table->field[13]->set_notnull();
+
if (schema_table_store_record(thd, table))
{
mysql_mutex_unlock(&LOCK_thread_count);
@@ -2650,7 +2676,7 @@ int add_status_vars(SHOW_VAR *list)
if (status_vars_inited)
mysql_mutex_lock(&LOCK_status);
if (!all_status_vars.buffer && // array is not allocated yet - do it now
- my_init_dynamic_array(&all_status_vars, sizeof(SHOW_VAR), 200, 20))
+ my_init_dynamic_array(&all_status_vars, sizeof(SHOW_VAR), 200, 20, MYF(0)))
{
res= 1;
goto err;
@@ -2784,7 +2810,6 @@ static bool show_status_array(THD *thd, const char *wild,
int len;
LEX_STRING null_lex_str;
SHOW_VAR tmp, *var;
- COND *partial_cond= 0;
enum_check_fields save_count_cuted_fields= thd->count_cuted_fields;
bool res= FALSE;
CHARSET_INFO *charset= system_charset_info;
@@ -2798,7 +2823,6 @@ static bool show_status_array(THD *thd, const char *wild,
if (*prefix)
*prefix_end++= '_';
len=name_buffer + sizeof(name_buffer) - prefix_end;
- partial_cond= make_cond_for_info_schema(cond, table->pos_in_table_list);
for (; variables->name; variables++)
{
@@ -2836,14 +2860,14 @@ static bool show_status_array(THD *thd, const char *wild,
if (show_type == SHOW_ARRAY)
{
show_status_array(thd, wild, (SHOW_VAR *) var->value, value_type,
- status_var, name_buffer, table, ucase_names, partial_cond);
+ status_var, name_buffer, table, ucase_names, cond);
}
else
{
if ((wild_checked ||
(wild && wild[0] && wild_case_compare(system_charset_info,
name_buffer, wild))) &&
- (!partial_cond || partial_cond->val_int()))
+ (!cond || cond->val_int()))
{
char *value=var->value;
const char *pos, *end; // We assign a lot of const's
@@ -2999,7 +3023,8 @@ static int aggregate_user_stats(HASH *all_user_stats, HASH *agg_user_stats)
{
// First entry for this role.
if (!(agg_user= (USER_STATS*) my_malloc(sizeof(USER_STATS),
- MYF(MY_WME | MY_ZEROFILL))))
+ MYF(MY_WME | MY_ZEROFILL|
+ MY_THREAD_SPECIFIC))))
{
sql_print_error("Malloc in aggregate_user_stats failed");
DBUG_RETURN(1);
@@ -4372,7 +4397,7 @@ static int fill_schema_table_from_frm(THD *thd, TABLE_LIST *tables,
if (schema_table->i_s_requested_object & OPEN_TRIGGER_ONLY)
{
- init_sql_alloc(&tbl.mem_root, TABLE_ALLOC_BLOCK_SIZE, 0);
+ init_sql_alloc(&tbl.mem_root, TABLE_ALLOC_BLOCK_SIZE, 0, MYF(0));
if (!Table_triggers_list::check_n_load(thd, db_name->str,
table_name->str, &tbl, 1))
{
@@ -5870,7 +5895,13 @@ int fill_schema_proc(THD *thd, TABLE_LIST *tables, COND *cond)
{
DBUG_RETURN(1);
}
- proc_table->file->ha_index_init(0, 1);
+
+ if (proc_table->file->ha_index_init(0, 1))
+ {
+ res= 1;
+ goto err;
+ }
+
if ((res= proc_table->file->ha_index_first(proc_table->record[0])))
{
res= (res == HA_ERR_END_OF_FILE) ? 0 : 1;
@@ -5896,7 +5927,9 @@ int fill_schema_proc(THD *thd, TABLE_LIST *tables, COND *cond)
}
err:
- proc_table->file->ha_index_end();
+ if (proc_table->file->inited)
+ (void) proc_table->file->ha_index_end();
+
close_system_tables(thd, &open_tables_state_backup);
DBUG_RETURN(res);
}
@@ -7095,9 +7128,12 @@ int fill_variables(THD *thd, TABLE_LIST *tables, COND *cond)
schema_table_idx == SCH_GLOBAL_VARIABLES)
option_type= OPT_GLOBAL;
+ COND *partial_cond= make_cond_for_info_schema(cond, tables);
+
mysql_rwlock_rdlock(&LOCK_system_variables_hash);
res= show_status_array(thd, wild, enumerate_sys_vars(thd, sorted_vars, option_type),
- option_type, NULL, "", tables->table, upper_case_names, cond);
+ option_type, NULL, "", tables->table,
+ upper_case_names, partial_cond);
mysql_rwlock_unlock(&LOCK_system_variables_hash);
DBUG_RETURN(res);
}
@@ -7134,13 +7170,18 @@ int fill_status(THD *thd, TABLE_LIST *tables, COND *cond)
tmp1= &thd->status_var;
}
+ COND *partial_cond= make_cond_for_info_schema(cond, tables);
+ // Evaluate and cache const subqueries now, before the mutex.
+ if (partial_cond)
+ partial_cond->val_int();
+
mysql_mutex_lock(&LOCK_status);
if (option_type == OPT_GLOBAL)
calc_sum_of_all_status(&tmp);
res= show_status_array(thd, wild,
(SHOW_VAR *)all_status_vars.buffer,
option_type, tmp1, "", tables->table,
- upper_case_names, cond);
+ upper_case_names, partial_cond);
mysql_mutex_unlock(&LOCK_status);
DBUG_RETURN(res);
}
@@ -8612,6 +8653,8 @@ ST_FIELD_INFO processlist_fields_info[]=
{"MAX_STAGE", 2, MYSQL_TYPE_TINY, 0, 0, "Max_stage", SKIP_OPEN_TABLE},
{"PROGRESS", 703, MYSQL_TYPE_DECIMAL, 0, 0, "Progress",
SKIP_OPEN_TABLE},
+ {"MEMORY_USED", 7, MYSQL_TYPE_LONG, 0, 0, "Memory_used", SKIP_OPEN_TABLE},
+ {"EXAMINED_ROWS", 7, MYSQL_TYPE_LONG, 0, 0, "Examined_rows", SKIP_OPEN_TABLE},
{0, 0, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE}
};
@@ -8941,7 +8984,7 @@ int initialize_schema_table(st_plugin_int *plugin)
DBUG_ENTER("initialize_schema_table");
if (!(schema_table= (ST_SCHEMA_TABLE *)my_malloc(sizeof(ST_SCHEMA_TABLE),
- MYF(MY_WME | MY_ZEROFILL))))
+ MYF(MY_WME | MY_ZEROFILL))))
DBUG_RETURN(1);
/* Historical Requirement */
plugin->data= schema_table; // shortcut for the future
diff --git a/sql/sql_signal.cc b/sql/sql_signal.cc
index 9da10f5b2f5..ed4d2c23d53 100644
--- a/sql/sql_signal.cc
+++ b/sql/sql_signal.cc
@@ -477,7 +477,7 @@ bool Signal_statement::execute(THD *thd)
bool Resignal_statement::execute(THD *thd)
{
- MYSQL_ERROR *signaled;
+ Sql_condition_info *signaled;
int result= TRUE;
DBUG_ENTER("Resignal_statement::execute");
@@ -490,15 +490,21 @@ bool Resignal_statement::execute(THD *thd)
DBUG_RETURN(result);
}
+ MYSQL_ERROR signaled_err(thd->mem_root);
+ signaled_err.set(signaled->m_sql_errno,
+ signaled->m_sql_state,
+ signaled->m_level,
+ signaled->m_message);
+
if (m_cond == NULL)
{
/* RESIGNAL without signal_value */
- result= raise_condition(thd, signaled);
+ result= raise_condition(thd, &signaled_err);
DBUG_RETURN(result);
}
/* RESIGNAL with signal_value */
- result= raise_condition(thd, signaled);
+ result= raise_condition(thd, &signaled_err);
DBUG_RETURN(result);
}
diff --git a/sql/sql_statistics.cc b/sql/sql_statistics.cc
index 618fd9b7799..e34b4b21819 100644
--- a/sql/sql_statistics.cc
+++ b/sql/sql_statistics.cc
@@ -1296,7 +1296,7 @@ public:
if (tree->elements == 0)
return (ulonglong) tree->elements_in_tree();
count= 0;
- tree->walk(count_distinct_walk, (void*) &count);
+ tree->walk(table_field->table, count_distinct_walk, (void*) &count);
return count;
}
};
@@ -1387,7 +1387,8 @@ public:
is_single_comp_pk= FALSE;
uint pk= table->s->primary_key;
- if (table->key_info - key_info == pk && table->key_info[pk].key_parts == 1)
+ if ((uint) (table->key_info - key_info) == pk &&
+ table->key_info[pk].key_parts == 1)
{
prefixes= 1;
is_single_comp_pk= TRUE;
@@ -2499,6 +2500,8 @@ int read_statistics_for_table(THD *thd, TABLE *table, TABLE_LIST *stat_tables)
}
}
+ table->stats_is_read= TRUE;
+
DBUG_RETURN(0);
}
@@ -2557,6 +2560,8 @@ bool statistics_for_tables_is_needed(THD *thd, TABLE_LIST *tables)
table_share->stats_cb.stats_can_be_read &&
!table_share->stats_cb.stats_is_read)
return TRUE;
+ if (table_share->stats_cb.stats_is_read)
+ tl->table->stats_is_read= TRUE;
}
}
@@ -2616,6 +2621,8 @@ int read_statistics_for_tables_if_needed(THD *thd, TABLE_LIST *tables)
(void) read_statistics_for_table(thd, tl->table, stat_tables);
table_share->stats_cb.stats_is_read= TRUE;
}
+ if (table_share->stats_cb.stats_is_read)
+ tl->table->stats_is_read= TRUE;
}
}
@@ -3034,7 +3041,7 @@ void set_statistics_for_table(THD *thd, TABLE *table)
Use_stat_tables_mode use_stat_table_mode= get_use_stat_tables_mode(thd);
table->used_stat_records=
(use_stat_table_mode <= COMPLEMENTARY ||
- !stats_cb->stats_is_read || read_stats->cardinality_is_null) ?
+ !table->stats_is_read || read_stats->cardinality_is_null) ?
table->file->stats.records : read_stats->cardinality;
KEY *key_info, *key_info_end;
for (key_info= table->key_info, key_info_end= key_info+table->s->keys;
@@ -3042,7 +3049,7 @@ void set_statistics_for_table(THD *thd, TABLE *table)
{
key_info->is_statistics_from_stat_tables=
(use_stat_table_mode > COMPLEMENTARY &&
- stats_cb->stats_is_read &&
+ table->stats_is_read &&
key_info->read_stats->avg_frequency_is_inited() &&
key_info->read_stats->get_avg_frequency(0) > 0.5);
}
diff --git a/sql/sql_string.cc b/sql/sql_string.cc
index 89536b93feb..9d11677666f 100644
--- a/sql/sql_string.cc
+++ b/sql/sql_string.cc
@@ -42,7 +42,9 @@ bool String::real_alloc(uint32 length)
if (Alloced_length < arg_length)
{
free();
- if (!(Ptr=(char*) my_malloc(arg_length,MYF(MY_WME))))
+ if (!(Ptr=(char*) my_malloc(arg_length,MYF(MY_WME |
+ (thread_specific ?
+ MY_THREAD_SPECIFIC : 0)))))
return TRUE;
Alloced_length=arg_length;
alloced=1;
@@ -90,10 +92,16 @@ bool String::realloc_raw(uint32 alloc_length)
return TRUE; /* Overflow */
if (alloced)
{
- if (!(new_ptr= (char*) my_realloc(Ptr,len,MYF(MY_WME))))
+ if (!(new_ptr= (char*) my_realloc(Ptr,len,
+ MYF(MY_WME |
+ (thread_specific ?
+ MY_THREAD_SPECIFIC : 0)))))
return TRUE; // Signal error
}
- else if ((new_ptr= (char*) my_malloc(len,MYF(MY_WME))))
+ else if ((new_ptr= (char*) my_malloc(len,
+ MYF(MY_WME |
+ (thread_specific ?
+ MY_THREAD_SPECIFIC : 0)))))
{
if (str_length > len - 1)
str_length= 0;
@@ -768,79 +776,6 @@ String *copy_if_not_alloced(String *to,String *from,uint32 from_length)
Help functions
****************************************************************************/
-/*
- copy a string from one character set to another
-
- SYNOPSIS
- copy_and_convert()
- to Store result here
- to_cs Character set of result string
- from Copy from here
- from_length Length of from string
- from_cs From character set
-
- NOTES
- 'to' must be big enough as form_length * to_cs->mbmaxlen
-
- RETURN
- length of bytes copied to 'to'
-*/
-
-
-static uint32
-copy_and_convert_extended(char *to, uint32 to_length, CHARSET_INFO *to_cs,
- const char *from, uint32 from_length,
- CHARSET_INFO *from_cs,
- uint *errors)
-{
- int cnvres;
- my_wc_t wc;
- const uchar *from_end= (const uchar*) from+from_length;
- char *to_start= to;
- uchar *to_end= (uchar*) to+to_length;
- my_charset_conv_mb_wc mb_wc= from_cs->cset->mb_wc;
- my_charset_conv_wc_mb wc_mb= to_cs->cset->wc_mb;
- uint error_count= 0;
-
- while (1)
- {
- if ((cnvres= (*mb_wc)(from_cs, &wc, (uchar*) from,
- from_end)) > 0)
- from+= cnvres;
- else if (cnvres == MY_CS_ILSEQ)
- {
- error_count++;
- from++;
- wc= '?';
- }
- else if (cnvres > MY_CS_TOOSMALL)
- {
- /*
- A correct multibyte sequence detected
- But it doesn't have Unicode mapping.
- */
- error_count++;
- from+= (-cnvres);
- wc= '?';
- }
- else
- break; // Not enough characters
-
-outp:
- if ((cnvres= (*wc_mb)(to_cs, wc, (uchar*) to, to_end)) > 0)
- to+= cnvres;
- else if (cnvres == MY_CS_ILUNI && wc != '?')
- {
- error_count++;
- wc= '?';
- goto outp;
- }
- else
- break;
- }
- *errors= error_count;
- return (uint32) (to - to_start);
-}
/*
diff --git a/sql/sql_string.h b/sql/sql_string.h
index 2966fc2a920..58cda343dac 100644
--- a/sql/sql_string.h
+++ b/sql/sql_string.h
@@ -56,23 +56,26 @@ class String
{
char *Ptr;
uint32 str_length,Alloced_length, extra_alloc;
- bool alloced;
+ bool alloced,thread_specific;
CHARSET_INFO *str_charset;
public:
String()
{
- Ptr=0; str_length=Alloced_length=extra_alloc=0; alloced=0;
+ Ptr=0; str_length=Alloced_length=extra_alloc=0;
+ alloced= thread_specific= 0;
str_charset= &my_charset_bin;
}
String(uint32 length_arg)
{
- alloced=0; Alloced_length= extra_alloc= 0; (void) real_alloc(length_arg);
+ alloced= thread_specific= 0;
+ Alloced_length= extra_alloc= 0; (void) real_alloc(length_arg);
str_charset= &my_charset_bin;
}
String(const char *str, CHARSET_INFO *cs)
{
Ptr=(char*) str; str_length= (uint32) strlen(str);
- Alloced_length= extra_alloc= 0; alloced=0;
+ Alloced_length= extra_alloc= 0;
+ alloced= thread_specific= 0;
str_charset=cs;
}
/*
@@ -82,18 +85,21 @@ public:
*/
String(const char *str,uint32 len, CHARSET_INFO *cs)
{
- Ptr=(char*) str; str_length=len; Alloced_length= extra_alloc=0; alloced=0;
+ Ptr=(char*) str; str_length=len; Alloced_length= extra_alloc=0;
+ alloced= thread_specific= 0;
str_charset=cs;
}
String(char *str,uint32 len, CHARSET_INFO *cs)
{
- Ptr=(char*) str; Alloced_length=str_length=len; extra_alloc= 0; alloced=0;
+ Ptr=(char*) str; Alloced_length=str_length=len; extra_alloc= 0;
+ alloced= thread_specific= 0;
str_charset=cs;
}
String(const String &str)
{
Ptr=str.Ptr ; str_length=str.str_length ;
- Alloced_length=str.Alloced_length; extra_alloc= 0; alloced=0;
+ Alloced_length=str.Alloced_length; extra_alloc= 0;
+ alloced= thread_specific= 0;
str_charset=str.str_charset;
}
static void *operator new(size_t size, MEM_ROOT *mem_root) throw ()
@@ -108,6 +114,12 @@ public:
{ /* never called */ }
~String() { free(); }
+ /* Mark variable thread specific it it's not allocated already */
+ inline void set_thread_specific()
+ {
+ if (!alloced)
+ thread_specific= 1;
+ }
inline void set_charset(CHARSET_INFO *charset_arg)
{ str_charset= charset_arg; }
inline CHARSET_INFO *charset() const { return str_charset; }
@@ -332,6 +344,7 @@ public:
Ptr=s.Ptr ; str_length=s.str_length ; Alloced_length=s.Alloced_length;
extra_alloc= s.extra_alloc;
alloced= s.alloced;
+ thread_specific= s.thread_specific;
s.alloced= 0;
}
bool append(const String &s);
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index 31e4110c4b1..3c094e1740e 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -961,7 +961,7 @@ static int execute_ddl_log_action(THD *thd, DDL_LOG_ENTRY *ddl_log_entry)
ddl_log_entry->handler_name));
handler_name.str= (char*)ddl_log_entry->handler_name;
handler_name.length= strlen(ddl_log_entry->handler_name);
- init_sql_alloc(&mem_root, TABLE_ALLOC_BLOCK_SIZE, 0);
+ init_sql_alloc(&mem_root, TABLE_ALLOC_BLOCK_SIZE, 0, MYF(MY_THREAD_SPECIFIC));
if (!strcmp(ddl_log_entry->handler_name, reg_ext))
frm_action= TRUE;
else
@@ -1525,7 +1525,7 @@ void execute_ddl_log_recovery()
global_ddl_log.recovery_phase= FALSE;
delete thd;
/* Remember that we don't have a THD */
- my_pthread_setspecific_ptr(THR_THD, 0);
+ set_current_thd(0);
DBUG_VOID_RETURN;
}
@@ -5395,7 +5395,7 @@ mysql_compare_tables(TABLE *table,
if (table->s->tmp_table == NO_TMP_TABLE)
{
(void) delete_statistics_for_index(thd, table, table_key, FALSE);
- if (table_key - table->key_info == table->s->primary_key)
+ if ((uint) (table_key - table->key_info) == table->s->primary_key)
{
KEY *tab_key_info= table->key_info;
for (uint j=0; j < table->s->keys; j++, tab_key_info++)
@@ -7555,7 +7555,8 @@ copy_data_between_tables(THD *thd, TABLE *from,TABLE *to,
else
{
from->sort.io_cache=(IO_CACHE*) my_malloc(sizeof(IO_CACHE),
- MYF(MY_FAE | MY_ZEROFILL));
+ MYF(MY_FAE | MY_ZEROFILL |
+ MY_THREAD_SPECIFIC));
bzero((char *) &tables, sizeof(tables));
tables.table= from;
tables.alias= tables.table_name= from->s->table_name.str;
diff --git a/sql/sql_test.cc b/sql/sql_test.cc
index 25ab84fe4db..5b3286d77b0 100644
--- a/sql/sql_test.cc
+++ b/sql/sql_test.cc
@@ -484,7 +484,9 @@ static void display_table_locks(void)
void *saved_base;
DYNAMIC_ARRAY saved_table_locks;
- (void) my_init_dynamic_array(&saved_table_locks,sizeof(TABLE_LOCK_INFO), cached_open_tables() + 20,50);
+ (void) my_init_dynamic_array(&saved_table_locks,sizeof(TABLE_LOCK_INFO),
+ cached_open_tables() + 20, 50,
+ MYF(MY_THREAD_SPECIFIC));
mysql_mutex_lock(&THR_LOCK_lock);
for (list= thr_lock_thread_list; list; list= list_rest(list))
{
diff --git a/sql/sql_time.cc b/sql/sql_time.cc
index 5c0471fdfaa..57dbd979933 100644
--- a/sql/sql_time.cc
+++ b/sql/sql_time.cc
@@ -1,5 +1,5 @@
/* Copyright (c) 2000, 2010, Oracle and/or its affiliates.
- Copyright (c) 2009-2011 Monty Program Ab
+ Copyright (c) 2009, 2013 Monty Program Ab.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -154,7 +154,7 @@ bool get_date_from_daynr(long daynr,uint *ret_year,uint *ret_month,
uchar *month_pos;
DBUG_ENTER("get_date_from_daynr");
- if (daynr < 365 || daynr > MAX_DAY_NUMBER)
+ if (daynr < 366 || daynr > MAX_DAY_NUMBER)
DBUG_RETURN(1);
year= (uint) (daynr*100 / 36525L);
diff --git a/sql/sql_trigger.cc b/sql/sql_trigger.cc
index aff00f9fcf4..d7d902bc6b0 100644
--- a/sql/sql_trigger.cc
+++ b/sql/sql_trigger.cc
@@ -1779,7 +1779,7 @@ bool Table_triggers_list::drop_all_triggers(THD *thd, char *db, char *name)
DBUG_ENTER("drop_all_triggers");
bzero(&table, sizeof(table));
- init_sql_alloc(&table.mem_root, 8192, 0);
+ init_sql_alloc(&table.mem_root, 8192, 0, MYF(0));
if (Table_triggers_list::check_n_load(thd, db, name, &table, 1))
{
@@ -1999,7 +1999,7 @@ bool Table_triggers_list::change_table_name(THD *thd, const char *db,
DBUG_ENTER("change_table_name");
bzero(&table, sizeof(table));
- init_sql_alloc(&table.mem_root, 8192, 0);
+ init_sql_alloc(&table.mem_root, 8192, 0, MYF(0));
/*
This method interfaces the mysql server code protected by
diff --git a/sql/sql_truncate.cc b/sql/sql_truncate.cc
index 9d4ca5e1373..4b77344c042 100644
--- a/sql/sql_truncate.cc
+++ b/sql/sql_truncate.cc
@@ -24,7 +24,7 @@
#include "sql_acl.h" // DROP_ACL
#include "sql_parse.h" // check_one_table_access()
#include "sql_truncate.h"
-#include "sql_show.h"
+#include "sql_show.h" //append_identifier()
/**
@@ -263,6 +263,7 @@ static bool recreate_temporary_table(THD *thd, TABLE *table)
DBUG_ENTER("recreate_temporary_table");
memset(&create_info, 0, sizeof(create_info));
+ create_info.options|= HA_LEX_CREATE_TMP_TABLE;
table->file->info(HA_STATUS_AUTO | HA_STATUS_NO_LOCK);
diff --git a/sql/sql_udf.cc b/sql/sql_udf.cc
index 9069d876609..c792dca873c 100644
--- a/sql/sql_udf.cc
+++ b/sql/sql_udf.cc
@@ -151,7 +151,7 @@ void udf_init()
mysql_rwlock_init(key_rwlock_THR_LOCK_udf, &THR_LOCK_udf);
- init_sql_alloc(&mem, UDF_ALLOC_BLOCK_SIZE, 0);
+ init_sql_alloc(&mem, UDF_ALLOC_BLOCK_SIZE, 0, MYF(0));
THD *new_thd = new THD;
if (!new_thd ||
my_hash_init(&udf_hash,system_charset_info,32,0,0,get_hash_key, NULL, 0))
@@ -258,7 +258,7 @@ end:
close_mysql_tables(new_thd);
delete new_thd;
/* Remember that we don't have a THD */
- my_pthread_setspecific_ptr(THR_THD, 0);
+ set_current_thd(0);
DBUG_VOID_RETURN;
}
diff --git a/sql/sql_union.cc b/sql/sql_union.cc
index bda9b919663..106c134223e 100644
--- a/sql/sql_union.cc
+++ b/sql/sql_union.cc
@@ -716,7 +716,7 @@ bool st_select_lex_unit::exec()
ER(ER_QUERY_EXCEEDED_ROWS_EXAMINED_LIMIT),
thd->accessed_rows_and_keys,
thd->lex->limit_rows_examined->val_uint());
- thd->killed= NOT_KILLED;
+ thd->reset_killed();
break;
}
}
diff --git a/sql/sql_update.cc b/sql/sql_update.cc
index 066bc2c24f7..0d1cb7de5f2 100644
--- a/sql/sql_update.cc
+++ b/sql/sql_update.cc
@@ -493,7 +493,8 @@ int mysql_update(THD *thd,
ha_rows found_rows;
table->sort.io_cache = (IO_CACHE *) my_malloc(sizeof(IO_CACHE),
- MYF(MY_FAE | MY_ZEROFILL));
+ MYF(MY_FAE | MY_ZEROFILL |
+ MY_THREAD_SPECIFIC));
if (!(sortorder=make_unireg_sortorder(order, &length, NULL)) ||
(table->sort.found_records= filesort(thd, table, sortorder, length,
select, limit,
@@ -2233,11 +2234,16 @@ err:
}
err2:
- (void) table->file->ha_rnd_end();
- (void) tmp_table->file->ha_rnd_end();
+ if (table->file->inited)
+ (void) table->file->ha_rnd_end();
+ if (tmp_table->file->inited)
+ (void) tmp_table->file->ha_rnd_end();
check_opt_it.rewind();
while (TABLE *tbl= check_opt_it++)
- tbl->file->ha_rnd_end();
+ {
+ if (tbl->file->inited)
+ (void) tbl->file->ha_rnd_end();
+ }
if (updated != org_updated)
{
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index ac904c990ed..56e7db96a1a 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -993,11 +993,10 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
%token COLLATION_SYM /* SQL-2003-N */
%token COLUMNS
%token COLUMN_ADD_SYM
+%token COLUMN_CHECK_SYM
%token COLUMN_CREATE_SYM
%token COLUMN_DELETE_SYM
-%token COLUMN_EXISTS_SYM
%token COLUMN_GET_SYM
-%token COLUMN_LIST_SYM
%token COLUMN_SYM /* SQL-2003-R */
%token COLUMN_NAME_SYM /* SQL-2003-N */
%token COMMENT_SYM
@@ -8566,7 +8565,7 @@ dyncall_create_element:
alloc_root(YYTHD->mem_root, sizeof(DYNCALL_CREATE_DEF));
if ($$ == NULL)
MYSQL_YYABORT;
- $$->num= $1;
+ $$->key= $1;
$$->value= $3;
$$->type= (DYNAMIC_COLUMN_TYPE)$4;
$$->cs= lex->charset;
@@ -9120,16 +9119,9 @@ function_call_nonkeyword:
MYSQL_YYABORT;
}
|
- COLUMN_EXISTS_SYM '(' expr ',' expr ')'
+ COLUMN_CHECK_SYM '(' expr ')'
{
- $$= new (YYTHD->mem_root) Item_func_dyncol_exists($3, $5);
- if ($$ == NULL)
- MYSQL_YYABORT;
- }
- |
- COLUMN_LIST_SYM '(' expr ')'
- {
- $$= new (YYTHD->mem_root) Item_func_dyncol_list($3);
+ $$= new (YYTHD->mem_root) Item_func_dyncol_check($3);
if ($$ == NULL)
MYSQL_YYABORT;
}
@@ -11758,11 +11750,19 @@ show_param:
{
LEX *lex=Lex;
lex->sql_command= SQLCOM_SHOW_AUTHORS;
+ push_warning_printf(YYTHD, MYSQL_ERROR::WARN_LEVEL_WARN,
+ ER_WARN_DEPRECATED_SYNTAX_NO_REPLACEMENT,
+ ER(ER_WARN_DEPRECATED_SYNTAX_NO_REPLACEMENT),
+ "SHOW AUTHORS");
}
| CONTRIBUTORS_SYM
{
LEX *lex=Lex;
lex->sql_command= SQLCOM_SHOW_CONTRIBUTORS;
+ push_warning_printf(YYTHD, MYSQL_ERROR::WARN_LEVEL_WARN,
+ ER_WARN_DEPRECATED_SYNTAX_NO_REPLACEMENT,
+ ER(ER_WARN_DEPRECATED_SYNTAX_NO_REPLACEMENT),
+ "SHOW CONTRIBUTORS");
}
| PRIVILEGES
{
@@ -13277,11 +13277,10 @@ keyword:
| CHECKPOINT_SYM {}
| CLOSE_SYM {}
| COLUMN_ADD_SYM {}
+ | COLUMN_CHECK_SYM {}
| COLUMN_CREATE_SYM {}
| COLUMN_DELETE_SYM {}
- | COLUMN_EXISTS_SYM {}
| COLUMN_GET_SYM {}
- | COLUMN_LIST_SYM {}
| COMMENT_SYM {}
| COMMIT_SYM {}
| CONTAINS_SYM {}
diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc
index c585f6681f0..9b55c09a170 100644
--- a/sql/sys_vars.cc
+++ b/sql/sys_vars.cc
@@ -3674,7 +3674,7 @@ Sys_slave_skip_counter("sql_slave_skip_counter",
"Skip the next N events from the master log",
SESSION_VAR(slave_skip_counter),
NO_CMD_LINE,
- offsetof(Master_info, rli.slave_skip_counter),
+ my_offsetof(Master_info, rli.slave_skip_counter),
VALID_RANGE(0, UINT_MAX), DEFAULT(0), BLOCK_SIZE(1),
ON_UPDATE(update_slave_skip_counter));
@@ -3693,7 +3693,7 @@ Sys_max_relay_log_size( "max_relay_log_size",
"set to max_binlog_size",
SESSION_VAR(max_relay_log_size),
CMD_LINE(REQUIRED_ARG),
- offsetof(Master_info, rli.max_relay_log_size),
+ my_offsetof(Master_info, rli.max_relay_log_size),
VALID_RANGE(0, 1024L*1024*1024), DEFAULT(0),
BLOCK_SIZE(IO_SIZE),
ON_UPDATE(update_max_relay_log_size));
diff --git a/sql/table.cc b/sql/table.cc
index 22d4eed1b12..c8dc2b4ed5a 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -307,7 +307,7 @@ TABLE_SHARE *alloc_table_share(TABLE_LIST *table_list, char *key,
path_length= build_table_filename(path, sizeof(path) - 1,
table_list->db,
table_list->table_name, "", 0);
- init_sql_alloc(&mem_root, TABLE_ALLOC_BLOCK_SIZE, 0);
+ init_sql_alloc(&mem_root, TABLE_ALLOC_BLOCK_SIZE, 0, MYF(0));
if (multi_alloc_root(&mem_root,
&share, sizeof(*share),
&key_buff, key_length,
@@ -340,7 +340,7 @@ TABLE_SHARE *alloc_table_share(TABLE_LIST *table_list, char *key,
share->free_tables.empty();
share->m_flush_tickets.empty();
- init_sql_alloc(&share->stats_cb.mem_root, TABLE_ALLOC_BLOCK_SIZE, 0);
+ init_sql_alloc(&share->stats_cb.mem_root, TABLE_ALLOC_BLOCK_SIZE, 0, MYF(0));
memcpy((char*) &share->mem_root, (char*) &mem_root, sizeof(mem_root));
mysql_mutex_init(key_TABLE_SHARE_LOCK_ha_data,
@@ -381,7 +381,12 @@ void init_tmp_table_share(THD *thd, TABLE_SHARE *share, const char *key,
DBUG_PRINT("enter", ("table: '%s'.'%s'", key, table_name));
bzero((char*) share, sizeof(*share));
- init_sql_alloc(&share->mem_root, TABLE_ALLOC_BLOCK_SIZE, 0);
+ /*
+ This can't be MY_THREAD_SPECIFIC for slaves as they are freed
+ during cleanup() from Relay_log_info::close_temporary_tables()
+ */
+ init_sql_alloc(&share->mem_root, TABLE_ALLOC_BLOCK_SIZE, 0,
+ MYF(thd->slave_thread ? 0 : MY_THREAD_SPECIFIC));
share->table_category= TABLE_CATEGORY_TEMPORARY;
share->tmp_table= INTERNAL_TMP_TABLE;
share->db.str= (char*) key;
@@ -2158,9 +2163,11 @@ end:
@brief
Unpack the definition of a virtual column from its linear representation
- @parm
+ @param
thd The thread object
@param
+ mem_root The mem_root object where to allocated memory
+ @param
table The table containing the virtual column
@param
field The field for the virtual
@@ -2189,6 +2196,7 @@ end:
TRUE Otherwise
*/
bool unpack_vcol_info_from_frm(THD *thd,
+ MEM_ROOT *mem_root,
TABLE *table,
Field *field,
LEX_STRING *vcol_expr,
@@ -2216,7 +2224,7 @@ bool unpack_vcol_info_from_frm(THD *thd,
"PARSE_VCOL_EXPR (<expr_string_from_frm>)".
*/
- if (!(vcol_expr_str= (char*) alloc_root(&table->mem_root,
+ if (!(vcol_expr_str= (char*) alloc_root(mem_root,
vcol_expr->length +
parse_vcol_keyword.length + 3)))
{
@@ -2250,10 +2258,10 @@ bool unpack_vcol_info_from_frm(THD *thd,
We need to use CONVENTIONAL_EXECUTION here to ensure that
any new items created by fix_fields() are not reverted.
*/
- Query_arena expr_arena(&table->mem_root,
+ Query_arena expr_arena(mem_root,
Query_arena::STMT_CONVENTIONAL_EXECUTION);
- if (!(vcol_arena= (Query_arena *) alloc_root(&table->mem_root,
- sizeof(Query_arena))))
+ if (!(vcol_arena= (Query_arena *) alloc_root(mem_root,
+ sizeof(Query_arena))))
goto err;
*vcol_arena= expr_arena;
table->expr_arena= vcol_arena;
@@ -2336,7 +2344,7 @@ int open_table_from_share(THD *thd, TABLE_SHARE *share, const char *alias,
uint records, i, bitmap_size;
bool error_reported= FALSE;
uchar *record, *bitmaps;
- Field **field_ptr, **vfield_ptr, **dfield_ptr;
+ Field **field_ptr, **UNINIT_VAR(vfield_ptr), **UNINIT_VAR(dfield_ptr);
uint8 save_context_analysis_only= thd->lex->context_analysis_only;
DBUG_ENTER("open_table_from_share");
DBUG_PRINT("enter",("name: '%s.%s' form: 0x%lx", share->db.str,
@@ -2351,7 +2359,7 @@ int open_table_from_share(THD *thd, TABLE_SHARE *share, const char *alias,
outparam->db_stat= db_stat;
outparam->write_row_record= NULL;
- init_sql_alloc(&outparam->mem_root, TABLE_ALLOC_BLOCK_SIZE, 0);
+ init_sql_alloc(&outparam->mem_root, TABLE_ALLOC_BLOCK_SIZE, 0, MYF(0));
if (outparam->alias.copy(alias, strlen(alias), table_alias_charset))
goto err;
@@ -2520,6 +2528,7 @@ int open_table_from_share(THD *thd, TABLE_SHARE *share, const char *alias,
if (share->vfields && (*field_ptr)->vcol_info)
{
if (unpack_vcol_info_from_frm(thd,
+ &outparam->mem_root,
outparam,
*field_ptr,
&(*field_ptr)->vcol_info->expr_str,
@@ -5000,19 +5009,33 @@ TABLE *TABLE_LIST::get_real_join_table()
DBUG_ASSERT(tbl->derived == NULL ||
tbl->derived->first_select()->next_select() == NULL);
- if (tbl->table)
- table= tbl->table;
- tbl= (tbl->view != NULL ?
- tbl->view->select_lex.get_table_list() :
- tbl->derived->first_select()->get_table_list());
-
- /* find left table in outer join on this level */
- while(tbl->outer_join & JOIN_TYPE_RIGHT)
{
- DBUG_ASSERT(tbl->next_local);
- tbl= tbl->next_local;
+ List_iterator_fast<TABLE_LIST> ti;
+ {
+ List_iterator_fast<TABLE_LIST>
+ ti(tbl->view != NULL ?
+ tbl->view->select_lex.top_join_list :
+ tbl->derived->first_select()->top_join_list);
+ for (;;)
+ {
+ tbl= NULL;
+ /*
+ Find left table in outer join on this level
+ (the list is reverted).
+ */
+ for (TABLE_LIST *t= ti++; t; t= ti++)
+ tbl= t;
+ /*
+ It is impossible that the list is empty
+ so tbl can't be NULL after above loop.
+ */
+ if (!tbl->nested_join)
+ break;
+ /* go deeper if we've found nested join */
+ ti= tbl->nested_join->join_list;
+ }
+ }
}
-
}
return tbl->table;
diff --git a/sql/table.h b/sql/table.h
index ecad83cff22..1a567ae75d1 100644
--- a/sql/table.h
+++ b/sql/table.h
@@ -1196,6 +1196,7 @@ public:
bool no_partitions_used; /* If true, all partitions have been pruned away */
#endif
uint max_keys; /* Size of allocated key_info array. */
+ bool stats_is_read; /* Persistent statistics is read for the table */
MDL_ticket *mdl_ticket;
void init(THD *thd, TABLE_LIST *tl);
@@ -2411,6 +2412,9 @@ void init_mdl_requests(TABLE_LIST *table_list);
int open_table_from_share(THD *thd, TABLE_SHARE *share, const char *alias,
uint db_stat, uint prgflag, uint ha_open_flags,
TABLE *outparam, bool is_create_table);
+bool unpack_vcol_info_from_frm(THD *thd, MEM_ROOT *mem_root,
+ TABLE *table, Field *field,
+ LEX_STRING *vcol_expr, bool *error_reported);
TABLE_SHARE *alloc_table_share(TABLE_LIST *table_list, char *key,
uint key_length);
void init_tmp_table_share(THD *thd, TABLE_SHARE *share, const char *key,
diff --git a/sql/thr_malloc.cc b/sql/thr_malloc.cc
index cedcbefc26f..8c7db0673ac 100644
--- a/sql/thr_malloc.cc
+++ b/sql/thr_malloc.cc
@@ -61,9 +61,10 @@ extern "C" {
}
}
-void init_sql_alloc(MEM_ROOT *mem_root, uint block_size, uint pre_alloc)
+void init_sql_alloc(MEM_ROOT *mem_root, uint block_size, uint pre_alloc,
+ myf my_flags)
{
- init_alloc_root(mem_root, block_size, pre_alloc);
+ init_alloc_root(mem_root, block_size, pre_alloc, my_flags);
mem_root->error_handler=sql_alloc_error_handler;
}
diff --git a/sql/thr_malloc.h b/sql/thr_malloc.h
index 81b7d3cc238..0b17c5cdaf1 100644
--- a/sql/thr_malloc.h
+++ b/sql/thr_malloc.h
@@ -20,7 +20,8 @@
typedef struct st_mem_root MEM_ROOT;
-void init_sql_alloc(MEM_ROOT *root, uint block_size, uint pre_alloc_size);
+void init_sql_alloc(MEM_ROOT *root, uint block_size, uint pre_alloc_size,
+ myf my_flags);
void *sql_alloc(size_t);
void *sql_calloc(size_t);
char *sql_strdup(const char *str);
diff --git a/sql/tztime.cc b/sql/tztime.cc
index ba24cab9ca7..b16cc65d6bb 100644
--- a/sql/tztime.cc
+++ b/sql/tztime.cc
@@ -1637,7 +1637,7 @@ my_tz_init(THD *org_thd, const char *default_tzname, my_bool bootstrap)
my_hash_free(&tz_names);
goto end;
}
- init_sql_alloc(&tz_storage, 32 * 1024, 0);
+ init_sql_alloc(&tz_storage, 32 * 1024, 0, MYF(0));
mysql_mutex_init(key_tz_LOCK, &tz_LOCK, MY_MUTEX_INIT_FAST);
tz_inited= 1;
@@ -1718,14 +1718,11 @@ my_tz_init(THD *org_thd, const char *default_tzname, my_bool bootstrap)
}
table= tz_tables[0].table;
- /*
- It is OK to ignore ha_index_init()/ha_index_end() return values since
- mysql.time_zone* tables are MyISAM and these operations always succeed
- for MyISAM.
- */
- (void)table->file->ha_index_init(0, 1);
- table->use_all_columns();
+ if (table->file->ha_index_init(0, 1))
+ goto end_with_close;
+
+ table->use_all_columns();
tz_leapcnt= 0;
res= table->file->ha_index_first(table->record[0]);
@@ -1803,7 +1800,7 @@ end:
else
{
/* Remember that we don't have a THD */
- my_pthread_setspecific_ptr(THR_THD, 0);
+ set_current_thd(0);
my_pthread_setspecific_ptr(THR_MALLOC, 0);
}
@@ -1913,12 +1910,8 @@ tz_load_from_open_tables(const String *tz_name, TABLE_LIST *tz_tables)
tz_tables= tz_tables->next_local;
table->field[0]->store(tz_name->ptr(), tz_name->length(),
&my_charset_latin1);
- /*
- It is OK to ignore ha_index_init()/ha_index_end() return values since
- mysql.time_zone* tables are MyISAM and these operations always succeed
- for MyISAM.
- */
- (void)table->file->ha_index_init(0, 1);
+ if (table->file->ha_index_init(0, 1))
+ goto end;
if (table->file->ha_index_read_map(table->record[0], table->field[0]->ptr,
HA_WHOLE_KEY, HA_READ_KEY_EXACT))
@@ -1951,7 +1944,8 @@ tz_load_from_open_tables(const String *tz_name, TABLE_LIST *tz_tables)
field->get_key_image(keybuff,
min(field->key_length(), sizeof(keybuff)),
Field::itRAW);
- (void)table->file->ha_index_init(0, 1);
+ if (table->file->ha_index_init(0, 1))
+ goto end;
if (table->file->ha_index_read_map(table->record[0], keybuff,
HA_WHOLE_KEY, HA_READ_KEY_EXACT))
@@ -1983,7 +1977,8 @@ tz_load_from_open_tables(const String *tz_name, TABLE_LIST *tz_tables)
field->get_key_image(keybuff,
min(field->key_length(), sizeof(keybuff)),
Field::itRAW);
- (void)table->file->ha_index_init(0, 1);
+ if (table->file->ha_index_init(0, 1))
+ goto end;
res= table->file->ha_index_read_map(table->record[0], keybuff,
(key_part_map)1, HA_READ_KEY_EXACT);
@@ -2053,7 +2048,8 @@ tz_load_from_open_tables(const String *tz_name, TABLE_LIST *tz_tables)
*/
table= tz_tables->table;
table->field[0]->store((longlong) tzid, TRUE);
- (void)table->file->ha_index_init(0, 1);
+ if (table->file->ha_index_init(0, 1))
+ goto end;
res= table->file->ha_index_read_map(table->record[0], keybuff,
(key_part_map)1, HA_READ_KEY_EXACT);
@@ -2187,8 +2183,8 @@ tz_load_from_open_tables(const String *tz_name, TABLE_LIST *tz_tables)
end:
- if (table)
- (void)table->file->ha_index_end();
+ if (table && table->file->inited)
+ (void) table->file->ha_index_end();
DBUG_RETURN(return_val);
}
@@ -2541,7 +2537,7 @@ scan_tz_dir(char * name_end)
}
else if (MY_S_ISREG(cur_dir->dir_entry[i].mystat->st_mode))
{
- init_alloc_root(&tz_storage, 32768, 0);
+ init_alloc_root(&tz_storage, 32768, 0, MYF(MY_THREAD_SPECIFIC));
if (!tz_load(fullname, &tz_info, &tz_storage))
print_tz_as_sql(root_name_end + 1, &tz_info);
else
@@ -2599,7 +2595,7 @@ main(int argc, char **argv)
}
else
{
- init_alloc_root(&tz_storage, 32768, 0);
+ init_alloc_root(&tz_storage, 32768, 0, MYF(0));
if (strcmp(argv[1], "--leap") == 0)
{
@@ -2676,7 +2672,7 @@ main(int argc, char **argv)
MY_INIT(argv[0]);
- init_alloc_root(&tz_storage, 32768, 0);
+ init_alloc_root(&tz_storage, 32768, MYF(0));
/* let us set some well known timezone */
setenv("TZ", "MET", 1);
diff --git a/sql/uniques.cc b/sql/uniques.cc
index c246cd637bd..9fa06311ece 100644
--- a/sql/uniques.cc
+++ b/sql/uniques.cc
@@ -77,17 +77,21 @@ int unique_intersect_write_to_ptrs(uchar* key, element_count count, Unique *uniq
Unique::Unique(qsort_cmp2 comp_func, void * comp_func_fixed_arg,
uint size_arg, ulonglong max_in_memory_size_arg,
uint min_dupl_count_arg)
- :max_in_memory_size(max_in_memory_size_arg), size(size_arg), elements(0)
+ :max_in_memory_size(max_in_memory_size_arg),
+ record_pointers(NULL),
+ size(size_arg),
+ elements(0)
{
min_dupl_count= min_dupl_count_arg;
full_size= size;
if (min_dupl_count_arg)
full_size+= sizeof(element_count);
my_b_clear(&file);
- init_tree(&tree, (ulong) (max_in_memory_size / 16), 0, size, comp_func, 0,
- NULL, comp_func_fixed_arg);
+ init_tree(&tree, (ulong) (max_in_memory_size / 16), 0, size, comp_func,
+ NULL, comp_func_fixed_arg, MYF(MY_THREAD_SPECIFIC));
/* If the following fail's the next add will also fail */
- my_init_dynamic_array(&file_ptrs, sizeof(BUFFPEK), 16, 16);
+ my_init_dynamic_array(&file_ptrs, sizeof(BUFFPEK), 16, 16,
+ MYF(MY_THREAD_SPECIFIC));
/*
If you change the following, change it in get_max_elements function, too.
*/
@@ -581,6 +585,7 @@ end:
SYNOPSIS
Unique:walk()
All params are 'IN':
+ table parameter for the call of the merge method
action function-visitor, typed in include/my_tree.h
function is called for each unique element
arg argument for visitor, which is passed to it on each call
@@ -589,69 +594,67 @@ end:
<> 0 error
*/
-bool Unique::walk(tree_walk_action action, void *walk_action_arg)
+bool Unique::walk(TABLE *table, tree_walk_action action, void *walk_action_arg)
{
- int res;
+ int res= 0;
uchar *merge_buffer;
if (elements == 0) /* the whole tree is in memory */
return tree_walk(&tree, action, walk_action_arg, left_root_right);
+ table->sort.found_records=elements+tree.elements_in_tree;
/* flush current tree to the file to have some memory for merge buffer */
if (flush())
return 1;
if (flush_io_cache(&file) || reinit_io_cache(&file, READ_CACHE, 0L, 0, 0))
return 1;
- if (!(merge_buffer= (uchar *) my_malloc((ulong) max_in_memory_size, MYF(0))))
+ ulong buff_sz= (max_in_memory_size / full_size + 1) * full_size;
+ if (!(merge_buffer= (uchar *) my_malloc(buff_sz, MYF(MY_THREAD_SPECIFIC))))
return 1;
- res= merge_walk(merge_buffer, (ulong) max_in_memory_size, size,
- (BUFFPEK *) file_ptrs.buffer,
- (BUFFPEK *) file_ptrs.buffer + file_ptrs.elements,
- action, walk_action_arg,
- tree.compare, tree.custom_arg, &file);
+ if (buff_sz < full_size * (file_ptrs.elements + 1UL))
+ res= merge(table, merge_buffer, buff_sz >= full_size * MERGEBUFF2) ;
+
+ if (!res)
+ {
+ res= merge_walk(merge_buffer, (ulong) max_in_memory_size, full_size,
+ (BUFFPEK *) file_ptrs.buffer,
+ (BUFFPEK *) file_ptrs.buffer + file_ptrs.elements,
+ action, walk_action_arg,
+ tree.compare, tree.custom_arg, &file);
+ }
my_free(merge_buffer);
return res;
}
+
/*
- Modify the TABLE element so that when one calls init_records()
- the rows will be read in priority order.
-*/
+ DESCRIPTION
+ Perform multi-pass sort merge of the elements accessed through table->sort,
+ using the buffer buff as the merge buffer. The last pass is not performed
+ if without_last_merge is TRUE.
+ SYNOPSIS
+ Unique:merge()
+ All params are 'IN':
+ table the parameter to access sort context
+ buff merge buffer
+ without_last_merge TRUE <=> do not perform the last merge
+ RETURN VALUE
+ 0 OK
+ <> 0 error
+ */
-bool Unique::get(TABLE *table)
+bool Unique::merge(TABLE *table, uchar *buff, bool without_last_merge)
{
- table->sort.found_records=elements+tree.elements_in_tree;
- if (my_b_tell(&file) == 0)
- {
- /* Whole tree is in memory; Don't use disk if you don't need to */
- if ((record_pointers=table->sort.record_pointers= (uchar*)
- my_malloc(size * tree.elements_in_tree, MYF(0))))
- {
- tree_walk_action action= min_dupl_count ?
- (tree_walk_action) unique_intersect_write_to_ptrs :
- (tree_walk_action) unique_write_to_ptrs;
- filtered_out_elems= 0;
- (void) tree_walk(&tree, action,
- this, left_root_right);
- table->sort.found_records-= filtered_out_elems;
- return 0;
- }
- }
- /* Not enough memory; Save the result to file && free memory used by tree */
- if (flush())
- return 1;
-
- IO_CACHE *outfile=table->sort.io_cache;
+ IO_CACHE *outfile= table->sort.io_cache;
BUFFPEK *file_ptr= (BUFFPEK*) file_ptrs.buffer;
uint maxbuffer= file_ptrs.elements - 1;
- uchar *sort_buffer;
my_off_t save_pos;
- bool error=1;
-
- /* Open cached file if it isn't open */
- outfile=table->sort.io_cache=(IO_CACHE*) my_malloc(sizeof(IO_CACHE),
- MYF(MY_ZEROFILL));
+ bool error= 1;
+ /* Open cached file if it isn't open */
+ if (!outfile)
+ outfile= table->sort.io_cache= (IO_CACHE*) my_malloc(sizeof(IO_CACHE),
+ MYF(MY_THREAD_SPECIFIC|MY_ZEROFILL));
if (!outfile ||
(! my_b_inited(outfile) &&
open_cached_file(outfile,mysql_tmpdir,TEMP_PREFIX,READ_RECORD_BUFFER,
@@ -662,20 +665,16 @@ bool Unique::get(TABLE *table)
Sort_param sort_param;
bzero((char*) &sort_param,sizeof(sort_param));
sort_param.max_rows= elements;
- sort_param.sort_form=table;
+ sort_param.sort_form= table;
sort_param.rec_length= sort_param.sort_length= sort_param.ref_length=
full_size;
sort_param.min_dupl_count= min_dupl_count;
sort_param.res_length= 0;
sort_param.max_keys_per_buffer=
(uint) (max_in_memory_size / sort_param.sort_length);
- sort_param.not_killable=1;
+ sort_param.not_killable= 1;
- if (!(sort_buffer=(uchar*) my_malloc((sort_param.max_keys_per_buffer+1) *
- sort_param.sort_length,
- MYF(0))))
- return 1;
- sort_param.unique_buff= sort_buffer+(sort_param.max_keys_per_buffer *
+ sort_param.unique_buff= buff +(sort_param.max_keys_per_buffer *
sort_param.sort_length);
sort_param.compare= (qsort2_cmp) buffpek_compare;
@@ -683,27 +682,74 @@ bool Unique::get(TABLE *table)
sort_param.cmp_context.key_compare_arg= tree.custom_arg;
/* Merge the buffers to one file, removing duplicates */
- if (merge_many_buff(&sort_param,sort_buffer,file_ptr,&maxbuffer,&file))
+ if (merge_many_buff(&sort_param,buff,file_ptr,&maxbuffer,&file))
goto err;
if (flush_io_cache(&file) ||
reinit_io_cache(&file,READ_CACHE,0L,0,0))
goto err;
sort_param.res_length= sort_param.rec_length-
(min_dupl_count ? sizeof(min_dupl_count) : 0);
- if (merge_index(&sort_param, sort_buffer, file_ptr, maxbuffer, &file, outfile))
+ if (without_last_merge)
+ {
+ file_ptrs.elements= maxbuffer+1;
+ return 0;
+ }
+ if (merge_index(&sort_param, buff, file_ptr, maxbuffer, &file, outfile))
goto err;
- error=0;
+ error= 0;
err:
- my_free(sort_buffer);
if (flush_io_cache(outfile))
- error=1;
+ error= 1;
/* Setup io_cache for reading */
- save_pos=outfile->pos_in_file;
+ save_pos= outfile->pos_in_file;
if (reinit_io_cache(outfile,READ_CACHE,0L,0,0))
- error=1;
+ error= 1;
outfile->end_of_file=save_pos;
return error;
}
+/*
+ Modify the TABLE element so that when one calls init_records()
+ the rows will be read in priority order.
+*/
+
+bool Unique::get(TABLE *table)
+{
+ bool rc= 1;
+ uchar *sort_buffer= NULL;
+ table->sort.found_records= elements+tree.elements_in_tree;
+
+ if (my_b_tell(&file) == 0)
+ {
+ /* Whole tree is in memory; Don't use disk if you don't need to */
+ if ((record_pointers=table->sort.record_pointers= (uchar*)
+ my_malloc(size * tree.elements_in_tree, MYF(MY_THREAD_SPECIFIC))))
+ {
+ tree_walk_action action= min_dupl_count ?
+ (tree_walk_action) unique_intersect_write_to_ptrs :
+ (tree_walk_action) unique_write_to_ptrs;
+ filtered_out_elems= 0;
+ (void) tree_walk(&tree, action,
+ this, left_root_right);
+ table->sort.found_records-= filtered_out_elems;
+ return 0;
+ }
+ }
+ /* Not enough memory; Save the result to file && free memory used by tree */
+ if (flush())
+ return 1;
+
+ ulong buff_sz= (max_in_memory_size / full_size + 1) * full_size;
+ if (!(sort_buffer= (uchar*) my_malloc(buff_sz, MYF(MY_THREAD_SPECIFIC))))
+ return 1;
+
+ if (merge(table, sort_buffer, FALSE))
+ goto err;
+ rc= 0;
+
+err:
+ my_free(sort_buffer);
+ return rc;
+}
diff --git a/sql/unireg.cc b/sql/unireg.cc
index 72dbbf973e0..e40dc02c21b 100644
--- a/sql/unireg.cc
+++ b/sql/unireg.cc
@@ -281,7 +281,7 @@ bool mysql_create_frm(THD *thd, const char *file_name,
}
key_buff_length= uint4korr(fileinfo+47);
- keybuff=(uchar*) my_malloc(key_buff_length, MYF(0));
+ keybuff=(uchar*) my_malloc(key_buff_length, MYF(MY_THREAD_SPECIFIC));
key_info_length= pack_keys(keybuff, keys, key_info, data_offset);
/*
@@ -533,7 +533,7 @@ static uchar *pack_screens(List<Create_field> &create_fields,
while ((field=it++))
length+=(uint) strlen(field->field_name)+1+TE_INFO_LENGTH+cols/2;
- if (!(info=(uchar*) my_malloc(length,MYF(MY_WME))))
+ if (!(info=(uchar*) my_malloc(length,MYF(MY_WME | MY_THREAD_SPECIFIC))))
DBUG_RETURN(0);
start_screen=0;
@@ -1106,7 +1106,9 @@ static bool make_empty_rec(THD *thd, File file,enum legacy_db_type table_type,
bzero((char*) &share, sizeof(share));
table.s= &share;
- if (!(buff=(uchar*) my_malloc((size_t) reclength,MYF(MY_WME | MY_ZEROFILL))))
+ if (!(buff=(uchar*) my_malloc((size_t) reclength,
+ MYF(MY_WME | MY_ZEROFILL |
+ MY_THREAD_SPECIFIC))))
{
DBUG_RETURN(1);
}
diff --git a/storage/archive/ha_archive.cc b/storage/archive/ha_archive.cc
index 75026f2a443..342f8be956e 100644
--- a/storage/archive/ha_archive.cc
+++ b/storage/archive/ha_archive.cc
@@ -1666,7 +1666,7 @@ int ha_archive::info(uint flag)
turn will keep selects from causing a sync to occur.
Basically, yet another optimizations to keep compression working well.
*/
-void ha_archive::start_bulk_insert(ha_rows rows)
+void ha_archive::start_bulk_insert(ha_rows rows, uint flags)
{
DBUG_ENTER("ha_archive::start_bulk_insert");
if (!rows || rows >= ARCHIVE_MIN_ROWS_TO_USE_BULK_INSERT)
diff --git a/storage/archive/ha_archive.h b/storage/archive/ha_archive.h
index d1c4bfbc7fb..627267c7306 100644
--- a/storage/archive/ha_archive.h
+++ b/storage/archive/ha_archive.h
@@ -136,7 +136,7 @@ public:
int optimize(THD* thd, HA_CHECK_OPT* check_opt);
int repair(THD* thd, HA_CHECK_OPT* check_opt);
int check_for_upgrade(HA_CHECK_OPT *check_opt);
- void start_bulk_insert(ha_rows rows);
+ void start_bulk_insert(ha_rows rows, uint flags);
int end_bulk_insert();
enum row_type get_row_type() const
{
diff --git a/storage/cassandra/CMakeLists.txt b/storage/cassandra/CMakeLists.txt
new file mode 100644
index 00000000000..dbccc2eb127
--- /dev/null
+++ b/storage/cassandra/CMakeLists.txt
@@ -0,0 +1,68 @@
+# use the first path that has Thrift.h included, if found
+
+FIND_PATH(Thrift_INCLUDE_DIRS Thrift.h PATHS
+$ENV{THRIFT_INCLUDE} # environment variable to be used optionally
+${Thrift_INCLUDE_DIR} # this may be set
+/usr/local/include/thrift # list of additional directories to look from
+/opt/local/include/thrift
+/usr/include/thrift
+/opt/include/thrift
+)
+
+# Verify that thrift linking library is found
+FIND_LIBRARY(Thrift_LIBS NAMES thrift PATHS ${Thrift_LIB_PATHS} ${Thrift_LIB})
+IF(EXISTS ${Thrift_LIBS})
+ GET_FILENAME_COMPONENT(LINK_DIR ${Thrift_LIBS} PATH ABSOLUTE)
+ELSE()
+ RETURN()
+ENDIF()
+
+INCLUDE_DIRECTORIES(AFTER ${Thrift_INCLUDE_DIRS})
+SET(CMAKE_REQUIRED_INCLUDES ${Thrift_INCLUDE_DIRS})
+
+STRING(REPLACE "-fno-exceptions" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
+STRING(REPLACE "-fno-implicit-templates" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
+
+CHECK_CXX_SOURCE_COMPILES(
+"
+#include <Thrift.h>
+#include <boost/shared_ptr.hpp>
+int main() {
+ boost::shared_ptr<char> p(new char(10));
+ return 0;
+}
+" CASSANDRASE_OK)
+
+IF(CASSANDRASE_OK)
+ SET(cassandra_sources
+ ha_cassandra.cc
+ ha_cassandra.h
+ cassandra_se.h
+ cassandra_se.cc
+ gen-cpp/Cassandra.cpp
+ gen-cpp/cassandra_types.h
+ gen-cpp/cassandra_types.cpp
+ gen-cpp/cassandra_constants.h
+ gen-cpp/cassandra_constants.cpp
+ gen-cpp/Cassandra.h)
+
+ LINK_DIRECTORIES(${LINK_DIR})
+
+ MYSQL_ADD_PLUGIN(cassandra ${cassandra_sources} STORAGE_ENGINE MODULE_ONLY LINK_LIBRARIES thrift COMPONENT CassandraSE)
+ IF (INSTALL_SYSCONFDIR)
+ INSTALL(FILES cassandra.cnf DESTINATION ${INSTALL_SYSCONFDIR}/my.cnf.d
+ COMPONENT CassandraSE)
+ ENDIF(INSTALL_SYSCONFDIR)
+
+ IF(RPM)
+ SET(CPACK_COMPONENT_CASSANDRASELIBRARIES_GROUP "CassandraSE" PARENT_SCOPE)
+ SET(CPACK_COMPONENTS_ALL ${CPACK_COMPONENTS_ALL} CassandraSE PARENT_SCOPE)
+ SET(CPACK_RPM_CassandraSE_PACKAGE_REQUIRES "MariaDB-server" PARENT_SCOPE)
+
+ # workarounds for cmake issues #13248 and #12864:
+ SET(CPACK_RPM_CassandraSE_USER_FILELIST ${ignored} "%config(noreplace) /etc/my.cnf.d/*" PARENT_SCOPE)
+ SET(CPACK_RPM_CassandraSE_PACKAGE_PROVIDES "cmake_bug_13248" PARENT_SCOPE)
+ SET(CPACK_RPM_CassandraSE_PACKAGE_OBSOLETES "cmake_bug_13248" PARENT_SCOPE)
+ ENDIF(RPM)
+
+ENDIF(CASSANDRASE_OK)
diff --git a/storage/cassandra/cassandra.cnf b/storage/cassandra/cassandra.cnf
new file mode 100644
index 00000000000..8f4b3d6f91e
--- /dev/null
+++ b/storage/cassandra/cassandra.cnf
@@ -0,0 +1,2 @@
+[mariadb]
+plugin-load-add=ha_cassandra.so
diff --git a/storage/cassandra/cassandra_se.cc b/storage/cassandra/cassandra_se.cc
new file mode 100644
index 00000000000..0d62c5af7a6
--- /dev/null
+++ b/storage/cassandra/cassandra_se.cc
@@ -0,0 +1,800 @@
+
+// Cassandra includes:
+#include <inttypes.h>
+#include <netinet/in.h>
+#include <sys/time.h>
+#include <stdio.h>
+#include <stdarg.h>
+
+#include "Thrift.h"
+#include "transport/TSocket.h"
+#include "transport/TTransport.h"
+#include "transport/TBufferTransports.h"
+#include "protocol/TProtocol.h"
+#include "protocol/TBinaryProtocol.h"
+#include "gen-cpp/Cassandra.h"
+// cassandra includes end
+
+#include "cassandra_se.h"
+
+struct st_mysql_lex_string
+{
+ char *str;
+ size_t length;
+};
+
+using namespace std;
+using namespace apache::thrift;
+using namespace apache::thrift::transport;
+using namespace apache::thrift::protocol;
+using namespace org::apache::cassandra;
+
+
+/*
+ Implementation of connection to one Cassandra column family (ie., table)
+*/
+class Cassandra_se_impl: public Cassandra_se_interface
+{
+ CassandraClient *cass; /* Connection to cassandra */
+
+ std::string column_family;
+ std::string keyspace;
+
+ ConsistencyLevel::type write_consistency;
+ ConsistencyLevel::type read_consistency;
+
+ /* How many times to retry an operation before giving up */
+ int thrift_call_retries_to_do;
+
+
+ /* DDL data */
+ KsDef ks_def; /* KeySpace we're using (TODO: put this in table->share) */
+ CfDef cf_def; /* Column family we're using (TODO: put in table->share)*/
+ std::vector<ColumnDef>::iterator column_ddl_it;
+
+ /* The list that was returned by the last key lookup */
+ std::vector<ColumnOrSuperColumn> column_data_vec;
+ std::vector<ColumnOrSuperColumn>::iterator column_data_it;
+
+ /* Insert preparation */
+ typedef std::map<std::string, std::vector<Mutation> > ColumnFamilyToMutation;
+ typedef std::map<std::string, ColumnFamilyToMutation> KeyToCfMutationMap;
+
+ KeyToCfMutationMap batch_mutation; /* Prepare operation here */
+ int64_t insert_timestamp;
+ std::vector<Mutation>* insert_list;
+
+ /* Resultset we're reading */
+ std::vector<KeySlice> key_slice_vec;
+ std::vector<KeySlice>::iterator key_slice_it;
+
+ std::string rowkey; /* key of the record we're returning now */
+
+ SlicePredicate slice_pred;
+ SliceRange slice_pred_sr;
+ bool get_slices_returned_less;
+ bool get_slice_found_rows;
+public:
+ Cassandra_se_impl() : cass(NULL),
+ write_consistency(ConsistencyLevel::ONE),
+ read_consistency(ConsistencyLevel::ONE),
+ thrift_call_retries_to_do(0) {}
+ virtual ~Cassandra_se_impl(){ delete cass; }
+
+ /* Connection and DDL checks */
+ bool connect(const char *host, int port, const char *keyspace);
+ void set_column_family(const char *cfname) { column_family.assign(cfname); }
+
+ bool setup_ddl_checks();
+ void first_ddl_column();
+ bool next_ddl_column(char **name, int *name_len, char **value, int *value_len);
+ void get_rowkey_type(char **name, char **type);
+ size_t get_ddl_size();
+ const char* get_default_validator();
+
+ /* Settings */
+ void set_consistency_levels(ulong read_cons_level, ulong write_cons_level);
+
+ /* Writes */
+ void clear_insert_buffer();
+ void start_row_insert(const char *key, int key_len);
+ void add_insert_column(const char *name, int name_len,
+ const char *value, int value_len);
+ void add_insert_delete_column(const char *name, int name_len);
+ void add_row_deletion(const char *key, int key_len,
+ Column_name_enumerator *col_names,
+ LEX_STRING *names, uint nnames);
+
+ bool do_insert();
+
+ /* Reads, point lookups */
+ bool get_slice(char *key, size_t key_len, bool *found);
+ bool get_next_read_column(char **name, int *name_len,
+ char **value, int *value_len );
+ void get_read_rowkey(char **value, int *value_len);
+
+ /* Reads, multi-row scans */
+private:
+ bool have_rowkey_to_skip;
+ std::string rowkey_to_skip;
+
+ bool get_range_slices_param_last_key_as_start_key;
+public:
+ bool get_range_slices(bool last_key_as_start_key);
+ void finish_reading_range_slices();
+ bool get_next_range_slice_row(bool *eof);
+
+ /* Setup that's necessary before a multi-row read. (todo: use it before point lookups, too) */
+ void clear_read_columns();
+ void clear_read_all_columns();
+ void add_read_column(const char *name);
+
+ /* Reads, MRR scans */
+ void new_lookup_keys();
+ int add_lookup_key(const char *key, size_t key_len);
+ bool multiget_slice();
+
+ bool get_next_multiget_row();
+
+ bool truncate();
+
+ bool remove_row();
+
+private:
+ bool retryable_truncate();
+ bool retryable_do_insert();
+ bool retryable_remove_row();
+ bool retryable_setup_ddl_checks();
+ bool retryable_multiget_slice();
+ bool retryable_get_range_slices();
+ bool retryable_get_slice();
+
+ std::vector<std::string> mrr_keys; /* can we use allocator to put these into MRR buffer? */
+ std::map<std::string, std::vector<ColumnOrSuperColumn> > mrr_result;
+ std::map<std::string, std::vector<ColumnOrSuperColumn> >::iterator mrr_result_it;
+
+ /* Non-inherited utility functions: */
+ int64_t get_i64_timestamp();
+
+ typedef bool (Cassandra_se_impl::*retryable_func_t)();
+ bool try_operation(retryable_func_t func);
+};
+
+
+/////////////////////////////////////////////////////////////////////////////
+// Connection and setup
+/////////////////////////////////////////////////////////////////////////////
+Cassandra_se_interface *create_cassandra_se()
+{
+ return new Cassandra_se_impl;
+}
+
+
+bool Cassandra_se_impl::connect(const char *host, int port, const char *keyspace_arg)
+{
+ bool res= true;
+
+ keyspace.assign(keyspace_arg);
+
+ try {
+ boost::shared_ptr<TTransport> socket =
+ boost::shared_ptr<TSocket>(new TSocket(host, port));
+ boost::shared_ptr<TTransport> tr =
+ boost::shared_ptr<TFramedTransport>(new TFramedTransport (socket));
+ boost::shared_ptr<TProtocol> p =
+ boost::shared_ptr<TBinaryProtocol>(new TBinaryProtocol(tr));
+
+ cass= new CassandraClient(p);
+ tr->open();
+ cass->set_keyspace(keyspace_arg);
+
+ res= false; // success
+ }catch(TTransportException te){
+ print_error("%s [%d]", te.what(), te.getType());
+ }catch(InvalidRequestException ire){
+ print_error("%s [%s]", ire.what(), ire.why.c_str());
+ }catch(NotFoundException nfe){
+ print_error("%s", nfe.what());
+ }catch(TException e){
+ print_error("Thrift exception: %s", e.what());
+ }catch (...) {
+ print_error("Unknown exception");
+ }
+
+ if (!res && setup_ddl_checks())
+ res= true;
+ return res;
+}
+
+
+void Cassandra_se_impl::set_consistency_levels(ulong read_cons_level,
+ ulong write_cons_level)
+{
+ write_cons_level= (ConsistencyLevel::type)(write_cons_level + 1);
+ read_cons_level= (ConsistencyLevel::type)(read_cons_level + 1);
+}
+
+
+bool Cassandra_se_impl::retryable_setup_ddl_checks()
+{
+ try {
+
+ cass->describe_keyspace(ks_def, keyspace);
+
+ } catch (NotFoundException nfe) {
+ print_error("keyspace `%s` not found: %s", keyspace.c_str(), nfe.what());
+ return true;
+ }
+
+ std::vector<CfDef>::iterator it;
+ for (it= ks_def.cf_defs.begin(); it < ks_def.cf_defs.end(); it++)
+ {
+ cf_def= *it;
+ if (!cf_def.name.compare(column_family))
+ return false;
+ }
+
+ print_error("Column family %s not found in keyspace %s",
+ column_family.c_str(),
+ keyspace.c_str());
+ return true;
+}
+
+bool Cassandra_se_impl::setup_ddl_checks()
+{
+ return try_operation(&Cassandra_se_impl::retryable_setup_ddl_checks);
+}
+
+
+void Cassandra_se_impl::first_ddl_column()
+{
+ column_ddl_it= cf_def.column_metadata.begin();
+}
+
+
+bool Cassandra_se_impl::next_ddl_column(char **name, int *name_len,
+ char **type, int *type_len)
+{
+ if (column_ddl_it == cf_def.column_metadata.end())
+ return true;
+
+ *name= (char*)(*column_ddl_it).name.c_str();
+ *name_len= (*column_ddl_it).name.length();
+
+ *type= (char*)(*column_ddl_it).validation_class.c_str();
+ *type_len= (*column_ddl_it).validation_class.length();
+
+ column_ddl_it++;
+ return false;
+}
+
+
+void Cassandra_se_impl::get_rowkey_type(char **name, char **type)
+{
+ if (cf_def.__isset.key_validation_class)
+ *type= (char*)cf_def.key_validation_class.c_str();
+ else
+ *type= NULL;
+
+ if (cf_def.__isset.key_alias)
+ *name= (char*)cf_def.key_alias.c_str();
+ else
+ *name= NULL;
+}
+
+size_t Cassandra_se_impl::get_ddl_size()
+{
+ return cf_def.column_metadata.size();
+}
+
+const char* Cassandra_se_impl::get_default_validator()
+{
+ return cf_def.default_validation_class.c_str();
+}
+
+
+/////////////////////////////////////////////////////////////////////////////
+// Data writes
+/////////////////////////////////////////////////////////////////////////////
+int64_t Cassandra_se_impl::get_i64_timestamp()
+{
+ struct timeval td;
+ gettimeofday(&td, NULL);
+ int64_t ms = td.tv_sec;
+ ms = ms * 1000;
+ int64_t usec = td.tv_usec;
+ usec = usec / 1000;
+ ms += usec;
+
+ return ms;
+}
+
+
+void Cassandra_se_impl::clear_insert_buffer()
+{
+ batch_mutation.clear();
+}
+
+
+void Cassandra_se_impl::start_row_insert(const char *key, int key_len)
+{
+ std::string key_to_insert;
+ key_to_insert.assign(key, key_len);
+ batch_mutation[key_to_insert]= ColumnFamilyToMutation();
+ ColumnFamilyToMutation& cf_mut= batch_mutation[key_to_insert];
+
+ cf_mut[column_family]= std::vector<Mutation>();
+ insert_list= &cf_mut[column_family];
+
+ insert_timestamp= get_i64_timestamp();
+}
+
+
+void Cassandra_se_impl::add_row_deletion(const char *key, int key_len,
+ Column_name_enumerator *col_names,
+ LEX_STRING *names, uint nnames)
+{
+ std::string key_to_delete;
+ key_to_delete.assign(key, key_len);
+
+ batch_mutation[key_to_delete]= ColumnFamilyToMutation();
+ ColumnFamilyToMutation& cf_mut= batch_mutation[key_to_delete];
+
+ cf_mut[column_family]= std::vector<Mutation>();
+ std::vector<Mutation> &mutation_list= cf_mut[column_family];
+
+ Mutation mut;
+ mut.__isset.deletion= true;
+ mut.deletion.__isset.timestamp= true;
+ mut.deletion.timestamp= get_i64_timestamp();
+ mut.deletion.__isset.predicate= true;
+
+ /*
+ Attempting to delete columns with SliceRange causes exception with message
+ "Deletion does not yet support SliceRange predicates".
+
+ Delete all columns individually.
+ */
+ SlicePredicate slice_pred;
+ slice_pred.__isset.column_names= true;
+ const char *col_name;
+ while ((col_name= col_names->get_next_name()))
+ slice_pred.column_names.push_back(std::string(col_name));
+ for (uint i= 0; i < nnames; i++)
+ slice_pred.column_names.push_back(std::string(names[i].str,
+ names[i].length));
+
+ mut.deletion.predicate= slice_pred;
+
+ mutation_list.push_back(mut);
+}
+
+
+void Cassandra_se_impl::add_insert_column(const char *name,
+ int name_len,
+ const char *value,
+ int value_len)
+{
+ Mutation mut;
+ mut.__isset.column_or_supercolumn= true;
+ mut.column_or_supercolumn.__isset.column= true;
+
+ Column& col=mut.column_or_supercolumn.column;
+ if (name_len)
+ col.name.assign(name, name_len);
+ else
+ col.name.assign(name);
+ col.value.assign(value, value_len);
+ col.timestamp= insert_timestamp;
+ col.__isset.value= true;
+ col.__isset.timestamp= true;
+ insert_list->push_back(mut);
+}
+
+void Cassandra_se_impl::add_insert_delete_column(const char *name,
+ int name_len)
+{
+ Mutation mut;
+ mut.__isset.deletion= true;
+ mut.deletion.__isset.timestamp= true;
+ mut.deletion.timestamp= insert_timestamp;
+ mut.deletion.__isset.predicate= true;
+
+ SlicePredicate slice_pred;
+ slice_pred.__isset.column_names= true;
+ slice_pred.column_names.push_back(std::string(name, name_len));
+ mut.deletion.predicate= slice_pred;
+
+ insert_list->push_back(mut);
+}
+
+
+bool Cassandra_se_impl::retryable_do_insert()
+{
+ cass->batch_mutate(batch_mutation, write_consistency);
+
+ cassandra_counters.row_inserts+= batch_mutation.size();
+ cassandra_counters.row_insert_batches++;
+
+ clear_insert_buffer();
+ return 0;
+}
+
+
+bool Cassandra_se_impl::do_insert()
+{
+ /*
+ zero-size mutations are allowed by Cassandra's batch_mutate but lets not
+ do them (we may attempt to do it if there is a bulk insert that stores
+ exactly @@cassandra_insert_batch_size*n elements.
+ */
+ if (batch_mutation.empty())
+ return false;
+
+ return try_operation(&Cassandra_se_impl::retryable_do_insert);
+}
+
+
+/////////////////////////////////////////////////////////////////////////////
+// Reading data
+/////////////////////////////////////////////////////////////////////////////
+
+/*
+ Make one key lookup. If the record is found, the result is stored locally and
+ the caller should iterate over it.
+*/
+
+bool Cassandra_se_impl::get_slice(char *key, size_t key_len, bool *found)
+{
+ bool res;
+ rowkey.assign(key, key_len);
+
+ if (!(res= try_operation(&Cassandra_se_impl::retryable_get_slice)))
+ *found= get_slice_found_rows;
+ return res;
+}
+
+
+bool Cassandra_se_impl::retryable_get_slice()
+{
+ ColumnParent cparent;
+ cparent.column_family= column_family;
+
+ SlicePredicate slice_pred;
+ SliceRange sr;
+ sr.start = "";
+ sr.finish = "";
+ slice_pred.__set_slice_range(sr);
+
+ cass->get_slice(column_data_vec, rowkey, cparent, slice_pred,
+ read_consistency);
+
+ if (column_data_vec.size() == 0)
+ {
+ /*
+ No columns found. Cassandra doesn't allow records without any column =>
+ this means the seach key doesn't exist
+ */
+ get_slice_found_rows= false;
+ return false;
+ }
+ get_slice_found_rows= true;
+
+ column_data_it= column_data_vec.begin();
+ return false;
+}
+
+
+bool Cassandra_se_impl::get_next_read_column(char **name, int *name_len,
+ char **value, int *value_len)
+{
+ bool use_counter=false;
+ while (1)
+ {
+ if (column_data_it == column_data_vec.end())
+ return true;
+
+ if ((*column_data_it).__isset.column)
+ break; /* Ok it's a real column. Should be always the case. */
+
+ if ((*column_data_it).__isset.counter_column)
+ {
+ use_counter= true;
+ break;
+ }
+
+ column_data_it++;
+ }
+
+ ColumnOrSuperColumn& cs= *column_data_it;
+ if (use_counter)
+ {
+ *name_len= cs.counter_column.name.size();
+ *name= (char*)cs.counter_column.name.c_str();
+ *value= (char*)&cs.counter_column.value;
+ *value_len= sizeof(cs.counter_column.value);
+ }
+ else
+ {
+ *name_len= cs.column.name.size();
+ *name= (char*)cs.column.name.c_str();
+ *value= (char*)cs.column.value.c_str();
+ *value_len= cs.column.value.length();
+ }
+
+ column_data_it++;
+ return false;
+}
+
+
+/* Return the rowkey for the record that was read */
+
+void Cassandra_se_impl::get_read_rowkey(char **value, int *value_len)
+{
+ *value= (char*)rowkey.c_str();
+ *value_len= rowkey.length();
+}
+
+
+bool Cassandra_se_impl::get_range_slices(bool last_key_as_start_key)
+{
+ get_range_slices_param_last_key_as_start_key= last_key_as_start_key;
+
+ return try_operation(&Cassandra_se_impl::retryable_get_range_slices);
+}
+
+
+bool Cassandra_se_impl::retryable_get_range_slices()
+{
+ bool last_key_as_start_key= get_range_slices_param_last_key_as_start_key;
+
+ ColumnParent cparent;
+ cparent.column_family= column_family;
+
+ /* SlicePredicate can be used to limit columns we will retrieve */
+
+ KeyRange key_range;
+ key_range.__isset.start_key= true;
+ key_range.__isset.end_key= true;
+
+ if (last_key_as_start_key)
+ {
+ key_range.start_key= rowkey;
+
+ have_rowkey_to_skip= true;
+ rowkey_to_skip= rowkey;
+ }
+ else
+ {
+ have_rowkey_to_skip= false;
+ key_range.start_key.assign("", 0);
+ }
+
+ key_range.end_key.assign("", 0);
+ key_range.count= read_batch_size;
+
+ cass->get_range_slices(key_slice_vec, cparent, slice_pred, key_range,
+ read_consistency);
+
+ if (key_slice_vec.size() < (uint)read_batch_size)
+ get_slices_returned_less= true;
+ else
+ get_slices_returned_less= false;
+
+ key_slice_it= key_slice_vec.begin();
+ return false;
+}
+
+
+/* Switch to next row. This may produce an error */
+bool Cassandra_se_impl::get_next_range_slice_row(bool *eof)
+{
+restart:
+ if (key_slice_it == key_slice_vec.end())
+ {
+ if (get_slices_returned_less)
+ {
+ *eof= true;
+ return false;
+ }
+
+ /*
+ We have read through all columns in this batch. Try getting the next
+ batch.
+ */
+ if (get_range_slices(true))
+ return true;
+
+ if (key_slice_vec.empty())
+ {
+ *eof= true;
+ return false;
+ }
+ }
+
+ /*
+ (1) - skip the last row that we have read in the previous batch.
+ (2) - Rows that were deleted show up as rows without any columns. Skip
+ them, like CQL does.
+ */
+ if ((have_rowkey_to_skip && !rowkey_to_skip.compare(key_slice_it->key)) || // (1)
+ key_slice_it->columns.size() == 0) // (2)
+ {
+ key_slice_it++;
+ goto restart;
+ }
+
+ *eof= false;
+ column_data_vec= key_slice_it->columns;
+ rowkey= key_slice_it->key;
+ column_data_it= column_data_vec.begin();
+ key_slice_it++;
+ return false;
+}
+
+
+void Cassandra_se_impl::finish_reading_range_slices()
+{
+ key_slice_vec.clear();
+}
+
+
+void Cassandra_se_impl::clear_read_columns()
+{
+ slice_pred.column_names.clear();
+}
+
+void Cassandra_se_impl::clear_read_all_columns()
+{
+ slice_pred_sr.start = "";
+ slice_pred_sr.finish = "";
+ slice_pred.__set_slice_range(slice_pred_sr);
+}
+
+
+void Cassandra_se_impl::add_read_column(const char *name_arg)
+{
+ std::string name(name_arg);
+ slice_pred.__isset.column_names= true;
+ slice_pred.column_names.push_back(name);
+}
+
+
+bool Cassandra_se_impl::truncate()
+{
+ return try_operation(&Cassandra_se_impl::retryable_truncate);
+}
+
+
+bool Cassandra_se_impl::retryable_truncate()
+{
+ cass->truncate(column_family);
+ return 0;
+}
+
+
+bool Cassandra_se_impl::remove_row()
+{
+ return try_operation(&Cassandra_se_impl::retryable_remove_row);
+}
+
+
+bool Cassandra_se_impl::retryable_remove_row()
+{
+ ColumnPath column_path;
+ column_path.column_family= column_family;
+ cass->remove(rowkey, column_path, get_i64_timestamp(), write_consistency);
+ return 0;
+}
+
+/*
+ Try calling a function, catching possible Cassandra errors, and re-trying
+ for "transient" errors.
+*/
+bool Cassandra_se_impl::try_operation(retryable_func_t func_to_call)
+{
+ bool res;
+ int n_retries= thrift_call_retries_to_do;
+
+ do
+ {
+ res= true;
+
+ try {
+
+ if ((res= (this->*func_to_call)()))
+ {
+ /*
+ The function call was made successfully (without timeouts, etc),
+ but something inside it returned 'true'.
+ This is supposedly a failure (or "not found" or other negative
+ result). We need to return this to the caller.
+ */
+ n_retries= 0;
+ }
+
+ } catch (InvalidRequestException ire) {
+ n_retries= 0; /* there is no point in retrying this operation */
+ print_error("%s [%s]", ire.what(), ire.why.c_str());
+ } catch (UnavailableException ue) {
+ cassandra_counters.unavailable_exceptions++;
+ if (!--n_retries)
+ print_error("UnavailableException: %s", ue.what());
+ } catch (TimedOutException te) {
+ cassandra_counters.timeout_exceptions++;
+ if (!--n_retries)
+ print_error("TimedOutException: %s", te.what());
+ }catch(TException e){
+ /* todo: we may use retry for certain kinds of Thrift errors */
+ n_retries= 0;
+ print_error("Thrift exception: %s", e.what());
+ } catch (...) {
+ n_retries= 0; /* Don't retry */
+ print_error("Unknown exception");
+ }
+
+ } while (res && n_retries > 0);
+
+ return res;
+}
+
+/////////////////////////////////////////////////////////////////////////////
+// MRR reads
+/////////////////////////////////////////////////////////////////////////////
+
+void Cassandra_se_impl::new_lookup_keys()
+{
+ mrr_keys.clear();
+}
+
+
+int Cassandra_se_impl::add_lookup_key(const char *key, size_t key_len)
+{
+ mrr_keys.push_back(std::string(key, key_len));
+ return mrr_keys.size();
+}
+
+bool Cassandra_se_impl::multiget_slice()
+{
+ return try_operation(&Cassandra_se_impl::retryable_multiget_slice);
+}
+
+
+bool Cassandra_se_impl::retryable_multiget_slice()
+{
+ ColumnParent cparent;
+ cparent.column_family= column_family;
+
+ SlicePredicate slice_pred;
+ SliceRange sr;
+ sr.start = "";
+ sr.finish = "";
+ slice_pred.__set_slice_range(sr);
+
+ cassandra_counters.multiget_reads++;
+ cassandra_counters.multiget_keys_scanned += mrr_keys.size();
+ cass->multiget_slice(mrr_result, mrr_keys, cparent, slice_pred,
+ read_consistency);
+
+ cassandra_counters.multiget_rows_read += mrr_result.size();
+ mrr_result_it= mrr_result.begin();
+
+ return false;
+}
+
+
+bool Cassandra_se_impl::get_next_multiget_row()
+{
+ if (mrr_result_it == mrr_result.end())
+ return true; /* EOF */
+
+ column_data_vec= mrr_result_it->second;
+ rowkey= mrr_result_it->first;
+
+ column_data_it= column_data_vec.begin();
+ mrr_result_it++;
+ return false;
+}
+
+
+
diff --git a/storage/cassandra/cassandra_se.h b/storage/cassandra/cassandra_se.h
new file mode 100644
index 00000000000..050c65e6dde
--- /dev/null
+++ b/storage/cassandra/cassandra_se.h
@@ -0,0 +1,123 @@
+
+/*
+ This file is a "bridge" interface between cassandra+Thrift and MariaDB.
+
+ It is #included by both sides, so it must itself include neither (including
+ both together causes compile errors due to conflicts).
+*/
+
+struct st_mysql_lex_string;
+typedef struct st_mysql_lex_string LEX_STRING;
+
+/* We need to define this here so that ha_cassandra.cc also has access to it */
+typedef enum
+{
+ ONE = 1-1,
+ QUORUM = 2-1,
+ LOCAL_QUORUM = 3-1,
+ EACH_QUORUM = 4-1,
+ ALL = 5-1,
+ ANY = 6-1,
+ TWO = 7-1,
+ THREE = 8-1,
+} enum_cassandra_consistency_level;
+
+
+class Column_name_enumerator
+{
+public:
+ virtual const char* get_next_name()=0;
+ virtual ~Column_name_enumerator(){}
+};
+
+/*
+ Interface to one cassandra column family, i.e. one 'table'
+*/
+class Cassandra_se_interface
+{
+public:
+ Cassandra_se_interface() { err_buffer[0]=0; }
+
+ virtual ~Cassandra_se_interface(){};
+ /* Init */
+ virtual bool connect(const char *host, int port, const char *keyspace)=0;
+ virtual void set_column_family(const char *cfname) = 0;
+
+ /* Settings */
+ virtual void set_consistency_levels(ulong read_cons_level, ulong write_cons_level)=0;
+
+ /* Check underlying DDL */
+ virtual bool setup_ddl_checks()=0;
+ virtual void first_ddl_column()=0;
+ virtual bool next_ddl_column(char **name, int *name_len, char **value,
+ int *value_len)=0;
+ virtual void get_rowkey_type(char **name, char **type)=0;
+ virtual size_t get_ddl_size()=0;
+ virtual const char* get_default_validator()=0;
+
+ /* Writes */
+ virtual void clear_insert_buffer()=0;
+ virtual void add_row_deletion(const char *key, int key_len,
+ Column_name_enumerator *col_names,
+ LEX_STRING *names, uint nnames)=0;
+ virtual void start_row_insert(const char *key, int key_len)=0;
+ virtual void add_insert_delete_column(const char *name, int name_len)= 0;
+ virtual void add_insert_column(const char *name, int name_len,
+ const char *value,
+ int value_len)=0;
+ virtual bool do_insert()=0;
+
+ /* Reads */
+ virtual bool get_slice(char *key, size_t key_len, bool *found)=0 ;
+ virtual bool get_next_read_column(char **name, int *name_len,
+ char **value, int *value_len)=0;
+ virtual void get_read_rowkey(char **value, int *value_len)=0;
+
+ /* Reads, multi-row scans */
+ int read_batch_size;
+ virtual bool get_range_slices(bool last_key_as_start_key)=0;
+ virtual void finish_reading_range_slices()=0;
+ virtual bool get_next_range_slice_row(bool *eof)=0;
+
+ /* Reads, MRR scans */
+ virtual void new_lookup_keys()=0;
+ virtual int add_lookup_key(const char *key, size_t key_len)=0;
+ virtual bool multiget_slice()=0;
+ virtual bool get_next_multiget_row()=0;
+
+ /* read_set setup */
+ virtual void clear_read_columns()=0;
+ virtual void clear_read_all_columns()=0;
+ virtual void add_read_column(const char *name)=0;
+
+ virtual bool truncate()=0;
+ virtual bool remove_row()=0;
+
+ /* Passing error messages up to ha_cassandra */
+ char err_buffer[512];
+ const char *error_str() { return err_buffer; }
+ void print_error(const char *format, ...);
+};
+
+
+/* A structure with global counters */
+class Cassandra_status_vars
+{
+public:
+ ulong row_inserts;
+ ulong row_insert_batches;
+
+ ulong multiget_reads;
+ ulong multiget_keys_scanned;
+ ulong multiget_rows_read;
+
+ ulong timeout_exceptions;
+ ulong unavailable_exceptions;
+};
+
+
+extern Cassandra_status_vars cassandra_counters;
+
+
+Cassandra_se_interface *create_cassandra_se();
+
diff --git a/storage/cassandra/gen-cpp/Cassandra.cpp b/storage/cassandra/gen-cpp/Cassandra.cpp
new file mode 100644
index 00000000000..db1deb34c31
--- /dev/null
+++ b/storage/cassandra/gen-cpp/Cassandra.cpp
@@ -0,0 +1,12871 @@
+/**
+ * Autogenerated by Thrift Compiler (0.8.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+#include <inttypes.h>
+#include <netinet/in.h>
+
+#include "Cassandra.h"
+
+namespace org { namespace apache { namespace cassandra {
+
+uint32_t Cassandra_login_args::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+ bool isset_auth_request = false;
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->auth_request.read(iprot);
+ isset_auth_request = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ if (!isset_auth_request)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ return xfer;
+}
+
+uint32_t Cassandra_login_args::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("Cassandra_login_args");
+ xfer += oprot->writeFieldBegin("auth_request", ::apache::thrift::protocol::T_STRUCT, 1);
+ xfer += this->auth_request.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_login_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("Cassandra_login_pargs");
+ xfer += oprot->writeFieldBegin("auth_request", ::apache::thrift::protocol::T_STRUCT, 1);
+ xfer += (*(this->auth_request)).write(oprot);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_login_result::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->authnx.read(iprot);
+ this->__isset.authnx = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 2:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->authzx.read(iprot);
+ this->__isset.authzx = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
+uint32_t Cassandra_login_result::write(::apache::thrift::protocol::TProtocol* oprot) const {
+
+ uint32_t xfer = 0;
+
+ xfer += oprot->writeStructBegin("Cassandra_login_result");
+
+ if (this->__isset.authnx) {
+ xfer += oprot->writeFieldBegin("authnx", ::apache::thrift::protocol::T_STRUCT, 1);
+ xfer += this->authnx.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ } else if (this->__isset.authzx) {
+ xfer += oprot->writeFieldBegin("authzx", ::apache::thrift::protocol::T_STRUCT, 2);
+ xfer += this->authzx.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ }
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_login_presult::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->authnx.read(iprot);
+ this->__isset.authnx = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 2:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->authzx.read(iprot);
+ this->__isset.authzx = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
+uint32_t Cassandra_set_keyspace_args::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+ bool isset_keyspace = false;
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readString(this->keyspace);
+ isset_keyspace = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ if (!isset_keyspace)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ return xfer;
+}
+
+uint32_t Cassandra_set_keyspace_args::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("Cassandra_set_keyspace_args");
+ xfer += oprot->writeFieldBegin("keyspace", ::apache::thrift::protocol::T_STRING, 1);
+ xfer += oprot->writeString(this->keyspace);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_set_keyspace_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("Cassandra_set_keyspace_pargs");
+ xfer += oprot->writeFieldBegin("keyspace", ::apache::thrift::protocol::T_STRING, 1);
+ xfer += oprot->writeString((*(this->keyspace)));
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_set_keyspace_result::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->ire.read(iprot);
+ this->__isset.ire = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
+uint32_t Cassandra_set_keyspace_result::write(::apache::thrift::protocol::TProtocol* oprot) const {
+
+ uint32_t xfer = 0;
+
+ xfer += oprot->writeStructBegin("Cassandra_set_keyspace_result");
+
+ if (this->__isset.ire) {
+ xfer += oprot->writeFieldBegin("ire", ::apache::thrift::protocol::T_STRUCT, 1);
+ xfer += this->ire.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ }
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_set_keyspace_presult::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->ire.read(iprot);
+ this->__isset.ire = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
+uint32_t Cassandra_get_args::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+ bool isset_key = false;
+ bool isset_column_path = false;
+ bool isset_consistency_level = false;
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readBinary(this->key);
+ isset_key = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 2:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->column_path.read(iprot);
+ isset_column_path = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 3:
+ if (ftype == ::apache::thrift::protocol::T_I32) {
+ int32_t ecast149;
+ xfer += iprot->readI32(ecast149);
+ this->consistency_level = (ConsistencyLevel::type)ecast149;
+ isset_consistency_level = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ if (!isset_key)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ if (!isset_column_path)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ if (!isset_consistency_level)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ return xfer;
+}
+
+uint32_t Cassandra_get_args::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("Cassandra_get_args");
+ xfer += oprot->writeFieldBegin("key", ::apache::thrift::protocol::T_STRING, 1);
+ xfer += oprot->writeBinary(this->key);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldBegin("column_path", ::apache::thrift::protocol::T_STRUCT, 2);
+ xfer += this->column_path.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldBegin("consistency_level", ::apache::thrift::protocol::T_I32, 3);
+ xfer += oprot->writeI32((int32_t)this->consistency_level);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_get_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("Cassandra_get_pargs");
+ xfer += oprot->writeFieldBegin("key", ::apache::thrift::protocol::T_STRING, 1);
+ xfer += oprot->writeBinary((*(this->key)));
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldBegin("column_path", ::apache::thrift::protocol::T_STRUCT, 2);
+ xfer += (*(this->column_path)).write(oprot);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldBegin("consistency_level", ::apache::thrift::protocol::T_I32, 3);
+ xfer += oprot->writeI32((int32_t)(*(this->consistency_level)));
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_get_result::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 0:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->success.read(iprot);
+ this->__isset.success = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->ire.read(iprot);
+ this->__isset.ire = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 2:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->nfe.read(iprot);
+ this->__isset.nfe = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 3:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->ue.read(iprot);
+ this->__isset.ue = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 4:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->te.read(iprot);
+ this->__isset.te = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
+uint32_t Cassandra_get_result::write(::apache::thrift::protocol::TProtocol* oprot) const {
+
+ uint32_t xfer = 0;
+
+ xfer += oprot->writeStructBegin("Cassandra_get_result");
+
+ if (this->__isset.success) {
+ xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0);
+ xfer += this->success.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ } else if (this->__isset.ire) {
+ xfer += oprot->writeFieldBegin("ire", ::apache::thrift::protocol::T_STRUCT, 1);
+ xfer += this->ire.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ } else if (this->__isset.nfe) {
+ xfer += oprot->writeFieldBegin("nfe", ::apache::thrift::protocol::T_STRUCT, 2);
+ xfer += this->nfe.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ } else if (this->__isset.ue) {
+ xfer += oprot->writeFieldBegin("ue", ::apache::thrift::protocol::T_STRUCT, 3);
+ xfer += this->ue.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ } else if (this->__isset.te) {
+ xfer += oprot->writeFieldBegin("te", ::apache::thrift::protocol::T_STRUCT, 4);
+ xfer += this->te.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ }
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_get_presult::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 0:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += (*(this->success)).read(iprot);
+ this->__isset.success = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->ire.read(iprot);
+ this->__isset.ire = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 2:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->nfe.read(iprot);
+ this->__isset.nfe = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 3:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->ue.read(iprot);
+ this->__isset.ue = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 4:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->te.read(iprot);
+ this->__isset.te = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
+uint32_t Cassandra_get_slice_args::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+ bool isset_key = false;
+ bool isset_column_parent = false;
+ bool isset_predicate = false;
+ bool isset_consistency_level = false;
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readBinary(this->key);
+ isset_key = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 2:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->column_parent.read(iprot);
+ isset_column_parent = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 3:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->predicate.read(iprot);
+ isset_predicate = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 4:
+ if (ftype == ::apache::thrift::protocol::T_I32) {
+ int32_t ecast150;
+ xfer += iprot->readI32(ecast150);
+ this->consistency_level = (ConsistencyLevel::type)ecast150;
+ isset_consistency_level = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ if (!isset_key)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ if (!isset_column_parent)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ if (!isset_predicate)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ if (!isset_consistency_level)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ return xfer;
+}
+
+uint32_t Cassandra_get_slice_args::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("Cassandra_get_slice_args");
+ xfer += oprot->writeFieldBegin("key", ::apache::thrift::protocol::T_STRING, 1);
+ xfer += oprot->writeBinary(this->key);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldBegin("column_parent", ::apache::thrift::protocol::T_STRUCT, 2);
+ xfer += this->column_parent.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldBegin("predicate", ::apache::thrift::protocol::T_STRUCT, 3);
+ xfer += this->predicate.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldBegin("consistency_level", ::apache::thrift::protocol::T_I32, 4);
+ xfer += oprot->writeI32((int32_t)this->consistency_level);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_get_slice_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("Cassandra_get_slice_pargs");
+ xfer += oprot->writeFieldBegin("key", ::apache::thrift::protocol::T_STRING, 1);
+ xfer += oprot->writeBinary((*(this->key)));
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldBegin("column_parent", ::apache::thrift::protocol::T_STRUCT, 2);
+ xfer += (*(this->column_parent)).write(oprot);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldBegin("predicate", ::apache::thrift::protocol::T_STRUCT, 3);
+ xfer += (*(this->predicate)).write(oprot);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldBegin("consistency_level", ::apache::thrift::protocol::T_I32, 4);
+ xfer += oprot->writeI32((int32_t)(*(this->consistency_level)));
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_get_slice_result::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 0:
+ if (ftype == ::apache::thrift::protocol::T_LIST) {
+ {
+ this->success.clear();
+ uint32_t _size151;
+ ::apache::thrift::protocol::TType _etype154;
+ iprot->readListBegin(_etype154, _size151);
+ this->success.resize(_size151);
+ uint32_t _i155;
+ for (_i155 = 0; _i155 < _size151; ++_i155)
+ {
+ xfer += this->success[_i155].read(iprot);
+ }
+ iprot->readListEnd();
+ }
+ this->__isset.success = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->ire.read(iprot);
+ this->__isset.ire = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 2:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->ue.read(iprot);
+ this->__isset.ue = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 3:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->te.read(iprot);
+ this->__isset.te = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
+uint32_t Cassandra_get_slice_result::write(::apache::thrift::protocol::TProtocol* oprot) const {
+
+ uint32_t xfer = 0;
+
+ xfer += oprot->writeStructBegin("Cassandra_get_slice_result");
+
+ if (this->__isset.success) {
+ xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_LIST, 0);
+ {
+ xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast<uint32_t>(this->success.size()));
+ std::vector<ColumnOrSuperColumn> ::const_iterator _iter156;
+ for (_iter156 = this->success.begin(); _iter156 != this->success.end(); ++_iter156)
+ {
+ xfer += (*_iter156).write(oprot);
+ }
+ xfer += oprot->writeListEnd();
+ }
+ xfer += oprot->writeFieldEnd();
+ } else if (this->__isset.ire) {
+ xfer += oprot->writeFieldBegin("ire", ::apache::thrift::protocol::T_STRUCT, 1);
+ xfer += this->ire.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ } else if (this->__isset.ue) {
+ xfer += oprot->writeFieldBegin("ue", ::apache::thrift::protocol::T_STRUCT, 2);
+ xfer += this->ue.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ } else if (this->__isset.te) {
+ xfer += oprot->writeFieldBegin("te", ::apache::thrift::protocol::T_STRUCT, 3);
+ xfer += this->te.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ }
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_get_slice_presult::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 0:
+ if (ftype == ::apache::thrift::protocol::T_LIST) {
+ {
+ (*(this->success)).clear();
+ uint32_t _size157;
+ ::apache::thrift::protocol::TType _etype160;
+ iprot->readListBegin(_etype160, _size157);
+ (*(this->success)).resize(_size157);
+ uint32_t _i161;
+ for (_i161 = 0; _i161 < _size157; ++_i161)
+ {
+ xfer += (*(this->success))[_i161].read(iprot);
+ }
+ iprot->readListEnd();
+ }
+ this->__isset.success = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->ire.read(iprot);
+ this->__isset.ire = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 2:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->ue.read(iprot);
+ this->__isset.ue = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 3:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->te.read(iprot);
+ this->__isset.te = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
+uint32_t Cassandra_get_count_args::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+ bool isset_key = false;
+ bool isset_column_parent = false;
+ bool isset_predicate = false;
+ bool isset_consistency_level = false;
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readBinary(this->key);
+ isset_key = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 2:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->column_parent.read(iprot);
+ isset_column_parent = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 3:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->predicate.read(iprot);
+ isset_predicate = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 4:
+ if (ftype == ::apache::thrift::protocol::T_I32) {
+ int32_t ecast162;
+ xfer += iprot->readI32(ecast162);
+ this->consistency_level = (ConsistencyLevel::type)ecast162;
+ isset_consistency_level = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ if (!isset_key)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ if (!isset_column_parent)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ if (!isset_predicate)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ if (!isset_consistency_level)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ return xfer;
+}
+
+uint32_t Cassandra_get_count_args::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("Cassandra_get_count_args");
+ xfer += oprot->writeFieldBegin("key", ::apache::thrift::protocol::T_STRING, 1);
+ xfer += oprot->writeBinary(this->key);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldBegin("column_parent", ::apache::thrift::protocol::T_STRUCT, 2);
+ xfer += this->column_parent.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldBegin("predicate", ::apache::thrift::protocol::T_STRUCT, 3);
+ xfer += this->predicate.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldBegin("consistency_level", ::apache::thrift::protocol::T_I32, 4);
+ xfer += oprot->writeI32((int32_t)this->consistency_level);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_get_count_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("Cassandra_get_count_pargs");
+ xfer += oprot->writeFieldBegin("key", ::apache::thrift::protocol::T_STRING, 1);
+ xfer += oprot->writeBinary((*(this->key)));
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldBegin("column_parent", ::apache::thrift::protocol::T_STRUCT, 2);
+ xfer += (*(this->column_parent)).write(oprot);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldBegin("predicate", ::apache::thrift::protocol::T_STRUCT, 3);
+ xfer += (*(this->predicate)).write(oprot);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldBegin("consistency_level", ::apache::thrift::protocol::T_I32, 4);
+ xfer += oprot->writeI32((int32_t)(*(this->consistency_level)));
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_get_count_result::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 0:
+ if (ftype == ::apache::thrift::protocol::T_I32) {
+ xfer += iprot->readI32(this->success);
+ this->__isset.success = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->ire.read(iprot);
+ this->__isset.ire = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 2:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->ue.read(iprot);
+ this->__isset.ue = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 3:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->te.read(iprot);
+ this->__isset.te = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
+uint32_t Cassandra_get_count_result::write(::apache::thrift::protocol::TProtocol* oprot) const {
+
+ uint32_t xfer = 0;
+
+ xfer += oprot->writeStructBegin("Cassandra_get_count_result");
+
+ if (this->__isset.success) {
+ xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_I32, 0);
+ xfer += oprot->writeI32(this->success);
+ xfer += oprot->writeFieldEnd();
+ } else if (this->__isset.ire) {
+ xfer += oprot->writeFieldBegin("ire", ::apache::thrift::protocol::T_STRUCT, 1);
+ xfer += this->ire.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ } else if (this->__isset.ue) {
+ xfer += oprot->writeFieldBegin("ue", ::apache::thrift::protocol::T_STRUCT, 2);
+ xfer += this->ue.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ } else if (this->__isset.te) {
+ xfer += oprot->writeFieldBegin("te", ::apache::thrift::protocol::T_STRUCT, 3);
+ xfer += this->te.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ }
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_get_count_presult::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 0:
+ if (ftype == ::apache::thrift::protocol::T_I32) {
+ xfer += iprot->readI32((*(this->success)));
+ this->__isset.success = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->ire.read(iprot);
+ this->__isset.ire = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 2:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->ue.read(iprot);
+ this->__isset.ue = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 3:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->te.read(iprot);
+ this->__isset.te = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
+uint32_t Cassandra_multiget_slice_args::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+ bool isset_keys = false;
+ bool isset_column_parent = false;
+ bool isset_predicate = false;
+ bool isset_consistency_level = false;
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_LIST) {
+ {
+ this->keys.clear();
+ uint32_t _size163;
+ ::apache::thrift::protocol::TType _etype166;
+ iprot->readListBegin(_etype166, _size163);
+ this->keys.resize(_size163);
+ uint32_t _i167;
+ for (_i167 = 0; _i167 < _size163; ++_i167)
+ {
+ xfer += iprot->readBinary(this->keys[_i167]);
+ }
+ iprot->readListEnd();
+ }
+ isset_keys = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 2:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->column_parent.read(iprot);
+ isset_column_parent = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 3:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->predicate.read(iprot);
+ isset_predicate = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 4:
+ if (ftype == ::apache::thrift::protocol::T_I32) {
+ int32_t ecast168;
+ xfer += iprot->readI32(ecast168);
+ this->consistency_level = (ConsistencyLevel::type)ecast168;
+ isset_consistency_level = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ if (!isset_keys)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ if (!isset_column_parent)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ if (!isset_predicate)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ if (!isset_consistency_level)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ return xfer;
+}
+
+uint32_t Cassandra_multiget_slice_args::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("Cassandra_multiget_slice_args");
+ xfer += oprot->writeFieldBegin("keys", ::apache::thrift::protocol::T_LIST, 1);
+ {
+ xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast<uint32_t>(this->keys.size()));
+ std::vector<std::string> ::const_iterator _iter169;
+ for (_iter169 = this->keys.begin(); _iter169 != this->keys.end(); ++_iter169)
+ {
+ xfer += oprot->writeBinary((*_iter169));
+ }
+ xfer += oprot->writeListEnd();
+ }
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldBegin("column_parent", ::apache::thrift::protocol::T_STRUCT, 2);
+ xfer += this->column_parent.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldBegin("predicate", ::apache::thrift::protocol::T_STRUCT, 3);
+ xfer += this->predicate.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldBegin("consistency_level", ::apache::thrift::protocol::T_I32, 4);
+ xfer += oprot->writeI32((int32_t)this->consistency_level);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_multiget_slice_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("Cassandra_multiget_slice_pargs");
+ xfer += oprot->writeFieldBegin("keys", ::apache::thrift::protocol::T_LIST, 1);
+ {
+ xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast<uint32_t>((*(this->keys)).size()));
+ std::vector<std::string> ::const_iterator _iter170;
+ for (_iter170 = (*(this->keys)).begin(); _iter170 != (*(this->keys)).end(); ++_iter170)
+ {
+ xfer += oprot->writeBinary((*_iter170));
+ }
+ xfer += oprot->writeListEnd();
+ }
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldBegin("column_parent", ::apache::thrift::protocol::T_STRUCT, 2);
+ xfer += (*(this->column_parent)).write(oprot);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldBegin("predicate", ::apache::thrift::protocol::T_STRUCT, 3);
+ xfer += (*(this->predicate)).write(oprot);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldBegin("consistency_level", ::apache::thrift::protocol::T_I32, 4);
+ xfer += oprot->writeI32((int32_t)(*(this->consistency_level)));
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_multiget_slice_result::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 0:
+ if (ftype == ::apache::thrift::protocol::T_MAP) {
+ {
+ this->success.clear();
+ uint32_t _size171;
+ ::apache::thrift::protocol::TType _ktype172;
+ ::apache::thrift::protocol::TType _vtype173;
+ iprot->readMapBegin(_ktype172, _vtype173, _size171);
+ uint32_t _i175;
+ for (_i175 = 0; _i175 < _size171; ++_i175)
+ {
+ std::string _key176;
+ xfer += iprot->readBinary(_key176);
+ std::vector<ColumnOrSuperColumn> & _val177 = this->success[_key176];
+ {
+ _val177.clear();
+ uint32_t _size178;
+ ::apache::thrift::protocol::TType _etype181;
+ iprot->readListBegin(_etype181, _size178);
+ _val177.resize(_size178);
+ uint32_t _i182;
+ for (_i182 = 0; _i182 < _size178; ++_i182)
+ {
+ xfer += _val177[_i182].read(iprot);
+ }
+ iprot->readListEnd();
+ }
+ }
+ iprot->readMapEnd();
+ }
+ this->__isset.success = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->ire.read(iprot);
+ this->__isset.ire = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 2:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->ue.read(iprot);
+ this->__isset.ue = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 3:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->te.read(iprot);
+ this->__isset.te = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
+uint32_t Cassandra_multiget_slice_result::write(::apache::thrift::protocol::TProtocol* oprot) const {
+
+ uint32_t xfer = 0;
+
+ xfer += oprot->writeStructBegin("Cassandra_multiget_slice_result");
+
+ if (this->__isset.success) {
+ xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_MAP, 0);
+ {
+ xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_LIST, static_cast<uint32_t>(this->success.size()));
+ std::map<std::string, std::vector<ColumnOrSuperColumn> > ::const_iterator _iter183;
+ for (_iter183 = this->success.begin(); _iter183 != this->success.end(); ++_iter183)
+ {
+ xfer += oprot->writeBinary(_iter183->first);
+ {
+ xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast<uint32_t>(_iter183->second.size()));
+ std::vector<ColumnOrSuperColumn> ::const_iterator _iter184;
+ for (_iter184 = _iter183->second.begin(); _iter184 != _iter183->second.end(); ++_iter184)
+ {
+ xfer += (*_iter184).write(oprot);
+ }
+ xfer += oprot->writeListEnd();
+ }
+ }
+ xfer += oprot->writeMapEnd();
+ }
+ xfer += oprot->writeFieldEnd();
+ } else if (this->__isset.ire) {
+ xfer += oprot->writeFieldBegin("ire", ::apache::thrift::protocol::T_STRUCT, 1);
+ xfer += this->ire.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ } else if (this->__isset.ue) {
+ xfer += oprot->writeFieldBegin("ue", ::apache::thrift::protocol::T_STRUCT, 2);
+ xfer += this->ue.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ } else if (this->__isset.te) {
+ xfer += oprot->writeFieldBegin("te", ::apache::thrift::protocol::T_STRUCT, 3);
+ xfer += this->te.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ }
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_multiget_slice_presult::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 0:
+ if (ftype == ::apache::thrift::protocol::T_MAP) {
+ {
+ (*(this->success)).clear();
+ uint32_t _size185;
+ ::apache::thrift::protocol::TType _ktype186;
+ ::apache::thrift::protocol::TType _vtype187;
+ iprot->readMapBegin(_ktype186, _vtype187, _size185);
+ uint32_t _i189;
+ for (_i189 = 0; _i189 < _size185; ++_i189)
+ {
+ std::string _key190;
+ xfer += iprot->readBinary(_key190);
+ std::vector<ColumnOrSuperColumn> & _val191 = (*(this->success))[_key190];
+ {
+ _val191.clear();
+ uint32_t _size192;
+ ::apache::thrift::protocol::TType _etype195;
+ iprot->readListBegin(_etype195, _size192);
+ _val191.resize(_size192);
+ uint32_t _i196;
+ for (_i196 = 0; _i196 < _size192; ++_i196)
+ {
+ xfer += _val191[_i196].read(iprot);
+ }
+ iprot->readListEnd();
+ }
+ }
+ iprot->readMapEnd();
+ }
+ this->__isset.success = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->ire.read(iprot);
+ this->__isset.ire = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 2:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->ue.read(iprot);
+ this->__isset.ue = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 3:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->te.read(iprot);
+ this->__isset.te = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
+uint32_t Cassandra_multiget_count_args::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+ bool isset_keys = false;
+ bool isset_column_parent = false;
+ bool isset_predicate = false;
+ bool isset_consistency_level = false;
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_LIST) {
+ {
+ this->keys.clear();
+ uint32_t _size197;
+ ::apache::thrift::protocol::TType _etype200;
+ iprot->readListBegin(_etype200, _size197);
+ this->keys.resize(_size197);
+ uint32_t _i201;
+ for (_i201 = 0; _i201 < _size197; ++_i201)
+ {
+ xfer += iprot->readBinary(this->keys[_i201]);
+ }
+ iprot->readListEnd();
+ }
+ isset_keys = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 2:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->column_parent.read(iprot);
+ isset_column_parent = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 3:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->predicate.read(iprot);
+ isset_predicate = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 4:
+ if (ftype == ::apache::thrift::protocol::T_I32) {
+ int32_t ecast202;
+ xfer += iprot->readI32(ecast202);
+ this->consistency_level = (ConsistencyLevel::type)ecast202;
+ isset_consistency_level = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ if (!isset_keys)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ if (!isset_column_parent)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ if (!isset_predicate)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ if (!isset_consistency_level)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ return xfer;
+}
+
+uint32_t Cassandra_multiget_count_args::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("Cassandra_multiget_count_args");
+ xfer += oprot->writeFieldBegin("keys", ::apache::thrift::protocol::T_LIST, 1);
+ {
+ xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast<uint32_t>(this->keys.size()));
+ std::vector<std::string> ::const_iterator _iter203;
+ for (_iter203 = this->keys.begin(); _iter203 != this->keys.end(); ++_iter203)
+ {
+ xfer += oprot->writeBinary((*_iter203));
+ }
+ xfer += oprot->writeListEnd();
+ }
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldBegin("column_parent", ::apache::thrift::protocol::T_STRUCT, 2);
+ xfer += this->column_parent.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldBegin("predicate", ::apache::thrift::protocol::T_STRUCT, 3);
+ xfer += this->predicate.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldBegin("consistency_level", ::apache::thrift::protocol::T_I32, 4);
+ xfer += oprot->writeI32((int32_t)this->consistency_level);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_multiget_count_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("Cassandra_multiget_count_pargs");
+ xfer += oprot->writeFieldBegin("keys", ::apache::thrift::protocol::T_LIST, 1);
+ {
+ xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast<uint32_t>((*(this->keys)).size()));
+ std::vector<std::string> ::const_iterator _iter204;
+ for (_iter204 = (*(this->keys)).begin(); _iter204 != (*(this->keys)).end(); ++_iter204)
+ {
+ xfer += oprot->writeBinary((*_iter204));
+ }
+ xfer += oprot->writeListEnd();
+ }
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldBegin("column_parent", ::apache::thrift::protocol::T_STRUCT, 2);
+ xfer += (*(this->column_parent)).write(oprot);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldBegin("predicate", ::apache::thrift::protocol::T_STRUCT, 3);
+ xfer += (*(this->predicate)).write(oprot);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldBegin("consistency_level", ::apache::thrift::protocol::T_I32, 4);
+ xfer += oprot->writeI32((int32_t)(*(this->consistency_level)));
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_multiget_count_result::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 0:
+ if (ftype == ::apache::thrift::protocol::T_MAP) {
+ {
+ this->success.clear();
+ uint32_t _size205;
+ ::apache::thrift::protocol::TType _ktype206;
+ ::apache::thrift::protocol::TType _vtype207;
+ iprot->readMapBegin(_ktype206, _vtype207, _size205);
+ uint32_t _i209;
+ for (_i209 = 0; _i209 < _size205; ++_i209)
+ {
+ std::string _key210;
+ xfer += iprot->readBinary(_key210);
+ int32_t& _val211 = this->success[_key210];
+ xfer += iprot->readI32(_val211);
+ }
+ iprot->readMapEnd();
+ }
+ this->__isset.success = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->ire.read(iprot);
+ this->__isset.ire = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 2:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->ue.read(iprot);
+ this->__isset.ue = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 3:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->te.read(iprot);
+ this->__isset.te = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
+uint32_t Cassandra_multiget_count_result::write(::apache::thrift::protocol::TProtocol* oprot) const {
+
+ uint32_t xfer = 0;
+
+ xfer += oprot->writeStructBegin("Cassandra_multiget_count_result");
+
+ if (this->__isset.success) {
+ xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_MAP, 0);
+ {
+ xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_I32, static_cast<uint32_t>(this->success.size()));
+ std::map<std::string, int32_t> ::const_iterator _iter212;
+ for (_iter212 = this->success.begin(); _iter212 != this->success.end(); ++_iter212)
+ {
+ xfer += oprot->writeBinary(_iter212->first);
+ xfer += oprot->writeI32(_iter212->second);
+ }
+ xfer += oprot->writeMapEnd();
+ }
+ xfer += oprot->writeFieldEnd();
+ } else if (this->__isset.ire) {
+ xfer += oprot->writeFieldBegin("ire", ::apache::thrift::protocol::T_STRUCT, 1);
+ xfer += this->ire.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ } else if (this->__isset.ue) {
+ xfer += oprot->writeFieldBegin("ue", ::apache::thrift::protocol::T_STRUCT, 2);
+ xfer += this->ue.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ } else if (this->__isset.te) {
+ xfer += oprot->writeFieldBegin("te", ::apache::thrift::protocol::T_STRUCT, 3);
+ xfer += this->te.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ }
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_multiget_count_presult::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 0:
+ if (ftype == ::apache::thrift::protocol::T_MAP) {
+ {
+ (*(this->success)).clear();
+ uint32_t _size213;
+ ::apache::thrift::protocol::TType _ktype214;
+ ::apache::thrift::protocol::TType _vtype215;
+ iprot->readMapBegin(_ktype214, _vtype215, _size213);
+ uint32_t _i217;
+ for (_i217 = 0; _i217 < _size213; ++_i217)
+ {
+ std::string _key218;
+ xfer += iprot->readBinary(_key218);
+ int32_t& _val219 = (*(this->success))[_key218];
+ xfer += iprot->readI32(_val219);
+ }
+ iprot->readMapEnd();
+ }
+ this->__isset.success = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->ire.read(iprot);
+ this->__isset.ire = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 2:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->ue.read(iprot);
+ this->__isset.ue = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 3:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->te.read(iprot);
+ this->__isset.te = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
+uint32_t Cassandra_get_range_slices_args::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+ bool isset_column_parent = false;
+ bool isset_predicate = false;
+ bool isset_range = false;
+ bool isset_consistency_level = false;
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->column_parent.read(iprot);
+ isset_column_parent = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 2:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->predicate.read(iprot);
+ isset_predicate = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 3:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->range.read(iprot);
+ isset_range = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 4:
+ if (ftype == ::apache::thrift::protocol::T_I32) {
+ int32_t ecast220;
+ xfer += iprot->readI32(ecast220);
+ this->consistency_level = (ConsistencyLevel::type)ecast220;
+ isset_consistency_level = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ if (!isset_column_parent)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ if (!isset_predicate)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ if (!isset_range)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ if (!isset_consistency_level)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ return xfer;
+}
+
+uint32_t Cassandra_get_range_slices_args::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("Cassandra_get_range_slices_args");
+ xfer += oprot->writeFieldBegin("column_parent", ::apache::thrift::protocol::T_STRUCT, 1);
+ xfer += this->column_parent.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldBegin("predicate", ::apache::thrift::protocol::T_STRUCT, 2);
+ xfer += this->predicate.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldBegin("range", ::apache::thrift::protocol::T_STRUCT, 3);
+ xfer += this->range.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldBegin("consistency_level", ::apache::thrift::protocol::T_I32, 4);
+ xfer += oprot->writeI32((int32_t)this->consistency_level);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_get_range_slices_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("Cassandra_get_range_slices_pargs");
+ xfer += oprot->writeFieldBegin("column_parent", ::apache::thrift::protocol::T_STRUCT, 1);
+ xfer += (*(this->column_parent)).write(oprot);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldBegin("predicate", ::apache::thrift::protocol::T_STRUCT, 2);
+ xfer += (*(this->predicate)).write(oprot);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldBegin("range", ::apache::thrift::protocol::T_STRUCT, 3);
+ xfer += (*(this->range)).write(oprot);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldBegin("consistency_level", ::apache::thrift::protocol::T_I32, 4);
+ xfer += oprot->writeI32((int32_t)(*(this->consistency_level)));
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_get_range_slices_result::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 0:
+ if (ftype == ::apache::thrift::protocol::T_LIST) {
+ {
+ this->success.clear();
+ uint32_t _size221;
+ ::apache::thrift::protocol::TType _etype224;
+ iprot->readListBegin(_etype224, _size221);
+ this->success.resize(_size221);
+ uint32_t _i225;
+ for (_i225 = 0; _i225 < _size221; ++_i225)
+ {
+ xfer += this->success[_i225].read(iprot);
+ }
+ iprot->readListEnd();
+ }
+ this->__isset.success = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->ire.read(iprot);
+ this->__isset.ire = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 2:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->ue.read(iprot);
+ this->__isset.ue = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 3:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->te.read(iprot);
+ this->__isset.te = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
+uint32_t Cassandra_get_range_slices_result::write(::apache::thrift::protocol::TProtocol* oprot) const {
+
+ uint32_t xfer = 0;
+
+ xfer += oprot->writeStructBegin("Cassandra_get_range_slices_result");
+
+ if (this->__isset.success) {
+ xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_LIST, 0);
+ {
+ xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast<uint32_t>(this->success.size()));
+ std::vector<KeySlice> ::const_iterator _iter226;
+ for (_iter226 = this->success.begin(); _iter226 != this->success.end(); ++_iter226)
+ {
+ xfer += (*_iter226).write(oprot);
+ }
+ xfer += oprot->writeListEnd();
+ }
+ xfer += oprot->writeFieldEnd();
+ } else if (this->__isset.ire) {
+ xfer += oprot->writeFieldBegin("ire", ::apache::thrift::protocol::T_STRUCT, 1);
+ xfer += this->ire.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ } else if (this->__isset.ue) {
+ xfer += oprot->writeFieldBegin("ue", ::apache::thrift::protocol::T_STRUCT, 2);
+ xfer += this->ue.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ } else if (this->__isset.te) {
+ xfer += oprot->writeFieldBegin("te", ::apache::thrift::protocol::T_STRUCT, 3);
+ xfer += this->te.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ }
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_get_range_slices_presult::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 0:
+ if (ftype == ::apache::thrift::protocol::T_LIST) {
+ {
+ (*(this->success)).clear();
+ uint32_t _size227;
+ ::apache::thrift::protocol::TType _etype230;
+ iprot->readListBegin(_etype230, _size227);
+ (*(this->success)).resize(_size227);
+ uint32_t _i231;
+ for (_i231 = 0; _i231 < _size227; ++_i231)
+ {
+ xfer += (*(this->success))[_i231].read(iprot);
+ }
+ iprot->readListEnd();
+ }
+ this->__isset.success = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->ire.read(iprot);
+ this->__isset.ire = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 2:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->ue.read(iprot);
+ this->__isset.ue = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 3:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->te.read(iprot);
+ this->__isset.te = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
+uint32_t Cassandra_get_paged_slice_args::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+ bool isset_column_family = false;
+ bool isset_range = false;
+ bool isset_start_column = false;
+ bool isset_consistency_level = false;
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readString(this->column_family);
+ isset_column_family = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 2:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->range.read(iprot);
+ isset_range = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 3:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readBinary(this->start_column);
+ isset_start_column = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 4:
+ if (ftype == ::apache::thrift::protocol::T_I32) {
+ int32_t ecast232;
+ xfer += iprot->readI32(ecast232);
+ this->consistency_level = (ConsistencyLevel::type)ecast232;
+ isset_consistency_level = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ if (!isset_column_family)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ if (!isset_range)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ if (!isset_start_column)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ if (!isset_consistency_level)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ return xfer;
+}
+
+uint32_t Cassandra_get_paged_slice_args::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("Cassandra_get_paged_slice_args");
+ xfer += oprot->writeFieldBegin("column_family", ::apache::thrift::protocol::T_STRING, 1);
+ xfer += oprot->writeString(this->column_family);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldBegin("range", ::apache::thrift::protocol::T_STRUCT, 2);
+ xfer += this->range.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldBegin("start_column", ::apache::thrift::protocol::T_STRING, 3);
+ xfer += oprot->writeBinary(this->start_column);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldBegin("consistency_level", ::apache::thrift::protocol::T_I32, 4);
+ xfer += oprot->writeI32((int32_t)this->consistency_level);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_get_paged_slice_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("Cassandra_get_paged_slice_pargs");
+ xfer += oprot->writeFieldBegin("column_family", ::apache::thrift::protocol::T_STRING, 1);
+ xfer += oprot->writeString((*(this->column_family)));
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldBegin("range", ::apache::thrift::protocol::T_STRUCT, 2);
+ xfer += (*(this->range)).write(oprot);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldBegin("start_column", ::apache::thrift::protocol::T_STRING, 3);
+ xfer += oprot->writeBinary((*(this->start_column)));
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldBegin("consistency_level", ::apache::thrift::protocol::T_I32, 4);
+ xfer += oprot->writeI32((int32_t)(*(this->consistency_level)));
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_get_paged_slice_result::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 0:
+ if (ftype == ::apache::thrift::protocol::T_LIST) {
+ {
+ this->success.clear();
+ uint32_t _size233;
+ ::apache::thrift::protocol::TType _etype236;
+ iprot->readListBegin(_etype236, _size233);
+ this->success.resize(_size233);
+ uint32_t _i237;
+ for (_i237 = 0; _i237 < _size233; ++_i237)
+ {
+ xfer += this->success[_i237].read(iprot);
+ }
+ iprot->readListEnd();
+ }
+ this->__isset.success = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->ire.read(iprot);
+ this->__isset.ire = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 2:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->ue.read(iprot);
+ this->__isset.ue = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 3:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->te.read(iprot);
+ this->__isset.te = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
+uint32_t Cassandra_get_paged_slice_result::write(::apache::thrift::protocol::TProtocol* oprot) const {
+
+ uint32_t xfer = 0;
+
+ xfer += oprot->writeStructBegin("Cassandra_get_paged_slice_result");
+
+ if (this->__isset.success) {
+ xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_LIST, 0);
+ {
+ xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast<uint32_t>(this->success.size()));
+ std::vector<KeySlice> ::const_iterator _iter238;
+ for (_iter238 = this->success.begin(); _iter238 != this->success.end(); ++_iter238)
+ {
+ xfer += (*_iter238).write(oprot);
+ }
+ xfer += oprot->writeListEnd();
+ }
+ xfer += oprot->writeFieldEnd();
+ } else if (this->__isset.ire) {
+ xfer += oprot->writeFieldBegin("ire", ::apache::thrift::protocol::T_STRUCT, 1);
+ xfer += this->ire.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ } else if (this->__isset.ue) {
+ xfer += oprot->writeFieldBegin("ue", ::apache::thrift::protocol::T_STRUCT, 2);
+ xfer += this->ue.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ } else if (this->__isset.te) {
+ xfer += oprot->writeFieldBegin("te", ::apache::thrift::protocol::T_STRUCT, 3);
+ xfer += this->te.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ }
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_get_paged_slice_presult::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 0:
+ if (ftype == ::apache::thrift::protocol::T_LIST) {
+ {
+ (*(this->success)).clear();
+ uint32_t _size239;
+ ::apache::thrift::protocol::TType _etype242;
+ iprot->readListBegin(_etype242, _size239);
+ (*(this->success)).resize(_size239);
+ uint32_t _i243;
+ for (_i243 = 0; _i243 < _size239; ++_i243)
+ {
+ xfer += (*(this->success))[_i243].read(iprot);
+ }
+ iprot->readListEnd();
+ }
+ this->__isset.success = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->ire.read(iprot);
+ this->__isset.ire = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 2:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->ue.read(iprot);
+ this->__isset.ue = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 3:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->te.read(iprot);
+ this->__isset.te = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
+uint32_t Cassandra_get_indexed_slices_args::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+ bool isset_column_parent = false;
+ bool isset_index_clause = false;
+ bool isset_column_predicate = false;
+ bool isset_consistency_level = false;
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->column_parent.read(iprot);
+ isset_column_parent = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 2:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->index_clause.read(iprot);
+ isset_index_clause = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 3:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->column_predicate.read(iprot);
+ isset_column_predicate = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 4:
+ if (ftype == ::apache::thrift::protocol::T_I32) {
+ int32_t ecast244;
+ xfer += iprot->readI32(ecast244);
+ this->consistency_level = (ConsistencyLevel::type)ecast244;
+ isset_consistency_level = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ if (!isset_column_parent)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ if (!isset_index_clause)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ if (!isset_column_predicate)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ if (!isset_consistency_level)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ return xfer;
+}
+
+uint32_t Cassandra_get_indexed_slices_args::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("Cassandra_get_indexed_slices_args");
+ xfer += oprot->writeFieldBegin("column_parent", ::apache::thrift::protocol::T_STRUCT, 1);
+ xfer += this->column_parent.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldBegin("index_clause", ::apache::thrift::protocol::T_STRUCT, 2);
+ xfer += this->index_clause.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldBegin("column_predicate", ::apache::thrift::protocol::T_STRUCT, 3);
+ xfer += this->column_predicate.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldBegin("consistency_level", ::apache::thrift::protocol::T_I32, 4);
+ xfer += oprot->writeI32((int32_t)this->consistency_level);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_get_indexed_slices_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("Cassandra_get_indexed_slices_pargs");
+ xfer += oprot->writeFieldBegin("column_parent", ::apache::thrift::protocol::T_STRUCT, 1);
+ xfer += (*(this->column_parent)).write(oprot);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldBegin("index_clause", ::apache::thrift::protocol::T_STRUCT, 2);
+ xfer += (*(this->index_clause)).write(oprot);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldBegin("column_predicate", ::apache::thrift::protocol::T_STRUCT, 3);
+ xfer += (*(this->column_predicate)).write(oprot);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldBegin("consistency_level", ::apache::thrift::protocol::T_I32, 4);
+ xfer += oprot->writeI32((int32_t)(*(this->consistency_level)));
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_get_indexed_slices_result::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 0:
+ if (ftype == ::apache::thrift::protocol::T_LIST) {
+ {
+ this->success.clear();
+ uint32_t _size245;
+ ::apache::thrift::protocol::TType _etype248;
+ iprot->readListBegin(_etype248, _size245);
+ this->success.resize(_size245);
+ uint32_t _i249;
+ for (_i249 = 0; _i249 < _size245; ++_i249)
+ {
+ xfer += this->success[_i249].read(iprot);
+ }
+ iprot->readListEnd();
+ }
+ this->__isset.success = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->ire.read(iprot);
+ this->__isset.ire = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 2:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->ue.read(iprot);
+ this->__isset.ue = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 3:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->te.read(iprot);
+ this->__isset.te = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
+uint32_t Cassandra_get_indexed_slices_result::write(::apache::thrift::protocol::TProtocol* oprot) const {
+
+ uint32_t xfer = 0;
+
+ xfer += oprot->writeStructBegin("Cassandra_get_indexed_slices_result");
+
+ if (this->__isset.success) {
+ xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_LIST, 0);
+ {
+ xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast<uint32_t>(this->success.size()));
+ std::vector<KeySlice> ::const_iterator _iter250;
+ for (_iter250 = this->success.begin(); _iter250 != this->success.end(); ++_iter250)
+ {
+ xfer += (*_iter250).write(oprot);
+ }
+ xfer += oprot->writeListEnd();
+ }
+ xfer += oprot->writeFieldEnd();
+ } else if (this->__isset.ire) {
+ xfer += oprot->writeFieldBegin("ire", ::apache::thrift::protocol::T_STRUCT, 1);
+ xfer += this->ire.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ } else if (this->__isset.ue) {
+ xfer += oprot->writeFieldBegin("ue", ::apache::thrift::protocol::T_STRUCT, 2);
+ xfer += this->ue.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ } else if (this->__isset.te) {
+ xfer += oprot->writeFieldBegin("te", ::apache::thrift::protocol::T_STRUCT, 3);
+ xfer += this->te.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ }
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_get_indexed_slices_presult::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 0:
+ if (ftype == ::apache::thrift::protocol::T_LIST) {
+ {
+ (*(this->success)).clear();
+ uint32_t _size251;
+ ::apache::thrift::protocol::TType _etype254;
+ iprot->readListBegin(_etype254, _size251);
+ (*(this->success)).resize(_size251);
+ uint32_t _i255;
+ for (_i255 = 0; _i255 < _size251; ++_i255)
+ {
+ xfer += (*(this->success))[_i255].read(iprot);
+ }
+ iprot->readListEnd();
+ }
+ this->__isset.success = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->ire.read(iprot);
+ this->__isset.ire = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 2:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->ue.read(iprot);
+ this->__isset.ue = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 3:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->te.read(iprot);
+ this->__isset.te = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
+uint32_t Cassandra_insert_args::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+ bool isset_key = false;
+ bool isset_column_parent = false;
+ bool isset_column = false;
+ bool isset_consistency_level = false;
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readBinary(this->key);
+ isset_key = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 2:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->column_parent.read(iprot);
+ isset_column_parent = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 3:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->column.read(iprot);
+ isset_column = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 4:
+ if (ftype == ::apache::thrift::protocol::T_I32) {
+ int32_t ecast256;
+ xfer += iprot->readI32(ecast256);
+ this->consistency_level = (ConsistencyLevel::type)ecast256;
+ isset_consistency_level = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ if (!isset_key)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ if (!isset_column_parent)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ if (!isset_column)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ if (!isset_consistency_level)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ return xfer;
+}
+
+uint32_t Cassandra_insert_args::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("Cassandra_insert_args");
+ xfer += oprot->writeFieldBegin("key", ::apache::thrift::protocol::T_STRING, 1);
+ xfer += oprot->writeBinary(this->key);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldBegin("column_parent", ::apache::thrift::protocol::T_STRUCT, 2);
+ xfer += this->column_parent.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldBegin("column", ::apache::thrift::protocol::T_STRUCT, 3);
+ xfer += this->column.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldBegin("consistency_level", ::apache::thrift::protocol::T_I32, 4);
+ xfer += oprot->writeI32((int32_t)this->consistency_level);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_insert_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("Cassandra_insert_pargs");
+ xfer += oprot->writeFieldBegin("key", ::apache::thrift::protocol::T_STRING, 1);
+ xfer += oprot->writeBinary((*(this->key)));
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldBegin("column_parent", ::apache::thrift::protocol::T_STRUCT, 2);
+ xfer += (*(this->column_parent)).write(oprot);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldBegin("column", ::apache::thrift::protocol::T_STRUCT, 3);
+ xfer += (*(this->column)).write(oprot);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldBegin("consistency_level", ::apache::thrift::protocol::T_I32, 4);
+ xfer += oprot->writeI32((int32_t)(*(this->consistency_level)));
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_insert_result::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->ire.read(iprot);
+ this->__isset.ire = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 2:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->ue.read(iprot);
+ this->__isset.ue = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 3:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->te.read(iprot);
+ this->__isset.te = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
+uint32_t Cassandra_insert_result::write(::apache::thrift::protocol::TProtocol* oprot) const {
+
+ uint32_t xfer = 0;
+
+ xfer += oprot->writeStructBegin("Cassandra_insert_result");
+
+ if (this->__isset.ire) {
+ xfer += oprot->writeFieldBegin("ire", ::apache::thrift::protocol::T_STRUCT, 1);
+ xfer += this->ire.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ } else if (this->__isset.ue) {
+ xfer += oprot->writeFieldBegin("ue", ::apache::thrift::protocol::T_STRUCT, 2);
+ xfer += this->ue.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ } else if (this->__isset.te) {
+ xfer += oprot->writeFieldBegin("te", ::apache::thrift::protocol::T_STRUCT, 3);
+ xfer += this->te.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ }
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_insert_presult::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->ire.read(iprot);
+ this->__isset.ire = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 2:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->ue.read(iprot);
+ this->__isset.ue = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 3:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->te.read(iprot);
+ this->__isset.te = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
+uint32_t Cassandra_add_args::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+ bool isset_key = false;
+ bool isset_column_parent = false;
+ bool isset_column = false;
+ bool isset_consistency_level = false;
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readBinary(this->key);
+ isset_key = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 2:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->column_parent.read(iprot);
+ isset_column_parent = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 3:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->column.read(iprot);
+ isset_column = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 4:
+ if (ftype == ::apache::thrift::protocol::T_I32) {
+ int32_t ecast257;
+ xfer += iprot->readI32(ecast257);
+ this->consistency_level = (ConsistencyLevel::type)ecast257;
+ isset_consistency_level = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ if (!isset_key)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ if (!isset_column_parent)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ if (!isset_column)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ if (!isset_consistency_level)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ return xfer;
+}
+
+uint32_t Cassandra_add_args::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("Cassandra_add_args");
+ xfer += oprot->writeFieldBegin("key", ::apache::thrift::protocol::T_STRING, 1);
+ xfer += oprot->writeBinary(this->key);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldBegin("column_parent", ::apache::thrift::protocol::T_STRUCT, 2);
+ xfer += this->column_parent.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldBegin("column", ::apache::thrift::protocol::T_STRUCT, 3);
+ xfer += this->column.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldBegin("consistency_level", ::apache::thrift::protocol::T_I32, 4);
+ xfer += oprot->writeI32((int32_t)this->consistency_level);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_add_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("Cassandra_add_pargs");
+ xfer += oprot->writeFieldBegin("key", ::apache::thrift::protocol::T_STRING, 1);
+ xfer += oprot->writeBinary((*(this->key)));
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldBegin("column_parent", ::apache::thrift::protocol::T_STRUCT, 2);
+ xfer += (*(this->column_parent)).write(oprot);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldBegin("column", ::apache::thrift::protocol::T_STRUCT, 3);
+ xfer += (*(this->column)).write(oprot);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldBegin("consistency_level", ::apache::thrift::protocol::T_I32, 4);
+ xfer += oprot->writeI32((int32_t)(*(this->consistency_level)));
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_add_result::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->ire.read(iprot);
+ this->__isset.ire = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 2:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->ue.read(iprot);
+ this->__isset.ue = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 3:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->te.read(iprot);
+ this->__isset.te = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
+uint32_t Cassandra_add_result::write(::apache::thrift::protocol::TProtocol* oprot) const {
+
+ uint32_t xfer = 0;
+
+ xfer += oprot->writeStructBegin("Cassandra_add_result");
+
+ if (this->__isset.ire) {
+ xfer += oprot->writeFieldBegin("ire", ::apache::thrift::protocol::T_STRUCT, 1);
+ xfer += this->ire.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ } else if (this->__isset.ue) {
+ xfer += oprot->writeFieldBegin("ue", ::apache::thrift::protocol::T_STRUCT, 2);
+ xfer += this->ue.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ } else if (this->__isset.te) {
+ xfer += oprot->writeFieldBegin("te", ::apache::thrift::protocol::T_STRUCT, 3);
+ xfer += this->te.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ }
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_add_presult::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->ire.read(iprot);
+ this->__isset.ire = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 2:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->ue.read(iprot);
+ this->__isset.ue = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 3:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->te.read(iprot);
+ this->__isset.te = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
+uint32_t Cassandra_remove_args::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+ bool isset_key = false;
+ bool isset_column_path = false;
+ bool isset_timestamp = false;
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readBinary(this->key);
+ isset_key = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 2:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->column_path.read(iprot);
+ isset_column_path = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 3:
+ if (ftype == ::apache::thrift::protocol::T_I64) {
+ xfer += iprot->readI64(this->timestamp);
+ isset_timestamp = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 4:
+ if (ftype == ::apache::thrift::protocol::T_I32) {
+ int32_t ecast258;
+ xfer += iprot->readI32(ecast258);
+ this->consistency_level = (ConsistencyLevel::type)ecast258;
+ this->__isset.consistency_level = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ if (!isset_key)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ if (!isset_column_path)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ if (!isset_timestamp)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ return xfer;
+}
+
+uint32_t Cassandra_remove_args::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("Cassandra_remove_args");
+ xfer += oprot->writeFieldBegin("key", ::apache::thrift::protocol::T_STRING, 1);
+ xfer += oprot->writeBinary(this->key);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldBegin("column_path", ::apache::thrift::protocol::T_STRUCT, 2);
+ xfer += this->column_path.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldBegin("timestamp", ::apache::thrift::protocol::T_I64, 3);
+ xfer += oprot->writeI64(this->timestamp);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldBegin("consistency_level", ::apache::thrift::protocol::T_I32, 4);
+ xfer += oprot->writeI32((int32_t)this->consistency_level);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_remove_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("Cassandra_remove_pargs");
+ xfer += oprot->writeFieldBegin("key", ::apache::thrift::protocol::T_STRING, 1);
+ xfer += oprot->writeBinary((*(this->key)));
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldBegin("column_path", ::apache::thrift::protocol::T_STRUCT, 2);
+ xfer += (*(this->column_path)).write(oprot);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldBegin("timestamp", ::apache::thrift::protocol::T_I64, 3);
+ xfer += oprot->writeI64((*(this->timestamp)));
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldBegin("consistency_level", ::apache::thrift::protocol::T_I32, 4);
+ xfer += oprot->writeI32((int32_t)(*(this->consistency_level)));
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_remove_result::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->ire.read(iprot);
+ this->__isset.ire = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 2:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->ue.read(iprot);
+ this->__isset.ue = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 3:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->te.read(iprot);
+ this->__isset.te = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
+uint32_t Cassandra_remove_result::write(::apache::thrift::protocol::TProtocol* oprot) const {
+
+ uint32_t xfer = 0;
+
+ xfer += oprot->writeStructBegin("Cassandra_remove_result");
+
+ if (this->__isset.ire) {
+ xfer += oprot->writeFieldBegin("ire", ::apache::thrift::protocol::T_STRUCT, 1);
+ xfer += this->ire.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ } else if (this->__isset.ue) {
+ xfer += oprot->writeFieldBegin("ue", ::apache::thrift::protocol::T_STRUCT, 2);
+ xfer += this->ue.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ } else if (this->__isset.te) {
+ xfer += oprot->writeFieldBegin("te", ::apache::thrift::protocol::T_STRUCT, 3);
+ xfer += this->te.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ }
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_remove_presult::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->ire.read(iprot);
+ this->__isset.ire = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 2:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->ue.read(iprot);
+ this->__isset.ue = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 3:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->te.read(iprot);
+ this->__isset.te = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
+uint32_t Cassandra_remove_counter_args::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+ bool isset_key = false;
+ bool isset_path = false;
+ bool isset_consistency_level = false;
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readBinary(this->key);
+ isset_key = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 2:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->path.read(iprot);
+ isset_path = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 3:
+ if (ftype == ::apache::thrift::protocol::T_I32) {
+ int32_t ecast259;
+ xfer += iprot->readI32(ecast259);
+ this->consistency_level = (ConsistencyLevel::type)ecast259;
+ isset_consistency_level = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ if (!isset_key)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ if (!isset_path)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ if (!isset_consistency_level)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ return xfer;
+}
+
+uint32_t Cassandra_remove_counter_args::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("Cassandra_remove_counter_args");
+ xfer += oprot->writeFieldBegin("key", ::apache::thrift::protocol::T_STRING, 1);
+ xfer += oprot->writeBinary(this->key);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldBegin("path", ::apache::thrift::protocol::T_STRUCT, 2);
+ xfer += this->path.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldBegin("consistency_level", ::apache::thrift::protocol::T_I32, 3);
+ xfer += oprot->writeI32((int32_t)this->consistency_level);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_remove_counter_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("Cassandra_remove_counter_pargs");
+ xfer += oprot->writeFieldBegin("key", ::apache::thrift::protocol::T_STRING, 1);
+ xfer += oprot->writeBinary((*(this->key)));
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldBegin("path", ::apache::thrift::protocol::T_STRUCT, 2);
+ xfer += (*(this->path)).write(oprot);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldBegin("consistency_level", ::apache::thrift::protocol::T_I32, 3);
+ xfer += oprot->writeI32((int32_t)(*(this->consistency_level)));
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_remove_counter_result::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->ire.read(iprot);
+ this->__isset.ire = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 2:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->ue.read(iprot);
+ this->__isset.ue = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 3:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->te.read(iprot);
+ this->__isset.te = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
+uint32_t Cassandra_remove_counter_result::write(::apache::thrift::protocol::TProtocol* oprot) const {
+
+ uint32_t xfer = 0;
+
+ xfer += oprot->writeStructBegin("Cassandra_remove_counter_result");
+
+ if (this->__isset.ire) {
+ xfer += oprot->writeFieldBegin("ire", ::apache::thrift::protocol::T_STRUCT, 1);
+ xfer += this->ire.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ } else if (this->__isset.ue) {
+ xfer += oprot->writeFieldBegin("ue", ::apache::thrift::protocol::T_STRUCT, 2);
+ xfer += this->ue.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ } else if (this->__isset.te) {
+ xfer += oprot->writeFieldBegin("te", ::apache::thrift::protocol::T_STRUCT, 3);
+ xfer += this->te.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ }
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_remove_counter_presult::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->ire.read(iprot);
+ this->__isset.ire = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 2:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->ue.read(iprot);
+ this->__isset.ue = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 3:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->te.read(iprot);
+ this->__isset.te = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
+uint32_t Cassandra_batch_mutate_args::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+ bool isset_mutation_map = false;
+ bool isset_consistency_level = false;
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_MAP) {
+ {
+ this->mutation_map.clear();
+ uint32_t _size260;
+ ::apache::thrift::protocol::TType _ktype261;
+ ::apache::thrift::protocol::TType _vtype262;
+ iprot->readMapBegin(_ktype261, _vtype262, _size260);
+ uint32_t _i264;
+ for (_i264 = 0; _i264 < _size260; ++_i264)
+ {
+ std::string _key265;
+ xfer += iprot->readBinary(_key265);
+ std::map<std::string, std::vector<Mutation> > & _val266 = this->mutation_map[_key265];
+ {
+ _val266.clear();
+ uint32_t _size267;
+ ::apache::thrift::protocol::TType _ktype268;
+ ::apache::thrift::protocol::TType _vtype269;
+ iprot->readMapBegin(_ktype268, _vtype269, _size267);
+ uint32_t _i271;
+ for (_i271 = 0; _i271 < _size267; ++_i271)
+ {
+ std::string _key272;
+ xfer += iprot->readString(_key272);
+ std::vector<Mutation> & _val273 = _val266[_key272];
+ {
+ _val273.clear();
+ uint32_t _size274;
+ ::apache::thrift::protocol::TType _etype277;
+ iprot->readListBegin(_etype277, _size274);
+ _val273.resize(_size274);
+ uint32_t _i278;
+ for (_i278 = 0; _i278 < _size274; ++_i278)
+ {
+ xfer += _val273[_i278].read(iprot);
+ }
+ iprot->readListEnd();
+ }
+ }
+ iprot->readMapEnd();
+ }
+ }
+ iprot->readMapEnd();
+ }
+ isset_mutation_map = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 2:
+ if (ftype == ::apache::thrift::protocol::T_I32) {
+ int32_t ecast279;
+ xfer += iprot->readI32(ecast279);
+ this->consistency_level = (ConsistencyLevel::type)ecast279;
+ isset_consistency_level = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ if (!isset_mutation_map)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ if (!isset_consistency_level)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ return xfer;
+}
+
+uint32_t Cassandra_batch_mutate_args::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("Cassandra_batch_mutate_args");
+ xfer += oprot->writeFieldBegin("mutation_map", ::apache::thrift::protocol::T_MAP, 1);
+ {
+ xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_MAP, static_cast<uint32_t>(this->mutation_map.size()));
+ std::map<std::string, std::map<std::string, std::vector<Mutation> > > ::const_iterator _iter280;
+ for (_iter280 = this->mutation_map.begin(); _iter280 != this->mutation_map.end(); ++_iter280)
+ {
+ xfer += oprot->writeBinary(_iter280->first);
+ {
+ xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_LIST, static_cast<uint32_t>(_iter280->second.size()));
+ std::map<std::string, std::vector<Mutation> > ::const_iterator _iter281;
+ for (_iter281 = _iter280->second.begin(); _iter281 != _iter280->second.end(); ++_iter281)
+ {
+ xfer += oprot->writeString(_iter281->first);
+ {
+ xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast<uint32_t>(_iter281->second.size()));
+ std::vector<Mutation> ::const_iterator _iter282;
+ for (_iter282 = _iter281->second.begin(); _iter282 != _iter281->second.end(); ++_iter282)
+ {
+ xfer += (*_iter282).write(oprot);
+ }
+ xfer += oprot->writeListEnd();
+ }
+ }
+ xfer += oprot->writeMapEnd();
+ }
+ }
+ xfer += oprot->writeMapEnd();
+ }
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldBegin("consistency_level", ::apache::thrift::protocol::T_I32, 2);
+ xfer += oprot->writeI32((int32_t)this->consistency_level);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_batch_mutate_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("Cassandra_batch_mutate_pargs");
+ xfer += oprot->writeFieldBegin("mutation_map", ::apache::thrift::protocol::T_MAP, 1);
+ {
+ xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_MAP, static_cast<uint32_t>((*(this->mutation_map)).size()));
+ std::map<std::string, std::map<std::string, std::vector<Mutation> > > ::const_iterator _iter283;
+ for (_iter283 = (*(this->mutation_map)).begin(); _iter283 != (*(this->mutation_map)).end(); ++_iter283)
+ {
+ xfer += oprot->writeBinary(_iter283->first);
+ {
+ xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_LIST, static_cast<uint32_t>(_iter283->second.size()));
+ std::map<std::string, std::vector<Mutation> > ::const_iterator _iter284;
+ for (_iter284 = _iter283->second.begin(); _iter284 != _iter283->second.end(); ++_iter284)
+ {
+ xfer += oprot->writeString(_iter284->first);
+ {
+ xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast<uint32_t>(_iter284->second.size()));
+ std::vector<Mutation> ::const_iterator _iter285;
+ for (_iter285 = _iter284->second.begin(); _iter285 != _iter284->second.end(); ++_iter285)
+ {
+ xfer += (*_iter285).write(oprot);
+ }
+ xfer += oprot->writeListEnd();
+ }
+ }
+ xfer += oprot->writeMapEnd();
+ }
+ }
+ xfer += oprot->writeMapEnd();
+ }
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldBegin("consistency_level", ::apache::thrift::protocol::T_I32, 2);
+ xfer += oprot->writeI32((int32_t)(*(this->consistency_level)));
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_batch_mutate_result::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->ire.read(iprot);
+ this->__isset.ire = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 2:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->ue.read(iprot);
+ this->__isset.ue = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 3:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->te.read(iprot);
+ this->__isset.te = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
+uint32_t Cassandra_batch_mutate_result::write(::apache::thrift::protocol::TProtocol* oprot) const {
+
+ uint32_t xfer = 0;
+
+ xfer += oprot->writeStructBegin("Cassandra_batch_mutate_result");
+
+ if (this->__isset.ire) {
+ xfer += oprot->writeFieldBegin("ire", ::apache::thrift::protocol::T_STRUCT, 1);
+ xfer += this->ire.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ } else if (this->__isset.ue) {
+ xfer += oprot->writeFieldBegin("ue", ::apache::thrift::protocol::T_STRUCT, 2);
+ xfer += this->ue.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ } else if (this->__isset.te) {
+ xfer += oprot->writeFieldBegin("te", ::apache::thrift::protocol::T_STRUCT, 3);
+ xfer += this->te.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ }
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_batch_mutate_presult::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->ire.read(iprot);
+ this->__isset.ire = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 2:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->ue.read(iprot);
+ this->__isset.ue = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 3:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->te.read(iprot);
+ this->__isset.te = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
+uint32_t Cassandra_truncate_args::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+ bool isset_cfname = false;
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readString(this->cfname);
+ isset_cfname = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ if (!isset_cfname)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ return xfer;
+}
+
+uint32_t Cassandra_truncate_args::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("Cassandra_truncate_args");
+ xfer += oprot->writeFieldBegin("cfname", ::apache::thrift::protocol::T_STRING, 1);
+ xfer += oprot->writeString(this->cfname);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_truncate_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("Cassandra_truncate_pargs");
+ xfer += oprot->writeFieldBegin("cfname", ::apache::thrift::protocol::T_STRING, 1);
+ xfer += oprot->writeString((*(this->cfname)));
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_truncate_result::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->ire.read(iprot);
+ this->__isset.ire = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 2:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->ue.read(iprot);
+ this->__isset.ue = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 3:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->te.read(iprot);
+ this->__isset.te = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
+uint32_t Cassandra_truncate_result::write(::apache::thrift::protocol::TProtocol* oprot) const {
+
+ uint32_t xfer = 0;
+
+ xfer += oprot->writeStructBegin("Cassandra_truncate_result");
+
+ if (this->__isset.ire) {
+ xfer += oprot->writeFieldBegin("ire", ::apache::thrift::protocol::T_STRUCT, 1);
+ xfer += this->ire.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ } else if (this->__isset.ue) {
+ xfer += oprot->writeFieldBegin("ue", ::apache::thrift::protocol::T_STRUCT, 2);
+ xfer += this->ue.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ } else if (this->__isset.te) {
+ xfer += oprot->writeFieldBegin("te", ::apache::thrift::protocol::T_STRUCT, 3);
+ xfer += this->te.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ }
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_truncate_presult::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->ire.read(iprot);
+ this->__isset.ire = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 2:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->ue.read(iprot);
+ this->__isset.ue = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 3:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->te.read(iprot);
+ this->__isset.te = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
+uint32_t Cassandra_describe_schema_versions_args::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
+uint32_t Cassandra_describe_schema_versions_args::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("Cassandra_describe_schema_versions_args");
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_describe_schema_versions_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("Cassandra_describe_schema_versions_pargs");
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_describe_schema_versions_result::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 0:
+ if (ftype == ::apache::thrift::protocol::T_MAP) {
+ {
+ this->success.clear();
+ uint32_t _size286;
+ ::apache::thrift::protocol::TType _ktype287;
+ ::apache::thrift::protocol::TType _vtype288;
+ iprot->readMapBegin(_ktype287, _vtype288, _size286);
+ uint32_t _i290;
+ for (_i290 = 0; _i290 < _size286; ++_i290)
+ {
+ std::string _key291;
+ xfer += iprot->readString(_key291);
+ std::vector<std::string> & _val292 = this->success[_key291];
+ {
+ _val292.clear();
+ uint32_t _size293;
+ ::apache::thrift::protocol::TType _etype296;
+ iprot->readListBegin(_etype296, _size293);
+ _val292.resize(_size293);
+ uint32_t _i297;
+ for (_i297 = 0; _i297 < _size293; ++_i297)
+ {
+ xfer += iprot->readString(_val292[_i297]);
+ }
+ iprot->readListEnd();
+ }
+ }
+ iprot->readMapEnd();
+ }
+ this->__isset.success = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->ire.read(iprot);
+ this->__isset.ire = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
+uint32_t Cassandra_describe_schema_versions_result::write(::apache::thrift::protocol::TProtocol* oprot) const {
+
+ uint32_t xfer = 0;
+
+ xfer += oprot->writeStructBegin("Cassandra_describe_schema_versions_result");
+
+ if (this->__isset.success) {
+ xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_MAP, 0);
+ {
+ xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_LIST, static_cast<uint32_t>(this->success.size()));
+ std::map<std::string, std::vector<std::string> > ::const_iterator _iter298;
+ for (_iter298 = this->success.begin(); _iter298 != this->success.end(); ++_iter298)
+ {
+ xfer += oprot->writeString(_iter298->first);
+ {
+ xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast<uint32_t>(_iter298->second.size()));
+ std::vector<std::string> ::const_iterator _iter299;
+ for (_iter299 = _iter298->second.begin(); _iter299 != _iter298->second.end(); ++_iter299)
+ {
+ xfer += oprot->writeString((*_iter299));
+ }
+ xfer += oprot->writeListEnd();
+ }
+ }
+ xfer += oprot->writeMapEnd();
+ }
+ xfer += oprot->writeFieldEnd();
+ } else if (this->__isset.ire) {
+ xfer += oprot->writeFieldBegin("ire", ::apache::thrift::protocol::T_STRUCT, 1);
+ xfer += this->ire.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ }
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_describe_schema_versions_presult::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 0:
+ if (ftype == ::apache::thrift::protocol::T_MAP) {
+ {
+ (*(this->success)).clear();
+ uint32_t _size300;
+ ::apache::thrift::protocol::TType _ktype301;
+ ::apache::thrift::protocol::TType _vtype302;
+ iprot->readMapBegin(_ktype301, _vtype302, _size300);
+ uint32_t _i304;
+ for (_i304 = 0; _i304 < _size300; ++_i304)
+ {
+ std::string _key305;
+ xfer += iprot->readString(_key305);
+ std::vector<std::string> & _val306 = (*(this->success))[_key305];
+ {
+ _val306.clear();
+ uint32_t _size307;
+ ::apache::thrift::protocol::TType _etype310;
+ iprot->readListBegin(_etype310, _size307);
+ _val306.resize(_size307);
+ uint32_t _i311;
+ for (_i311 = 0; _i311 < _size307; ++_i311)
+ {
+ xfer += iprot->readString(_val306[_i311]);
+ }
+ iprot->readListEnd();
+ }
+ }
+ iprot->readMapEnd();
+ }
+ this->__isset.success = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->ire.read(iprot);
+ this->__isset.ire = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
+uint32_t Cassandra_describe_keyspaces_args::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
+uint32_t Cassandra_describe_keyspaces_args::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("Cassandra_describe_keyspaces_args");
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_describe_keyspaces_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("Cassandra_describe_keyspaces_pargs");
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_describe_keyspaces_result::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 0:
+ if (ftype == ::apache::thrift::protocol::T_LIST) {
+ {
+ this->success.clear();
+ uint32_t _size312;
+ ::apache::thrift::protocol::TType _etype315;
+ iprot->readListBegin(_etype315, _size312);
+ this->success.resize(_size312);
+ uint32_t _i316;
+ for (_i316 = 0; _i316 < _size312; ++_i316)
+ {
+ xfer += this->success[_i316].read(iprot);
+ }
+ iprot->readListEnd();
+ }
+ this->__isset.success = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->ire.read(iprot);
+ this->__isset.ire = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
+uint32_t Cassandra_describe_keyspaces_result::write(::apache::thrift::protocol::TProtocol* oprot) const {
+
+ uint32_t xfer = 0;
+
+ xfer += oprot->writeStructBegin("Cassandra_describe_keyspaces_result");
+
+ if (this->__isset.success) {
+ xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_LIST, 0);
+ {
+ xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast<uint32_t>(this->success.size()));
+ std::vector<KsDef> ::const_iterator _iter317;
+ for (_iter317 = this->success.begin(); _iter317 != this->success.end(); ++_iter317)
+ {
+ xfer += (*_iter317).write(oprot);
+ }
+ xfer += oprot->writeListEnd();
+ }
+ xfer += oprot->writeFieldEnd();
+ } else if (this->__isset.ire) {
+ xfer += oprot->writeFieldBegin("ire", ::apache::thrift::protocol::T_STRUCT, 1);
+ xfer += this->ire.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ }
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_describe_keyspaces_presult::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 0:
+ if (ftype == ::apache::thrift::protocol::T_LIST) {
+ {
+ (*(this->success)).clear();
+ uint32_t _size318;
+ ::apache::thrift::protocol::TType _etype321;
+ iprot->readListBegin(_etype321, _size318);
+ (*(this->success)).resize(_size318);
+ uint32_t _i322;
+ for (_i322 = 0; _i322 < _size318; ++_i322)
+ {
+ xfer += (*(this->success))[_i322].read(iprot);
+ }
+ iprot->readListEnd();
+ }
+ this->__isset.success = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->ire.read(iprot);
+ this->__isset.ire = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
+uint32_t Cassandra_describe_cluster_name_args::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
+uint32_t Cassandra_describe_cluster_name_args::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("Cassandra_describe_cluster_name_args");
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_describe_cluster_name_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("Cassandra_describe_cluster_name_pargs");
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_describe_cluster_name_result::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 0:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readString(this->success);
+ this->__isset.success = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
+uint32_t Cassandra_describe_cluster_name_result::write(::apache::thrift::protocol::TProtocol* oprot) const {
+
+ uint32_t xfer = 0;
+
+ xfer += oprot->writeStructBegin("Cassandra_describe_cluster_name_result");
+
+ if (this->__isset.success) {
+ xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRING, 0);
+ xfer += oprot->writeString(this->success);
+ xfer += oprot->writeFieldEnd();
+ }
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_describe_cluster_name_presult::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 0:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readString((*(this->success)));
+ this->__isset.success = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
+uint32_t Cassandra_describe_version_args::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
+uint32_t Cassandra_describe_version_args::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("Cassandra_describe_version_args");
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_describe_version_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("Cassandra_describe_version_pargs");
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_describe_version_result::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 0:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readString(this->success);
+ this->__isset.success = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
+uint32_t Cassandra_describe_version_result::write(::apache::thrift::protocol::TProtocol* oprot) const {
+
+ uint32_t xfer = 0;
+
+ xfer += oprot->writeStructBegin("Cassandra_describe_version_result");
+
+ if (this->__isset.success) {
+ xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRING, 0);
+ xfer += oprot->writeString(this->success);
+ xfer += oprot->writeFieldEnd();
+ }
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_describe_version_presult::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 0:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readString((*(this->success)));
+ this->__isset.success = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
+uint32_t Cassandra_describe_ring_args::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+ bool isset_keyspace = false;
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readString(this->keyspace);
+ isset_keyspace = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ if (!isset_keyspace)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ return xfer;
+}
+
+uint32_t Cassandra_describe_ring_args::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("Cassandra_describe_ring_args");
+ xfer += oprot->writeFieldBegin("keyspace", ::apache::thrift::protocol::T_STRING, 1);
+ xfer += oprot->writeString(this->keyspace);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_describe_ring_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("Cassandra_describe_ring_pargs");
+ xfer += oprot->writeFieldBegin("keyspace", ::apache::thrift::protocol::T_STRING, 1);
+ xfer += oprot->writeString((*(this->keyspace)));
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_describe_ring_result::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 0:
+ if (ftype == ::apache::thrift::protocol::T_LIST) {
+ {
+ this->success.clear();
+ uint32_t _size323;
+ ::apache::thrift::protocol::TType _etype326;
+ iprot->readListBegin(_etype326, _size323);
+ this->success.resize(_size323);
+ uint32_t _i327;
+ for (_i327 = 0; _i327 < _size323; ++_i327)
+ {
+ xfer += this->success[_i327].read(iprot);
+ }
+ iprot->readListEnd();
+ }
+ this->__isset.success = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->ire.read(iprot);
+ this->__isset.ire = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
+uint32_t Cassandra_describe_ring_result::write(::apache::thrift::protocol::TProtocol* oprot) const {
+
+ uint32_t xfer = 0;
+
+ xfer += oprot->writeStructBegin("Cassandra_describe_ring_result");
+
+ if (this->__isset.success) {
+ xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_LIST, 0);
+ {
+ xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast<uint32_t>(this->success.size()));
+ std::vector<TokenRange> ::const_iterator _iter328;
+ for (_iter328 = this->success.begin(); _iter328 != this->success.end(); ++_iter328)
+ {
+ xfer += (*_iter328).write(oprot);
+ }
+ xfer += oprot->writeListEnd();
+ }
+ xfer += oprot->writeFieldEnd();
+ } else if (this->__isset.ire) {
+ xfer += oprot->writeFieldBegin("ire", ::apache::thrift::protocol::T_STRUCT, 1);
+ xfer += this->ire.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ }
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_describe_ring_presult::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 0:
+ if (ftype == ::apache::thrift::protocol::T_LIST) {
+ {
+ (*(this->success)).clear();
+ uint32_t _size329;
+ ::apache::thrift::protocol::TType _etype332;
+ iprot->readListBegin(_etype332, _size329);
+ (*(this->success)).resize(_size329);
+ uint32_t _i333;
+ for (_i333 = 0; _i333 < _size329; ++_i333)
+ {
+ xfer += (*(this->success))[_i333].read(iprot);
+ }
+ iprot->readListEnd();
+ }
+ this->__isset.success = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->ire.read(iprot);
+ this->__isset.ire = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
+uint32_t Cassandra_describe_token_map_args::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
+uint32_t Cassandra_describe_token_map_args::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("Cassandra_describe_token_map_args");
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_describe_token_map_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("Cassandra_describe_token_map_pargs");
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_describe_token_map_result::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 0:
+ if (ftype == ::apache::thrift::protocol::T_MAP) {
+ {
+ this->success.clear();
+ uint32_t _size334;
+ ::apache::thrift::protocol::TType _ktype335;
+ ::apache::thrift::protocol::TType _vtype336;
+ iprot->readMapBegin(_ktype335, _vtype336, _size334);
+ uint32_t _i338;
+ for (_i338 = 0; _i338 < _size334; ++_i338)
+ {
+ std::string _key339;
+ xfer += iprot->readString(_key339);
+ std::string& _val340 = this->success[_key339];
+ xfer += iprot->readString(_val340);
+ }
+ iprot->readMapEnd();
+ }
+ this->__isset.success = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->ire.read(iprot);
+ this->__isset.ire = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
+uint32_t Cassandra_describe_token_map_result::write(::apache::thrift::protocol::TProtocol* oprot) const {
+
+ uint32_t xfer = 0;
+
+ xfer += oprot->writeStructBegin("Cassandra_describe_token_map_result");
+
+ if (this->__isset.success) {
+ xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_MAP, 0);
+ {
+ xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_STRING, static_cast<uint32_t>(this->success.size()));
+ std::map<std::string, std::string> ::const_iterator _iter341;
+ for (_iter341 = this->success.begin(); _iter341 != this->success.end(); ++_iter341)
+ {
+ xfer += oprot->writeString(_iter341->first);
+ xfer += oprot->writeString(_iter341->second);
+ }
+ xfer += oprot->writeMapEnd();
+ }
+ xfer += oprot->writeFieldEnd();
+ } else if (this->__isset.ire) {
+ xfer += oprot->writeFieldBegin("ire", ::apache::thrift::protocol::T_STRUCT, 1);
+ xfer += this->ire.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ }
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_describe_token_map_presult::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 0:
+ if (ftype == ::apache::thrift::protocol::T_MAP) {
+ {
+ (*(this->success)).clear();
+ uint32_t _size342;
+ ::apache::thrift::protocol::TType _ktype343;
+ ::apache::thrift::protocol::TType _vtype344;
+ iprot->readMapBegin(_ktype343, _vtype344, _size342);
+ uint32_t _i346;
+ for (_i346 = 0; _i346 < _size342; ++_i346)
+ {
+ std::string _key347;
+ xfer += iprot->readString(_key347);
+ std::string& _val348 = (*(this->success))[_key347];
+ xfer += iprot->readString(_val348);
+ }
+ iprot->readMapEnd();
+ }
+ this->__isset.success = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->ire.read(iprot);
+ this->__isset.ire = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
+uint32_t Cassandra_describe_partitioner_args::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
+uint32_t Cassandra_describe_partitioner_args::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("Cassandra_describe_partitioner_args");
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_describe_partitioner_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("Cassandra_describe_partitioner_pargs");
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_describe_partitioner_result::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 0:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readString(this->success);
+ this->__isset.success = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
+uint32_t Cassandra_describe_partitioner_result::write(::apache::thrift::protocol::TProtocol* oprot) const {
+
+ uint32_t xfer = 0;
+
+ xfer += oprot->writeStructBegin("Cassandra_describe_partitioner_result");
+
+ if (this->__isset.success) {
+ xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRING, 0);
+ xfer += oprot->writeString(this->success);
+ xfer += oprot->writeFieldEnd();
+ }
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_describe_partitioner_presult::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 0:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readString((*(this->success)));
+ this->__isset.success = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
+uint32_t Cassandra_describe_snitch_args::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
+uint32_t Cassandra_describe_snitch_args::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("Cassandra_describe_snitch_args");
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_describe_snitch_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("Cassandra_describe_snitch_pargs");
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_describe_snitch_result::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 0:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readString(this->success);
+ this->__isset.success = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
+uint32_t Cassandra_describe_snitch_result::write(::apache::thrift::protocol::TProtocol* oprot) const {
+
+ uint32_t xfer = 0;
+
+ xfer += oprot->writeStructBegin("Cassandra_describe_snitch_result");
+
+ if (this->__isset.success) {
+ xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRING, 0);
+ xfer += oprot->writeString(this->success);
+ xfer += oprot->writeFieldEnd();
+ }
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_describe_snitch_presult::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 0:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readString((*(this->success)));
+ this->__isset.success = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
+uint32_t Cassandra_describe_keyspace_args::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+ bool isset_keyspace = false;
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readString(this->keyspace);
+ isset_keyspace = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ if (!isset_keyspace)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ return xfer;
+}
+
+uint32_t Cassandra_describe_keyspace_args::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("Cassandra_describe_keyspace_args");
+ xfer += oprot->writeFieldBegin("keyspace", ::apache::thrift::protocol::T_STRING, 1);
+ xfer += oprot->writeString(this->keyspace);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_describe_keyspace_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("Cassandra_describe_keyspace_pargs");
+ xfer += oprot->writeFieldBegin("keyspace", ::apache::thrift::protocol::T_STRING, 1);
+ xfer += oprot->writeString((*(this->keyspace)));
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_describe_keyspace_result::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 0:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->success.read(iprot);
+ this->__isset.success = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->nfe.read(iprot);
+ this->__isset.nfe = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 2:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->ire.read(iprot);
+ this->__isset.ire = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
+uint32_t Cassandra_describe_keyspace_result::write(::apache::thrift::protocol::TProtocol* oprot) const {
+
+ uint32_t xfer = 0;
+
+ xfer += oprot->writeStructBegin("Cassandra_describe_keyspace_result");
+
+ if (this->__isset.success) {
+ xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0);
+ xfer += this->success.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ } else if (this->__isset.nfe) {
+ xfer += oprot->writeFieldBegin("nfe", ::apache::thrift::protocol::T_STRUCT, 1);
+ xfer += this->nfe.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ } else if (this->__isset.ire) {
+ xfer += oprot->writeFieldBegin("ire", ::apache::thrift::protocol::T_STRUCT, 2);
+ xfer += this->ire.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ }
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_describe_keyspace_presult::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 0:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += (*(this->success)).read(iprot);
+ this->__isset.success = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->nfe.read(iprot);
+ this->__isset.nfe = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 2:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->ire.read(iprot);
+ this->__isset.ire = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
+uint32_t Cassandra_describe_splits_args::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+ bool isset_cfName = false;
+ bool isset_start_token = false;
+ bool isset_end_token = false;
+ bool isset_keys_per_split = false;
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readString(this->cfName);
+ isset_cfName = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 2:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readString(this->start_token);
+ isset_start_token = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 3:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readString(this->end_token);
+ isset_end_token = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 4:
+ if (ftype == ::apache::thrift::protocol::T_I32) {
+ xfer += iprot->readI32(this->keys_per_split);
+ isset_keys_per_split = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ if (!isset_cfName)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ if (!isset_start_token)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ if (!isset_end_token)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ if (!isset_keys_per_split)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ return xfer;
+}
+
+uint32_t Cassandra_describe_splits_args::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("Cassandra_describe_splits_args");
+ xfer += oprot->writeFieldBegin("cfName", ::apache::thrift::protocol::T_STRING, 1);
+ xfer += oprot->writeString(this->cfName);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldBegin("start_token", ::apache::thrift::protocol::T_STRING, 2);
+ xfer += oprot->writeString(this->start_token);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldBegin("end_token", ::apache::thrift::protocol::T_STRING, 3);
+ xfer += oprot->writeString(this->end_token);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldBegin("keys_per_split", ::apache::thrift::protocol::T_I32, 4);
+ xfer += oprot->writeI32(this->keys_per_split);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_describe_splits_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("Cassandra_describe_splits_pargs");
+ xfer += oprot->writeFieldBegin("cfName", ::apache::thrift::protocol::T_STRING, 1);
+ xfer += oprot->writeString((*(this->cfName)));
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldBegin("start_token", ::apache::thrift::protocol::T_STRING, 2);
+ xfer += oprot->writeString((*(this->start_token)));
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldBegin("end_token", ::apache::thrift::protocol::T_STRING, 3);
+ xfer += oprot->writeString((*(this->end_token)));
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldBegin("keys_per_split", ::apache::thrift::protocol::T_I32, 4);
+ xfer += oprot->writeI32((*(this->keys_per_split)));
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_describe_splits_result::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 0:
+ if (ftype == ::apache::thrift::protocol::T_LIST) {
+ {
+ this->success.clear();
+ uint32_t _size349;
+ ::apache::thrift::protocol::TType _etype352;
+ iprot->readListBegin(_etype352, _size349);
+ this->success.resize(_size349);
+ uint32_t _i353;
+ for (_i353 = 0; _i353 < _size349; ++_i353)
+ {
+ xfer += iprot->readString(this->success[_i353]);
+ }
+ iprot->readListEnd();
+ }
+ this->__isset.success = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->ire.read(iprot);
+ this->__isset.ire = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
+uint32_t Cassandra_describe_splits_result::write(::apache::thrift::protocol::TProtocol* oprot) const {
+
+ uint32_t xfer = 0;
+
+ xfer += oprot->writeStructBegin("Cassandra_describe_splits_result");
+
+ if (this->__isset.success) {
+ xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_LIST, 0);
+ {
+ xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast<uint32_t>(this->success.size()));
+ std::vector<std::string> ::const_iterator _iter354;
+ for (_iter354 = this->success.begin(); _iter354 != this->success.end(); ++_iter354)
+ {
+ xfer += oprot->writeString((*_iter354));
+ }
+ xfer += oprot->writeListEnd();
+ }
+ xfer += oprot->writeFieldEnd();
+ } else if (this->__isset.ire) {
+ xfer += oprot->writeFieldBegin("ire", ::apache::thrift::protocol::T_STRUCT, 1);
+ xfer += this->ire.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ }
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_describe_splits_presult::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 0:
+ if (ftype == ::apache::thrift::protocol::T_LIST) {
+ {
+ (*(this->success)).clear();
+ uint32_t _size355;
+ ::apache::thrift::protocol::TType _etype358;
+ iprot->readListBegin(_etype358, _size355);
+ (*(this->success)).resize(_size355);
+ uint32_t _i359;
+ for (_i359 = 0; _i359 < _size355; ++_i359)
+ {
+ xfer += iprot->readString((*(this->success))[_i359]);
+ }
+ iprot->readListEnd();
+ }
+ this->__isset.success = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->ire.read(iprot);
+ this->__isset.ire = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
+uint32_t Cassandra_system_add_column_family_args::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+ bool isset_cf_def = false;
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->cf_def.read(iprot);
+ isset_cf_def = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ if (!isset_cf_def)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ return xfer;
+}
+
+uint32_t Cassandra_system_add_column_family_args::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("Cassandra_system_add_column_family_args");
+ xfer += oprot->writeFieldBegin("cf_def", ::apache::thrift::protocol::T_STRUCT, 1);
+ xfer += this->cf_def.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_system_add_column_family_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("Cassandra_system_add_column_family_pargs");
+ xfer += oprot->writeFieldBegin("cf_def", ::apache::thrift::protocol::T_STRUCT, 1);
+ xfer += (*(this->cf_def)).write(oprot);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_system_add_column_family_result::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 0:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readString(this->success);
+ this->__isset.success = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->ire.read(iprot);
+ this->__isset.ire = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 2:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->sde.read(iprot);
+ this->__isset.sde = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
+uint32_t Cassandra_system_add_column_family_result::write(::apache::thrift::protocol::TProtocol* oprot) const {
+
+ uint32_t xfer = 0;
+
+ xfer += oprot->writeStructBegin("Cassandra_system_add_column_family_result");
+
+ if (this->__isset.success) {
+ xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRING, 0);
+ xfer += oprot->writeString(this->success);
+ xfer += oprot->writeFieldEnd();
+ } else if (this->__isset.ire) {
+ xfer += oprot->writeFieldBegin("ire", ::apache::thrift::protocol::T_STRUCT, 1);
+ xfer += this->ire.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ } else if (this->__isset.sde) {
+ xfer += oprot->writeFieldBegin("sde", ::apache::thrift::protocol::T_STRUCT, 2);
+ xfer += this->sde.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ }
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_system_add_column_family_presult::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 0:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readString((*(this->success)));
+ this->__isset.success = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->ire.read(iprot);
+ this->__isset.ire = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 2:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->sde.read(iprot);
+ this->__isset.sde = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
+uint32_t Cassandra_system_drop_column_family_args::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+ bool isset_column_family = false;
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readString(this->column_family);
+ isset_column_family = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ if (!isset_column_family)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ return xfer;
+}
+
+uint32_t Cassandra_system_drop_column_family_args::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("Cassandra_system_drop_column_family_args");
+ xfer += oprot->writeFieldBegin("column_family", ::apache::thrift::protocol::T_STRING, 1);
+ xfer += oprot->writeString(this->column_family);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_system_drop_column_family_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("Cassandra_system_drop_column_family_pargs");
+ xfer += oprot->writeFieldBegin("column_family", ::apache::thrift::protocol::T_STRING, 1);
+ xfer += oprot->writeString((*(this->column_family)));
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_system_drop_column_family_result::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 0:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readString(this->success);
+ this->__isset.success = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->ire.read(iprot);
+ this->__isset.ire = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 2:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->sde.read(iprot);
+ this->__isset.sde = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
+uint32_t Cassandra_system_drop_column_family_result::write(::apache::thrift::protocol::TProtocol* oprot) const {
+
+ uint32_t xfer = 0;
+
+ xfer += oprot->writeStructBegin("Cassandra_system_drop_column_family_result");
+
+ if (this->__isset.success) {
+ xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRING, 0);
+ xfer += oprot->writeString(this->success);
+ xfer += oprot->writeFieldEnd();
+ } else if (this->__isset.ire) {
+ xfer += oprot->writeFieldBegin("ire", ::apache::thrift::protocol::T_STRUCT, 1);
+ xfer += this->ire.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ } else if (this->__isset.sde) {
+ xfer += oprot->writeFieldBegin("sde", ::apache::thrift::protocol::T_STRUCT, 2);
+ xfer += this->sde.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ }
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_system_drop_column_family_presult::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 0:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readString((*(this->success)));
+ this->__isset.success = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->ire.read(iprot);
+ this->__isset.ire = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 2:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->sde.read(iprot);
+ this->__isset.sde = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
+uint32_t Cassandra_system_add_keyspace_args::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+ bool isset_ks_def = false;
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->ks_def.read(iprot);
+ isset_ks_def = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ if (!isset_ks_def)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ return xfer;
+}
+
+uint32_t Cassandra_system_add_keyspace_args::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("Cassandra_system_add_keyspace_args");
+ xfer += oprot->writeFieldBegin("ks_def", ::apache::thrift::protocol::T_STRUCT, 1);
+ xfer += this->ks_def.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_system_add_keyspace_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("Cassandra_system_add_keyspace_pargs");
+ xfer += oprot->writeFieldBegin("ks_def", ::apache::thrift::protocol::T_STRUCT, 1);
+ xfer += (*(this->ks_def)).write(oprot);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_system_add_keyspace_result::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 0:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readString(this->success);
+ this->__isset.success = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->ire.read(iprot);
+ this->__isset.ire = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 2:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->sde.read(iprot);
+ this->__isset.sde = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
+uint32_t Cassandra_system_add_keyspace_result::write(::apache::thrift::protocol::TProtocol* oprot) const {
+
+ uint32_t xfer = 0;
+
+ xfer += oprot->writeStructBegin("Cassandra_system_add_keyspace_result");
+
+ if (this->__isset.success) {
+ xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRING, 0);
+ xfer += oprot->writeString(this->success);
+ xfer += oprot->writeFieldEnd();
+ } else if (this->__isset.ire) {
+ xfer += oprot->writeFieldBegin("ire", ::apache::thrift::protocol::T_STRUCT, 1);
+ xfer += this->ire.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ } else if (this->__isset.sde) {
+ xfer += oprot->writeFieldBegin("sde", ::apache::thrift::protocol::T_STRUCT, 2);
+ xfer += this->sde.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ }
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_system_add_keyspace_presult::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 0:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readString((*(this->success)));
+ this->__isset.success = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->ire.read(iprot);
+ this->__isset.ire = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 2:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->sde.read(iprot);
+ this->__isset.sde = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
+uint32_t Cassandra_system_drop_keyspace_args::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+ bool isset_keyspace = false;
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readString(this->keyspace);
+ isset_keyspace = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ if (!isset_keyspace)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ return xfer;
+}
+
+uint32_t Cassandra_system_drop_keyspace_args::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("Cassandra_system_drop_keyspace_args");
+ xfer += oprot->writeFieldBegin("keyspace", ::apache::thrift::protocol::T_STRING, 1);
+ xfer += oprot->writeString(this->keyspace);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_system_drop_keyspace_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("Cassandra_system_drop_keyspace_pargs");
+ xfer += oprot->writeFieldBegin("keyspace", ::apache::thrift::protocol::T_STRING, 1);
+ xfer += oprot->writeString((*(this->keyspace)));
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_system_drop_keyspace_result::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 0:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readString(this->success);
+ this->__isset.success = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->ire.read(iprot);
+ this->__isset.ire = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 2:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->sde.read(iprot);
+ this->__isset.sde = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
+uint32_t Cassandra_system_drop_keyspace_result::write(::apache::thrift::protocol::TProtocol* oprot) const {
+
+ uint32_t xfer = 0;
+
+ xfer += oprot->writeStructBegin("Cassandra_system_drop_keyspace_result");
+
+ if (this->__isset.success) {
+ xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRING, 0);
+ xfer += oprot->writeString(this->success);
+ xfer += oprot->writeFieldEnd();
+ } else if (this->__isset.ire) {
+ xfer += oprot->writeFieldBegin("ire", ::apache::thrift::protocol::T_STRUCT, 1);
+ xfer += this->ire.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ } else if (this->__isset.sde) {
+ xfer += oprot->writeFieldBegin("sde", ::apache::thrift::protocol::T_STRUCT, 2);
+ xfer += this->sde.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ }
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_system_drop_keyspace_presult::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 0:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readString((*(this->success)));
+ this->__isset.success = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->ire.read(iprot);
+ this->__isset.ire = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 2:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->sde.read(iprot);
+ this->__isset.sde = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
+uint32_t Cassandra_system_update_keyspace_args::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+ bool isset_ks_def = false;
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->ks_def.read(iprot);
+ isset_ks_def = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ if (!isset_ks_def)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ return xfer;
+}
+
+uint32_t Cassandra_system_update_keyspace_args::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("Cassandra_system_update_keyspace_args");
+ xfer += oprot->writeFieldBegin("ks_def", ::apache::thrift::protocol::T_STRUCT, 1);
+ xfer += this->ks_def.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_system_update_keyspace_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("Cassandra_system_update_keyspace_pargs");
+ xfer += oprot->writeFieldBegin("ks_def", ::apache::thrift::protocol::T_STRUCT, 1);
+ xfer += (*(this->ks_def)).write(oprot);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_system_update_keyspace_result::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 0:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readString(this->success);
+ this->__isset.success = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->ire.read(iprot);
+ this->__isset.ire = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 2:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->sde.read(iprot);
+ this->__isset.sde = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
+uint32_t Cassandra_system_update_keyspace_result::write(::apache::thrift::protocol::TProtocol* oprot) const {
+
+ uint32_t xfer = 0;
+
+ xfer += oprot->writeStructBegin("Cassandra_system_update_keyspace_result");
+
+ if (this->__isset.success) {
+ xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRING, 0);
+ xfer += oprot->writeString(this->success);
+ xfer += oprot->writeFieldEnd();
+ } else if (this->__isset.ire) {
+ xfer += oprot->writeFieldBegin("ire", ::apache::thrift::protocol::T_STRUCT, 1);
+ xfer += this->ire.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ } else if (this->__isset.sde) {
+ xfer += oprot->writeFieldBegin("sde", ::apache::thrift::protocol::T_STRUCT, 2);
+ xfer += this->sde.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ }
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_system_update_keyspace_presult::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 0:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readString((*(this->success)));
+ this->__isset.success = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->ire.read(iprot);
+ this->__isset.ire = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 2:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->sde.read(iprot);
+ this->__isset.sde = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
+uint32_t Cassandra_system_update_column_family_args::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+ bool isset_cf_def = false;
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->cf_def.read(iprot);
+ isset_cf_def = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ if (!isset_cf_def)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ return xfer;
+}
+
+uint32_t Cassandra_system_update_column_family_args::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("Cassandra_system_update_column_family_args");
+ xfer += oprot->writeFieldBegin("cf_def", ::apache::thrift::protocol::T_STRUCT, 1);
+ xfer += this->cf_def.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_system_update_column_family_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("Cassandra_system_update_column_family_pargs");
+ xfer += oprot->writeFieldBegin("cf_def", ::apache::thrift::protocol::T_STRUCT, 1);
+ xfer += (*(this->cf_def)).write(oprot);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_system_update_column_family_result::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 0:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readString(this->success);
+ this->__isset.success = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->ire.read(iprot);
+ this->__isset.ire = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 2:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->sde.read(iprot);
+ this->__isset.sde = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
+uint32_t Cassandra_system_update_column_family_result::write(::apache::thrift::protocol::TProtocol* oprot) const {
+
+ uint32_t xfer = 0;
+
+ xfer += oprot->writeStructBegin("Cassandra_system_update_column_family_result");
+
+ if (this->__isset.success) {
+ xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRING, 0);
+ xfer += oprot->writeString(this->success);
+ xfer += oprot->writeFieldEnd();
+ } else if (this->__isset.ire) {
+ xfer += oprot->writeFieldBegin("ire", ::apache::thrift::protocol::T_STRUCT, 1);
+ xfer += this->ire.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ } else if (this->__isset.sde) {
+ xfer += oprot->writeFieldBegin("sde", ::apache::thrift::protocol::T_STRUCT, 2);
+ xfer += this->sde.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ }
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_system_update_column_family_presult::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 0:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readString((*(this->success)));
+ this->__isset.success = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->ire.read(iprot);
+ this->__isset.ire = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 2:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->sde.read(iprot);
+ this->__isset.sde = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
+uint32_t Cassandra_execute_cql_query_args::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+ bool isset_query = false;
+ bool isset_compression = false;
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readBinary(this->query);
+ isset_query = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 2:
+ if (ftype == ::apache::thrift::protocol::T_I32) {
+ int32_t ecast360;
+ xfer += iprot->readI32(ecast360);
+ this->compression = (Compression::type)ecast360;
+ isset_compression = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ if (!isset_query)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ if (!isset_compression)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ return xfer;
+}
+
+uint32_t Cassandra_execute_cql_query_args::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("Cassandra_execute_cql_query_args");
+ xfer += oprot->writeFieldBegin("query", ::apache::thrift::protocol::T_STRING, 1);
+ xfer += oprot->writeBinary(this->query);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldBegin("compression", ::apache::thrift::protocol::T_I32, 2);
+ xfer += oprot->writeI32((int32_t)this->compression);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_execute_cql_query_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("Cassandra_execute_cql_query_pargs");
+ xfer += oprot->writeFieldBegin("query", ::apache::thrift::protocol::T_STRING, 1);
+ xfer += oprot->writeBinary((*(this->query)));
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldBegin("compression", ::apache::thrift::protocol::T_I32, 2);
+ xfer += oprot->writeI32((int32_t)(*(this->compression)));
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_execute_cql_query_result::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 0:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->success.read(iprot);
+ this->__isset.success = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->ire.read(iprot);
+ this->__isset.ire = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 2:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->ue.read(iprot);
+ this->__isset.ue = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 3:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->te.read(iprot);
+ this->__isset.te = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 4:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->sde.read(iprot);
+ this->__isset.sde = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
+uint32_t Cassandra_execute_cql_query_result::write(::apache::thrift::protocol::TProtocol* oprot) const {
+
+ uint32_t xfer = 0;
+
+ xfer += oprot->writeStructBegin("Cassandra_execute_cql_query_result");
+
+ if (this->__isset.success) {
+ xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0);
+ xfer += this->success.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ } else if (this->__isset.ire) {
+ xfer += oprot->writeFieldBegin("ire", ::apache::thrift::protocol::T_STRUCT, 1);
+ xfer += this->ire.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ } else if (this->__isset.ue) {
+ xfer += oprot->writeFieldBegin("ue", ::apache::thrift::protocol::T_STRUCT, 2);
+ xfer += this->ue.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ } else if (this->__isset.te) {
+ xfer += oprot->writeFieldBegin("te", ::apache::thrift::protocol::T_STRUCT, 3);
+ xfer += this->te.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ } else if (this->__isset.sde) {
+ xfer += oprot->writeFieldBegin("sde", ::apache::thrift::protocol::T_STRUCT, 4);
+ xfer += this->sde.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ }
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_execute_cql_query_presult::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 0:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += (*(this->success)).read(iprot);
+ this->__isset.success = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->ire.read(iprot);
+ this->__isset.ire = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 2:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->ue.read(iprot);
+ this->__isset.ue = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 3:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->te.read(iprot);
+ this->__isset.te = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 4:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->sde.read(iprot);
+ this->__isset.sde = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
+uint32_t Cassandra_prepare_cql_query_args::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+ bool isset_query = false;
+ bool isset_compression = false;
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readBinary(this->query);
+ isset_query = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 2:
+ if (ftype == ::apache::thrift::protocol::T_I32) {
+ int32_t ecast361;
+ xfer += iprot->readI32(ecast361);
+ this->compression = (Compression::type)ecast361;
+ isset_compression = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ if (!isset_query)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ if (!isset_compression)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ return xfer;
+}
+
+uint32_t Cassandra_prepare_cql_query_args::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("Cassandra_prepare_cql_query_args");
+ xfer += oprot->writeFieldBegin("query", ::apache::thrift::protocol::T_STRING, 1);
+ xfer += oprot->writeBinary(this->query);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldBegin("compression", ::apache::thrift::protocol::T_I32, 2);
+ xfer += oprot->writeI32((int32_t)this->compression);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_prepare_cql_query_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("Cassandra_prepare_cql_query_pargs");
+ xfer += oprot->writeFieldBegin("query", ::apache::thrift::protocol::T_STRING, 1);
+ xfer += oprot->writeBinary((*(this->query)));
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldBegin("compression", ::apache::thrift::protocol::T_I32, 2);
+ xfer += oprot->writeI32((int32_t)(*(this->compression)));
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_prepare_cql_query_result::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 0:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->success.read(iprot);
+ this->__isset.success = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->ire.read(iprot);
+ this->__isset.ire = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
+uint32_t Cassandra_prepare_cql_query_result::write(::apache::thrift::protocol::TProtocol* oprot) const {
+
+ uint32_t xfer = 0;
+
+ xfer += oprot->writeStructBegin("Cassandra_prepare_cql_query_result");
+
+ if (this->__isset.success) {
+ xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0);
+ xfer += this->success.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ } else if (this->__isset.ire) {
+ xfer += oprot->writeFieldBegin("ire", ::apache::thrift::protocol::T_STRUCT, 1);
+ xfer += this->ire.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ }
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_prepare_cql_query_presult::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 0:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += (*(this->success)).read(iprot);
+ this->__isset.success = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->ire.read(iprot);
+ this->__isset.ire = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
+uint32_t Cassandra_execute_prepared_cql_query_args::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+ bool isset_itemId = false;
+ bool isset_values = false;
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_I32) {
+ xfer += iprot->readI32(this->itemId);
+ isset_itemId = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 2:
+ if (ftype == ::apache::thrift::protocol::T_LIST) {
+ {
+ this->values.clear();
+ uint32_t _size362;
+ ::apache::thrift::protocol::TType _etype365;
+ iprot->readListBegin(_etype365, _size362);
+ this->values.resize(_size362);
+ uint32_t _i366;
+ for (_i366 = 0; _i366 < _size362; ++_i366)
+ {
+ xfer += iprot->readBinary(this->values[_i366]);
+ }
+ iprot->readListEnd();
+ }
+ isset_values = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ if (!isset_itemId)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ if (!isset_values)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ return xfer;
+}
+
+uint32_t Cassandra_execute_prepared_cql_query_args::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("Cassandra_execute_prepared_cql_query_args");
+ xfer += oprot->writeFieldBegin("itemId", ::apache::thrift::protocol::T_I32, 1);
+ xfer += oprot->writeI32(this->itemId);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldBegin("values", ::apache::thrift::protocol::T_LIST, 2);
+ {
+ xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast<uint32_t>(this->values.size()));
+ std::vector<std::string> ::const_iterator _iter367;
+ for (_iter367 = this->values.begin(); _iter367 != this->values.end(); ++_iter367)
+ {
+ xfer += oprot->writeBinary((*_iter367));
+ }
+ xfer += oprot->writeListEnd();
+ }
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_execute_prepared_cql_query_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("Cassandra_execute_prepared_cql_query_pargs");
+ xfer += oprot->writeFieldBegin("itemId", ::apache::thrift::protocol::T_I32, 1);
+ xfer += oprot->writeI32((*(this->itemId)));
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldBegin("values", ::apache::thrift::protocol::T_LIST, 2);
+ {
+ xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast<uint32_t>((*(this->values)).size()));
+ std::vector<std::string> ::const_iterator _iter368;
+ for (_iter368 = (*(this->values)).begin(); _iter368 != (*(this->values)).end(); ++_iter368)
+ {
+ xfer += oprot->writeBinary((*_iter368));
+ }
+ xfer += oprot->writeListEnd();
+ }
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_execute_prepared_cql_query_result::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 0:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->success.read(iprot);
+ this->__isset.success = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->ire.read(iprot);
+ this->__isset.ire = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 2:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->ue.read(iprot);
+ this->__isset.ue = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 3:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->te.read(iprot);
+ this->__isset.te = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 4:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->sde.read(iprot);
+ this->__isset.sde = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
+uint32_t Cassandra_execute_prepared_cql_query_result::write(::apache::thrift::protocol::TProtocol* oprot) const {
+
+ uint32_t xfer = 0;
+
+ xfer += oprot->writeStructBegin("Cassandra_execute_prepared_cql_query_result");
+
+ if (this->__isset.success) {
+ xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0);
+ xfer += this->success.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ } else if (this->__isset.ire) {
+ xfer += oprot->writeFieldBegin("ire", ::apache::thrift::protocol::T_STRUCT, 1);
+ xfer += this->ire.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ } else if (this->__isset.ue) {
+ xfer += oprot->writeFieldBegin("ue", ::apache::thrift::protocol::T_STRUCT, 2);
+ xfer += this->ue.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ } else if (this->__isset.te) {
+ xfer += oprot->writeFieldBegin("te", ::apache::thrift::protocol::T_STRUCT, 3);
+ xfer += this->te.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ } else if (this->__isset.sde) {
+ xfer += oprot->writeFieldBegin("sde", ::apache::thrift::protocol::T_STRUCT, 4);
+ xfer += this->sde.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ }
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_execute_prepared_cql_query_presult::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 0:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += (*(this->success)).read(iprot);
+ this->__isset.success = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->ire.read(iprot);
+ this->__isset.ire = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 2:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->ue.read(iprot);
+ this->__isset.ue = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 3:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->te.read(iprot);
+ this->__isset.te = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 4:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->sde.read(iprot);
+ this->__isset.sde = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
+uint32_t Cassandra_set_cql_version_args::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+ bool isset_version = false;
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readString(this->version);
+ isset_version = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ if (!isset_version)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ return xfer;
+}
+
+uint32_t Cassandra_set_cql_version_args::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("Cassandra_set_cql_version_args");
+ xfer += oprot->writeFieldBegin("version", ::apache::thrift::protocol::T_STRING, 1);
+ xfer += oprot->writeString(this->version);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_set_cql_version_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("Cassandra_set_cql_version_pargs");
+ xfer += oprot->writeFieldBegin("version", ::apache::thrift::protocol::T_STRING, 1);
+ xfer += oprot->writeString((*(this->version)));
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_set_cql_version_result::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->ire.read(iprot);
+ this->__isset.ire = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
+uint32_t Cassandra_set_cql_version_result::write(::apache::thrift::protocol::TProtocol* oprot) const {
+
+ uint32_t xfer = 0;
+
+ xfer += oprot->writeStructBegin("Cassandra_set_cql_version_result");
+
+ if (this->__isset.ire) {
+ xfer += oprot->writeFieldBegin("ire", ::apache::thrift::protocol::T_STRUCT, 1);
+ xfer += this->ire.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ }
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t Cassandra_set_cql_version_presult::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->ire.read(iprot);
+ this->__isset.ire = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
+void CassandraClient::login(const AuthenticationRequest& auth_request)
+{
+ send_login(auth_request);
+ recv_login();
+}
+
+void CassandraClient::send_login(const AuthenticationRequest& auth_request)
+{
+ int32_t cseqid = 0;
+ oprot_->writeMessageBegin("login", ::apache::thrift::protocol::T_CALL, cseqid);
+
+ Cassandra_login_pargs args;
+ args.auth_request = &auth_request;
+ args.write(oprot_);
+
+ oprot_->writeMessageEnd();
+ oprot_->getTransport()->writeEnd();
+ oprot_->getTransport()->flush();
+}
+
+void CassandraClient::recv_login()
+{
+
+ int32_t rseqid = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TMessageType mtype;
+
+ iprot_->readMessageBegin(fname, mtype, rseqid);
+ if (mtype == ::apache::thrift::protocol::T_EXCEPTION) {
+ ::apache::thrift::TApplicationException x;
+ x.read(iprot_);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ throw x;
+ }
+ if (mtype != ::apache::thrift::protocol::T_REPLY) {
+ iprot_->skip(::apache::thrift::protocol::T_STRUCT);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ }
+ if (fname.compare("login") != 0) {
+ iprot_->skip(::apache::thrift::protocol::T_STRUCT);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ }
+ Cassandra_login_presult result;
+ result.read(iprot_);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+
+ if (result.__isset.authnx) {
+ throw result.authnx;
+ }
+ if (result.__isset.authzx) {
+ throw result.authzx;
+ }
+ return;
+}
+
+void CassandraClient::set_keyspace(const std::string& keyspace)
+{
+ send_set_keyspace(keyspace);
+ recv_set_keyspace();
+}
+
+void CassandraClient::send_set_keyspace(const std::string& keyspace)
+{
+ int32_t cseqid = 0;
+ oprot_->writeMessageBegin("set_keyspace", ::apache::thrift::protocol::T_CALL, cseqid);
+
+ Cassandra_set_keyspace_pargs args;
+ args.keyspace = &keyspace;
+ args.write(oprot_);
+
+ oprot_->writeMessageEnd();
+ oprot_->getTransport()->writeEnd();
+ oprot_->getTransport()->flush();
+}
+
+void CassandraClient::recv_set_keyspace()
+{
+
+ int32_t rseqid = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TMessageType mtype;
+
+ iprot_->readMessageBegin(fname, mtype, rseqid);
+ if (mtype == ::apache::thrift::protocol::T_EXCEPTION) {
+ ::apache::thrift::TApplicationException x;
+ x.read(iprot_);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ throw x;
+ }
+ if (mtype != ::apache::thrift::protocol::T_REPLY) {
+ iprot_->skip(::apache::thrift::protocol::T_STRUCT);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ }
+ if (fname.compare("set_keyspace") != 0) {
+ iprot_->skip(::apache::thrift::protocol::T_STRUCT);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ }
+ Cassandra_set_keyspace_presult result;
+ result.read(iprot_);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+
+ if (result.__isset.ire) {
+ throw result.ire;
+ }
+ return;
+}
+
+void CassandraClient::get(ColumnOrSuperColumn& _return, const std::string& key, const ColumnPath& column_path, const ConsistencyLevel::type consistency_level)
+{
+ send_get(key, column_path, consistency_level);
+ recv_get(_return);
+}
+
+void CassandraClient::send_get(const std::string& key, const ColumnPath& column_path, const ConsistencyLevel::type consistency_level)
+{
+ int32_t cseqid = 0;
+ oprot_->writeMessageBegin("get", ::apache::thrift::protocol::T_CALL, cseqid);
+
+ Cassandra_get_pargs args;
+ args.key = &key;
+ args.column_path = &column_path;
+ args.consistency_level = &consistency_level;
+ args.write(oprot_);
+
+ oprot_->writeMessageEnd();
+ oprot_->getTransport()->writeEnd();
+ oprot_->getTransport()->flush();
+}
+
+void CassandraClient::recv_get(ColumnOrSuperColumn& _return)
+{
+
+ int32_t rseqid = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TMessageType mtype;
+
+ iprot_->readMessageBegin(fname, mtype, rseqid);
+ if (mtype == ::apache::thrift::protocol::T_EXCEPTION) {
+ ::apache::thrift::TApplicationException x;
+ x.read(iprot_);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ throw x;
+ }
+ if (mtype != ::apache::thrift::protocol::T_REPLY) {
+ iprot_->skip(::apache::thrift::protocol::T_STRUCT);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ }
+ if (fname.compare("get") != 0) {
+ iprot_->skip(::apache::thrift::protocol::T_STRUCT);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ }
+ Cassandra_get_presult result;
+ result.success = &_return;
+ result.read(iprot_);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+
+ if (result.__isset.success) {
+ // _return pointer has now been filled
+ return;
+ }
+ if (result.__isset.ire) {
+ throw result.ire;
+ }
+ if (result.__isset.nfe) {
+ throw result.nfe;
+ }
+ if (result.__isset.ue) {
+ throw result.ue;
+ }
+ if (result.__isset.te) {
+ throw result.te;
+ }
+ throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get failed: unknown result");
+}
+
+void CassandraClient::get_slice(std::vector<ColumnOrSuperColumn> & _return, const std::string& key, const ColumnParent& column_parent, const SlicePredicate& predicate, const ConsistencyLevel::type consistency_level)
+{
+ send_get_slice(key, column_parent, predicate, consistency_level);
+ recv_get_slice(_return);
+}
+
+void CassandraClient::send_get_slice(const std::string& key, const ColumnParent& column_parent, const SlicePredicate& predicate, const ConsistencyLevel::type consistency_level)
+{
+ int32_t cseqid = 0;
+ oprot_->writeMessageBegin("get_slice", ::apache::thrift::protocol::T_CALL, cseqid);
+
+ Cassandra_get_slice_pargs args;
+ args.key = &key;
+ args.column_parent = &column_parent;
+ args.predicate = &predicate;
+ args.consistency_level = &consistency_level;
+ args.write(oprot_);
+
+ oprot_->writeMessageEnd();
+ oprot_->getTransport()->writeEnd();
+ oprot_->getTransport()->flush();
+}
+
+void CassandraClient::recv_get_slice(std::vector<ColumnOrSuperColumn> & _return)
+{
+
+ int32_t rseqid = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TMessageType mtype;
+
+ iprot_->readMessageBegin(fname, mtype, rseqid);
+ if (mtype == ::apache::thrift::protocol::T_EXCEPTION) {
+ ::apache::thrift::TApplicationException x;
+ x.read(iprot_);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ throw x;
+ }
+ if (mtype != ::apache::thrift::protocol::T_REPLY) {
+ iprot_->skip(::apache::thrift::protocol::T_STRUCT);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ }
+ if (fname.compare("get_slice") != 0) {
+ iprot_->skip(::apache::thrift::protocol::T_STRUCT);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ }
+ Cassandra_get_slice_presult result;
+ result.success = &_return;
+ result.read(iprot_);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+
+ if (result.__isset.success) {
+ // _return pointer has now been filled
+ return;
+ }
+ if (result.__isset.ire) {
+ throw result.ire;
+ }
+ if (result.__isset.ue) {
+ throw result.ue;
+ }
+ if (result.__isset.te) {
+ throw result.te;
+ }
+ throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_slice failed: unknown result");
+}
+
+int32_t CassandraClient::get_count(const std::string& key, const ColumnParent& column_parent, const SlicePredicate& predicate, const ConsistencyLevel::type consistency_level)
+{
+ send_get_count(key, column_parent, predicate, consistency_level);
+ return recv_get_count();
+}
+
+void CassandraClient::send_get_count(const std::string& key, const ColumnParent& column_parent, const SlicePredicate& predicate, const ConsistencyLevel::type consistency_level)
+{
+ int32_t cseqid = 0;
+ oprot_->writeMessageBegin("get_count", ::apache::thrift::protocol::T_CALL, cseqid);
+
+ Cassandra_get_count_pargs args;
+ args.key = &key;
+ args.column_parent = &column_parent;
+ args.predicate = &predicate;
+ args.consistency_level = &consistency_level;
+ args.write(oprot_);
+
+ oprot_->writeMessageEnd();
+ oprot_->getTransport()->writeEnd();
+ oprot_->getTransport()->flush();
+}
+
+int32_t CassandraClient::recv_get_count()
+{
+
+ int32_t rseqid = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TMessageType mtype;
+
+ iprot_->readMessageBegin(fname, mtype, rseqid);
+ if (mtype == ::apache::thrift::protocol::T_EXCEPTION) {
+ ::apache::thrift::TApplicationException x;
+ x.read(iprot_);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ throw x;
+ }
+ if (mtype != ::apache::thrift::protocol::T_REPLY) {
+ iprot_->skip(::apache::thrift::protocol::T_STRUCT);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ }
+ if (fname.compare("get_count") != 0) {
+ iprot_->skip(::apache::thrift::protocol::T_STRUCT);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ }
+ int32_t _return;
+ Cassandra_get_count_presult result;
+ result.success = &_return;
+ result.read(iprot_);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+
+ if (result.__isset.success) {
+ return _return;
+ }
+ if (result.__isset.ire) {
+ throw result.ire;
+ }
+ if (result.__isset.ue) {
+ throw result.ue;
+ }
+ if (result.__isset.te) {
+ throw result.te;
+ }
+ throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_count failed: unknown result");
+}
+
+void CassandraClient::multiget_slice(std::map<std::string, std::vector<ColumnOrSuperColumn> > & _return, const std::vector<std::string> & keys, const ColumnParent& column_parent, const SlicePredicate& predicate, const ConsistencyLevel::type consistency_level)
+{
+ send_multiget_slice(keys, column_parent, predicate, consistency_level);
+ recv_multiget_slice(_return);
+}
+
+void CassandraClient::send_multiget_slice(const std::vector<std::string> & keys, const ColumnParent& column_parent, const SlicePredicate& predicate, const ConsistencyLevel::type consistency_level)
+{
+ int32_t cseqid = 0;
+ oprot_->writeMessageBegin("multiget_slice", ::apache::thrift::protocol::T_CALL, cseqid);
+
+ Cassandra_multiget_slice_pargs args;
+ args.keys = &keys;
+ args.column_parent = &column_parent;
+ args.predicate = &predicate;
+ args.consistency_level = &consistency_level;
+ args.write(oprot_);
+
+ oprot_->writeMessageEnd();
+ oprot_->getTransport()->writeEnd();
+ oprot_->getTransport()->flush();
+}
+
+void CassandraClient::recv_multiget_slice(std::map<std::string, std::vector<ColumnOrSuperColumn> > & _return)
+{
+
+ int32_t rseqid = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TMessageType mtype;
+
+ iprot_->readMessageBegin(fname, mtype, rseqid);
+ if (mtype == ::apache::thrift::protocol::T_EXCEPTION) {
+ ::apache::thrift::TApplicationException x;
+ x.read(iprot_);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ throw x;
+ }
+ if (mtype != ::apache::thrift::protocol::T_REPLY) {
+ iprot_->skip(::apache::thrift::protocol::T_STRUCT);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ }
+ if (fname.compare("multiget_slice") != 0) {
+ iprot_->skip(::apache::thrift::protocol::T_STRUCT);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ }
+ Cassandra_multiget_slice_presult result;
+ result.success = &_return;
+ result.read(iprot_);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+
+ if (result.__isset.success) {
+ // _return pointer has now been filled
+ return;
+ }
+ if (result.__isset.ire) {
+ throw result.ire;
+ }
+ if (result.__isset.ue) {
+ throw result.ue;
+ }
+ if (result.__isset.te) {
+ throw result.te;
+ }
+ throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "multiget_slice failed: unknown result");
+}
+
+void CassandraClient::multiget_count(std::map<std::string, int32_t> & _return, const std::vector<std::string> & keys, const ColumnParent& column_parent, const SlicePredicate& predicate, const ConsistencyLevel::type consistency_level)
+{
+ send_multiget_count(keys, column_parent, predicate, consistency_level);
+ recv_multiget_count(_return);
+}
+
+void CassandraClient::send_multiget_count(const std::vector<std::string> & keys, const ColumnParent& column_parent, const SlicePredicate& predicate, const ConsistencyLevel::type consistency_level)
+{
+ int32_t cseqid = 0;
+ oprot_->writeMessageBegin("multiget_count", ::apache::thrift::protocol::T_CALL, cseqid);
+
+ Cassandra_multiget_count_pargs args;
+ args.keys = &keys;
+ args.column_parent = &column_parent;
+ args.predicate = &predicate;
+ args.consistency_level = &consistency_level;
+ args.write(oprot_);
+
+ oprot_->writeMessageEnd();
+ oprot_->getTransport()->writeEnd();
+ oprot_->getTransport()->flush();
+}
+
+void CassandraClient::recv_multiget_count(std::map<std::string, int32_t> & _return)
+{
+
+ int32_t rseqid = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TMessageType mtype;
+
+ iprot_->readMessageBegin(fname, mtype, rseqid);
+ if (mtype == ::apache::thrift::protocol::T_EXCEPTION) {
+ ::apache::thrift::TApplicationException x;
+ x.read(iprot_);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ throw x;
+ }
+ if (mtype != ::apache::thrift::protocol::T_REPLY) {
+ iprot_->skip(::apache::thrift::protocol::T_STRUCT);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ }
+ if (fname.compare("multiget_count") != 0) {
+ iprot_->skip(::apache::thrift::protocol::T_STRUCT);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ }
+ Cassandra_multiget_count_presult result;
+ result.success = &_return;
+ result.read(iprot_);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+
+ if (result.__isset.success) {
+ // _return pointer has now been filled
+ return;
+ }
+ if (result.__isset.ire) {
+ throw result.ire;
+ }
+ if (result.__isset.ue) {
+ throw result.ue;
+ }
+ if (result.__isset.te) {
+ throw result.te;
+ }
+ throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "multiget_count failed: unknown result");
+}
+
+void CassandraClient::get_range_slices(std::vector<KeySlice> & _return, const ColumnParent& column_parent, const SlicePredicate& predicate, const KeyRange& range, const ConsistencyLevel::type consistency_level)
+{
+ send_get_range_slices(column_parent, predicate, range, consistency_level);
+ recv_get_range_slices(_return);
+}
+
+void CassandraClient::send_get_range_slices(const ColumnParent& column_parent, const SlicePredicate& predicate, const KeyRange& range, const ConsistencyLevel::type consistency_level)
+{
+ int32_t cseqid = 0;
+ oprot_->writeMessageBegin("get_range_slices", ::apache::thrift::protocol::T_CALL, cseqid);
+
+ Cassandra_get_range_slices_pargs args;
+ args.column_parent = &column_parent;
+ args.predicate = &predicate;
+ args.range = &range;
+ args.consistency_level = &consistency_level;
+ args.write(oprot_);
+
+ oprot_->writeMessageEnd();
+ oprot_->getTransport()->writeEnd();
+ oprot_->getTransport()->flush();
+}
+
+void CassandraClient::recv_get_range_slices(std::vector<KeySlice> & _return)
+{
+
+ int32_t rseqid = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TMessageType mtype;
+
+ iprot_->readMessageBegin(fname, mtype, rseqid);
+ if (mtype == ::apache::thrift::protocol::T_EXCEPTION) {
+ ::apache::thrift::TApplicationException x;
+ x.read(iprot_);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ throw x;
+ }
+ if (mtype != ::apache::thrift::protocol::T_REPLY) {
+ iprot_->skip(::apache::thrift::protocol::T_STRUCT);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ }
+ if (fname.compare("get_range_slices") != 0) {
+ iprot_->skip(::apache::thrift::protocol::T_STRUCT);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ }
+ Cassandra_get_range_slices_presult result;
+ result.success = &_return;
+ result.read(iprot_);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+
+ if (result.__isset.success) {
+ // _return pointer has now been filled
+ return;
+ }
+ if (result.__isset.ire) {
+ throw result.ire;
+ }
+ if (result.__isset.ue) {
+ throw result.ue;
+ }
+ if (result.__isset.te) {
+ throw result.te;
+ }
+ throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_range_slices failed: unknown result");
+}
+
+void CassandraClient::get_paged_slice(std::vector<KeySlice> & _return, const std::string& column_family, const KeyRange& range, const std::string& start_column, const ConsistencyLevel::type consistency_level)
+{
+ send_get_paged_slice(column_family, range, start_column, consistency_level);
+ recv_get_paged_slice(_return);
+}
+
+void CassandraClient::send_get_paged_slice(const std::string& column_family, const KeyRange& range, const std::string& start_column, const ConsistencyLevel::type consistency_level)
+{
+ int32_t cseqid = 0;
+ oprot_->writeMessageBegin("get_paged_slice", ::apache::thrift::protocol::T_CALL, cseqid);
+
+ Cassandra_get_paged_slice_pargs args;
+ args.column_family = &column_family;
+ args.range = &range;
+ args.start_column = &start_column;
+ args.consistency_level = &consistency_level;
+ args.write(oprot_);
+
+ oprot_->writeMessageEnd();
+ oprot_->getTransport()->writeEnd();
+ oprot_->getTransport()->flush();
+}
+
+void CassandraClient::recv_get_paged_slice(std::vector<KeySlice> & _return)
+{
+
+ int32_t rseqid = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TMessageType mtype;
+
+ iprot_->readMessageBegin(fname, mtype, rseqid);
+ if (mtype == ::apache::thrift::protocol::T_EXCEPTION) {
+ ::apache::thrift::TApplicationException x;
+ x.read(iprot_);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ throw x;
+ }
+ if (mtype != ::apache::thrift::protocol::T_REPLY) {
+ iprot_->skip(::apache::thrift::protocol::T_STRUCT);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ }
+ if (fname.compare("get_paged_slice") != 0) {
+ iprot_->skip(::apache::thrift::protocol::T_STRUCT);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ }
+ Cassandra_get_paged_slice_presult result;
+ result.success = &_return;
+ result.read(iprot_);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+
+ if (result.__isset.success) {
+ // _return pointer has now been filled
+ return;
+ }
+ if (result.__isset.ire) {
+ throw result.ire;
+ }
+ if (result.__isset.ue) {
+ throw result.ue;
+ }
+ if (result.__isset.te) {
+ throw result.te;
+ }
+ throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_paged_slice failed: unknown result");
+}
+
+void CassandraClient::get_indexed_slices(std::vector<KeySlice> & _return, const ColumnParent& column_parent, const IndexClause& index_clause, const SlicePredicate& column_predicate, const ConsistencyLevel::type consistency_level)
+{
+ send_get_indexed_slices(column_parent, index_clause, column_predicate, consistency_level);
+ recv_get_indexed_slices(_return);
+}
+
+void CassandraClient::send_get_indexed_slices(const ColumnParent& column_parent, const IndexClause& index_clause, const SlicePredicate& column_predicate, const ConsistencyLevel::type consistency_level)
+{
+ int32_t cseqid = 0;
+ oprot_->writeMessageBegin("get_indexed_slices", ::apache::thrift::protocol::T_CALL, cseqid);
+
+ Cassandra_get_indexed_slices_pargs args;
+ args.column_parent = &column_parent;
+ args.index_clause = &index_clause;
+ args.column_predicate = &column_predicate;
+ args.consistency_level = &consistency_level;
+ args.write(oprot_);
+
+ oprot_->writeMessageEnd();
+ oprot_->getTransport()->writeEnd();
+ oprot_->getTransport()->flush();
+}
+
+void CassandraClient::recv_get_indexed_slices(std::vector<KeySlice> & _return)
+{
+
+ int32_t rseqid = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TMessageType mtype;
+
+ iprot_->readMessageBegin(fname, mtype, rseqid);
+ if (mtype == ::apache::thrift::protocol::T_EXCEPTION) {
+ ::apache::thrift::TApplicationException x;
+ x.read(iprot_);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ throw x;
+ }
+ if (mtype != ::apache::thrift::protocol::T_REPLY) {
+ iprot_->skip(::apache::thrift::protocol::T_STRUCT);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ }
+ if (fname.compare("get_indexed_slices") != 0) {
+ iprot_->skip(::apache::thrift::protocol::T_STRUCT);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ }
+ Cassandra_get_indexed_slices_presult result;
+ result.success = &_return;
+ result.read(iprot_);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+
+ if (result.__isset.success) {
+ // _return pointer has now been filled
+ return;
+ }
+ if (result.__isset.ire) {
+ throw result.ire;
+ }
+ if (result.__isset.ue) {
+ throw result.ue;
+ }
+ if (result.__isset.te) {
+ throw result.te;
+ }
+ throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_indexed_slices failed: unknown result");
+}
+
+void CassandraClient::insert(const std::string& key, const ColumnParent& column_parent, const Column& column, const ConsistencyLevel::type consistency_level)
+{
+ send_insert(key, column_parent, column, consistency_level);
+ recv_insert();
+}
+
+void CassandraClient::send_insert(const std::string& key, const ColumnParent& column_parent, const Column& column, const ConsistencyLevel::type consistency_level)
+{
+ int32_t cseqid = 0;
+ oprot_->writeMessageBegin("insert", ::apache::thrift::protocol::T_CALL, cseqid);
+
+ Cassandra_insert_pargs args;
+ args.key = &key;
+ args.column_parent = &column_parent;
+ args.column = &column;
+ args.consistency_level = &consistency_level;
+ args.write(oprot_);
+
+ oprot_->writeMessageEnd();
+ oprot_->getTransport()->writeEnd();
+ oprot_->getTransport()->flush();
+}
+
+void CassandraClient::recv_insert()
+{
+
+ int32_t rseqid = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TMessageType mtype;
+
+ iprot_->readMessageBegin(fname, mtype, rseqid);
+ if (mtype == ::apache::thrift::protocol::T_EXCEPTION) {
+ ::apache::thrift::TApplicationException x;
+ x.read(iprot_);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ throw x;
+ }
+ if (mtype != ::apache::thrift::protocol::T_REPLY) {
+ iprot_->skip(::apache::thrift::protocol::T_STRUCT);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ }
+ if (fname.compare("insert") != 0) {
+ iprot_->skip(::apache::thrift::protocol::T_STRUCT);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ }
+ Cassandra_insert_presult result;
+ result.read(iprot_);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+
+ if (result.__isset.ire) {
+ throw result.ire;
+ }
+ if (result.__isset.ue) {
+ throw result.ue;
+ }
+ if (result.__isset.te) {
+ throw result.te;
+ }
+ return;
+}
+
+void CassandraClient::add(const std::string& key, const ColumnParent& column_parent, const CounterColumn& column, const ConsistencyLevel::type consistency_level)
+{
+ send_add(key, column_parent, column, consistency_level);
+ recv_add();
+}
+
+void CassandraClient::send_add(const std::string& key, const ColumnParent& column_parent, const CounterColumn& column, const ConsistencyLevel::type consistency_level)
+{
+ int32_t cseqid = 0;
+ oprot_->writeMessageBegin("add", ::apache::thrift::protocol::T_CALL, cseqid);
+
+ Cassandra_add_pargs args;
+ args.key = &key;
+ args.column_parent = &column_parent;
+ args.column = &column;
+ args.consistency_level = &consistency_level;
+ args.write(oprot_);
+
+ oprot_->writeMessageEnd();
+ oprot_->getTransport()->writeEnd();
+ oprot_->getTransport()->flush();
+}
+
+void CassandraClient::recv_add()
+{
+
+ int32_t rseqid = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TMessageType mtype;
+
+ iprot_->readMessageBegin(fname, mtype, rseqid);
+ if (mtype == ::apache::thrift::protocol::T_EXCEPTION) {
+ ::apache::thrift::TApplicationException x;
+ x.read(iprot_);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ throw x;
+ }
+ if (mtype != ::apache::thrift::protocol::T_REPLY) {
+ iprot_->skip(::apache::thrift::protocol::T_STRUCT);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ }
+ if (fname.compare("add") != 0) {
+ iprot_->skip(::apache::thrift::protocol::T_STRUCT);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ }
+ Cassandra_add_presult result;
+ result.read(iprot_);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+
+ if (result.__isset.ire) {
+ throw result.ire;
+ }
+ if (result.__isset.ue) {
+ throw result.ue;
+ }
+ if (result.__isset.te) {
+ throw result.te;
+ }
+ return;
+}
+
+void CassandraClient::remove(const std::string& key, const ColumnPath& column_path, const int64_t timestamp, const ConsistencyLevel::type consistency_level)
+{
+ send_remove(key, column_path, timestamp, consistency_level);
+ recv_remove();
+}
+
+void CassandraClient::send_remove(const std::string& key, const ColumnPath& column_path, const int64_t timestamp, const ConsistencyLevel::type consistency_level)
+{
+ int32_t cseqid = 0;
+ oprot_->writeMessageBegin("remove", ::apache::thrift::protocol::T_CALL, cseqid);
+
+ Cassandra_remove_pargs args;
+ args.key = &key;
+ args.column_path = &column_path;
+ args.timestamp = &timestamp;
+ args.consistency_level = &consistency_level;
+ args.write(oprot_);
+
+ oprot_->writeMessageEnd();
+ oprot_->getTransport()->writeEnd();
+ oprot_->getTransport()->flush();
+}
+
+void CassandraClient::recv_remove()
+{
+
+ int32_t rseqid = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TMessageType mtype;
+
+ iprot_->readMessageBegin(fname, mtype, rseqid);
+ if (mtype == ::apache::thrift::protocol::T_EXCEPTION) {
+ ::apache::thrift::TApplicationException x;
+ x.read(iprot_);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ throw x;
+ }
+ if (mtype != ::apache::thrift::protocol::T_REPLY) {
+ iprot_->skip(::apache::thrift::protocol::T_STRUCT);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ }
+ if (fname.compare("remove") != 0) {
+ iprot_->skip(::apache::thrift::protocol::T_STRUCT);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ }
+ Cassandra_remove_presult result;
+ result.read(iprot_);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+
+ if (result.__isset.ire) {
+ throw result.ire;
+ }
+ if (result.__isset.ue) {
+ throw result.ue;
+ }
+ if (result.__isset.te) {
+ throw result.te;
+ }
+ return;
+}
+
+void CassandraClient::remove_counter(const std::string& key, const ColumnPath& path, const ConsistencyLevel::type consistency_level)
+{
+ send_remove_counter(key, path, consistency_level);
+ recv_remove_counter();
+}
+
+void CassandraClient::send_remove_counter(const std::string& key, const ColumnPath& path, const ConsistencyLevel::type consistency_level)
+{
+ int32_t cseqid = 0;
+ oprot_->writeMessageBegin("remove_counter", ::apache::thrift::protocol::T_CALL, cseqid);
+
+ Cassandra_remove_counter_pargs args;
+ args.key = &key;
+ args.path = &path;
+ args.consistency_level = &consistency_level;
+ args.write(oprot_);
+
+ oprot_->writeMessageEnd();
+ oprot_->getTransport()->writeEnd();
+ oprot_->getTransport()->flush();
+}
+
+void CassandraClient::recv_remove_counter()
+{
+
+ int32_t rseqid = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TMessageType mtype;
+
+ iprot_->readMessageBegin(fname, mtype, rseqid);
+ if (mtype == ::apache::thrift::protocol::T_EXCEPTION) {
+ ::apache::thrift::TApplicationException x;
+ x.read(iprot_);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ throw x;
+ }
+ if (mtype != ::apache::thrift::protocol::T_REPLY) {
+ iprot_->skip(::apache::thrift::protocol::T_STRUCT);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ }
+ if (fname.compare("remove_counter") != 0) {
+ iprot_->skip(::apache::thrift::protocol::T_STRUCT);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ }
+ Cassandra_remove_counter_presult result;
+ result.read(iprot_);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+
+ if (result.__isset.ire) {
+ throw result.ire;
+ }
+ if (result.__isset.ue) {
+ throw result.ue;
+ }
+ if (result.__isset.te) {
+ throw result.te;
+ }
+ return;
+}
+
+void CassandraClient::batch_mutate(const std::map<std::string, std::map<std::string, std::vector<Mutation> > > & mutation_map, const ConsistencyLevel::type consistency_level)
+{
+ send_batch_mutate(mutation_map, consistency_level);
+ recv_batch_mutate();
+}
+
+void CassandraClient::send_batch_mutate(const std::map<std::string, std::map<std::string, std::vector<Mutation> > > & mutation_map, const ConsistencyLevel::type consistency_level)
+{
+ int32_t cseqid = 0;
+ oprot_->writeMessageBegin("batch_mutate", ::apache::thrift::protocol::T_CALL, cseqid);
+
+ Cassandra_batch_mutate_pargs args;
+ args.mutation_map = &mutation_map;
+ args.consistency_level = &consistency_level;
+ args.write(oprot_);
+
+ oprot_->writeMessageEnd();
+ oprot_->getTransport()->writeEnd();
+ oprot_->getTransport()->flush();
+}
+
+void CassandraClient::recv_batch_mutate()
+{
+
+ int32_t rseqid = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TMessageType mtype;
+
+ iprot_->readMessageBegin(fname, mtype, rseqid);
+ if (mtype == ::apache::thrift::protocol::T_EXCEPTION) {
+ ::apache::thrift::TApplicationException x;
+ x.read(iprot_);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ throw x;
+ }
+ if (mtype != ::apache::thrift::protocol::T_REPLY) {
+ iprot_->skip(::apache::thrift::protocol::T_STRUCT);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ }
+ if (fname.compare("batch_mutate") != 0) {
+ iprot_->skip(::apache::thrift::protocol::T_STRUCT);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ }
+ Cassandra_batch_mutate_presult result;
+ result.read(iprot_);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+
+ if (result.__isset.ire) {
+ throw result.ire;
+ }
+ if (result.__isset.ue) {
+ throw result.ue;
+ }
+ if (result.__isset.te) {
+ throw result.te;
+ }
+ return;
+}
+
+void CassandraClient::truncate(const std::string& cfname)
+{
+ send_truncate(cfname);
+ recv_truncate();
+}
+
+void CassandraClient::send_truncate(const std::string& cfname)
+{
+ int32_t cseqid = 0;
+ oprot_->writeMessageBegin("truncate", ::apache::thrift::protocol::T_CALL, cseqid);
+
+ Cassandra_truncate_pargs args;
+ args.cfname = &cfname;
+ args.write(oprot_);
+
+ oprot_->writeMessageEnd();
+ oprot_->getTransport()->writeEnd();
+ oprot_->getTransport()->flush();
+}
+
+void CassandraClient::recv_truncate()
+{
+
+ int32_t rseqid = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TMessageType mtype;
+
+ iprot_->readMessageBegin(fname, mtype, rseqid);
+ if (mtype == ::apache::thrift::protocol::T_EXCEPTION) {
+ ::apache::thrift::TApplicationException x;
+ x.read(iprot_);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ throw x;
+ }
+ if (mtype != ::apache::thrift::protocol::T_REPLY) {
+ iprot_->skip(::apache::thrift::protocol::T_STRUCT);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ }
+ if (fname.compare("truncate") != 0) {
+ iprot_->skip(::apache::thrift::protocol::T_STRUCT);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ }
+ Cassandra_truncate_presult result;
+ result.read(iprot_);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+
+ if (result.__isset.ire) {
+ throw result.ire;
+ }
+ if (result.__isset.ue) {
+ throw result.ue;
+ }
+ if (result.__isset.te) {
+ throw result.te;
+ }
+ return;
+}
+
+void CassandraClient::describe_schema_versions(std::map<std::string, std::vector<std::string> > & _return)
+{
+ send_describe_schema_versions();
+ recv_describe_schema_versions(_return);
+}
+
+void CassandraClient::send_describe_schema_versions()
+{
+ int32_t cseqid = 0;
+ oprot_->writeMessageBegin("describe_schema_versions", ::apache::thrift::protocol::T_CALL, cseqid);
+
+ Cassandra_describe_schema_versions_pargs args;
+ args.write(oprot_);
+
+ oprot_->writeMessageEnd();
+ oprot_->getTransport()->writeEnd();
+ oprot_->getTransport()->flush();
+}
+
+void CassandraClient::recv_describe_schema_versions(std::map<std::string, std::vector<std::string> > & _return)
+{
+
+ int32_t rseqid = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TMessageType mtype;
+
+ iprot_->readMessageBegin(fname, mtype, rseqid);
+ if (mtype == ::apache::thrift::protocol::T_EXCEPTION) {
+ ::apache::thrift::TApplicationException x;
+ x.read(iprot_);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ throw x;
+ }
+ if (mtype != ::apache::thrift::protocol::T_REPLY) {
+ iprot_->skip(::apache::thrift::protocol::T_STRUCT);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ }
+ if (fname.compare("describe_schema_versions") != 0) {
+ iprot_->skip(::apache::thrift::protocol::T_STRUCT);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ }
+ Cassandra_describe_schema_versions_presult result;
+ result.success = &_return;
+ result.read(iprot_);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+
+ if (result.__isset.success) {
+ // _return pointer has now been filled
+ return;
+ }
+ if (result.__isset.ire) {
+ throw result.ire;
+ }
+ throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "describe_schema_versions failed: unknown result");
+}
+
+void CassandraClient::describe_keyspaces(std::vector<KsDef> & _return)
+{
+ send_describe_keyspaces();
+ recv_describe_keyspaces(_return);
+}
+
+void CassandraClient::send_describe_keyspaces()
+{
+ int32_t cseqid = 0;
+ oprot_->writeMessageBegin("describe_keyspaces", ::apache::thrift::protocol::T_CALL, cseqid);
+
+ Cassandra_describe_keyspaces_pargs args;
+ args.write(oprot_);
+
+ oprot_->writeMessageEnd();
+ oprot_->getTransport()->writeEnd();
+ oprot_->getTransport()->flush();
+}
+
+void CassandraClient::recv_describe_keyspaces(std::vector<KsDef> & _return)
+{
+
+ int32_t rseqid = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TMessageType mtype;
+
+ iprot_->readMessageBegin(fname, mtype, rseqid);
+ if (mtype == ::apache::thrift::protocol::T_EXCEPTION) {
+ ::apache::thrift::TApplicationException x;
+ x.read(iprot_);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ throw x;
+ }
+ if (mtype != ::apache::thrift::protocol::T_REPLY) {
+ iprot_->skip(::apache::thrift::protocol::T_STRUCT);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ }
+ if (fname.compare("describe_keyspaces") != 0) {
+ iprot_->skip(::apache::thrift::protocol::T_STRUCT);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ }
+ Cassandra_describe_keyspaces_presult result;
+ result.success = &_return;
+ result.read(iprot_);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+
+ if (result.__isset.success) {
+ // _return pointer has now been filled
+ return;
+ }
+ if (result.__isset.ire) {
+ throw result.ire;
+ }
+ throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "describe_keyspaces failed: unknown result");
+}
+
+void CassandraClient::describe_cluster_name(std::string& _return)
+{
+ send_describe_cluster_name();
+ recv_describe_cluster_name(_return);
+}
+
+void CassandraClient::send_describe_cluster_name()
+{
+ int32_t cseqid = 0;
+ oprot_->writeMessageBegin("describe_cluster_name", ::apache::thrift::protocol::T_CALL, cseqid);
+
+ Cassandra_describe_cluster_name_pargs args;
+ args.write(oprot_);
+
+ oprot_->writeMessageEnd();
+ oprot_->getTransport()->writeEnd();
+ oprot_->getTransport()->flush();
+}
+
+void CassandraClient::recv_describe_cluster_name(std::string& _return)
+{
+
+ int32_t rseqid = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TMessageType mtype;
+
+ iprot_->readMessageBegin(fname, mtype, rseqid);
+ if (mtype == ::apache::thrift::protocol::T_EXCEPTION) {
+ ::apache::thrift::TApplicationException x;
+ x.read(iprot_);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ throw x;
+ }
+ if (mtype != ::apache::thrift::protocol::T_REPLY) {
+ iprot_->skip(::apache::thrift::protocol::T_STRUCT);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ }
+ if (fname.compare("describe_cluster_name") != 0) {
+ iprot_->skip(::apache::thrift::protocol::T_STRUCT);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ }
+ Cassandra_describe_cluster_name_presult result;
+ result.success = &_return;
+ result.read(iprot_);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+
+ if (result.__isset.success) {
+ // _return pointer has now been filled
+ return;
+ }
+ throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "describe_cluster_name failed: unknown result");
+}
+
+void CassandraClient::describe_version(std::string& _return)
+{
+ send_describe_version();
+ recv_describe_version(_return);
+}
+
+void CassandraClient::send_describe_version()
+{
+ int32_t cseqid = 0;
+ oprot_->writeMessageBegin("describe_version", ::apache::thrift::protocol::T_CALL, cseqid);
+
+ Cassandra_describe_version_pargs args;
+ args.write(oprot_);
+
+ oprot_->writeMessageEnd();
+ oprot_->getTransport()->writeEnd();
+ oprot_->getTransport()->flush();
+}
+
+void CassandraClient::recv_describe_version(std::string& _return)
+{
+
+ int32_t rseqid = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TMessageType mtype;
+
+ iprot_->readMessageBegin(fname, mtype, rseqid);
+ if (mtype == ::apache::thrift::protocol::T_EXCEPTION) {
+ ::apache::thrift::TApplicationException x;
+ x.read(iprot_);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ throw x;
+ }
+ if (mtype != ::apache::thrift::protocol::T_REPLY) {
+ iprot_->skip(::apache::thrift::protocol::T_STRUCT);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ }
+ if (fname.compare("describe_version") != 0) {
+ iprot_->skip(::apache::thrift::protocol::T_STRUCT);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ }
+ Cassandra_describe_version_presult result;
+ result.success = &_return;
+ result.read(iprot_);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+
+ if (result.__isset.success) {
+ // _return pointer has now been filled
+ return;
+ }
+ throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "describe_version failed: unknown result");
+}
+
+void CassandraClient::describe_ring(std::vector<TokenRange> & _return, const std::string& keyspace)
+{
+ send_describe_ring(keyspace);
+ recv_describe_ring(_return);
+}
+
+void CassandraClient::send_describe_ring(const std::string& keyspace)
+{
+ int32_t cseqid = 0;
+ oprot_->writeMessageBegin("describe_ring", ::apache::thrift::protocol::T_CALL, cseqid);
+
+ Cassandra_describe_ring_pargs args;
+ args.keyspace = &keyspace;
+ args.write(oprot_);
+
+ oprot_->writeMessageEnd();
+ oprot_->getTransport()->writeEnd();
+ oprot_->getTransport()->flush();
+}
+
+void CassandraClient::recv_describe_ring(std::vector<TokenRange> & _return)
+{
+
+ int32_t rseqid = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TMessageType mtype;
+
+ iprot_->readMessageBegin(fname, mtype, rseqid);
+ if (mtype == ::apache::thrift::protocol::T_EXCEPTION) {
+ ::apache::thrift::TApplicationException x;
+ x.read(iprot_);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ throw x;
+ }
+ if (mtype != ::apache::thrift::protocol::T_REPLY) {
+ iprot_->skip(::apache::thrift::protocol::T_STRUCT);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ }
+ if (fname.compare("describe_ring") != 0) {
+ iprot_->skip(::apache::thrift::protocol::T_STRUCT);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ }
+ Cassandra_describe_ring_presult result;
+ result.success = &_return;
+ result.read(iprot_);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+
+ if (result.__isset.success) {
+ // _return pointer has now been filled
+ return;
+ }
+ if (result.__isset.ire) {
+ throw result.ire;
+ }
+ throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "describe_ring failed: unknown result");
+}
+
+void CassandraClient::describe_token_map(std::map<std::string, std::string> & _return)
+{
+ send_describe_token_map();
+ recv_describe_token_map(_return);
+}
+
+void CassandraClient::send_describe_token_map()
+{
+ int32_t cseqid = 0;
+ oprot_->writeMessageBegin("describe_token_map", ::apache::thrift::protocol::T_CALL, cseqid);
+
+ Cassandra_describe_token_map_pargs args;
+ args.write(oprot_);
+
+ oprot_->writeMessageEnd();
+ oprot_->getTransport()->writeEnd();
+ oprot_->getTransport()->flush();
+}
+
+void CassandraClient::recv_describe_token_map(std::map<std::string, std::string> & _return)
+{
+
+ int32_t rseqid = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TMessageType mtype;
+
+ iprot_->readMessageBegin(fname, mtype, rseqid);
+ if (mtype == ::apache::thrift::protocol::T_EXCEPTION) {
+ ::apache::thrift::TApplicationException x;
+ x.read(iprot_);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ throw x;
+ }
+ if (mtype != ::apache::thrift::protocol::T_REPLY) {
+ iprot_->skip(::apache::thrift::protocol::T_STRUCT);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ }
+ if (fname.compare("describe_token_map") != 0) {
+ iprot_->skip(::apache::thrift::protocol::T_STRUCT);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ }
+ Cassandra_describe_token_map_presult result;
+ result.success = &_return;
+ result.read(iprot_);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+
+ if (result.__isset.success) {
+ // _return pointer has now been filled
+ return;
+ }
+ if (result.__isset.ire) {
+ throw result.ire;
+ }
+ throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "describe_token_map failed: unknown result");
+}
+
+void CassandraClient::describe_partitioner(std::string& _return)
+{
+ send_describe_partitioner();
+ recv_describe_partitioner(_return);
+}
+
+void CassandraClient::send_describe_partitioner()
+{
+ int32_t cseqid = 0;
+ oprot_->writeMessageBegin("describe_partitioner", ::apache::thrift::protocol::T_CALL, cseqid);
+
+ Cassandra_describe_partitioner_pargs args;
+ args.write(oprot_);
+
+ oprot_->writeMessageEnd();
+ oprot_->getTransport()->writeEnd();
+ oprot_->getTransport()->flush();
+}
+
+void CassandraClient::recv_describe_partitioner(std::string& _return)
+{
+
+ int32_t rseqid = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TMessageType mtype;
+
+ iprot_->readMessageBegin(fname, mtype, rseqid);
+ if (mtype == ::apache::thrift::protocol::T_EXCEPTION) {
+ ::apache::thrift::TApplicationException x;
+ x.read(iprot_);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ throw x;
+ }
+ if (mtype != ::apache::thrift::protocol::T_REPLY) {
+ iprot_->skip(::apache::thrift::protocol::T_STRUCT);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ }
+ if (fname.compare("describe_partitioner") != 0) {
+ iprot_->skip(::apache::thrift::protocol::T_STRUCT);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ }
+ Cassandra_describe_partitioner_presult result;
+ result.success = &_return;
+ result.read(iprot_);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+
+ if (result.__isset.success) {
+ // _return pointer has now been filled
+ return;
+ }
+ throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "describe_partitioner failed: unknown result");
+}
+
+void CassandraClient::describe_snitch(std::string& _return)
+{
+ send_describe_snitch();
+ recv_describe_snitch(_return);
+}
+
+void CassandraClient::send_describe_snitch()
+{
+ int32_t cseqid = 0;
+ oprot_->writeMessageBegin("describe_snitch", ::apache::thrift::protocol::T_CALL, cseqid);
+
+ Cassandra_describe_snitch_pargs args;
+ args.write(oprot_);
+
+ oprot_->writeMessageEnd();
+ oprot_->getTransport()->writeEnd();
+ oprot_->getTransport()->flush();
+}
+
+void CassandraClient::recv_describe_snitch(std::string& _return)
+{
+
+ int32_t rseqid = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TMessageType mtype;
+
+ iprot_->readMessageBegin(fname, mtype, rseqid);
+ if (mtype == ::apache::thrift::protocol::T_EXCEPTION) {
+ ::apache::thrift::TApplicationException x;
+ x.read(iprot_);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ throw x;
+ }
+ if (mtype != ::apache::thrift::protocol::T_REPLY) {
+ iprot_->skip(::apache::thrift::protocol::T_STRUCT);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ }
+ if (fname.compare("describe_snitch") != 0) {
+ iprot_->skip(::apache::thrift::protocol::T_STRUCT);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ }
+ Cassandra_describe_snitch_presult result;
+ result.success = &_return;
+ result.read(iprot_);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+
+ if (result.__isset.success) {
+ // _return pointer has now been filled
+ return;
+ }
+ throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "describe_snitch failed: unknown result");
+}
+
+void CassandraClient::describe_keyspace(KsDef& _return, const std::string& keyspace)
+{
+ send_describe_keyspace(keyspace);
+ recv_describe_keyspace(_return);
+}
+
+void CassandraClient::send_describe_keyspace(const std::string& keyspace)
+{
+ int32_t cseqid = 0;
+ oprot_->writeMessageBegin("describe_keyspace", ::apache::thrift::protocol::T_CALL, cseqid);
+
+ Cassandra_describe_keyspace_pargs args;
+ args.keyspace = &keyspace;
+ args.write(oprot_);
+
+ oprot_->writeMessageEnd();
+ oprot_->getTransport()->writeEnd();
+ oprot_->getTransport()->flush();
+}
+
+void CassandraClient::recv_describe_keyspace(KsDef& _return)
+{
+
+ int32_t rseqid = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TMessageType mtype;
+
+ iprot_->readMessageBegin(fname, mtype, rseqid);
+ if (mtype == ::apache::thrift::protocol::T_EXCEPTION) {
+ ::apache::thrift::TApplicationException x;
+ x.read(iprot_);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ throw x;
+ }
+ if (mtype != ::apache::thrift::protocol::T_REPLY) {
+ iprot_->skip(::apache::thrift::protocol::T_STRUCT);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ }
+ if (fname.compare("describe_keyspace") != 0) {
+ iprot_->skip(::apache::thrift::protocol::T_STRUCT);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ }
+ Cassandra_describe_keyspace_presult result;
+ result.success = &_return;
+ result.read(iprot_);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+
+ if (result.__isset.success) {
+ // _return pointer has now been filled
+ return;
+ }
+ if (result.__isset.nfe) {
+ throw result.nfe;
+ }
+ if (result.__isset.ire) {
+ throw result.ire;
+ }
+ throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "describe_keyspace failed: unknown result");
+}
+
+void CassandraClient::describe_splits(std::vector<std::string> & _return, const std::string& cfName, const std::string& start_token, const std::string& end_token, const int32_t keys_per_split)
+{
+ send_describe_splits(cfName, start_token, end_token, keys_per_split);
+ recv_describe_splits(_return);
+}
+
+void CassandraClient::send_describe_splits(const std::string& cfName, const std::string& start_token, const std::string& end_token, const int32_t keys_per_split)
+{
+ int32_t cseqid = 0;
+ oprot_->writeMessageBegin("describe_splits", ::apache::thrift::protocol::T_CALL, cseqid);
+
+ Cassandra_describe_splits_pargs args;
+ args.cfName = &cfName;
+ args.start_token = &start_token;
+ args.end_token = &end_token;
+ args.keys_per_split = &keys_per_split;
+ args.write(oprot_);
+
+ oprot_->writeMessageEnd();
+ oprot_->getTransport()->writeEnd();
+ oprot_->getTransport()->flush();
+}
+
+void CassandraClient::recv_describe_splits(std::vector<std::string> & _return)
+{
+
+ int32_t rseqid = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TMessageType mtype;
+
+ iprot_->readMessageBegin(fname, mtype, rseqid);
+ if (mtype == ::apache::thrift::protocol::T_EXCEPTION) {
+ ::apache::thrift::TApplicationException x;
+ x.read(iprot_);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ throw x;
+ }
+ if (mtype != ::apache::thrift::protocol::T_REPLY) {
+ iprot_->skip(::apache::thrift::protocol::T_STRUCT);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ }
+ if (fname.compare("describe_splits") != 0) {
+ iprot_->skip(::apache::thrift::protocol::T_STRUCT);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ }
+ Cassandra_describe_splits_presult result;
+ result.success = &_return;
+ result.read(iprot_);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+
+ if (result.__isset.success) {
+ // _return pointer has now been filled
+ return;
+ }
+ if (result.__isset.ire) {
+ throw result.ire;
+ }
+ throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "describe_splits failed: unknown result");
+}
+
+void CassandraClient::system_add_column_family(std::string& _return, const CfDef& cf_def)
+{
+ send_system_add_column_family(cf_def);
+ recv_system_add_column_family(_return);
+}
+
+void CassandraClient::send_system_add_column_family(const CfDef& cf_def)
+{
+ int32_t cseqid = 0;
+ oprot_->writeMessageBegin("system_add_column_family", ::apache::thrift::protocol::T_CALL, cseqid);
+
+ Cassandra_system_add_column_family_pargs args;
+ args.cf_def = &cf_def;
+ args.write(oprot_);
+
+ oprot_->writeMessageEnd();
+ oprot_->getTransport()->writeEnd();
+ oprot_->getTransport()->flush();
+}
+
+void CassandraClient::recv_system_add_column_family(std::string& _return)
+{
+
+ int32_t rseqid = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TMessageType mtype;
+
+ iprot_->readMessageBegin(fname, mtype, rseqid);
+ if (mtype == ::apache::thrift::protocol::T_EXCEPTION) {
+ ::apache::thrift::TApplicationException x;
+ x.read(iprot_);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ throw x;
+ }
+ if (mtype != ::apache::thrift::protocol::T_REPLY) {
+ iprot_->skip(::apache::thrift::protocol::T_STRUCT);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ }
+ if (fname.compare("system_add_column_family") != 0) {
+ iprot_->skip(::apache::thrift::protocol::T_STRUCT);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ }
+ Cassandra_system_add_column_family_presult result;
+ result.success = &_return;
+ result.read(iprot_);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+
+ if (result.__isset.success) {
+ // _return pointer has now been filled
+ return;
+ }
+ if (result.__isset.ire) {
+ throw result.ire;
+ }
+ if (result.__isset.sde) {
+ throw result.sde;
+ }
+ throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "system_add_column_family failed: unknown result");
+}
+
+void CassandraClient::system_drop_column_family(std::string& _return, const std::string& column_family)
+{
+ send_system_drop_column_family(column_family);
+ recv_system_drop_column_family(_return);
+}
+
+void CassandraClient::send_system_drop_column_family(const std::string& column_family)
+{
+ int32_t cseqid = 0;
+ oprot_->writeMessageBegin("system_drop_column_family", ::apache::thrift::protocol::T_CALL, cseqid);
+
+ Cassandra_system_drop_column_family_pargs args;
+ args.column_family = &column_family;
+ args.write(oprot_);
+
+ oprot_->writeMessageEnd();
+ oprot_->getTransport()->writeEnd();
+ oprot_->getTransport()->flush();
+}
+
+void CassandraClient::recv_system_drop_column_family(std::string& _return)
+{
+
+ int32_t rseqid = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TMessageType mtype;
+
+ iprot_->readMessageBegin(fname, mtype, rseqid);
+ if (mtype == ::apache::thrift::protocol::T_EXCEPTION) {
+ ::apache::thrift::TApplicationException x;
+ x.read(iprot_);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ throw x;
+ }
+ if (mtype != ::apache::thrift::protocol::T_REPLY) {
+ iprot_->skip(::apache::thrift::protocol::T_STRUCT);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ }
+ if (fname.compare("system_drop_column_family") != 0) {
+ iprot_->skip(::apache::thrift::protocol::T_STRUCT);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ }
+ Cassandra_system_drop_column_family_presult result;
+ result.success = &_return;
+ result.read(iprot_);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+
+ if (result.__isset.success) {
+ // _return pointer has now been filled
+ return;
+ }
+ if (result.__isset.ire) {
+ throw result.ire;
+ }
+ if (result.__isset.sde) {
+ throw result.sde;
+ }
+ throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "system_drop_column_family failed: unknown result");
+}
+
+void CassandraClient::system_add_keyspace(std::string& _return, const KsDef& ks_def)
+{
+ send_system_add_keyspace(ks_def);
+ recv_system_add_keyspace(_return);
+}
+
+void CassandraClient::send_system_add_keyspace(const KsDef& ks_def)
+{
+ int32_t cseqid = 0;
+ oprot_->writeMessageBegin("system_add_keyspace", ::apache::thrift::protocol::T_CALL, cseqid);
+
+ Cassandra_system_add_keyspace_pargs args;
+ args.ks_def = &ks_def;
+ args.write(oprot_);
+
+ oprot_->writeMessageEnd();
+ oprot_->getTransport()->writeEnd();
+ oprot_->getTransport()->flush();
+}
+
+void CassandraClient::recv_system_add_keyspace(std::string& _return)
+{
+
+ int32_t rseqid = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TMessageType mtype;
+
+ iprot_->readMessageBegin(fname, mtype, rseqid);
+ if (mtype == ::apache::thrift::protocol::T_EXCEPTION) {
+ ::apache::thrift::TApplicationException x;
+ x.read(iprot_);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ throw x;
+ }
+ if (mtype != ::apache::thrift::protocol::T_REPLY) {
+ iprot_->skip(::apache::thrift::protocol::T_STRUCT);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ }
+ if (fname.compare("system_add_keyspace") != 0) {
+ iprot_->skip(::apache::thrift::protocol::T_STRUCT);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ }
+ Cassandra_system_add_keyspace_presult result;
+ result.success = &_return;
+ result.read(iprot_);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+
+ if (result.__isset.success) {
+ // _return pointer has now been filled
+ return;
+ }
+ if (result.__isset.ire) {
+ throw result.ire;
+ }
+ if (result.__isset.sde) {
+ throw result.sde;
+ }
+ throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "system_add_keyspace failed: unknown result");
+}
+
+void CassandraClient::system_drop_keyspace(std::string& _return, const std::string& keyspace)
+{
+ send_system_drop_keyspace(keyspace);
+ recv_system_drop_keyspace(_return);
+}
+
+void CassandraClient::send_system_drop_keyspace(const std::string& keyspace)
+{
+ int32_t cseqid = 0;
+ oprot_->writeMessageBegin("system_drop_keyspace", ::apache::thrift::protocol::T_CALL, cseqid);
+
+ Cassandra_system_drop_keyspace_pargs args;
+ args.keyspace = &keyspace;
+ args.write(oprot_);
+
+ oprot_->writeMessageEnd();
+ oprot_->getTransport()->writeEnd();
+ oprot_->getTransport()->flush();
+}
+
+void CassandraClient::recv_system_drop_keyspace(std::string& _return)
+{
+
+ int32_t rseqid = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TMessageType mtype;
+
+ iprot_->readMessageBegin(fname, mtype, rseqid);
+ if (mtype == ::apache::thrift::protocol::T_EXCEPTION) {
+ ::apache::thrift::TApplicationException x;
+ x.read(iprot_);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ throw x;
+ }
+ if (mtype != ::apache::thrift::protocol::T_REPLY) {
+ iprot_->skip(::apache::thrift::protocol::T_STRUCT);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ }
+ if (fname.compare("system_drop_keyspace") != 0) {
+ iprot_->skip(::apache::thrift::protocol::T_STRUCT);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ }
+ Cassandra_system_drop_keyspace_presult result;
+ result.success = &_return;
+ result.read(iprot_);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+
+ if (result.__isset.success) {
+ // _return pointer has now been filled
+ return;
+ }
+ if (result.__isset.ire) {
+ throw result.ire;
+ }
+ if (result.__isset.sde) {
+ throw result.sde;
+ }
+ throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "system_drop_keyspace failed: unknown result");
+}
+
+void CassandraClient::system_update_keyspace(std::string& _return, const KsDef& ks_def)
+{
+ send_system_update_keyspace(ks_def);
+ recv_system_update_keyspace(_return);
+}
+
+void CassandraClient::send_system_update_keyspace(const KsDef& ks_def)
+{
+ int32_t cseqid = 0;
+ oprot_->writeMessageBegin("system_update_keyspace", ::apache::thrift::protocol::T_CALL, cseqid);
+
+ Cassandra_system_update_keyspace_pargs args;
+ args.ks_def = &ks_def;
+ args.write(oprot_);
+
+ oprot_->writeMessageEnd();
+ oprot_->getTransport()->writeEnd();
+ oprot_->getTransport()->flush();
+}
+
+void CassandraClient::recv_system_update_keyspace(std::string& _return)
+{
+
+ int32_t rseqid = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TMessageType mtype;
+
+ iprot_->readMessageBegin(fname, mtype, rseqid);
+ if (mtype == ::apache::thrift::protocol::T_EXCEPTION) {
+ ::apache::thrift::TApplicationException x;
+ x.read(iprot_);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ throw x;
+ }
+ if (mtype != ::apache::thrift::protocol::T_REPLY) {
+ iprot_->skip(::apache::thrift::protocol::T_STRUCT);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ }
+ if (fname.compare("system_update_keyspace") != 0) {
+ iprot_->skip(::apache::thrift::protocol::T_STRUCT);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ }
+ Cassandra_system_update_keyspace_presult result;
+ result.success = &_return;
+ result.read(iprot_);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+
+ if (result.__isset.success) {
+ // _return pointer has now been filled
+ return;
+ }
+ if (result.__isset.ire) {
+ throw result.ire;
+ }
+ if (result.__isset.sde) {
+ throw result.sde;
+ }
+ throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "system_update_keyspace failed: unknown result");
+}
+
+void CassandraClient::system_update_column_family(std::string& _return, const CfDef& cf_def)
+{
+ send_system_update_column_family(cf_def);
+ recv_system_update_column_family(_return);
+}
+
+void CassandraClient::send_system_update_column_family(const CfDef& cf_def)
+{
+ int32_t cseqid = 0;
+ oprot_->writeMessageBegin("system_update_column_family", ::apache::thrift::protocol::T_CALL, cseqid);
+
+ Cassandra_system_update_column_family_pargs args;
+ args.cf_def = &cf_def;
+ args.write(oprot_);
+
+ oprot_->writeMessageEnd();
+ oprot_->getTransport()->writeEnd();
+ oprot_->getTransport()->flush();
+}
+
+void CassandraClient::recv_system_update_column_family(std::string& _return)
+{
+
+ int32_t rseqid = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TMessageType mtype;
+
+ iprot_->readMessageBegin(fname, mtype, rseqid);
+ if (mtype == ::apache::thrift::protocol::T_EXCEPTION) {
+ ::apache::thrift::TApplicationException x;
+ x.read(iprot_);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ throw x;
+ }
+ if (mtype != ::apache::thrift::protocol::T_REPLY) {
+ iprot_->skip(::apache::thrift::protocol::T_STRUCT);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ }
+ if (fname.compare("system_update_column_family") != 0) {
+ iprot_->skip(::apache::thrift::protocol::T_STRUCT);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ }
+ Cassandra_system_update_column_family_presult result;
+ result.success = &_return;
+ result.read(iprot_);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+
+ if (result.__isset.success) {
+ // _return pointer has now been filled
+ return;
+ }
+ if (result.__isset.ire) {
+ throw result.ire;
+ }
+ if (result.__isset.sde) {
+ throw result.sde;
+ }
+ throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "system_update_column_family failed: unknown result");
+}
+
+void CassandraClient::execute_cql_query(CqlResult& _return, const std::string& query, const Compression::type compression)
+{
+ send_execute_cql_query(query, compression);
+ recv_execute_cql_query(_return);
+}
+
+void CassandraClient::send_execute_cql_query(const std::string& query, const Compression::type compression)
+{
+ int32_t cseqid = 0;
+ oprot_->writeMessageBegin("execute_cql_query", ::apache::thrift::protocol::T_CALL, cseqid);
+
+ Cassandra_execute_cql_query_pargs args;
+ args.query = &query;
+ args.compression = &compression;
+ args.write(oprot_);
+
+ oprot_->writeMessageEnd();
+ oprot_->getTransport()->writeEnd();
+ oprot_->getTransport()->flush();
+}
+
+void CassandraClient::recv_execute_cql_query(CqlResult& _return)
+{
+
+ int32_t rseqid = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TMessageType mtype;
+
+ iprot_->readMessageBegin(fname, mtype, rseqid);
+ if (mtype == ::apache::thrift::protocol::T_EXCEPTION) {
+ ::apache::thrift::TApplicationException x;
+ x.read(iprot_);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ throw x;
+ }
+ if (mtype != ::apache::thrift::protocol::T_REPLY) {
+ iprot_->skip(::apache::thrift::protocol::T_STRUCT);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ }
+ if (fname.compare("execute_cql_query") != 0) {
+ iprot_->skip(::apache::thrift::protocol::T_STRUCT);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ }
+ Cassandra_execute_cql_query_presult result;
+ result.success = &_return;
+ result.read(iprot_);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+
+ if (result.__isset.success) {
+ // _return pointer has now been filled
+ return;
+ }
+ if (result.__isset.ire) {
+ throw result.ire;
+ }
+ if (result.__isset.ue) {
+ throw result.ue;
+ }
+ if (result.__isset.te) {
+ throw result.te;
+ }
+ if (result.__isset.sde) {
+ throw result.sde;
+ }
+ throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "execute_cql_query failed: unknown result");
+}
+
+void CassandraClient::prepare_cql_query(CqlPreparedResult& _return, const std::string& query, const Compression::type compression)
+{
+ send_prepare_cql_query(query, compression);
+ recv_prepare_cql_query(_return);
+}
+
+void CassandraClient::send_prepare_cql_query(const std::string& query, const Compression::type compression)
+{
+ int32_t cseqid = 0;
+ oprot_->writeMessageBegin("prepare_cql_query", ::apache::thrift::protocol::T_CALL, cseqid);
+
+ Cassandra_prepare_cql_query_pargs args;
+ args.query = &query;
+ args.compression = &compression;
+ args.write(oprot_);
+
+ oprot_->writeMessageEnd();
+ oprot_->getTransport()->writeEnd();
+ oprot_->getTransport()->flush();
+}
+
+void CassandraClient::recv_prepare_cql_query(CqlPreparedResult& _return)
+{
+
+ int32_t rseqid = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TMessageType mtype;
+
+ iprot_->readMessageBegin(fname, mtype, rseqid);
+ if (mtype == ::apache::thrift::protocol::T_EXCEPTION) {
+ ::apache::thrift::TApplicationException x;
+ x.read(iprot_);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ throw x;
+ }
+ if (mtype != ::apache::thrift::protocol::T_REPLY) {
+ iprot_->skip(::apache::thrift::protocol::T_STRUCT);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ }
+ if (fname.compare("prepare_cql_query") != 0) {
+ iprot_->skip(::apache::thrift::protocol::T_STRUCT);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ }
+ Cassandra_prepare_cql_query_presult result;
+ result.success = &_return;
+ result.read(iprot_);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+
+ if (result.__isset.success) {
+ // _return pointer has now been filled
+ return;
+ }
+ if (result.__isset.ire) {
+ throw result.ire;
+ }
+ throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "prepare_cql_query failed: unknown result");
+}
+
+void CassandraClient::execute_prepared_cql_query(CqlResult& _return, const int32_t itemId, const std::vector<std::string> & values)
+{
+ send_execute_prepared_cql_query(itemId, values);
+ recv_execute_prepared_cql_query(_return);
+}
+
+void CassandraClient::send_execute_prepared_cql_query(const int32_t itemId, const std::vector<std::string> & values)
+{
+ int32_t cseqid = 0;
+ oprot_->writeMessageBegin("execute_prepared_cql_query", ::apache::thrift::protocol::T_CALL, cseqid);
+
+ Cassandra_execute_prepared_cql_query_pargs args;
+ args.itemId = &itemId;
+ args.values = &values;
+ args.write(oprot_);
+
+ oprot_->writeMessageEnd();
+ oprot_->getTransport()->writeEnd();
+ oprot_->getTransport()->flush();
+}
+
+void CassandraClient::recv_execute_prepared_cql_query(CqlResult& _return)
+{
+
+ int32_t rseqid = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TMessageType mtype;
+
+ iprot_->readMessageBegin(fname, mtype, rseqid);
+ if (mtype == ::apache::thrift::protocol::T_EXCEPTION) {
+ ::apache::thrift::TApplicationException x;
+ x.read(iprot_);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ throw x;
+ }
+ if (mtype != ::apache::thrift::protocol::T_REPLY) {
+ iprot_->skip(::apache::thrift::protocol::T_STRUCT);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ }
+ if (fname.compare("execute_prepared_cql_query") != 0) {
+ iprot_->skip(::apache::thrift::protocol::T_STRUCT);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ }
+ Cassandra_execute_prepared_cql_query_presult result;
+ result.success = &_return;
+ result.read(iprot_);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+
+ if (result.__isset.success) {
+ // _return pointer has now been filled
+ return;
+ }
+ if (result.__isset.ire) {
+ throw result.ire;
+ }
+ if (result.__isset.ue) {
+ throw result.ue;
+ }
+ if (result.__isset.te) {
+ throw result.te;
+ }
+ if (result.__isset.sde) {
+ throw result.sde;
+ }
+ throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "execute_prepared_cql_query failed: unknown result");
+}
+
+void CassandraClient::set_cql_version(const std::string& version)
+{
+ send_set_cql_version(version);
+ recv_set_cql_version();
+}
+
+void CassandraClient::send_set_cql_version(const std::string& version)
+{
+ int32_t cseqid = 0;
+ oprot_->writeMessageBegin("set_cql_version", ::apache::thrift::protocol::T_CALL, cseqid);
+
+ Cassandra_set_cql_version_pargs args;
+ args.version = &version;
+ args.write(oprot_);
+
+ oprot_->writeMessageEnd();
+ oprot_->getTransport()->writeEnd();
+ oprot_->getTransport()->flush();
+}
+
+void CassandraClient::recv_set_cql_version()
+{
+
+ int32_t rseqid = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TMessageType mtype;
+
+ iprot_->readMessageBegin(fname, mtype, rseqid);
+ if (mtype == ::apache::thrift::protocol::T_EXCEPTION) {
+ ::apache::thrift::TApplicationException x;
+ x.read(iprot_);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ throw x;
+ }
+ if (mtype != ::apache::thrift::protocol::T_REPLY) {
+ iprot_->skip(::apache::thrift::protocol::T_STRUCT);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ }
+ if (fname.compare("set_cql_version") != 0) {
+ iprot_->skip(::apache::thrift::protocol::T_STRUCT);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ }
+ Cassandra_set_cql_version_presult result;
+ result.read(iprot_);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+
+ if (result.__isset.ire) {
+ throw result.ire;
+ }
+ return;
+}
+
+bool CassandraProcessor::process(boost::shared_ptr< ::apache::thrift::protocol::TProtocol> piprot, boost::shared_ptr< ::apache::thrift::protocol::TProtocol> poprot, void* callContext) {
+
+ ::apache::thrift::protocol::TProtocol* iprot = piprot.get();
+ ::apache::thrift::protocol::TProtocol* oprot = poprot.get();
+ std::string fname;
+ ::apache::thrift::protocol::TMessageType mtype;
+ int32_t seqid;
+
+ iprot->readMessageBegin(fname, mtype, seqid);
+
+ if (mtype != ::apache::thrift::protocol::T_CALL && mtype != ::apache::thrift::protocol::T_ONEWAY) {
+ iprot->skip(::apache::thrift::protocol::T_STRUCT);
+ iprot->readMessageEnd();
+ iprot->getTransport()->readEnd();
+ ::apache::thrift::TApplicationException x(::apache::thrift::TApplicationException::INVALID_MESSAGE_TYPE);
+ oprot->writeMessageBegin(fname, ::apache::thrift::protocol::T_EXCEPTION, seqid);
+ x.write(oprot);
+ oprot->writeMessageEnd();
+ oprot->getTransport()->writeEnd();
+ oprot->getTransport()->flush();
+ return true;
+ }
+
+ return process_fn(iprot, oprot, fname, seqid, callContext);
+}
+
+bool CassandraProcessor::process_fn( ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, std::string& fname, int32_t seqid, void* callContext) {
+ std::map<std::string, void (CassandraProcessor::*)(int32_t, ::apache::thrift::protocol::TProtocol*, ::apache::thrift::protocol::TProtocol*, void*)>::iterator pfn;
+ pfn = processMap_.find(fname);
+ if (pfn == processMap_.end()) {
+ iprot->skip(::apache::thrift::protocol::T_STRUCT);
+ iprot->readMessageEnd();
+ iprot->getTransport()->readEnd();
+ ::apache::thrift::TApplicationException x(::apache::thrift::TApplicationException::UNKNOWN_METHOD, "Invalid method name: '"+fname+"'");
+ oprot->writeMessageBegin(fname, ::apache::thrift::protocol::T_EXCEPTION, seqid);
+ x.write(oprot);
+ oprot->writeMessageEnd();
+ oprot->getTransport()->writeEnd();
+ oprot->getTransport()->flush();
+ return true;
+ }
+ (this->*(pfn->second))(seqid, iprot, oprot, callContext);
+ return true;
+}
+
+void CassandraProcessor::process_login(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext)
+{
+ void* ctx = NULL;
+ if (this->eventHandler_.get() != NULL) {
+ ctx = this->eventHandler_->getContext("Cassandra.login", callContext);
+ }
+ ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "Cassandra.login");
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->preRead(ctx, "Cassandra.login");
+ }
+
+ Cassandra_login_args args;
+ args.read(iprot);
+ iprot->readMessageEnd();
+ uint32_t bytes = iprot->getTransport()->readEnd();
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->postRead(ctx, "Cassandra.login", bytes);
+ }
+
+ Cassandra_login_result result;
+ try {
+ iface_->login(args.auth_request);
+ } catch (AuthenticationException &authnx) {
+ result.authnx = authnx;
+ result.__isset.authnx = true;
+ } catch (AuthorizationException &authzx) {
+ result.authzx = authzx;
+ result.__isset.authzx = true;
+ } catch (const std::exception& e) {
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->handlerError(ctx, "Cassandra.login");
+ }
+
+ ::apache::thrift::TApplicationException x(e.what());
+ oprot->writeMessageBegin("login", ::apache::thrift::protocol::T_EXCEPTION, seqid);
+ x.write(oprot);
+ oprot->writeMessageEnd();
+ oprot->getTransport()->writeEnd();
+ oprot->getTransport()->flush();
+ return;
+ }
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->preWrite(ctx, "Cassandra.login");
+ }
+
+ oprot->writeMessageBegin("login", ::apache::thrift::protocol::T_REPLY, seqid);
+ result.write(oprot);
+ oprot->writeMessageEnd();
+ bytes = oprot->getTransport()->writeEnd();
+ oprot->getTransport()->flush();
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->postWrite(ctx, "Cassandra.login", bytes);
+ }
+}
+
+void CassandraProcessor::process_set_keyspace(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext)
+{
+ void* ctx = NULL;
+ if (this->eventHandler_.get() != NULL) {
+ ctx = this->eventHandler_->getContext("Cassandra.set_keyspace", callContext);
+ }
+ ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "Cassandra.set_keyspace");
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->preRead(ctx, "Cassandra.set_keyspace");
+ }
+
+ Cassandra_set_keyspace_args args;
+ args.read(iprot);
+ iprot->readMessageEnd();
+ uint32_t bytes = iprot->getTransport()->readEnd();
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->postRead(ctx, "Cassandra.set_keyspace", bytes);
+ }
+
+ Cassandra_set_keyspace_result result;
+ try {
+ iface_->set_keyspace(args.keyspace);
+ } catch (InvalidRequestException &ire) {
+ result.ire = ire;
+ result.__isset.ire = true;
+ } catch (const std::exception& e) {
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->handlerError(ctx, "Cassandra.set_keyspace");
+ }
+
+ ::apache::thrift::TApplicationException x(e.what());
+ oprot->writeMessageBegin("set_keyspace", ::apache::thrift::protocol::T_EXCEPTION, seqid);
+ x.write(oprot);
+ oprot->writeMessageEnd();
+ oprot->getTransport()->writeEnd();
+ oprot->getTransport()->flush();
+ return;
+ }
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->preWrite(ctx, "Cassandra.set_keyspace");
+ }
+
+ oprot->writeMessageBegin("set_keyspace", ::apache::thrift::protocol::T_REPLY, seqid);
+ result.write(oprot);
+ oprot->writeMessageEnd();
+ bytes = oprot->getTransport()->writeEnd();
+ oprot->getTransport()->flush();
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->postWrite(ctx, "Cassandra.set_keyspace", bytes);
+ }
+}
+
+void CassandraProcessor::process_get(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext)
+{
+ void* ctx = NULL;
+ if (this->eventHandler_.get() != NULL) {
+ ctx = this->eventHandler_->getContext("Cassandra.get", callContext);
+ }
+ ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "Cassandra.get");
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->preRead(ctx, "Cassandra.get");
+ }
+
+ Cassandra_get_args args;
+ args.read(iprot);
+ iprot->readMessageEnd();
+ uint32_t bytes = iprot->getTransport()->readEnd();
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->postRead(ctx, "Cassandra.get", bytes);
+ }
+
+ Cassandra_get_result result;
+ try {
+ iface_->get(result.success, args.key, args.column_path, args.consistency_level);
+ result.__isset.success = true;
+ } catch (InvalidRequestException &ire) {
+ result.ire = ire;
+ result.__isset.ire = true;
+ } catch (NotFoundException &nfe) {
+ result.nfe = nfe;
+ result.__isset.nfe = true;
+ } catch (UnavailableException &ue) {
+ result.ue = ue;
+ result.__isset.ue = true;
+ } catch (TimedOutException &te) {
+ result.te = te;
+ result.__isset.te = true;
+ } catch (const std::exception& e) {
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->handlerError(ctx, "Cassandra.get");
+ }
+
+ ::apache::thrift::TApplicationException x(e.what());
+ oprot->writeMessageBegin("get", ::apache::thrift::protocol::T_EXCEPTION, seqid);
+ x.write(oprot);
+ oprot->writeMessageEnd();
+ oprot->getTransport()->writeEnd();
+ oprot->getTransport()->flush();
+ return;
+ }
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->preWrite(ctx, "Cassandra.get");
+ }
+
+ oprot->writeMessageBegin("get", ::apache::thrift::protocol::T_REPLY, seqid);
+ result.write(oprot);
+ oprot->writeMessageEnd();
+ bytes = oprot->getTransport()->writeEnd();
+ oprot->getTransport()->flush();
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->postWrite(ctx, "Cassandra.get", bytes);
+ }
+}
+
+void CassandraProcessor::process_get_slice(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext)
+{
+ void* ctx = NULL;
+ if (this->eventHandler_.get() != NULL) {
+ ctx = this->eventHandler_->getContext("Cassandra.get_slice", callContext);
+ }
+ ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "Cassandra.get_slice");
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->preRead(ctx, "Cassandra.get_slice");
+ }
+
+ Cassandra_get_slice_args args;
+ args.read(iprot);
+ iprot->readMessageEnd();
+ uint32_t bytes = iprot->getTransport()->readEnd();
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->postRead(ctx, "Cassandra.get_slice", bytes);
+ }
+
+ Cassandra_get_slice_result result;
+ try {
+ iface_->get_slice(result.success, args.key, args.column_parent, args.predicate, args.consistency_level);
+ result.__isset.success = true;
+ } catch (InvalidRequestException &ire) {
+ result.ire = ire;
+ result.__isset.ire = true;
+ } catch (UnavailableException &ue) {
+ result.ue = ue;
+ result.__isset.ue = true;
+ } catch (TimedOutException &te) {
+ result.te = te;
+ result.__isset.te = true;
+ } catch (const std::exception& e) {
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->handlerError(ctx, "Cassandra.get_slice");
+ }
+
+ ::apache::thrift::TApplicationException x(e.what());
+ oprot->writeMessageBegin("get_slice", ::apache::thrift::protocol::T_EXCEPTION, seqid);
+ x.write(oprot);
+ oprot->writeMessageEnd();
+ oprot->getTransport()->writeEnd();
+ oprot->getTransport()->flush();
+ return;
+ }
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->preWrite(ctx, "Cassandra.get_slice");
+ }
+
+ oprot->writeMessageBegin("get_slice", ::apache::thrift::protocol::T_REPLY, seqid);
+ result.write(oprot);
+ oprot->writeMessageEnd();
+ bytes = oprot->getTransport()->writeEnd();
+ oprot->getTransport()->flush();
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->postWrite(ctx, "Cassandra.get_slice", bytes);
+ }
+}
+
+void CassandraProcessor::process_get_count(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext)
+{
+ void* ctx = NULL;
+ if (this->eventHandler_.get() != NULL) {
+ ctx = this->eventHandler_->getContext("Cassandra.get_count", callContext);
+ }
+ ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "Cassandra.get_count");
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->preRead(ctx, "Cassandra.get_count");
+ }
+
+ Cassandra_get_count_args args;
+ args.read(iprot);
+ iprot->readMessageEnd();
+ uint32_t bytes = iprot->getTransport()->readEnd();
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->postRead(ctx, "Cassandra.get_count", bytes);
+ }
+
+ Cassandra_get_count_result result;
+ try {
+ result.success = iface_->get_count(args.key, args.column_parent, args.predicate, args.consistency_level);
+ result.__isset.success = true;
+ } catch (InvalidRequestException &ire) {
+ result.ire = ire;
+ result.__isset.ire = true;
+ } catch (UnavailableException &ue) {
+ result.ue = ue;
+ result.__isset.ue = true;
+ } catch (TimedOutException &te) {
+ result.te = te;
+ result.__isset.te = true;
+ } catch (const std::exception& e) {
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->handlerError(ctx, "Cassandra.get_count");
+ }
+
+ ::apache::thrift::TApplicationException x(e.what());
+ oprot->writeMessageBegin("get_count", ::apache::thrift::protocol::T_EXCEPTION, seqid);
+ x.write(oprot);
+ oprot->writeMessageEnd();
+ oprot->getTransport()->writeEnd();
+ oprot->getTransport()->flush();
+ return;
+ }
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->preWrite(ctx, "Cassandra.get_count");
+ }
+
+ oprot->writeMessageBegin("get_count", ::apache::thrift::protocol::T_REPLY, seqid);
+ result.write(oprot);
+ oprot->writeMessageEnd();
+ bytes = oprot->getTransport()->writeEnd();
+ oprot->getTransport()->flush();
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->postWrite(ctx, "Cassandra.get_count", bytes);
+ }
+}
+
+void CassandraProcessor::process_multiget_slice(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext)
+{
+ void* ctx = NULL;
+ if (this->eventHandler_.get() != NULL) {
+ ctx = this->eventHandler_->getContext("Cassandra.multiget_slice", callContext);
+ }
+ ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "Cassandra.multiget_slice");
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->preRead(ctx, "Cassandra.multiget_slice");
+ }
+
+ Cassandra_multiget_slice_args args;
+ args.read(iprot);
+ iprot->readMessageEnd();
+ uint32_t bytes = iprot->getTransport()->readEnd();
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->postRead(ctx, "Cassandra.multiget_slice", bytes);
+ }
+
+ Cassandra_multiget_slice_result result;
+ try {
+ iface_->multiget_slice(result.success, args.keys, args.column_parent, args.predicate, args.consistency_level);
+ result.__isset.success = true;
+ } catch (InvalidRequestException &ire) {
+ result.ire = ire;
+ result.__isset.ire = true;
+ } catch (UnavailableException &ue) {
+ result.ue = ue;
+ result.__isset.ue = true;
+ } catch (TimedOutException &te) {
+ result.te = te;
+ result.__isset.te = true;
+ } catch (const std::exception& e) {
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->handlerError(ctx, "Cassandra.multiget_slice");
+ }
+
+ ::apache::thrift::TApplicationException x(e.what());
+ oprot->writeMessageBegin("multiget_slice", ::apache::thrift::protocol::T_EXCEPTION, seqid);
+ x.write(oprot);
+ oprot->writeMessageEnd();
+ oprot->getTransport()->writeEnd();
+ oprot->getTransport()->flush();
+ return;
+ }
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->preWrite(ctx, "Cassandra.multiget_slice");
+ }
+
+ oprot->writeMessageBegin("multiget_slice", ::apache::thrift::protocol::T_REPLY, seqid);
+ result.write(oprot);
+ oprot->writeMessageEnd();
+ bytes = oprot->getTransport()->writeEnd();
+ oprot->getTransport()->flush();
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->postWrite(ctx, "Cassandra.multiget_slice", bytes);
+ }
+}
+
+void CassandraProcessor::process_multiget_count(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext)
+{
+ void* ctx = NULL;
+ if (this->eventHandler_.get() != NULL) {
+ ctx = this->eventHandler_->getContext("Cassandra.multiget_count", callContext);
+ }
+ ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "Cassandra.multiget_count");
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->preRead(ctx, "Cassandra.multiget_count");
+ }
+
+ Cassandra_multiget_count_args args;
+ args.read(iprot);
+ iprot->readMessageEnd();
+ uint32_t bytes = iprot->getTransport()->readEnd();
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->postRead(ctx, "Cassandra.multiget_count", bytes);
+ }
+
+ Cassandra_multiget_count_result result;
+ try {
+ iface_->multiget_count(result.success, args.keys, args.column_parent, args.predicate, args.consistency_level);
+ result.__isset.success = true;
+ } catch (InvalidRequestException &ire) {
+ result.ire = ire;
+ result.__isset.ire = true;
+ } catch (UnavailableException &ue) {
+ result.ue = ue;
+ result.__isset.ue = true;
+ } catch (TimedOutException &te) {
+ result.te = te;
+ result.__isset.te = true;
+ } catch (const std::exception& e) {
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->handlerError(ctx, "Cassandra.multiget_count");
+ }
+
+ ::apache::thrift::TApplicationException x(e.what());
+ oprot->writeMessageBegin("multiget_count", ::apache::thrift::protocol::T_EXCEPTION, seqid);
+ x.write(oprot);
+ oprot->writeMessageEnd();
+ oprot->getTransport()->writeEnd();
+ oprot->getTransport()->flush();
+ return;
+ }
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->preWrite(ctx, "Cassandra.multiget_count");
+ }
+
+ oprot->writeMessageBegin("multiget_count", ::apache::thrift::protocol::T_REPLY, seqid);
+ result.write(oprot);
+ oprot->writeMessageEnd();
+ bytes = oprot->getTransport()->writeEnd();
+ oprot->getTransport()->flush();
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->postWrite(ctx, "Cassandra.multiget_count", bytes);
+ }
+}
+
+void CassandraProcessor::process_get_range_slices(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext)
+{
+ void* ctx = NULL;
+ if (this->eventHandler_.get() != NULL) {
+ ctx = this->eventHandler_->getContext("Cassandra.get_range_slices", callContext);
+ }
+ ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "Cassandra.get_range_slices");
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->preRead(ctx, "Cassandra.get_range_slices");
+ }
+
+ Cassandra_get_range_slices_args args;
+ args.read(iprot);
+ iprot->readMessageEnd();
+ uint32_t bytes = iprot->getTransport()->readEnd();
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->postRead(ctx, "Cassandra.get_range_slices", bytes);
+ }
+
+ Cassandra_get_range_slices_result result;
+ try {
+ iface_->get_range_slices(result.success, args.column_parent, args.predicate, args.range, args.consistency_level);
+ result.__isset.success = true;
+ } catch (InvalidRequestException &ire) {
+ result.ire = ire;
+ result.__isset.ire = true;
+ } catch (UnavailableException &ue) {
+ result.ue = ue;
+ result.__isset.ue = true;
+ } catch (TimedOutException &te) {
+ result.te = te;
+ result.__isset.te = true;
+ } catch (const std::exception& e) {
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->handlerError(ctx, "Cassandra.get_range_slices");
+ }
+
+ ::apache::thrift::TApplicationException x(e.what());
+ oprot->writeMessageBegin("get_range_slices", ::apache::thrift::protocol::T_EXCEPTION, seqid);
+ x.write(oprot);
+ oprot->writeMessageEnd();
+ oprot->getTransport()->writeEnd();
+ oprot->getTransport()->flush();
+ return;
+ }
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->preWrite(ctx, "Cassandra.get_range_slices");
+ }
+
+ oprot->writeMessageBegin("get_range_slices", ::apache::thrift::protocol::T_REPLY, seqid);
+ result.write(oprot);
+ oprot->writeMessageEnd();
+ bytes = oprot->getTransport()->writeEnd();
+ oprot->getTransport()->flush();
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->postWrite(ctx, "Cassandra.get_range_slices", bytes);
+ }
+}
+
+void CassandraProcessor::process_get_paged_slice(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext)
+{
+ void* ctx = NULL;
+ if (this->eventHandler_.get() != NULL) {
+ ctx = this->eventHandler_->getContext("Cassandra.get_paged_slice", callContext);
+ }
+ ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "Cassandra.get_paged_slice");
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->preRead(ctx, "Cassandra.get_paged_slice");
+ }
+
+ Cassandra_get_paged_slice_args args;
+ args.read(iprot);
+ iprot->readMessageEnd();
+ uint32_t bytes = iprot->getTransport()->readEnd();
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->postRead(ctx, "Cassandra.get_paged_slice", bytes);
+ }
+
+ Cassandra_get_paged_slice_result result;
+ try {
+ iface_->get_paged_slice(result.success, args.column_family, args.range, args.start_column, args.consistency_level);
+ result.__isset.success = true;
+ } catch (InvalidRequestException &ire) {
+ result.ire = ire;
+ result.__isset.ire = true;
+ } catch (UnavailableException &ue) {
+ result.ue = ue;
+ result.__isset.ue = true;
+ } catch (TimedOutException &te) {
+ result.te = te;
+ result.__isset.te = true;
+ } catch (const std::exception& e) {
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->handlerError(ctx, "Cassandra.get_paged_slice");
+ }
+
+ ::apache::thrift::TApplicationException x(e.what());
+ oprot->writeMessageBegin("get_paged_slice", ::apache::thrift::protocol::T_EXCEPTION, seqid);
+ x.write(oprot);
+ oprot->writeMessageEnd();
+ oprot->getTransport()->writeEnd();
+ oprot->getTransport()->flush();
+ return;
+ }
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->preWrite(ctx, "Cassandra.get_paged_slice");
+ }
+
+ oprot->writeMessageBegin("get_paged_slice", ::apache::thrift::protocol::T_REPLY, seqid);
+ result.write(oprot);
+ oprot->writeMessageEnd();
+ bytes = oprot->getTransport()->writeEnd();
+ oprot->getTransport()->flush();
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->postWrite(ctx, "Cassandra.get_paged_slice", bytes);
+ }
+}
+
+void CassandraProcessor::process_get_indexed_slices(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext)
+{
+ void* ctx = NULL;
+ if (this->eventHandler_.get() != NULL) {
+ ctx = this->eventHandler_->getContext("Cassandra.get_indexed_slices", callContext);
+ }
+ ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "Cassandra.get_indexed_slices");
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->preRead(ctx, "Cassandra.get_indexed_slices");
+ }
+
+ Cassandra_get_indexed_slices_args args;
+ args.read(iprot);
+ iprot->readMessageEnd();
+ uint32_t bytes = iprot->getTransport()->readEnd();
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->postRead(ctx, "Cassandra.get_indexed_slices", bytes);
+ }
+
+ Cassandra_get_indexed_slices_result result;
+ try {
+ iface_->get_indexed_slices(result.success, args.column_parent, args.index_clause, args.column_predicate, args.consistency_level);
+ result.__isset.success = true;
+ } catch (InvalidRequestException &ire) {
+ result.ire = ire;
+ result.__isset.ire = true;
+ } catch (UnavailableException &ue) {
+ result.ue = ue;
+ result.__isset.ue = true;
+ } catch (TimedOutException &te) {
+ result.te = te;
+ result.__isset.te = true;
+ } catch (const std::exception& e) {
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->handlerError(ctx, "Cassandra.get_indexed_slices");
+ }
+
+ ::apache::thrift::TApplicationException x(e.what());
+ oprot->writeMessageBegin("get_indexed_slices", ::apache::thrift::protocol::T_EXCEPTION, seqid);
+ x.write(oprot);
+ oprot->writeMessageEnd();
+ oprot->getTransport()->writeEnd();
+ oprot->getTransport()->flush();
+ return;
+ }
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->preWrite(ctx, "Cassandra.get_indexed_slices");
+ }
+
+ oprot->writeMessageBegin("get_indexed_slices", ::apache::thrift::protocol::T_REPLY, seqid);
+ result.write(oprot);
+ oprot->writeMessageEnd();
+ bytes = oprot->getTransport()->writeEnd();
+ oprot->getTransport()->flush();
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->postWrite(ctx, "Cassandra.get_indexed_slices", bytes);
+ }
+}
+
+void CassandraProcessor::process_insert(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext)
+{
+ void* ctx = NULL;
+ if (this->eventHandler_.get() != NULL) {
+ ctx = this->eventHandler_->getContext("Cassandra.insert", callContext);
+ }
+ ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "Cassandra.insert");
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->preRead(ctx, "Cassandra.insert");
+ }
+
+ Cassandra_insert_args args;
+ args.read(iprot);
+ iprot->readMessageEnd();
+ uint32_t bytes = iprot->getTransport()->readEnd();
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->postRead(ctx, "Cassandra.insert", bytes);
+ }
+
+ Cassandra_insert_result result;
+ try {
+ iface_->insert(args.key, args.column_parent, args.column, args.consistency_level);
+ } catch (InvalidRequestException &ire) {
+ result.ire = ire;
+ result.__isset.ire = true;
+ } catch (UnavailableException &ue) {
+ result.ue = ue;
+ result.__isset.ue = true;
+ } catch (TimedOutException &te) {
+ result.te = te;
+ result.__isset.te = true;
+ } catch (const std::exception& e) {
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->handlerError(ctx, "Cassandra.insert");
+ }
+
+ ::apache::thrift::TApplicationException x(e.what());
+ oprot->writeMessageBegin("insert", ::apache::thrift::protocol::T_EXCEPTION, seqid);
+ x.write(oprot);
+ oprot->writeMessageEnd();
+ oprot->getTransport()->writeEnd();
+ oprot->getTransport()->flush();
+ return;
+ }
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->preWrite(ctx, "Cassandra.insert");
+ }
+
+ oprot->writeMessageBegin("insert", ::apache::thrift::protocol::T_REPLY, seqid);
+ result.write(oprot);
+ oprot->writeMessageEnd();
+ bytes = oprot->getTransport()->writeEnd();
+ oprot->getTransport()->flush();
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->postWrite(ctx, "Cassandra.insert", bytes);
+ }
+}
+
+void CassandraProcessor::process_add(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext)
+{
+ void* ctx = NULL;
+ if (this->eventHandler_.get() != NULL) {
+ ctx = this->eventHandler_->getContext("Cassandra.add", callContext);
+ }
+ ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "Cassandra.add");
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->preRead(ctx, "Cassandra.add");
+ }
+
+ Cassandra_add_args args;
+ args.read(iprot);
+ iprot->readMessageEnd();
+ uint32_t bytes = iprot->getTransport()->readEnd();
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->postRead(ctx, "Cassandra.add", bytes);
+ }
+
+ Cassandra_add_result result;
+ try {
+ iface_->add(args.key, args.column_parent, args.column, args.consistency_level);
+ } catch (InvalidRequestException &ire) {
+ result.ire = ire;
+ result.__isset.ire = true;
+ } catch (UnavailableException &ue) {
+ result.ue = ue;
+ result.__isset.ue = true;
+ } catch (TimedOutException &te) {
+ result.te = te;
+ result.__isset.te = true;
+ } catch (const std::exception& e) {
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->handlerError(ctx, "Cassandra.add");
+ }
+
+ ::apache::thrift::TApplicationException x(e.what());
+ oprot->writeMessageBegin("add", ::apache::thrift::protocol::T_EXCEPTION, seqid);
+ x.write(oprot);
+ oprot->writeMessageEnd();
+ oprot->getTransport()->writeEnd();
+ oprot->getTransport()->flush();
+ return;
+ }
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->preWrite(ctx, "Cassandra.add");
+ }
+
+ oprot->writeMessageBegin("add", ::apache::thrift::protocol::T_REPLY, seqid);
+ result.write(oprot);
+ oprot->writeMessageEnd();
+ bytes = oprot->getTransport()->writeEnd();
+ oprot->getTransport()->flush();
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->postWrite(ctx, "Cassandra.add", bytes);
+ }
+}
+
+void CassandraProcessor::process_remove(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext)
+{
+ void* ctx = NULL;
+ if (this->eventHandler_.get() != NULL) {
+ ctx = this->eventHandler_->getContext("Cassandra.remove", callContext);
+ }
+ ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "Cassandra.remove");
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->preRead(ctx, "Cassandra.remove");
+ }
+
+ Cassandra_remove_args args;
+ args.read(iprot);
+ iprot->readMessageEnd();
+ uint32_t bytes = iprot->getTransport()->readEnd();
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->postRead(ctx, "Cassandra.remove", bytes);
+ }
+
+ Cassandra_remove_result result;
+ try {
+ iface_->remove(args.key, args.column_path, args.timestamp, args.consistency_level);
+ } catch (InvalidRequestException &ire) {
+ result.ire = ire;
+ result.__isset.ire = true;
+ } catch (UnavailableException &ue) {
+ result.ue = ue;
+ result.__isset.ue = true;
+ } catch (TimedOutException &te) {
+ result.te = te;
+ result.__isset.te = true;
+ } catch (const std::exception& e) {
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->handlerError(ctx, "Cassandra.remove");
+ }
+
+ ::apache::thrift::TApplicationException x(e.what());
+ oprot->writeMessageBegin("remove", ::apache::thrift::protocol::T_EXCEPTION, seqid);
+ x.write(oprot);
+ oprot->writeMessageEnd();
+ oprot->getTransport()->writeEnd();
+ oprot->getTransport()->flush();
+ return;
+ }
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->preWrite(ctx, "Cassandra.remove");
+ }
+
+ oprot->writeMessageBegin("remove", ::apache::thrift::protocol::T_REPLY, seqid);
+ result.write(oprot);
+ oprot->writeMessageEnd();
+ bytes = oprot->getTransport()->writeEnd();
+ oprot->getTransport()->flush();
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->postWrite(ctx, "Cassandra.remove", bytes);
+ }
+}
+
+void CassandraProcessor::process_remove_counter(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext)
+{
+ void* ctx = NULL;
+ if (this->eventHandler_.get() != NULL) {
+ ctx = this->eventHandler_->getContext("Cassandra.remove_counter", callContext);
+ }
+ ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "Cassandra.remove_counter");
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->preRead(ctx, "Cassandra.remove_counter");
+ }
+
+ Cassandra_remove_counter_args args;
+ args.read(iprot);
+ iprot->readMessageEnd();
+ uint32_t bytes = iprot->getTransport()->readEnd();
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->postRead(ctx, "Cassandra.remove_counter", bytes);
+ }
+
+ Cassandra_remove_counter_result result;
+ try {
+ iface_->remove_counter(args.key, args.path, args.consistency_level);
+ } catch (InvalidRequestException &ire) {
+ result.ire = ire;
+ result.__isset.ire = true;
+ } catch (UnavailableException &ue) {
+ result.ue = ue;
+ result.__isset.ue = true;
+ } catch (TimedOutException &te) {
+ result.te = te;
+ result.__isset.te = true;
+ } catch (const std::exception& e) {
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->handlerError(ctx, "Cassandra.remove_counter");
+ }
+
+ ::apache::thrift::TApplicationException x(e.what());
+ oprot->writeMessageBegin("remove_counter", ::apache::thrift::protocol::T_EXCEPTION, seqid);
+ x.write(oprot);
+ oprot->writeMessageEnd();
+ oprot->getTransport()->writeEnd();
+ oprot->getTransport()->flush();
+ return;
+ }
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->preWrite(ctx, "Cassandra.remove_counter");
+ }
+
+ oprot->writeMessageBegin("remove_counter", ::apache::thrift::protocol::T_REPLY, seqid);
+ result.write(oprot);
+ oprot->writeMessageEnd();
+ bytes = oprot->getTransport()->writeEnd();
+ oprot->getTransport()->flush();
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->postWrite(ctx, "Cassandra.remove_counter", bytes);
+ }
+}
+
+void CassandraProcessor::process_batch_mutate(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext)
+{
+ void* ctx = NULL;
+ if (this->eventHandler_.get() != NULL) {
+ ctx = this->eventHandler_->getContext("Cassandra.batch_mutate", callContext);
+ }
+ ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "Cassandra.batch_mutate");
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->preRead(ctx, "Cassandra.batch_mutate");
+ }
+
+ Cassandra_batch_mutate_args args;
+ args.read(iprot);
+ iprot->readMessageEnd();
+ uint32_t bytes = iprot->getTransport()->readEnd();
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->postRead(ctx, "Cassandra.batch_mutate", bytes);
+ }
+
+ Cassandra_batch_mutate_result result;
+ try {
+ iface_->batch_mutate(args.mutation_map, args.consistency_level);
+ } catch (InvalidRequestException &ire) {
+ result.ire = ire;
+ result.__isset.ire = true;
+ } catch (UnavailableException &ue) {
+ result.ue = ue;
+ result.__isset.ue = true;
+ } catch (TimedOutException &te) {
+ result.te = te;
+ result.__isset.te = true;
+ } catch (const std::exception& e) {
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->handlerError(ctx, "Cassandra.batch_mutate");
+ }
+
+ ::apache::thrift::TApplicationException x(e.what());
+ oprot->writeMessageBegin("batch_mutate", ::apache::thrift::protocol::T_EXCEPTION, seqid);
+ x.write(oprot);
+ oprot->writeMessageEnd();
+ oprot->getTransport()->writeEnd();
+ oprot->getTransport()->flush();
+ return;
+ }
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->preWrite(ctx, "Cassandra.batch_mutate");
+ }
+
+ oprot->writeMessageBegin("batch_mutate", ::apache::thrift::protocol::T_REPLY, seqid);
+ result.write(oprot);
+ oprot->writeMessageEnd();
+ bytes = oprot->getTransport()->writeEnd();
+ oprot->getTransport()->flush();
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->postWrite(ctx, "Cassandra.batch_mutate", bytes);
+ }
+}
+
+void CassandraProcessor::process_truncate(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext)
+{
+ void* ctx = NULL;
+ if (this->eventHandler_.get() != NULL) {
+ ctx = this->eventHandler_->getContext("Cassandra.truncate", callContext);
+ }
+ ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "Cassandra.truncate");
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->preRead(ctx, "Cassandra.truncate");
+ }
+
+ Cassandra_truncate_args args;
+ args.read(iprot);
+ iprot->readMessageEnd();
+ uint32_t bytes = iprot->getTransport()->readEnd();
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->postRead(ctx, "Cassandra.truncate", bytes);
+ }
+
+ Cassandra_truncate_result result;
+ try {
+ iface_->truncate(args.cfname);
+ } catch (InvalidRequestException &ire) {
+ result.ire = ire;
+ result.__isset.ire = true;
+ } catch (UnavailableException &ue) {
+ result.ue = ue;
+ result.__isset.ue = true;
+ } catch (TimedOutException &te) {
+ result.te = te;
+ result.__isset.te = true;
+ } catch (const std::exception& e) {
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->handlerError(ctx, "Cassandra.truncate");
+ }
+
+ ::apache::thrift::TApplicationException x(e.what());
+ oprot->writeMessageBegin("truncate", ::apache::thrift::protocol::T_EXCEPTION, seqid);
+ x.write(oprot);
+ oprot->writeMessageEnd();
+ oprot->getTransport()->writeEnd();
+ oprot->getTransport()->flush();
+ return;
+ }
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->preWrite(ctx, "Cassandra.truncate");
+ }
+
+ oprot->writeMessageBegin("truncate", ::apache::thrift::protocol::T_REPLY, seqid);
+ result.write(oprot);
+ oprot->writeMessageEnd();
+ bytes = oprot->getTransport()->writeEnd();
+ oprot->getTransport()->flush();
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->postWrite(ctx, "Cassandra.truncate", bytes);
+ }
+}
+
+void CassandraProcessor::process_describe_schema_versions(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext)
+{
+ void* ctx = NULL;
+ if (this->eventHandler_.get() != NULL) {
+ ctx = this->eventHandler_->getContext("Cassandra.describe_schema_versions", callContext);
+ }
+ ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "Cassandra.describe_schema_versions");
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->preRead(ctx, "Cassandra.describe_schema_versions");
+ }
+
+ Cassandra_describe_schema_versions_args args;
+ args.read(iprot);
+ iprot->readMessageEnd();
+ uint32_t bytes = iprot->getTransport()->readEnd();
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->postRead(ctx, "Cassandra.describe_schema_versions", bytes);
+ }
+
+ Cassandra_describe_schema_versions_result result;
+ try {
+ iface_->describe_schema_versions(result.success);
+ result.__isset.success = true;
+ } catch (InvalidRequestException &ire) {
+ result.ire = ire;
+ result.__isset.ire = true;
+ } catch (const std::exception& e) {
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->handlerError(ctx, "Cassandra.describe_schema_versions");
+ }
+
+ ::apache::thrift::TApplicationException x(e.what());
+ oprot->writeMessageBegin("describe_schema_versions", ::apache::thrift::protocol::T_EXCEPTION, seqid);
+ x.write(oprot);
+ oprot->writeMessageEnd();
+ oprot->getTransport()->writeEnd();
+ oprot->getTransport()->flush();
+ return;
+ }
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->preWrite(ctx, "Cassandra.describe_schema_versions");
+ }
+
+ oprot->writeMessageBegin("describe_schema_versions", ::apache::thrift::protocol::T_REPLY, seqid);
+ result.write(oprot);
+ oprot->writeMessageEnd();
+ bytes = oprot->getTransport()->writeEnd();
+ oprot->getTransport()->flush();
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->postWrite(ctx, "Cassandra.describe_schema_versions", bytes);
+ }
+}
+
+void CassandraProcessor::process_describe_keyspaces(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext)
+{
+ void* ctx = NULL;
+ if (this->eventHandler_.get() != NULL) {
+ ctx = this->eventHandler_->getContext("Cassandra.describe_keyspaces", callContext);
+ }
+ ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "Cassandra.describe_keyspaces");
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->preRead(ctx, "Cassandra.describe_keyspaces");
+ }
+
+ Cassandra_describe_keyspaces_args args;
+ args.read(iprot);
+ iprot->readMessageEnd();
+ uint32_t bytes = iprot->getTransport()->readEnd();
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->postRead(ctx, "Cassandra.describe_keyspaces", bytes);
+ }
+
+ Cassandra_describe_keyspaces_result result;
+ try {
+ iface_->describe_keyspaces(result.success);
+ result.__isset.success = true;
+ } catch (InvalidRequestException &ire) {
+ result.ire = ire;
+ result.__isset.ire = true;
+ } catch (const std::exception& e) {
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->handlerError(ctx, "Cassandra.describe_keyspaces");
+ }
+
+ ::apache::thrift::TApplicationException x(e.what());
+ oprot->writeMessageBegin("describe_keyspaces", ::apache::thrift::protocol::T_EXCEPTION, seqid);
+ x.write(oprot);
+ oprot->writeMessageEnd();
+ oprot->getTransport()->writeEnd();
+ oprot->getTransport()->flush();
+ return;
+ }
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->preWrite(ctx, "Cassandra.describe_keyspaces");
+ }
+
+ oprot->writeMessageBegin("describe_keyspaces", ::apache::thrift::protocol::T_REPLY, seqid);
+ result.write(oprot);
+ oprot->writeMessageEnd();
+ bytes = oprot->getTransport()->writeEnd();
+ oprot->getTransport()->flush();
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->postWrite(ctx, "Cassandra.describe_keyspaces", bytes);
+ }
+}
+
+void CassandraProcessor::process_describe_cluster_name(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext)
+{
+ void* ctx = NULL;
+ if (this->eventHandler_.get() != NULL) {
+ ctx = this->eventHandler_->getContext("Cassandra.describe_cluster_name", callContext);
+ }
+ ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "Cassandra.describe_cluster_name");
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->preRead(ctx, "Cassandra.describe_cluster_name");
+ }
+
+ Cassandra_describe_cluster_name_args args;
+ args.read(iprot);
+ iprot->readMessageEnd();
+ uint32_t bytes = iprot->getTransport()->readEnd();
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->postRead(ctx, "Cassandra.describe_cluster_name", bytes);
+ }
+
+ Cassandra_describe_cluster_name_result result;
+ try {
+ iface_->describe_cluster_name(result.success);
+ result.__isset.success = true;
+ } catch (const std::exception& e) {
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->handlerError(ctx, "Cassandra.describe_cluster_name");
+ }
+
+ ::apache::thrift::TApplicationException x(e.what());
+ oprot->writeMessageBegin("describe_cluster_name", ::apache::thrift::protocol::T_EXCEPTION, seqid);
+ x.write(oprot);
+ oprot->writeMessageEnd();
+ oprot->getTransport()->writeEnd();
+ oprot->getTransport()->flush();
+ return;
+ }
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->preWrite(ctx, "Cassandra.describe_cluster_name");
+ }
+
+ oprot->writeMessageBegin("describe_cluster_name", ::apache::thrift::protocol::T_REPLY, seqid);
+ result.write(oprot);
+ oprot->writeMessageEnd();
+ bytes = oprot->getTransport()->writeEnd();
+ oprot->getTransport()->flush();
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->postWrite(ctx, "Cassandra.describe_cluster_name", bytes);
+ }
+}
+
+void CassandraProcessor::process_describe_version(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext)
+{
+ void* ctx = NULL;
+ if (this->eventHandler_.get() != NULL) {
+ ctx = this->eventHandler_->getContext("Cassandra.describe_version", callContext);
+ }
+ ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "Cassandra.describe_version");
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->preRead(ctx, "Cassandra.describe_version");
+ }
+
+ Cassandra_describe_version_args args;
+ args.read(iprot);
+ iprot->readMessageEnd();
+ uint32_t bytes = iprot->getTransport()->readEnd();
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->postRead(ctx, "Cassandra.describe_version", bytes);
+ }
+
+ Cassandra_describe_version_result result;
+ try {
+ iface_->describe_version(result.success);
+ result.__isset.success = true;
+ } catch (const std::exception& e) {
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->handlerError(ctx, "Cassandra.describe_version");
+ }
+
+ ::apache::thrift::TApplicationException x(e.what());
+ oprot->writeMessageBegin("describe_version", ::apache::thrift::protocol::T_EXCEPTION, seqid);
+ x.write(oprot);
+ oprot->writeMessageEnd();
+ oprot->getTransport()->writeEnd();
+ oprot->getTransport()->flush();
+ return;
+ }
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->preWrite(ctx, "Cassandra.describe_version");
+ }
+
+ oprot->writeMessageBegin("describe_version", ::apache::thrift::protocol::T_REPLY, seqid);
+ result.write(oprot);
+ oprot->writeMessageEnd();
+ bytes = oprot->getTransport()->writeEnd();
+ oprot->getTransport()->flush();
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->postWrite(ctx, "Cassandra.describe_version", bytes);
+ }
+}
+
+void CassandraProcessor::process_describe_ring(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext)
+{
+ void* ctx = NULL;
+ if (this->eventHandler_.get() != NULL) {
+ ctx = this->eventHandler_->getContext("Cassandra.describe_ring", callContext);
+ }
+ ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "Cassandra.describe_ring");
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->preRead(ctx, "Cassandra.describe_ring");
+ }
+
+ Cassandra_describe_ring_args args;
+ args.read(iprot);
+ iprot->readMessageEnd();
+ uint32_t bytes = iprot->getTransport()->readEnd();
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->postRead(ctx, "Cassandra.describe_ring", bytes);
+ }
+
+ Cassandra_describe_ring_result result;
+ try {
+ iface_->describe_ring(result.success, args.keyspace);
+ result.__isset.success = true;
+ } catch (InvalidRequestException &ire) {
+ result.ire = ire;
+ result.__isset.ire = true;
+ } catch (const std::exception& e) {
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->handlerError(ctx, "Cassandra.describe_ring");
+ }
+
+ ::apache::thrift::TApplicationException x(e.what());
+ oprot->writeMessageBegin("describe_ring", ::apache::thrift::protocol::T_EXCEPTION, seqid);
+ x.write(oprot);
+ oprot->writeMessageEnd();
+ oprot->getTransport()->writeEnd();
+ oprot->getTransport()->flush();
+ return;
+ }
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->preWrite(ctx, "Cassandra.describe_ring");
+ }
+
+ oprot->writeMessageBegin("describe_ring", ::apache::thrift::protocol::T_REPLY, seqid);
+ result.write(oprot);
+ oprot->writeMessageEnd();
+ bytes = oprot->getTransport()->writeEnd();
+ oprot->getTransport()->flush();
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->postWrite(ctx, "Cassandra.describe_ring", bytes);
+ }
+}
+
+void CassandraProcessor::process_describe_token_map(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext)
+{
+ void* ctx = NULL;
+ if (this->eventHandler_.get() != NULL) {
+ ctx = this->eventHandler_->getContext("Cassandra.describe_token_map", callContext);
+ }
+ ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "Cassandra.describe_token_map");
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->preRead(ctx, "Cassandra.describe_token_map");
+ }
+
+ Cassandra_describe_token_map_args args;
+ args.read(iprot);
+ iprot->readMessageEnd();
+ uint32_t bytes = iprot->getTransport()->readEnd();
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->postRead(ctx, "Cassandra.describe_token_map", bytes);
+ }
+
+ Cassandra_describe_token_map_result result;
+ try {
+ iface_->describe_token_map(result.success);
+ result.__isset.success = true;
+ } catch (InvalidRequestException &ire) {
+ result.ire = ire;
+ result.__isset.ire = true;
+ } catch (const std::exception& e) {
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->handlerError(ctx, "Cassandra.describe_token_map");
+ }
+
+ ::apache::thrift::TApplicationException x(e.what());
+ oprot->writeMessageBegin("describe_token_map", ::apache::thrift::protocol::T_EXCEPTION, seqid);
+ x.write(oprot);
+ oprot->writeMessageEnd();
+ oprot->getTransport()->writeEnd();
+ oprot->getTransport()->flush();
+ return;
+ }
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->preWrite(ctx, "Cassandra.describe_token_map");
+ }
+
+ oprot->writeMessageBegin("describe_token_map", ::apache::thrift::protocol::T_REPLY, seqid);
+ result.write(oprot);
+ oprot->writeMessageEnd();
+ bytes = oprot->getTransport()->writeEnd();
+ oprot->getTransport()->flush();
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->postWrite(ctx, "Cassandra.describe_token_map", bytes);
+ }
+}
+
+void CassandraProcessor::process_describe_partitioner(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext)
+{
+ void* ctx = NULL;
+ if (this->eventHandler_.get() != NULL) {
+ ctx = this->eventHandler_->getContext("Cassandra.describe_partitioner", callContext);
+ }
+ ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "Cassandra.describe_partitioner");
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->preRead(ctx, "Cassandra.describe_partitioner");
+ }
+
+ Cassandra_describe_partitioner_args args;
+ args.read(iprot);
+ iprot->readMessageEnd();
+ uint32_t bytes = iprot->getTransport()->readEnd();
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->postRead(ctx, "Cassandra.describe_partitioner", bytes);
+ }
+
+ Cassandra_describe_partitioner_result result;
+ try {
+ iface_->describe_partitioner(result.success);
+ result.__isset.success = true;
+ } catch (const std::exception& e) {
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->handlerError(ctx, "Cassandra.describe_partitioner");
+ }
+
+ ::apache::thrift::TApplicationException x(e.what());
+ oprot->writeMessageBegin("describe_partitioner", ::apache::thrift::protocol::T_EXCEPTION, seqid);
+ x.write(oprot);
+ oprot->writeMessageEnd();
+ oprot->getTransport()->writeEnd();
+ oprot->getTransport()->flush();
+ return;
+ }
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->preWrite(ctx, "Cassandra.describe_partitioner");
+ }
+
+ oprot->writeMessageBegin("describe_partitioner", ::apache::thrift::protocol::T_REPLY, seqid);
+ result.write(oprot);
+ oprot->writeMessageEnd();
+ bytes = oprot->getTransport()->writeEnd();
+ oprot->getTransport()->flush();
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->postWrite(ctx, "Cassandra.describe_partitioner", bytes);
+ }
+}
+
+void CassandraProcessor::process_describe_snitch(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext)
+{
+ void* ctx = NULL;
+ if (this->eventHandler_.get() != NULL) {
+ ctx = this->eventHandler_->getContext("Cassandra.describe_snitch", callContext);
+ }
+ ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "Cassandra.describe_snitch");
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->preRead(ctx, "Cassandra.describe_snitch");
+ }
+
+ Cassandra_describe_snitch_args args;
+ args.read(iprot);
+ iprot->readMessageEnd();
+ uint32_t bytes = iprot->getTransport()->readEnd();
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->postRead(ctx, "Cassandra.describe_snitch", bytes);
+ }
+
+ Cassandra_describe_snitch_result result;
+ try {
+ iface_->describe_snitch(result.success);
+ result.__isset.success = true;
+ } catch (const std::exception& e) {
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->handlerError(ctx, "Cassandra.describe_snitch");
+ }
+
+ ::apache::thrift::TApplicationException x(e.what());
+ oprot->writeMessageBegin("describe_snitch", ::apache::thrift::protocol::T_EXCEPTION, seqid);
+ x.write(oprot);
+ oprot->writeMessageEnd();
+ oprot->getTransport()->writeEnd();
+ oprot->getTransport()->flush();
+ return;
+ }
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->preWrite(ctx, "Cassandra.describe_snitch");
+ }
+
+ oprot->writeMessageBegin("describe_snitch", ::apache::thrift::protocol::T_REPLY, seqid);
+ result.write(oprot);
+ oprot->writeMessageEnd();
+ bytes = oprot->getTransport()->writeEnd();
+ oprot->getTransport()->flush();
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->postWrite(ctx, "Cassandra.describe_snitch", bytes);
+ }
+}
+
+void CassandraProcessor::process_describe_keyspace(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext)
+{
+ void* ctx = NULL;
+ if (this->eventHandler_.get() != NULL) {
+ ctx = this->eventHandler_->getContext("Cassandra.describe_keyspace", callContext);
+ }
+ ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "Cassandra.describe_keyspace");
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->preRead(ctx, "Cassandra.describe_keyspace");
+ }
+
+ Cassandra_describe_keyspace_args args;
+ args.read(iprot);
+ iprot->readMessageEnd();
+ uint32_t bytes = iprot->getTransport()->readEnd();
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->postRead(ctx, "Cassandra.describe_keyspace", bytes);
+ }
+
+ Cassandra_describe_keyspace_result result;
+ try {
+ iface_->describe_keyspace(result.success, args.keyspace);
+ result.__isset.success = true;
+ } catch (NotFoundException &nfe) {
+ result.nfe = nfe;
+ result.__isset.nfe = true;
+ } catch (InvalidRequestException &ire) {
+ result.ire = ire;
+ result.__isset.ire = true;
+ } catch (const std::exception& e) {
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->handlerError(ctx, "Cassandra.describe_keyspace");
+ }
+
+ ::apache::thrift::TApplicationException x(e.what());
+ oprot->writeMessageBegin("describe_keyspace", ::apache::thrift::protocol::T_EXCEPTION, seqid);
+ x.write(oprot);
+ oprot->writeMessageEnd();
+ oprot->getTransport()->writeEnd();
+ oprot->getTransport()->flush();
+ return;
+ }
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->preWrite(ctx, "Cassandra.describe_keyspace");
+ }
+
+ oprot->writeMessageBegin("describe_keyspace", ::apache::thrift::protocol::T_REPLY, seqid);
+ result.write(oprot);
+ oprot->writeMessageEnd();
+ bytes = oprot->getTransport()->writeEnd();
+ oprot->getTransport()->flush();
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->postWrite(ctx, "Cassandra.describe_keyspace", bytes);
+ }
+}
+
+void CassandraProcessor::process_describe_splits(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext)
+{
+ void* ctx = NULL;
+ if (this->eventHandler_.get() != NULL) {
+ ctx = this->eventHandler_->getContext("Cassandra.describe_splits", callContext);
+ }
+ ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "Cassandra.describe_splits");
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->preRead(ctx, "Cassandra.describe_splits");
+ }
+
+ Cassandra_describe_splits_args args;
+ args.read(iprot);
+ iprot->readMessageEnd();
+ uint32_t bytes = iprot->getTransport()->readEnd();
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->postRead(ctx, "Cassandra.describe_splits", bytes);
+ }
+
+ Cassandra_describe_splits_result result;
+ try {
+ iface_->describe_splits(result.success, args.cfName, args.start_token, args.end_token, args.keys_per_split);
+ result.__isset.success = true;
+ } catch (InvalidRequestException &ire) {
+ result.ire = ire;
+ result.__isset.ire = true;
+ } catch (const std::exception& e) {
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->handlerError(ctx, "Cassandra.describe_splits");
+ }
+
+ ::apache::thrift::TApplicationException x(e.what());
+ oprot->writeMessageBegin("describe_splits", ::apache::thrift::protocol::T_EXCEPTION, seqid);
+ x.write(oprot);
+ oprot->writeMessageEnd();
+ oprot->getTransport()->writeEnd();
+ oprot->getTransport()->flush();
+ return;
+ }
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->preWrite(ctx, "Cassandra.describe_splits");
+ }
+
+ oprot->writeMessageBegin("describe_splits", ::apache::thrift::protocol::T_REPLY, seqid);
+ result.write(oprot);
+ oprot->writeMessageEnd();
+ bytes = oprot->getTransport()->writeEnd();
+ oprot->getTransport()->flush();
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->postWrite(ctx, "Cassandra.describe_splits", bytes);
+ }
+}
+
+void CassandraProcessor::process_system_add_column_family(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext)
+{
+ void* ctx = NULL;
+ if (this->eventHandler_.get() != NULL) {
+ ctx = this->eventHandler_->getContext("Cassandra.system_add_column_family", callContext);
+ }
+ ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "Cassandra.system_add_column_family");
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->preRead(ctx, "Cassandra.system_add_column_family");
+ }
+
+ Cassandra_system_add_column_family_args args;
+ args.read(iprot);
+ iprot->readMessageEnd();
+ uint32_t bytes = iprot->getTransport()->readEnd();
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->postRead(ctx, "Cassandra.system_add_column_family", bytes);
+ }
+
+ Cassandra_system_add_column_family_result result;
+ try {
+ iface_->system_add_column_family(result.success, args.cf_def);
+ result.__isset.success = true;
+ } catch (InvalidRequestException &ire) {
+ result.ire = ire;
+ result.__isset.ire = true;
+ } catch (SchemaDisagreementException &sde) {
+ result.sde = sde;
+ result.__isset.sde = true;
+ } catch (const std::exception& e) {
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->handlerError(ctx, "Cassandra.system_add_column_family");
+ }
+
+ ::apache::thrift::TApplicationException x(e.what());
+ oprot->writeMessageBegin("system_add_column_family", ::apache::thrift::protocol::T_EXCEPTION, seqid);
+ x.write(oprot);
+ oprot->writeMessageEnd();
+ oprot->getTransport()->writeEnd();
+ oprot->getTransport()->flush();
+ return;
+ }
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->preWrite(ctx, "Cassandra.system_add_column_family");
+ }
+
+ oprot->writeMessageBegin("system_add_column_family", ::apache::thrift::protocol::T_REPLY, seqid);
+ result.write(oprot);
+ oprot->writeMessageEnd();
+ bytes = oprot->getTransport()->writeEnd();
+ oprot->getTransport()->flush();
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->postWrite(ctx, "Cassandra.system_add_column_family", bytes);
+ }
+}
+
+void CassandraProcessor::process_system_drop_column_family(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext)
+{
+ void* ctx = NULL;
+ if (this->eventHandler_.get() != NULL) {
+ ctx = this->eventHandler_->getContext("Cassandra.system_drop_column_family", callContext);
+ }
+ ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "Cassandra.system_drop_column_family");
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->preRead(ctx, "Cassandra.system_drop_column_family");
+ }
+
+ Cassandra_system_drop_column_family_args args;
+ args.read(iprot);
+ iprot->readMessageEnd();
+ uint32_t bytes = iprot->getTransport()->readEnd();
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->postRead(ctx, "Cassandra.system_drop_column_family", bytes);
+ }
+
+ Cassandra_system_drop_column_family_result result;
+ try {
+ iface_->system_drop_column_family(result.success, args.column_family);
+ result.__isset.success = true;
+ } catch (InvalidRequestException &ire) {
+ result.ire = ire;
+ result.__isset.ire = true;
+ } catch (SchemaDisagreementException &sde) {
+ result.sde = sde;
+ result.__isset.sde = true;
+ } catch (const std::exception& e) {
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->handlerError(ctx, "Cassandra.system_drop_column_family");
+ }
+
+ ::apache::thrift::TApplicationException x(e.what());
+ oprot->writeMessageBegin("system_drop_column_family", ::apache::thrift::protocol::T_EXCEPTION, seqid);
+ x.write(oprot);
+ oprot->writeMessageEnd();
+ oprot->getTransport()->writeEnd();
+ oprot->getTransport()->flush();
+ return;
+ }
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->preWrite(ctx, "Cassandra.system_drop_column_family");
+ }
+
+ oprot->writeMessageBegin("system_drop_column_family", ::apache::thrift::protocol::T_REPLY, seqid);
+ result.write(oprot);
+ oprot->writeMessageEnd();
+ bytes = oprot->getTransport()->writeEnd();
+ oprot->getTransport()->flush();
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->postWrite(ctx, "Cassandra.system_drop_column_family", bytes);
+ }
+}
+
+void CassandraProcessor::process_system_add_keyspace(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext)
+{
+ void* ctx = NULL;
+ if (this->eventHandler_.get() != NULL) {
+ ctx = this->eventHandler_->getContext("Cassandra.system_add_keyspace", callContext);
+ }
+ ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "Cassandra.system_add_keyspace");
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->preRead(ctx, "Cassandra.system_add_keyspace");
+ }
+
+ Cassandra_system_add_keyspace_args args;
+ args.read(iprot);
+ iprot->readMessageEnd();
+ uint32_t bytes = iprot->getTransport()->readEnd();
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->postRead(ctx, "Cassandra.system_add_keyspace", bytes);
+ }
+
+ Cassandra_system_add_keyspace_result result;
+ try {
+ iface_->system_add_keyspace(result.success, args.ks_def);
+ result.__isset.success = true;
+ } catch (InvalidRequestException &ire) {
+ result.ire = ire;
+ result.__isset.ire = true;
+ } catch (SchemaDisagreementException &sde) {
+ result.sde = sde;
+ result.__isset.sde = true;
+ } catch (const std::exception& e) {
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->handlerError(ctx, "Cassandra.system_add_keyspace");
+ }
+
+ ::apache::thrift::TApplicationException x(e.what());
+ oprot->writeMessageBegin("system_add_keyspace", ::apache::thrift::protocol::T_EXCEPTION, seqid);
+ x.write(oprot);
+ oprot->writeMessageEnd();
+ oprot->getTransport()->writeEnd();
+ oprot->getTransport()->flush();
+ return;
+ }
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->preWrite(ctx, "Cassandra.system_add_keyspace");
+ }
+
+ oprot->writeMessageBegin("system_add_keyspace", ::apache::thrift::protocol::T_REPLY, seqid);
+ result.write(oprot);
+ oprot->writeMessageEnd();
+ bytes = oprot->getTransport()->writeEnd();
+ oprot->getTransport()->flush();
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->postWrite(ctx, "Cassandra.system_add_keyspace", bytes);
+ }
+}
+
+void CassandraProcessor::process_system_drop_keyspace(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext)
+{
+ void* ctx = NULL;
+ if (this->eventHandler_.get() != NULL) {
+ ctx = this->eventHandler_->getContext("Cassandra.system_drop_keyspace", callContext);
+ }
+ ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "Cassandra.system_drop_keyspace");
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->preRead(ctx, "Cassandra.system_drop_keyspace");
+ }
+
+ Cassandra_system_drop_keyspace_args args;
+ args.read(iprot);
+ iprot->readMessageEnd();
+ uint32_t bytes = iprot->getTransport()->readEnd();
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->postRead(ctx, "Cassandra.system_drop_keyspace", bytes);
+ }
+
+ Cassandra_system_drop_keyspace_result result;
+ try {
+ iface_->system_drop_keyspace(result.success, args.keyspace);
+ result.__isset.success = true;
+ } catch (InvalidRequestException &ire) {
+ result.ire = ire;
+ result.__isset.ire = true;
+ } catch (SchemaDisagreementException &sde) {
+ result.sde = sde;
+ result.__isset.sde = true;
+ } catch (const std::exception& e) {
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->handlerError(ctx, "Cassandra.system_drop_keyspace");
+ }
+
+ ::apache::thrift::TApplicationException x(e.what());
+ oprot->writeMessageBegin("system_drop_keyspace", ::apache::thrift::protocol::T_EXCEPTION, seqid);
+ x.write(oprot);
+ oprot->writeMessageEnd();
+ oprot->getTransport()->writeEnd();
+ oprot->getTransport()->flush();
+ return;
+ }
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->preWrite(ctx, "Cassandra.system_drop_keyspace");
+ }
+
+ oprot->writeMessageBegin("system_drop_keyspace", ::apache::thrift::protocol::T_REPLY, seqid);
+ result.write(oprot);
+ oprot->writeMessageEnd();
+ bytes = oprot->getTransport()->writeEnd();
+ oprot->getTransport()->flush();
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->postWrite(ctx, "Cassandra.system_drop_keyspace", bytes);
+ }
+}
+
+void CassandraProcessor::process_system_update_keyspace(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext)
+{
+ void* ctx = NULL;
+ if (this->eventHandler_.get() != NULL) {
+ ctx = this->eventHandler_->getContext("Cassandra.system_update_keyspace", callContext);
+ }
+ ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "Cassandra.system_update_keyspace");
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->preRead(ctx, "Cassandra.system_update_keyspace");
+ }
+
+ Cassandra_system_update_keyspace_args args;
+ args.read(iprot);
+ iprot->readMessageEnd();
+ uint32_t bytes = iprot->getTransport()->readEnd();
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->postRead(ctx, "Cassandra.system_update_keyspace", bytes);
+ }
+
+ Cassandra_system_update_keyspace_result result;
+ try {
+ iface_->system_update_keyspace(result.success, args.ks_def);
+ result.__isset.success = true;
+ } catch (InvalidRequestException &ire) {
+ result.ire = ire;
+ result.__isset.ire = true;
+ } catch (SchemaDisagreementException &sde) {
+ result.sde = sde;
+ result.__isset.sde = true;
+ } catch (const std::exception& e) {
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->handlerError(ctx, "Cassandra.system_update_keyspace");
+ }
+
+ ::apache::thrift::TApplicationException x(e.what());
+ oprot->writeMessageBegin("system_update_keyspace", ::apache::thrift::protocol::T_EXCEPTION, seqid);
+ x.write(oprot);
+ oprot->writeMessageEnd();
+ oprot->getTransport()->writeEnd();
+ oprot->getTransport()->flush();
+ return;
+ }
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->preWrite(ctx, "Cassandra.system_update_keyspace");
+ }
+
+ oprot->writeMessageBegin("system_update_keyspace", ::apache::thrift::protocol::T_REPLY, seqid);
+ result.write(oprot);
+ oprot->writeMessageEnd();
+ bytes = oprot->getTransport()->writeEnd();
+ oprot->getTransport()->flush();
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->postWrite(ctx, "Cassandra.system_update_keyspace", bytes);
+ }
+}
+
+void CassandraProcessor::process_system_update_column_family(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext)
+{
+ void* ctx = NULL;
+ if (this->eventHandler_.get() != NULL) {
+ ctx = this->eventHandler_->getContext("Cassandra.system_update_column_family", callContext);
+ }
+ ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "Cassandra.system_update_column_family");
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->preRead(ctx, "Cassandra.system_update_column_family");
+ }
+
+ Cassandra_system_update_column_family_args args;
+ args.read(iprot);
+ iprot->readMessageEnd();
+ uint32_t bytes = iprot->getTransport()->readEnd();
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->postRead(ctx, "Cassandra.system_update_column_family", bytes);
+ }
+
+ Cassandra_system_update_column_family_result result;
+ try {
+ iface_->system_update_column_family(result.success, args.cf_def);
+ result.__isset.success = true;
+ } catch (InvalidRequestException &ire) {
+ result.ire = ire;
+ result.__isset.ire = true;
+ } catch (SchemaDisagreementException &sde) {
+ result.sde = sde;
+ result.__isset.sde = true;
+ } catch (const std::exception& e) {
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->handlerError(ctx, "Cassandra.system_update_column_family");
+ }
+
+ ::apache::thrift::TApplicationException x(e.what());
+ oprot->writeMessageBegin("system_update_column_family", ::apache::thrift::protocol::T_EXCEPTION, seqid);
+ x.write(oprot);
+ oprot->writeMessageEnd();
+ oprot->getTransport()->writeEnd();
+ oprot->getTransport()->flush();
+ return;
+ }
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->preWrite(ctx, "Cassandra.system_update_column_family");
+ }
+
+ oprot->writeMessageBegin("system_update_column_family", ::apache::thrift::protocol::T_REPLY, seqid);
+ result.write(oprot);
+ oprot->writeMessageEnd();
+ bytes = oprot->getTransport()->writeEnd();
+ oprot->getTransport()->flush();
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->postWrite(ctx, "Cassandra.system_update_column_family", bytes);
+ }
+}
+
+void CassandraProcessor::process_execute_cql_query(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext)
+{
+ void* ctx = NULL;
+ if (this->eventHandler_.get() != NULL) {
+ ctx = this->eventHandler_->getContext("Cassandra.execute_cql_query", callContext);
+ }
+ ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "Cassandra.execute_cql_query");
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->preRead(ctx, "Cassandra.execute_cql_query");
+ }
+
+ Cassandra_execute_cql_query_args args;
+ args.read(iprot);
+ iprot->readMessageEnd();
+ uint32_t bytes = iprot->getTransport()->readEnd();
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->postRead(ctx, "Cassandra.execute_cql_query", bytes);
+ }
+
+ Cassandra_execute_cql_query_result result;
+ try {
+ iface_->execute_cql_query(result.success, args.query, args.compression);
+ result.__isset.success = true;
+ } catch (InvalidRequestException &ire) {
+ result.ire = ire;
+ result.__isset.ire = true;
+ } catch (UnavailableException &ue) {
+ result.ue = ue;
+ result.__isset.ue = true;
+ } catch (TimedOutException &te) {
+ result.te = te;
+ result.__isset.te = true;
+ } catch (SchemaDisagreementException &sde) {
+ result.sde = sde;
+ result.__isset.sde = true;
+ } catch (const std::exception& e) {
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->handlerError(ctx, "Cassandra.execute_cql_query");
+ }
+
+ ::apache::thrift::TApplicationException x(e.what());
+ oprot->writeMessageBegin("execute_cql_query", ::apache::thrift::protocol::T_EXCEPTION, seqid);
+ x.write(oprot);
+ oprot->writeMessageEnd();
+ oprot->getTransport()->writeEnd();
+ oprot->getTransport()->flush();
+ return;
+ }
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->preWrite(ctx, "Cassandra.execute_cql_query");
+ }
+
+ oprot->writeMessageBegin("execute_cql_query", ::apache::thrift::protocol::T_REPLY, seqid);
+ result.write(oprot);
+ oprot->writeMessageEnd();
+ bytes = oprot->getTransport()->writeEnd();
+ oprot->getTransport()->flush();
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->postWrite(ctx, "Cassandra.execute_cql_query", bytes);
+ }
+}
+
+void CassandraProcessor::process_prepare_cql_query(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext)
+{
+ void* ctx = NULL;
+ if (this->eventHandler_.get() != NULL) {
+ ctx = this->eventHandler_->getContext("Cassandra.prepare_cql_query", callContext);
+ }
+ ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "Cassandra.prepare_cql_query");
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->preRead(ctx, "Cassandra.prepare_cql_query");
+ }
+
+ Cassandra_prepare_cql_query_args args;
+ args.read(iprot);
+ iprot->readMessageEnd();
+ uint32_t bytes = iprot->getTransport()->readEnd();
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->postRead(ctx, "Cassandra.prepare_cql_query", bytes);
+ }
+
+ Cassandra_prepare_cql_query_result result;
+ try {
+ iface_->prepare_cql_query(result.success, args.query, args.compression);
+ result.__isset.success = true;
+ } catch (InvalidRequestException &ire) {
+ result.ire = ire;
+ result.__isset.ire = true;
+ } catch (const std::exception& e) {
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->handlerError(ctx, "Cassandra.prepare_cql_query");
+ }
+
+ ::apache::thrift::TApplicationException x(e.what());
+ oprot->writeMessageBegin("prepare_cql_query", ::apache::thrift::protocol::T_EXCEPTION, seqid);
+ x.write(oprot);
+ oprot->writeMessageEnd();
+ oprot->getTransport()->writeEnd();
+ oprot->getTransport()->flush();
+ return;
+ }
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->preWrite(ctx, "Cassandra.prepare_cql_query");
+ }
+
+ oprot->writeMessageBegin("prepare_cql_query", ::apache::thrift::protocol::T_REPLY, seqid);
+ result.write(oprot);
+ oprot->writeMessageEnd();
+ bytes = oprot->getTransport()->writeEnd();
+ oprot->getTransport()->flush();
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->postWrite(ctx, "Cassandra.prepare_cql_query", bytes);
+ }
+}
+
+void CassandraProcessor::process_execute_prepared_cql_query(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext)
+{
+ void* ctx = NULL;
+ if (this->eventHandler_.get() != NULL) {
+ ctx = this->eventHandler_->getContext("Cassandra.execute_prepared_cql_query", callContext);
+ }
+ ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "Cassandra.execute_prepared_cql_query");
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->preRead(ctx, "Cassandra.execute_prepared_cql_query");
+ }
+
+ Cassandra_execute_prepared_cql_query_args args;
+ args.read(iprot);
+ iprot->readMessageEnd();
+ uint32_t bytes = iprot->getTransport()->readEnd();
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->postRead(ctx, "Cassandra.execute_prepared_cql_query", bytes);
+ }
+
+ Cassandra_execute_prepared_cql_query_result result;
+ try {
+ iface_->execute_prepared_cql_query(result.success, args.itemId, args.values);
+ result.__isset.success = true;
+ } catch (InvalidRequestException &ire) {
+ result.ire = ire;
+ result.__isset.ire = true;
+ } catch (UnavailableException &ue) {
+ result.ue = ue;
+ result.__isset.ue = true;
+ } catch (TimedOutException &te) {
+ result.te = te;
+ result.__isset.te = true;
+ } catch (SchemaDisagreementException &sde) {
+ result.sde = sde;
+ result.__isset.sde = true;
+ } catch (const std::exception& e) {
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->handlerError(ctx, "Cassandra.execute_prepared_cql_query");
+ }
+
+ ::apache::thrift::TApplicationException x(e.what());
+ oprot->writeMessageBegin("execute_prepared_cql_query", ::apache::thrift::protocol::T_EXCEPTION, seqid);
+ x.write(oprot);
+ oprot->writeMessageEnd();
+ oprot->getTransport()->writeEnd();
+ oprot->getTransport()->flush();
+ return;
+ }
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->preWrite(ctx, "Cassandra.execute_prepared_cql_query");
+ }
+
+ oprot->writeMessageBegin("execute_prepared_cql_query", ::apache::thrift::protocol::T_REPLY, seqid);
+ result.write(oprot);
+ oprot->writeMessageEnd();
+ bytes = oprot->getTransport()->writeEnd();
+ oprot->getTransport()->flush();
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->postWrite(ctx, "Cassandra.execute_prepared_cql_query", bytes);
+ }
+}
+
+void CassandraProcessor::process_set_cql_version(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext)
+{
+ void* ctx = NULL;
+ if (this->eventHandler_.get() != NULL) {
+ ctx = this->eventHandler_->getContext("Cassandra.set_cql_version", callContext);
+ }
+ ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "Cassandra.set_cql_version");
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->preRead(ctx, "Cassandra.set_cql_version");
+ }
+
+ Cassandra_set_cql_version_args args;
+ args.read(iprot);
+ iprot->readMessageEnd();
+ uint32_t bytes = iprot->getTransport()->readEnd();
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->postRead(ctx, "Cassandra.set_cql_version", bytes);
+ }
+
+ Cassandra_set_cql_version_result result;
+ try {
+ iface_->set_cql_version(args.version);
+ } catch (InvalidRequestException &ire) {
+ result.ire = ire;
+ result.__isset.ire = true;
+ } catch (const std::exception& e) {
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->handlerError(ctx, "Cassandra.set_cql_version");
+ }
+
+ ::apache::thrift::TApplicationException x(e.what());
+ oprot->writeMessageBegin("set_cql_version", ::apache::thrift::protocol::T_EXCEPTION, seqid);
+ x.write(oprot);
+ oprot->writeMessageEnd();
+ oprot->getTransport()->writeEnd();
+ oprot->getTransport()->flush();
+ return;
+ }
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->preWrite(ctx, "Cassandra.set_cql_version");
+ }
+
+ oprot->writeMessageBegin("set_cql_version", ::apache::thrift::protocol::T_REPLY, seqid);
+ result.write(oprot);
+ oprot->writeMessageEnd();
+ bytes = oprot->getTransport()->writeEnd();
+ oprot->getTransport()->flush();
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->postWrite(ctx, "Cassandra.set_cql_version", bytes);
+ }
+}
+
+::boost::shared_ptr< ::apache::thrift::TProcessor > CassandraProcessorFactory::getProcessor(const ::apache::thrift::TConnectionInfo& connInfo) {
+ ::apache::thrift::ReleaseHandler< CassandraIfFactory > cleanup(handlerFactory_);
+ ::boost::shared_ptr< CassandraIf > handler(handlerFactory_->getHandler(connInfo), cleanup);
+ ::boost::shared_ptr< ::apache::thrift::TProcessor > processor(new CassandraProcessor(handler));
+ return processor;
+}
+}}} // namespace
+
diff --git a/storage/cassandra/gen-cpp/Cassandra.h b/storage/cassandra/gen-cpp/Cassandra.h
new file mode 100644
index 00000000000..2040cc63aa2
--- /dev/null
+++ b/storage/cassandra/gen-cpp/Cassandra.h
@@ -0,0 +1,5466 @@
+/**
+ * Autogenerated by Thrift Compiler (0.8.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+#ifndef Cassandra_H
+#define Cassandra_H
+
+#include <TProcessor.h>
+#include "cassandra_types.h"
+
+namespace org { namespace apache { namespace cassandra {
+
+class CassandraIf {
+ public:
+ virtual ~CassandraIf() {}
+ virtual void login(const AuthenticationRequest& auth_request) = 0;
+ virtual void set_keyspace(const std::string& keyspace) = 0;
+ virtual void get(ColumnOrSuperColumn& _return, const std::string& key, const ColumnPath& column_path, const ConsistencyLevel::type consistency_level) = 0;
+ virtual void get_slice(std::vector<ColumnOrSuperColumn> & _return, const std::string& key, const ColumnParent& column_parent, const SlicePredicate& predicate, const ConsistencyLevel::type consistency_level) = 0;
+ virtual int32_t get_count(const std::string& key, const ColumnParent& column_parent, const SlicePredicate& predicate, const ConsistencyLevel::type consistency_level) = 0;
+ virtual void multiget_slice(std::map<std::string, std::vector<ColumnOrSuperColumn> > & _return, const std::vector<std::string> & keys, const ColumnParent& column_parent, const SlicePredicate& predicate, const ConsistencyLevel::type consistency_level) = 0;
+ virtual void multiget_count(std::map<std::string, int32_t> & _return, const std::vector<std::string> & keys, const ColumnParent& column_parent, const SlicePredicate& predicate, const ConsistencyLevel::type consistency_level) = 0;
+ virtual void get_range_slices(std::vector<KeySlice> & _return, const ColumnParent& column_parent, const SlicePredicate& predicate, const KeyRange& range, const ConsistencyLevel::type consistency_level) = 0;
+ virtual void get_paged_slice(std::vector<KeySlice> & _return, const std::string& column_family, const KeyRange& range, const std::string& start_column, const ConsistencyLevel::type consistency_level) = 0;
+ virtual void get_indexed_slices(std::vector<KeySlice> & _return, const ColumnParent& column_parent, const IndexClause& index_clause, const SlicePredicate& column_predicate, const ConsistencyLevel::type consistency_level) = 0;
+ virtual void insert(const std::string& key, const ColumnParent& column_parent, const Column& column, const ConsistencyLevel::type consistency_level) = 0;
+ virtual void add(const std::string& key, const ColumnParent& column_parent, const CounterColumn& column, const ConsistencyLevel::type consistency_level) = 0;
+ virtual void remove(const std::string& key, const ColumnPath& column_path, const int64_t timestamp, const ConsistencyLevel::type consistency_level) = 0;
+ virtual void remove_counter(const std::string& key, const ColumnPath& path, const ConsistencyLevel::type consistency_level) = 0;
+ virtual void batch_mutate(const std::map<std::string, std::map<std::string, std::vector<Mutation> > > & mutation_map, const ConsistencyLevel::type consistency_level) = 0;
+ virtual void truncate(const std::string& cfname) = 0;
+ virtual void describe_schema_versions(std::map<std::string, std::vector<std::string> > & _return) = 0;
+ virtual void describe_keyspaces(std::vector<KsDef> & _return) = 0;
+ virtual void describe_cluster_name(std::string& _return) = 0;
+ virtual void describe_version(std::string& _return) = 0;
+ virtual void describe_ring(std::vector<TokenRange> & _return, const std::string& keyspace) = 0;
+ virtual void describe_token_map(std::map<std::string, std::string> & _return) = 0;
+ virtual void describe_partitioner(std::string& _return) = 0;
+ virtual void describe_snitch(std::string& _return) = 0;
+ virtual void describe_keyspace(KsDef& _return, const std::string& keyspace) = 0;
+ virtual void describe_splits(std::vector<std::string> & _return, const std::string& cfName, const std::string& start_token, const std::string& end_token, const int32_t keys_per_split) = 0;
+ virtual void system_add_column_family(std::string& _return, const CfDef& cf_def) = 0;
+ virtual void system_drop_column_family(std::string& _return, const std::string& column_family) = 0;
+ virtual void system_add_keyspace(std::string& _return, const KsDef& ks_def) = 0;
+ virtual void system_drop_keyspace(std::string& _return, const std::string& keyspace) = 0;
+ virtual void system_update_keyspace(std::string& _return, const KsDef& ks_def) = 0;
+ virtual void system_update_column_family(std::string& _return, const CfDef& cf_def) = 0;
+ virtual void execute_cql_query(CqlResult& _return, const std::string& query, const Compression::type compression) = 0;
+ virtual void prepare_cql_query(CqlPreparedResult& _return, const std::string& query, const Compression::type compression) = 0;
+ virtual void execute_prepared_cql_query(CqlResult& _return, const int32_t itemId, const std::vector<std::string> & values) = 0;
+ virtual void set_cql_version(const std::string& version) = 0;
+};
+
+class CassandraIfFactory {
+ public:
+ typedef CassandraIf Handler;
+
+ virtual ~CassandraIfFactory() {}
+
+ virtual CassandraIf* getHandler(const ::apache::thrift::TConnectionInfo& connInfo) = 0;
+ virtual void releaseHandler(CassandraIf* /* handler */) = 0;
+};
+
+class CassandraIfSingletonFactory : virtual public CassandraIfFactory {
+ public:
+ CassandraIfSingletonFactory(const boost::shared_ptr<CassandraIf>& iface) : iface_(iface) {}
+ virtual ~CassandraIfSingletonFactory() {}
+
+ virtual CassandraIf* getHandler(const ::apache::thrift::TConnectionInfo&) {
+ return iface_.get();
+ }
+ virtual void releaseHandler(CassandraIf* /* handler */) {}
+
+ protected:
+ boost::shared_ptr<CassandraIf> iface_;
+};
+
+class CassandraNull : virtual public CassandraIf {
+ public:
+ virtual ~CassandraNull() {}
+ void login(const AuthenticationRequest& /* auth_request */) {
+ return;
+ }
+ void set_keyspace(const std::string& /* keyspace */) {
+ return;
+ }
+ void get(ColumnOrSuperColumn& /* _return */, const std::string& /* key */, const ColumnPath& /* column_path */, const ConsistencyLevel::type /* consistency_level */) {
+ return;
+ }
+ void get_slice(std::vector<ColumnOrSuperColumn> & /* _return */, const std::string& /* key */, const ColumnParent& /* column_parent */, const SlicePredicate& /* predicate */, const ConsistencyLevel::type /* consistency_level */) {
+ return;
+ }
+ int32_t get_count(const std::string& /* key */, const ColumnParent& /* column_parent */, const SlicePredicate& /* predicate */, const ConsistencyLevel::type /* consistency_level */) {
+ int32_t _return = 0;
+ return _return;
+ }
+ void multiget_slice(std::map<std::string, std::vector<ColumnOrSuperColumn> > & /* _return */, const std::vector<std::string> & /* keys */, const ColumnParent& /* column_parent */, const SlicePredicate& /* predicate */, const ConsistencyLevel::type /* consistency_level */) {
+ return;
+ }
+ void multiget_count(std::map<std::string, int32_t> & /* _return */, const std::vector<std::string> & /* keys */, const ColumnParent& /* column_parent */, const SlicePredicate& /* predicate */, const ConsistencyLevel::type /* consistency_level */) {
+ return;
+ }
+ void get_range_slices(std::vector<KeySlice> & /* _return */, const ColumnParent& /* column_parent */, const SlicePredicate& /* predicate */, const KeyRange& /* range */, const ConsistencyLevel::type /* consistency_level */) {
+ return;
+ }
+ void get_paged_slice(std::vector<KeySlice> & /* _return */, const std::string& /* column_family */, const KeyRange& /* range */, const std::string& /* start_column */, const ConsistencyLevel::type /* consistency_level */) {
+ return;
+ }
+ void get_indexed_slices(std::vector<KeySlice> & /* _return */, const ColumnParent& /* column_parent */, const IndexClause& /* index_clause */, const SlicePredicate& /* column_predicate */, const ConsistencyLevel::type /* consistency_level */) {
+ return;
+ }
+ void insert(const std::string& /* key */, const ColumnParent& /* column_parent */, const Column& /* column */, const ConsistencyLevel::type /* consistency_level */) {
+ return;
+ }
+ void add(const std::string& /* key */, const ColumnParent& /* column_parent */, const CounterColumn& /* column */, const ConsistencyLevel::type /* consistency_level */) {
+ return;
+ }
+ void remove(const std::string& /* key */, const ColumnPath& /* column_path */, const int64_t /* timestamp */, const ConsistencyLevel::type /* consistency_level */) {
+ return;
+ }
+ void remove_counter(const std::string& /* key */, const ColumnPath& /* path */, const ConsistencyLevel::type /* consistency_level */) {
+ return;
+ }
+ void batch_mutate(const std::map<std::string, std::map<std::string, std::vector<Mutation> > > & /* mutation_map */, const ConsistencyLevel::type /* consistency_level */) {
+ return;
+ }
+ void truncate(const std::string& /* cfname */) {
+ return;
+ }
+ void describe_schema_versions(std::map<std::string, std::vector<std::string> > & /* _return */) {
+ return;
+ }
+ void describe_keyspaces(std::vector<KsDef> & /* _return */) {
+ return;
+ }
+ void describe_cluster_name(std::string& /* _return */) {
+ return;
+ }
+ void describe_version(std::string& /* _return */) {
+ return;
+ }
+ void describe_ring(std::vector<TokenRange> & /* _return */, const std::string& /* keyspace */) {
+ return;
+ }
+ void describe_token_map(std::map<std::string, std::string> & /* _return */) {
+ return;
+ }
+ void describe_partitioner(std::string& /* _return */) {
+ return;
+ }
+ void describe_snitch(std::string& /* _return */) {
+ return;
+ }
+ void describe_keyspace(KsDef& /* _return */, const std::string& /* keyspace */) {
+ return;
+ }
+ void describe_splits(std::vector<std::string> & /* _return */, const std::string& /* cfName */, const std::string& /* start_token */, const std::string& /* end_token */, const int32_t /* keys_per_split */) {
+ return;
+ }
+ void system_add_column_family(std::string& /* _return */, const CfDef& /* cf_def */) {
+ return;
+ }
+ void system_drop_column_family(std::string& /* _return */, const std::string& /* column_family */) {
+ return;
+ }
+ void system_add_keyspace(std::string& /* _return */, const KsDef& /* ks_def */) {
+ return;
+ }
+ void system_drop_keyspace(std::string& /* _return */, const std::string& /* keyspace */) {
+ return;
+ }
+ void system_update_keyspace(std::string& /* _return */, const KsDef& /* ks_def */) {
+ return;
+ }
+ void system_update_column_family(std::string& /* _return */, const CfDef& /* cf_def */) {
+ return;
+ }
+ void execute_cql_query(CqlResult& /* _return */, const std::string& /* query */, const Compression::type /* compression */) {
+ return;
+ }
+ void prepare_cql_query(CqlPreparedResult& /* _return */, const std::string& /* query */, const Compression::type /* compression */) {
+ return;
+ }
+ void execute_prepared_cql_query(CqlResult& /* _return */, const int32_t /* itemId */, const std::vector<std::string> & /* values */) {
+ return;
+ }
+ void set_cql_version(const std::string& /* version */) {
+ return;
+ }
+};
+
+
+class Cassandra_login_args {
+ public:
+
+ Cassandra_login_args() {
+ }
+
+ virtual ~Cassandra_login_args() throw() {}
+
+ AuthenticationRequest auth_request;
+
+ void __set_auth_request(const AuthenticationRequest& val) {
+ auth_request = val;
+ }
+
+ bool operator == (const Cassandra_login_args & rhs) const
+ {
+ if (!(auth_request == rhs.auth_request))
+ return false;
+ return true;
+ }
+ bool operator != (const Cassandra_login_args &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const Cassandra_login_args & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+
+class Cassandra_login_pargs {
+ public:
+
+
+ virtual ~Cassandra_login_pargs() throw() {}
+
+ const AuthenticationRequest* auth_request;
+
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+typedef struct _Cassandra_login_result__isset {
+ _Cassandra_login_result__isset() : authnx(false), authzx(false) {}
+ bool authnx;
+ bool authzx;
+} _Cassandra_login_result__isset;
+
+class Cassandra_login_result {
+ public:
+
+ Cassandra_login_result() {
+ }
+
+ virtual ~Cassandra_login_result() throw() {}
+
+ AuthenticationException authnx;
+ AuthorizationException authzx;
+
+ _Cassandra_login_result__isset __isset;
+
+ void __set_authnx(const AuthenticationException& val) {
+ authnx = val;
+ }
+
+ void __set_authzx(const AuthorizationException& val) {
+ authzx = val;
+ }
+
+ bool operator == (const Cassandra_login_result & rhs) const
+ {
+ if (!(authnx == rhs.authnx))
+ return false;
+ if (!(authzx == rhs.authzx))
+ return false;
+ return true;
+ }
+ bool operator != (const Cassandra_login_result &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const Cassandra_login_result & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+typedef struct _Cassandra_login_presult__isset {
+ _Cassandra_login_presult__isset() : authnx(false), authzx(false) {}
+ bool authnx;
+ bool authzx;
+} _Cassandra_login_presult__isset;
+
+class Cassandra_login_presult {
+ public:
+
+
+ virtual ~Cassandra_login_presult() throw() {}
+
+ AuthenticationException authnx;
+ AuthorizationException authzx;
+
+ _Cassandra_login_presult__isset __isset;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+
+};
+
+
+class Cassandra_set_keyspace_args {
+ public:
+
+ Cassandra_set_keyspace_args() : keyspace("") {
+ }
+
+ virtual ~Cassandra_set_keyspace_args() throw() {}
+
+ std::string keyspace;
+
+ void __set_keyspace(const std::string& val) {
+ keyspace = val;
+ }
+
+ bool operator == (const Cassandra_set_keyspace_args & rhs) const
+ {
+ if (!(keyspace == rhs.keyspace))
+ return false;
+ return true;
+ }
+ bool operator != (const Cassandra_set_keyspace_args &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const Cassandra_set_keyspace_args & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+
+class Cassandra_set_keyspace_pargs {
+ public:
+
+
+ virtual ~Cassandra_set_keyspace_pargs() throw() {}
+
+ const std::string* keyspace;
+
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+typedef struct _Cassandra_set_keyspace_result__isset {
+ _Cassandra_set_keyspace_result__isset() : ire(false) {}
+ bool ire;
+} _Cassandra_set_keyspace_result__isset;
+
+class Cassandra_set_keyspace_result {
+ public:
+
+ Cassandra_set_keyspace_result() {
+ }
+
+ virtual ~Cassandra_set_keyspace_result() throw() {}
+
+ InvalidRequestException ire;
+
+ _Cassandra_set_keyspace_result__isset __isset;
+
+ void __set_ire(const InvalidRequestException& val) {
+ ire = val;
+ }
+
+ bool operator == (const Cassandra_set_keyspace_result & rhs) const
+ {
+ if (!(ire == rhs.ire))
+ return false;
+ return true;
+ }
+ bool operator != (const Cassandra_set_keyspace_result &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const Cassandra_set_keyspace_result & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+typedef struct _Cassandra_set_keyspace_presult__isset {
+ _Cassandra_set_keyspace_presult__isset() : ire(false) {}
+ bool ire;
+} _Cassandra_set_keyspace_presult__isset;
+
+class Cassandra_set_keyspace_presult {
+ public:
+
+
+ virtual ~Cassandra_set_keyspace_presult() throw() {}
+
+ InvalidRequestException ire;
+
+ _Cassandra_set_keyspace_presult__isset __isset;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+
+};
+
+
+class Cassandra_get_args {
+ public:
+
+ Cassandra_get_args() : key(""), consistency_level((ConsistencyLevel::type)1) {
+ consistency_level = (ConsistencyLevel::type)1;
+
+ }
+
+ virtual ~Cassandra_get_args() throw() {}
+
+ std::string key;
+ ColumnPath column_path;
+ ConsistencyLevel::type consistency_level;
+
+ void __set_key(const std::string& val) {
+ key = val;
+ }
+
+ void __set_column_path(const ColumnPath& val) {
+ column_path = val;
+ }
+
+ void __set_consistency_level(const ConsistencyLevel::type val) {
+ consistency_level = val;
+ }
+
+ bool operator == (const Cassandra_get_args & rhs) const
+ {
+ if (!(key == rhs.key))
+ return false;
+ if (!(column_path == rhs.column_path))
+ return false;
+ if (!(consistency_level == rhs.consistency_level))
+ return false;
+ return true;
+ }
+ bool operator != (const Cassandra_get_args &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const Cassandra_get_args & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+
+class Cassandra_get_pargs {
+ public:
+
+
+ virtual ~Cassandra_get_pargs() throw() {}
+
+ const std::string* key;
+ const ColumnPath* column_path;
+ const ConsistencyLevel::type* consistency_level;
+
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+typedef struct _Cassandra_get_result__isset {
+ _Cassandra_get_result__isset() : success(false), ire(false), nfe(false), ue(false), te(false) {}
+ bool success;
+ bool ire;
+ bool nfe;
+ bool ue;
+ bool te;
+} _Cassandra_get_result__isset;
+
+class Cassandra_get_result {
+ public:
+
+ Cassandra_get_result() {
+ }
+
+ virtual ~Cassandra_get_result() throw() {}
+
+ ColumnOrSuperColumn success;
+ InvalidRequestException ire;
+ NotFoundException nfe;
+ UnavailableException ue;
+ TimedOutException te;
+
+ _Cassandra_get_result__isset __isset;
+
+ void __set_success(const ColumnOrSuperColumn& val) {
+ success = val;
+ }
+
+ void __set_ire(const InvalidRequestException& val) {
+ ire = val;
+ }
+
+ void __set_nfe(const NotFoundException& val) {
+ nfe = val;
+ }
+
+ void __set_ue(const UnavailableException& val) {
+ ue = val;
+ }
+
+ void __set_te(const TimedOutException& val) {
+ te = val;
+ }
+
+ bool operator == (const Cassandra_get_result & rhs) const
+ {
+ if (!(success == rhs.success))
+ return false;
+ if (!(ire == rhs.ire))
+ return false;
+ if (!(nfe == rhs.nfe))
+ return false;
+ if (!(ue == rhs.ue))
+ return false;
+ if (!(te == rhs.te))
+ return false;
+ return true;
+ }
+ bool operator != (const Cassandra_get_result &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const Cassandra_get_result & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+typedef struct _Cassandra_get_presult__isset {
+ _Cassandra_get_presult__isset() : success(false), ire(false), nfe(false), ue(false), te(false) {}
+ bool success;
+ bool ire;
+ bool nfe;
+ bool ue;
+ bool te;
+} _Cassandra_get_presult__isset;
+
+class Cassandra_get_presult {
+ public:
+
+
+ virtual ~Cassandra_get_presult() throw() {}
+
+ ColumnOrSuperColumn* success;
+ InvalidRequestException ire;
+ NotFoundException nfe;
+ UnavailableException ue;
+ TimedOutException te;
+
+ _Cassandra_get_presult__isset __isset;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+
+};
+
+
+class Cassandra_get_slice_args {
+ public:
+
+ Cassandra_get_slice_args() : key(""), consistency_level((ConsistencyLevel::type)1) {
+ consistency_level = (ConsistencyLevel::type)1;
+
+ }
+
+ virtual ~Cassandra_get_slice_args() throw() {}
+
+ std::string key;
+ ColumnParent column_parent;
+ SlicePredicate predicate;
+ ConsistencyLevel::type consistency_level;
+
+ void __set_key(const std::string& val) {
+ key = val;
+ }
+
+ void __set_column_parent(const ColumnParent& val) {
+ column_parent = val;
+ }
+
+ void __set_predicate(const SlicePredicate& val) {
+ predicate = val;
+ }
+
+ void __set_consistency_level(const ConsistencyLevel::type val) {
+ consistency_level = val;
+ }
+
+ bool operator == (const Cassandra_get_slice_args & rhs) const
+ {
+ if (!(key == rhs.key))
+ return false;
+ if (!(column_parent == rhs.column_parent))
+ return false;
+ if (!(predicate == rhs.predicate))
+ return false;
+ if (!(consistency_level == rhs.consistency_level))
+ return false;
+ return true;
+ }
+ bool operator != (const Cassandra_get_slice_args &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const Cassandra_get_slice_args & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+
+class Cassandra_get_slice_pargs {
+ public:
+
+
+ virtual ~Cassandra_get_slice_pargs() throw() {}
+
+ const std::string* key;
+ const ColumnParent* column_parent;
+ const SlicePredicate* predicate;
+ const ConsistencyLevel::type* consistency_level;
+
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+typedef struct _Cassandra_get_slice_result__isset {
+ _Cassandra_get_slice_result__isset() : success(false), ire(false), ue(false), te(false) {}
+ bool success;
+ bool ire;
+ bool ue;
+ bool te;
+} _Cassandra_get_slice_result__isset;
+
+class Cassandra_get_slice_result {
+ public:
+
+ Cassandra_get_slice_result() {
+ }
+
+ virtual ~Cassandra_get_slice_result() throw() {}
+
+ std::vector<ColumnOrSuperColumn> success;
+ InvalidRequestException ire;
+ UnavailableException ue;
+ TimedOutException te;
+
+ _Cassandra_get_slice_result__isset __isset;
+
+ void __set_success(const std::vector<ColumnOrSuperColumn> & val) {
+ success = val;
+ }
+
+ void __set_ire(const InvalidRequestException& val) {
+ ire = val;
+ }
+
+ void __set_ue(const UnavailableException& val) {
+ ue = val;
+ }
+
+ void __set_te(const TimedOutException& val) {
+ te = val;
+ }
+
+ bool operator == (const Cassandra_get_slice_result & rhs) const
+ {
+ if (!(success == rhs.success))
+ return false;
+ if (!(ire == rhs.ire))
+ return false;
+ if (!(ue == rhs.ue))
+ return false;
+ if (!(te == rhs.te))
+ return false;
+ return true;
+ }
+ bool operator != (const Cassandra_get_slice_result &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const Cassandra_get_slice_result & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+typedef struct _Cassandra_get_slice_presult__isset {
+ _Cassandra_get_slice_presult__isset() : success(false), ire(false), ue(false), te(false) {}
+ bool success;
+ bool ire;
+ bool ue;
+ bool te;
+} _Cassandra_get_slice_presult__isset;
+
+class Cassandra_get_slice_presult {
+ public:
+
+
+ virtual ~Cassandra_get_slice_presult() throw() {}
+
+ std::vector<ColumnOrSuperColumn> * success;
+ InvalidRequestException ire;
+ UnavailableException ue;
+ TimedOutException te;
+
+ _Cassandra_get_slice_presult__isset __isset;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+
+};
+
+
+class Cassandra_get_count_args {
+ public:
+
+ Cassandra_get_count_args() : key(""), consistency_level((ConsistencyLevel::type)1) {
+ consistency_level = (ConsistencyLevel::type)1;
+
+ }
+
+ virtual ~Cassandra_get_count_args() throw() {}
+
+ std::string key;
+ ColumnParent column_parent;
+ SlicePredicate predicate;
+ ConsistencyLevel::type consistency_level;
+
+ void __set_key(const std::string& val) {
+ key = val;
+ }
+
+ void __set_column_parent(const ColumnParent& val) {
+ column_parent = val;
+ }
+
+ void __set_predicate(const SlicePredicate& val) {
+ predicate = val;
+ }
+
+ void __set_consistency_level(const ConsistencyLevel::type val) {
+ consistency_level = val;
+ }
+
+ bool operator == (const Cassandra_get_count_args & rhs) const
+ {
+ if (!(key == rhs.key))
+ return false;
+ if (!(column_parent == rhs.column_parent))
+ return false;
+ if (!(predicate == rhs.predicate))
+ return false;
+ if (!(consistency_level == rhs.consistency_level))
+ return false;
+ return true;
+ }
+ bool operator != (const Cassandra_get_count_args &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const Cassandra_get_count_args & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+
+class Cassandra_get_count_pargs {
+ public:
+
+
+ virtual ~Cassandra_get_count_pargs() throw() {}
+
+ const std::string* key;
+ const ColumnParent* column_parent;
+ const SlicePredicate* predicate;
+ const ConsistencyLevel::type* consistency_level;
+
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+typedef struct _Cassandra_get_count_result__isset {
+ _Cassandra_get_count_result__isset() : success(false), ire(false), ue(false), te(false) {}
+ bool success;
+ bool ire;
+ bool ue;
+ bool te;
+} _Cassandra_get_count_result__isset;
+
+class Cassandra_get_count_result {
+ public:
+
+ Cassandra_get_count_result() : success(0) {
+ }
+
+ virtual ~Cassandra_get_count_result() throw() {}
+
+ int32_t success;
+ InvalidRequestException ire;
+ UnavailableException ue;
+ TimedOutException te;
+
+ _Cassandra_get_count_result__isset __isset;
+
+ void __set_success(const int32_t val) {
+ success = val;
+ }
+
+ void __set_ire(const InvalidRequestException& val) {
+ ire = val;
+ }
+
+ void __set_ue(const UnavailableException& val) {
+ ue = val;
+ }
+
+ void __set_te(const TimedOutException& val) {
+ te = val;
+ }
+
+ bool operator == (const Cassandra_get_count_result & rhs) const
+ {
+ if (!(success == rhs.success))
+ return false;
+ if (!(ire == rhs.ire))
+ return false;
+ if (!(ue == rhs.ue))
+ return false;
+ if (!(te == rhs.te))
+ return false;
+ return true;
+ }
+ bool operator != (const Cassandra_get_count_result &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const Cassandra_get_count_result & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+typedef struct _Cassandra_get_count_presult__isset {
+ _Cassandra_get_count_presult__isset() : success(false), ire(false), ue(false), te(false) {}
+ bool success;
+ bool ire;
+ bool ue;
+ bool te;
+} _Cassandra_get_count_presult__isset;
+
+class Cassandra_get_count_presult {
+ public:
+
+
+ virtual ~Cassandra_get_count_presult() throw() {}
+
+ int32_t* success;
+ InvalidRequestException ire;
+ UnavailableException ue;
+ TimedOutException te;
+
+ _Cassandra_get_count_presult__isset __isset;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+
+};
+
+
+class Cassandra_multiget_slice_args {
+ public:
+
+ Cassandra_multiget_slice_args() : consistency_level((ConsistencyLevel::type)1) {
+ consistency_level = (ConsistencyLevel::type)1;
+
+ }
+
+ virtual ~Cassandra_multiget_slice_args() throw() {}
+
+ std::vector<std::string> keys;
+ ColumnParent column_parent;
+ SlicePredicate predicate;
+ ConsistencyLevel::type consistency_level;
+
+ void __set_keys(const std::vector<std::string> & val) {
+ keys = val;
+ }
+
+ void __set_column_parent(const ColumnParent& val) {
+ column_parent = val;
+ }
+
+ void __set_predicate(const SlicePredicate& val) {
+ predicate = val;
+ }
+
+ void __set_consistency_level(const ConsistencyLevel::type val) {
+ consistency_level = val;
+ }
+
+ bool operator == (const Cassandra_multiget_slice_args & rhs) const
+ {
+ if (!(keys == rhs.keys))
+ return false;
+ if (!(column_parent == rhs.column_parent))
+ return false;
+ if (!(predicate == rhs.predicate))
+ return false;
+ if (!(consistency_level == rhs.consistency_level))
+ return false;
+ return true;
+ }
+ bool operator != (const Cassandra_multiget_slice_args &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const Cassandra_multiget_slice_args & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+
+class Cassandra_multiget_slice_pargs {
+ public:
+
+
+ virtual ~Cassandra_multiget_slice_pargs() throw() {}
+
+ const std::vector<std::string> * keys;
+ const ColumnParent* column_parent;
+ const SlicePredicate* predicate;
+ const ConsistencyLevel::type* consistency_level;
+
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+typedef struct _Cassandra_multiget_slice_result__isset {
+ _Cassandra_multiget_slice_result__isset() : success(false), ire(false), ue(false), te(false) {}
+ bool success;
+ bool ire;
+ bool ue;
+ bool te;
+} _Cassandra_multiget_slice_result__isset;
+
+class Cassandra_multiget_slice_result {
+ public:
+
+ Cassandra_multiget_slice_result() {
+ }
+
+ virtual ~Cassandra_multiget_slice_result() throw() {}
+
+ std::map<std::string, std::vector<ColumnOrSuperColumn> > success;
+ InvalidRequestException ire;
+ UnavailableException ue;
+ TimedOutException te;
+
+ _Cassandra_multiget_slice_result__isset __isset;
+
+ void __set_success(const std::map<std::string, std::vector<ColumnOrSuperColumn> > & val) {
+ success = val;
+ }
+
+ void __set_ire(const InvalidRequestException& val) {
+ ire = val;
+ }
+
+ void __set_ue(const UnavailableException& val) {
+ ue = val;
+ }
+
+ void __set_te(const TimedOutException& val) {
+ te = val;
+ }
+
+ bool operator == (const Cassandra_multiget_slice_result & rhs) const
+ {
+ if (!(success == rhs.success))
+ return false;
+ if (!(ire == rhs.ire))
+ return false;
+ if (!(ue == rhs.ue))
+ return false;
+ if (!(te == rhs.te))
+ return false;
+ return true;
+ }
+ bool operator != (const Cassandra_multiget_slice_result &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const Cassandra_multiget_slice_result & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+typedef struct _Cassandra_multiget_slice_presult__isset {
+ _Cassandra_multiget_slice_presult__isset() : success(false), ire(false), ue(false), te(false) {}
+ bool success;
+ bool ire;
+ bool ue;
+ bool te;
+} _Cassandra_multiget_slice_presult__isset;
+
+class Cassandra_multiget_slice_presult {
+ public:
+
+
+ virtual ~Cassandra_multiget_slice_presult() throw() {}
+
+ std::map<std::string, std::vector<ColumnOrSuperColumn> > * success;
+ InvalidRequestException ire;
+ UnavailableException ue;
+ TimedOutException te;
+
+ _Cassandra_multiget_slice_presult__isset __isset;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+
+};
+
+
+class Cassandra_multiget_count_args {
+ public:
+
+ Cassandra_multiget_count_args() : consistency_level((ConsistencyLevel::type)1) {
+ consistency_level = (ConsistencyLevel::type)1;
+
+ }
+
+ virtual ~Cassandra_multiget_count_args() throw() {}
+
+ std::vector<std::string> keys;
+ ColumnParent column_parent;
+ SlicePredicate predicate;
+ ConsistencyLevel::type consistency_level;
+
+ void __set_keys(const std::vector<std::string> & val) {
+ keys = val;
+ }
+
+ void __set_column_parent(const ColumnParent& val) {
+ column_parent = val;
+ }
+
+ void __set_predicate(const SlicePredicate& val) {
+ predicate = val;
+ }
+
+ void __set_consistency_level(const ConsistencyLevel::type val) {
+ consistency_level = val;
+ }
+
+ bool operator == (const Cassandra_multiget_count_args & rhs) const
+ {
+ if (!(keys == rhs.keys))
+ return false;
+ if (!(column_parent == rhs.column_parent))
+ return false;
+ if (!(predicate == rhs.predicate))
+ return false;
+ if (!(consistency_level == rhs.consistency_level))
+ return false;
+ return true;
+ }
+ bool operator != (const Cassandra_multiget_count_args &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const Cassandra_multiget_count_args & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+
+class Cassandra_multiget_count_pargs {
+ public:
+
+
+ virtual ~Cassandra_multiget_count_pargs() throw() {}
+
+ const std::vector<std::string> * keys;
+ const ColumnParent* column_parent;
+ const SlicePredicate* predicate;
+ const ConsistencyLevel::type* consistency_level;
+
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+typedef struct _Cassandra_multiget_count_result__isset {
+ _Cassandra_multiget_count_result__isset() : success(false), ire(false), ue(false), te(false) {}
+ bool success;
+ bool ire;
+ bool ue;
+ bool te;
+} _Cassandra_multiget_count_result__isset;
+
+class Cassandra_multiget_count_result {
+ public:
+
+ Cassandra_multiget_count_result() {
+ }
+
+ virtual ~Cassandra_multiget_count_result() throw() {}
+
+ std::map<std::string, int32_t> success;
+ InvalidRequestException ire;
+ UnavailableException ue;
+ TimedOutException te;
+
+ _Cassandra_multiget_count_result__isset __isset;
+
+ void __set_success(const std::map<std::string, int32_t> & val) {
+ success = val;
+ }
+
+ void __set_ire(const InvalidRequestException& val) {
+ ire = val;
+ }
+
+ void __set_ue(const UnavailableException& val) {
+ ue = val;
+ }
+
+ void __set_te(const TimedOutException& val) {
+ te = val;
+ }
+
+ bool operator == (const Cassandra_multiget_count_result & rhs) const
+ {
+ if (!(success == rhs.success))
+ return false;
+ if (!(ire == rhs.ire))
+ return false;
+ if (!(ue == rhs.ue))
+ return false;
+ if (!(te == rhs.te))
+ return false;
+ return true;
+ }
+ bool operator != (const Cassandra_multiget_count_result &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const Cassandra_multiget_count_result & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+typedef struct _Cassandra_multiget_count_presult__isset {
+ _Cassandra_multiget_count_presult__isset() : success(false), ire(false), ue(false), te(false) {}
+ bool success;
+ bool ire;
+ bool ue;
+ bool te;
+} _Cassandra_multiget_count_presult__isset;
+
+class Cassandra_multiget_count_presult {
+ public:
+
+
+ virtual ~Cassandra_multiget_count_presult() throw() {}
+
+ std::map<std::string, int32_t> * success;
+ InvalidRequestException ire;
+ UnavailableException ue;
+ TimedOutException te;
+
+ _Cassandra_multiget_count_presult__isset __isset;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+
+};
+
+
+class Cassandra_get_range_slices_args {
+ public:
+
+ Cassandra_get_range_slices_args() : consistency_level((ConsistencyLevel::type)1) {
+ consistency_level = (ConsistencyLevel::type)1;
+
+ }
+
+ virtual ~Cassandra_get_range_slices_args() throw() {}
+
+ ColumnParent column_parent;
+ SlicePredicate predicate;
+ KeyRange range;
+ ConsistencyLevel::type consistency_level;
+
+ void __set_column_parent(const ColumnParent& val) {
+ column_parent = val;
+ }
+
+ void __set_predicate(const SlicePredicate& val) {
+ predicate = val;
+ }
+
+ void __set_range(const KeyRange& val) {
+ range = val;
+ }
+
+ void __set_consistency_level(const ConsistencyLevel::type val) {
+ consistency_level = val;
+ }
+
+ bool operator == (const Cassandra_get_range_slices_args & rhs) const
+ {
+ if (!(column_parent == rhs.column_parent))
+ return false;
+ if (!(predicate == rhs.predicate))
+ return false;
+ if (!(range == rhs.range))
+ return false;
+ if (!(consistency_level == rhs.consistency_level))
+ return false;
+ return true;
+ }
+ bool operator != (const Cassandra_get_range_slices_args &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const Cassandra_get_range_slices_args & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+
+class Cassandra_get_range_slices_pargs {
+ public:
+
+
+ virtual ~Cassandra_get_range_slices_pargs() throw() {}
+
+ const ColumnParent* column_parent;
+ const SlicePredicate* predicate;
+ const KeyRange* range;
+ const ConsistencyLevel::type* consistency_level;
+
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+typedef struct _Cassandra_get_range_slices_result__isset {
+ _Cassandra_get_range_slices_result__isset() : success(false), ire(false), ue(false), te(false) {}
+ bool success;
+ bool ire;
+ bool ue;
+ bool te;
+} _Cassandra_get_range_slices_result__isset;
+
+class Cassandra_get_range_slices_result {
+ public:
+
+ Cassandra_get_range_slices_result() {
+ }
+
+ virtual ~Cassandra_get_range_slices_result() throw() {}
+
+ std::vector<KeySlice> success;
+ InvalidRequestException ire;
+ UnavailableException ue;
+ TimedOutException te;
+
+ _Cassandra_get_range_slices_result__isset __isset;
+
+ void __set_success(const std::vector<KeySlice> & val) {
+ success = val;
+ }
+
+ void __set_ire(const InvalidRequestException& val) {
+ ire = val;
+ }
+
+ void __set_ue(const UnavailableException& val) {
+ ue = val;
+ }
+
+ void __set_te(const TimedOutException& val) {
+ te = val;
+ }
+
+ bool operator == (const Cassandra_get_range_slices_result & rhs) const
+ {
+ if (!(success == rhs.success))
+ return false;
+ if (!(ire == rhs.ire))
+ return false;
+ if (!(ue == rhs.ue))
+ return false;
+ if (!(te == rhs.te))
+ return false;
+ return true;
+ }
+ bool operator != (const Cassandra_get_range_slices_result &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const Cassandra_get_range_slices_result & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+typedef struct _Cassandra_get_range_slices_presult__isset {
+ _Cassandra_get_range_slices_presult__isset() : success(false), ire(false), ue(false), te(false) {}
+ bool success;
+ bool ire;
+ bool ue;
+ bool te;
+} _Cassandra_get_range_slices_presult__isset;
+
+class Cassandra_get_range_slices_presult {
+ public:
+
+
+ virtual ~Cassandra_get_range_slices_presult() throw() {}
+
+ std::vector<KeySlice> * success;
+ InvalidRequestException ire;
+ UnavailableException ue;
+ TimedOutException te;
+
+ _Cassandra_get_range_slices_presult__isset __isset;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+
+};
+
+
+class Cassandra_get_paged_slice_args {
+ public:
+
+ Cassandra_get_paged_slice_args() : column_family(""), start_column(""), consistency_level((ConsistencyLevel::type)1) {
+ consistency_level = (ConsistencyLevel::type)1;
+
+ }
+
+ virtual ~Cassandra_get_paged_slice_args() throw() {}
+
+ std::string column_family;
+ KeyRange range;
+ std::string start_column;
+ ConsistencyLevel::type consistency_level;
+
+ void __set_column_family(const std::string& val) {
+ column_family = val;
+ }
+
+ void __set_range(const KeyRange& val) {
+ range = val;
+ }
+
+ void __set_start_column(const std::string& val) {
+ start_column = val;
+ }
+
+ void __set_consistency_level(const ConsistencyLevel::type val) {
+ consistency_level = val;
+ }
+
+ bool operator == (const Cassandra_get_paged_slice_args & rhs) const
+ {
+ if (!(column_family == rhs.column_family))
+ return false;
+ if (!(range == rhs.range))
+ return false;
+ if (!(start_column == rhs.start_column))
+ return false;
+ if (!(consistency_level == rhs.consistency_level))
+ return false;
+ return true;
+ }
+ bool operator != (const Cassandra_get_paged_slice_args &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const Cassandra_get_paged_slice_args & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+
+class Cassandra_get_paged_slice_pargs {
+ public:
+
+
+ virtual ~Cassandra_get_paged_slice_pargs() throw() {}
+
+ const std::string* column_family;
+ const KeyRange* range;
+ const std::string* start_column;
+ const ConsistencyLevel::type* consistency_level;
+
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+typedef struct _Cassandra_get_paged_slice_result__isset {
+ _Cassandra_get_paged_slice_result__isset() : success(false), ire(false), ue(false), te(false) {}
+ bool success;
+ bool ire;
+ bool ue;
+ bool te;
+} _Cassandra_get_paged_slice_result__isset;
+
+class Cassandra_get_paged_slice_result {
+ public:
+
+ Cassandra_get_paged_slice_result() {
+ }
+
+ virtual ~Cassandra_get_paged_slice_result() throw() {}
+
+ std::vector<KeySlice> success;
+ InvalidRequestException ire;
+ UnavailableException ue;
+ TimedOutException te;
+
+ _Cassandra_get_paged_slice_result__isset __isset;
+
+ void __set_success(const std::vector<KeySlice> & val) {
+ success = val;
+ }
+
+ void __set_ire(const InvalidRequestException& val) {
+ ire = val;
+ }
+
+ void __set_ue(const UnavailableException& val) {
+ ue = val;
+ }
+
+ void __set_te(const TimedOutException& val) {
+ te = val;
+ }
+
+ bool operator == (const Cassandra_get_paged_slice_result & rhs) const
+ {
+ if (!(success == rhs.success))
+ return false;
+ if (!(ire == rhs.ire))
+ return false;
+ if (!(ue == rhs.ue))
+ return false;
+ if (!(te == rhs.te))
+ return false;
+ return true;
+ }
+ bool operator != (const Cassandra_get_paged_slice_result &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const Cassandra_get_paged_slice_result & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+typedef struct _Cassandra_get_paged_slice_presult__isset {
+ _Cassandra_get_paged_slice_presult__isset() : success(false), ire(false), ue(false), te(false) {}
+ bool success;
+ bool ire;
+ bool ue;
+ bool te;
+} _Cassandra_get_paged_slice_presult__isset;
+
+class Cassandra_get_paged_slice_presult {
+ public:
+
+
+ virtual ~Cassandra_get_paged_slice_presult() throw() {}
+
+ std::vector<KeySlice> * success;
+ InvalidRequestException ire;
+ UnavailableException ue;
+ TimedOutException te;
+
+ _Cassandra_get_paged_slice_presult__isset __isset;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+
+};
+
+
+class Cassandra_get_indexed_slices_args {
+ public:
+
+ Cassandra_get_indexed_slices_args() : consistency_level((ConsistencyLevel::type)1) {
+ consistency_level = (ConsistencyLevel::type)1;
+
+ }
+
+ virtual ~Cassandra_get_indexed_slices_args() throw() {}
+
+ ColumnParent column_parent;
+ IndexClause index_clause;
+ SlicePredicate column_predicate;
+ ConsistencyLevel::type consistency_level;
+
+ void __set_column_parent(const ColumnParent& val) {
+ column_parent = val;
+ }
+
+ void __set_index_clause(const IndexClause& val) {
+ index_clause = val;
+ }
+
+ void __set_column_predicate(const SlicePredicate& val) {
+ column_predicate = val;
+ }
+
+ void __set_consistency_level(const ConsistencyLevel::type val) {
+ consistency_level = val;
+ }
+
+ bool operator == (const Cassandra_get_indexed_slices_args & rhs) const
+ {
+ if (!(column_parent == rhs.column_parent))
+ return false;
+ if (!(index_clause == rhs.index_clause))
+ return false;
+ if (!(column_predicate == rhs.column_predicate))
+ return false;
+ if (!(consistency_level == rhs.consistency_level))
+ return false;
+ return true;
+ }
+ bool operator != (const Cassandra_get_indexed_slices_args &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const Cassandra_get_indexed_slices_args & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+
+class Cassandra_get_indexed_slices_pargs {
+ public:
+
+
+ virtual ~Cassandra_get_indexed_slices_pargs() throw() {}
+
+ const ColumnParent* column_parent;
+ const IndexClause* index_clause;
+ const SlicePredicate* column_predicate;
+ const ConsistencyLevel::type* consistency_level;
+
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+typedef struct _Cassandra_get_indexed_slices_result__isset {
+ _Cassandra_get_indexed_slices_result__isset() : success(false), ire(false), ue(false), te(false) {}
+ bool success;
+ bool ire;
+ bool ue;
+ bool te;
+} _Cassandra_get_indexed_slices_result__isset;
+
+class Cassandra_get_indexed_slices_result {
+ public:
+
+ Cassandra_get_indexed_slices_result() {
+ }
+
+ virtual ~Cassandra_get_indexed_slices_result() throw() {}
+
+ std::vector<KeySlice> success;
+ InvalidRequestException ire;
+ UnavailableException ue;
+ TimedOutException te;
+
+ _Cassandra_get_indexed_slices_result__isset __isset;
+
+ void __set_success(const std::vector<KeySlice> & val) {
+ success = val;
+ }
+
+ void __set_ire(const InvalidRequestException& val) {
+ ire = val;
+ }
+
+ void __set_ue(const UnavailableException& val) {
+ ue = val;
+ }
+
+ void __set_te(const TimedOutException& val) {
+ te = val;
+ }
+
+ bool operator == (const Cassandra_get_indexed_slices_result & rhs) const
+ {
+ if (!(success == rhs.success))
+ return false;
+ if (!(ire == rhs.ire))
+ return false;
+ if (!(ue == rhs.ue))
+ return false;
+ if (!(te == rhs.te))
+ return false;
+ return true;
+ }
+ bool operator != (const Cassandra_get_indexed_slices_result &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const Cassandra_get_indexed_slices_result & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+typedef struct _Cassandra_get_indexed_slices_presult__isset {
+ _Cassandra_get_indexed_slices_presult__isset() : success(false), ire(false), ue(false), te(false) {}
+ bool success;
+ bool ire;
+ bool ue;
+ bool te;
+} _Cassandra_get_indexed_slices_presult__isset;
+
+class Cassandra_get_indexed_slices_presult {
+ public:
+
+
+ virtual ~Cassandra_get_indexed_slices_presult() throw() {}
+
+ std::vector<KeySlice> * success;
+ InvalidRequestException ire;
+ UnavailableException ue;
+ TimedOutException te;
+
+ _Cassandra_get_indexed_slices_presult__isset __isset;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+
+};
+
+
+class Cassandra_insert_args {
+ public:
+
+ Cassandra_insert_args() : key(""), consistency_level((ConsistencyLevel::type)1) {
+ consistency_level = (ConsistencyLevel::type)1;
+
+ }
+
+ virtual ~Cassandra_insert_args() throw() {}
+
+ std::string key;
+ ColumnParent column_parent;
+ Column column;
+ ConsistencyLevel::type consistency_level;
+
+ void __set_key(const std::string& val) {
+ key = val;
+ }
+
+ void __set_column_parent(const ColumnParent& val) {
+ column_parent = val;
+ }
+
+ void __set_column(const Column& val) {
+ column = val;
+ }
+
+ void __set_consistency_level(const ConsistencyLevel::type val) {
+ consistency_level = val;
+ }
+
+ bool operator == (const Cassandra_insert_args & rhs) const
+ {
+ if (!(key == rhs.key))
+ return false;
+ if (!(column_parent == rhs.column_parent))
+ return false;
+ if (!(column == rhs.column))
+ return false;
+ if (!(consistency_level == rhs.consistency_level))
+ return false;
+ return true;
+ }
+ bool operator != (const Cassandra_insert_args &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const Cassandra_insert_args & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+
+class Cassandra_insert_pargs {
+ public:
+
+
+ virtual ~Cassandra_insert_pargs() throw() {}
+
+ const std::string* key;
+ const ColumnParent* column_parent;
+ const Column* column;
+ const ConsistencyLevel::type* consistency_level;
+
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+typedef struct _Cassandra_insert_result__isset {
+ _Cassandra_insert_result__isset() : ire(false), ue(false), te(false) {}
+ bool ire;
+ bool ue;
+ bool te;
+} _Cassandra_insert_result__isset;
+
+class Cassandra_insert_result {
+ public:
+
+ Cassandra_insert_result() {
+ }
+
+ virtual ~Cassandra_insert_result() throw() {}
+
+ InvalidRequestException ire;
+ UnavailableException ue;
+ TimedOutException te;
+
+ _Cassandra_insert_result__isset __isset;
+
+ void __set_ire(const InvalidRequestException& val) {
+ ire = val;
+ }
+
+ void __set_ue(const UnavailableException& val) {
+ ue = val;
+ }
+
+ void __set_te(const TimedOutException& val) {
+ te = val;
+ }
+
+ bool operator == (const Cassandra_insert_result & rhs) const
+ {
+ if (!(ire == rhs.ire))
+ return false;
+ if (!(ue == rhs.ue))
+ return false;
+ if (!(te == rhs.te))
+ return false;
+ return true;
+ }
+ bool operator != (const Cassandra_insert_result &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const Cassandra_insert_result & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+typedef struct _Cassandra_insert_presult__isset {
+ _Cassandra_insert_presult__isset() : ire(false), ue(false), te(false) {}
+ bool ire;
+ bool ue;
+ bool te;
+} _Cassandra_insert_presult__isset;
+
+class Cassandra_insert_presult {
+ public:
+
+
+ virtual ~Cassandra_insert_presult() throw() {}
+
+ InvalidRequestException ire;
+ UnavailableException ue;
+ TimedOutException te;
+
+ _Cassandra_insert_presult__isset __isset;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+
+};
+
+
+class Cassandra_add_args {
+ public:
+
+ Cassandra_add_args() : key(""), consistency_level((ConsistencyLevel::type)1) {
+ consistency_level = (ConsistencyLevel::type)1;
+
+ }
+
+ virtual ~Cassandra_add_args() throw() {}
+
+ std::string key;
+ ColumnParent column_parent;
+ CounterColumn column;
+ ConsistencyLevel::type consistency_level;
+
+ void __set_key(const std::string& val) {
+ key = val;
+ }
+
+ void __set_column_parent(const ColumnParent& val) {
+ column_parent = val;
+ }
+
+ void __set_column(const CounterColumn& val) {
+ column = val;
+ }
+
+ void __set_consistency_level(const ConsistencyLevel::type val) {
+ consistency_level = val;
+ }
+
+ bool operator == (const Cassandra_add_args & rhs) const
+ {
+ if (!(key == rhs.key))
+ return false;
+ if (!(column_parent == rhs.column_parent))
+ return false;
+ if (!(column == rhs.column))
+ return false;
+ if (!(consistency_level == rhs.consistency_level))
+ return false;
+ return true;
+ }
+ bool operator != (const Cassandra_add_args &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const Cassandra_add_args & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+
+class Cassandra_add_pargs {
+ public:
+
+
+ virtual ~Cassandra_add_pargs() throw() {}
+
+ const std::string* key;
+ const ColumnParent* column_parent;
+ const CounterColumn* column;
+ const ConsistencyLevel::type* consistency_level;
+
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+typedef struct _Cassandra_add_result__isset {
+ _Cassandra_add_result__isset() : ire(false), ue(false), te(false) {}
+ bool ire;
+ bool ue;
+ bool te;
+} _Cassandra_add_result__isset;
+
+class Cassandra_add_result {
+ public:
+
+ Cassandra_add_result() {
+ }
+
+ virtual ~Cassandra_add_result() throw() {}
+
+ InvalidRequestException ire;
+ UnavailableException ue;
+ TimedOutException te;
+
+ _Cassandra_add_result__isset __isset;
+
+ void __set_ire(const InvalidRequestException& val) {
+ ire = val;
+ }
+
+ void __set_ue(const UnavailableException& val) {
+ ue = val;
+ }
+
+ void __set_te(const TimedOutException& val) {
+ te = val;
+ }
+
+ bool operator == (const Cassandra_add_result & rhs) const
+ {
+ if (!(ire == rhs.ire))
+ return false;
+ if (!(ue == rhs.ue))
+ return false;
+ if (!(te == rhs.te))
+ return false;
+ return true;
+ }
+ bool operator != (const Cassandra_add_result &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const Cassandra_add_result & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+typedef struct _Cassandra_add_presult__isset {
+ _Cassandra_add_presult__isset() : ire(false), ue(false), te(false) {}
+ bool ire;
+ bool ue;
+ bool te;
+} _Cassandra_add_presult__isset;
+
+class Cassandra_add_presult {
+ public:
+
+
+ virtual ~Cassandra_add_presult() throw() {}
+
+ InvalidRequestException ire;
+ UnavailableException ue;
+ TimedOutException te;
+
+ _Cassandra_add_presult__isset __isset;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+
+};
+
+typedef struct _Cassandra_remove_args__isset {
+ _Cassandra_remove_args__isset() : consistency_level(false) {}
+ bool consistency_level;
+} _Cassandra_remove_args__isset;
+
+class Cassandra_remove_args {
+ public:
+
+ Cassandra_remove_args() : key(""), timestamp(0), consistency_level((ConsistencyLevel::type)1) {
+ consistency_level = (ConsistencyLevel::type)1;
+
+ }
+
+ virtual ~Cassandra_remove_args() throw() {}
+
+ std::string key;
+ ColumnPath column_path;
+ int64_t timestamp;
+ ConsistencyLevel::type consistency_level;
+
+ _Cassandra_remove_args__isset __isset;
+
+ void __set_key(const std::string& val) {
+ key = val;
+ }
+
+ void __set_column_path(const ColumnPath& val) {
+ column_path = val;
+ }
+
+ void __set_timestamp(const int64_t val) {
+ timestamp = val;
+ }
+
+ void __set_consistency_level(const ConsistencyLevel::type val) {
+ consistency_level = val;
+ }
+
+ bool operator == (const Cassandra_remove_args & rhs) const
+ {
+ if (!(key == rhs.key))
+ return false;
+ if (!(column_path == rhs.column_path))
+ return false;
+ if (!(timestamp == rhs.timestamp))
+ return false;
+ if (!(consistency_level == rhs.consistency_level))
+ return false;
+ return true;
+ }
+ bool operator != (const Cassandra_remove_args &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const Cassandra_remove_args & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+
+class Cassandra_remove_pargs {
+ public:
+
+
+ virtual ~Cassandra_remove_pargs() throw() {}
+
+ const std::string* key;
+ const ColumnPath* column_path;
+ const int64_t* timestamp;
+ const ConsistencyLevel::type* consistency_level;
+
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+typedef struct _Cassandra_remove_result__isset {
+ _Cassandra_remove_result__isset() : ire(false), ue(false), te(false) {}
+ bool ire;
+ bool ue;
+ bool te;
+} _Cassandra_remove_result__isset;
+
+class Cassandra_remove_result {
+ public:
+
+ Cassandra_remove_result() {
+ }
+
+ virtual ~Cassandra_remove_result() throw() {}
+
+ InvalidRequestException ire;
+ UnavailableException ue;
+ TimedOutException te;
+
+ _Cassandra_remove_result__isset __isset;
+
+ void __set_ire(const InvalidRequestException& val) {
+ ire = val;
+ }
+
+ void __set_ue(const UnavailableException& val) {
+ ue = val;
+ }
+
+ void __set_te(const TimedOutException& val) {
+ te = val;
+ }
+
+ bool operator == (const Cassandra_remove_result & rhs) const
+ {
+ if (!(ire == rhs.ire))
+ return false;
+ if (!(ue == rhs.ue))
+ return false;
+ if (!(te == rhs.te))
+ return false;
+ return true;
+ }
+ bool operator != (const Cassandra_remove_result &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const Cassandra_remove_result & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+typedef struct _Cassandra_remove_presult__isset {
+ _Cassandra_remove_presult__isset() : ire(false), ue(false), te(false) {}
+ bool ire;
+ bool ue;
+ bool te;
+} _Cassandra_remove_presult__isset;
+
+class Cassandra_remove_presult {
+ public:
+
+
+ virtual ~Cassandra_remove_presult() throw() {}
+
+ InvalidRequestException ire;
+ UnavailableException ue;
+ TimedOutException te;
+
+ _Cassandra_remove_presult__isset __isset;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+
+};
+
+
+class Cassandra_remove_counter_args {
+ public:
+
+ Cassandra_remove_counter_args() : key(""), consistency_level((ConsistencyLevel::type)1) {
+ consistency_level = (ConsistencyLevel::type)1;
+
+ }
+
+ virtual ~Cassandra_remove_counter_args() throw() {}
+
+ std::string key;
+ ColumnPath path;
+ ConsistencyLevel::type consistency_level;
+
+ void __set_key(const std::string& val) {
+ key = val;
+ }
+
+ void __set_path(const ColumnPath& val) {
+ path = val;
+ }
+
+ void __set_consistency_level(const ConsistencyLevel::type val) {
+ consistency_level = val;
+ }
+
+ bool operator == (const Cassandra_remove_counter_args & rhs) const
+ {
+ if (!(key == rhs.key))
+ return false;
+ if (!(path == rhs.path))
+ return false;
+ if (!(consistency_level == rhs.consistency_level))
+ return false;
+ return true;
+ }
+ bool operator != (const Cassandra_remove_counter_args &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const Cassandra_remove_counter_args & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+
+class Cassandra_remove_counter_pargs {
+ public:
+
+
+ virtual ~Cassandra_remove_counter_pargs() throw() {}
+
+ const std::string* key;
+ const ColumnPath* path;
+ const ConsistencyLevel::type* consistency_level;
+
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+typedef struct _Cassandra_remove_counter_result__isset {
+ _Cassandra_remove_counter_result__isset() : ire(false), ue(false), te(false) {}
+ bool ire;
+ bool ue;
+ bool te;
+} _Cassandra_remove_counter_result__isset;
+
+class Cassandra_remove_counter_result {
+ public:
+
+ Cassandra_remove_counter_result() {
+ }
+
+ virtual ~Cassandra_remove_counter_result() throw() {}
+
+ InvalidRequestException ire;
+ UnavailableException ue;
+ TimedOutException te;
+
+ _Cassandra_remove_counter_result__isset __isset;
+
+ void __set_ire(const InvalidRequestException& val) {
+ ire = val;
+ }
+
+ void __set_ue(const UnavailableException& val) {
+ ue = val;
+ }
+
+ void __set_te(const TimedOutException& val) {
+ te = val;
+ }
+
+ bool operator == (const Cassandra_remove_counter_result & rhs) const
+ {
+ if (!(ire == rhs.ire))
+ return false;
+ if (!(ue == rhs.ue))
+ return false;
+ if (!(te == rhs.te))
+ return false;
+ return true;
+ }
+ bool operator != (const Cassandra_remove_counter_result &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const Cassandra_remove_counter_result & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+typedef struct _Cassandra_remove_counter_presult__isset {
+ _Cassandra_remove_counter_presult__isset() : ire(false), ue(false), te(false) {}
+ bool ire;
+ bool ue;
+ bool te;
+} _Cassandra_remove_counter_presult__isset;
+
+class Cassandra_remove_counter_presult {
+ public:
+
+
+ virtual ~Cassandra_remove_counter_presult() throw() {}
+
+ InvalidRequestException ire;
+ UnavailableException ue;
+ TimedOutException te;
+
+ _Cassandra_remove_counter_presult__isset __isset;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+
+};
+
+
+class Cassandra_batch_mutate_args {
+ public:
+
+ Cassandra_batch_mutate_args() : consistency_level((ConsistencyLevel::type)1) {
+ consistency_level = (ConsistencyLevel::type)1;
+
+ }
+
+ virtual ~Cassandra_batch_mutate_args() throw() {}
+
+ std::map<std::string, std::map<std::string, std::vector<Mutation> > > mutation_map;
+ ConsistencyLevel::type consistency_level;
+
+ void __set_mutation_map(const std::map<std::string, std::map<std::string, std::vector<Mutation> > > & val) {
+ mutation_map = val;
+ }
+
+ void __set_consistency_level(const ConsistencyLevel::type val) {
+ consistency_level = val;
+ }
+
+ bool operator == (const Cassandra_batch_mutate_args & rhs) const
+ {
+ if (!(mutation_map == rhs.mutation_map))
+ return false;
+ if (!(consistency_level == rhs.consistency_level))
+ return false;
+ return true;
+ }
+ bool operator != (const Cassandra_batch_mutate_args &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const Cassandra_batch_mutate_args & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+
+class Cassandra_batch_mutate_pargs {
+ public:
+
+
+ virtual ~Cassandra_batch_mutate_pargs() throw() {}
+
+ const std::map<std::string, std::map<std::string, std::vector<Mutation> > > * mutation_map;
+ const ConsistencyLevel::type* consistency_level;
+
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+typedef struct _Cassandra_batch_mutate_result__isset {
+ _Cassandra_batch_mutate_result__isset() : ire(false), ue(false), te(false) {}
+ bool ire;
+ bool ue;
+ bool te;
+} _Cassandra_batch_mutate_result__isset;
+
+class Cassandra_batch_mutate_result {
+ public:
+
+ Cassandra_batch_mutate_result() {
+ }
+
+ virtual ~Cassandra_batch_mutate_result() throw() {}
+
+ InvalidRequestException ire;
+ UnavailableException ue;
+ TimedOutException te;
+
+ _Cassandra_batch_mutate_result__isset __isset;
+
+ void __set_ire(const InvalidRequestException& val) {
+ ire = val;
+ }
+
+ void __set_ue(const UnavailableException& val) {
+ ue = val;
+ }
+
+ void __set_te(const TimedOutException& val) {
+ te = val;
+ }
+
+ bool operator == (const Cassandra_batch_mutate_result & rhs) const
+ {
+ if (!(ire == rhs.ire))
+ return false;
+ if (!(ue == rhs.ue))
+ return false;
+ if (!(te == rhs.te))
+ return false;
+ return true;
+ }
+ bool operator != (const Cassandra_batch_mutate_result &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const Cassandra_batch_mutate_result & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+typedef struct _Cassandra_batch_mutate_presult__isset {
+ _Cassandra_batch_mutate_presult__isset() : ire(false), ue(false), te(false) {}
+ bool ire;
+ bool ue;
+ bool te;
+} _Cassandra_batch_mutate_presult__isset;
+
+class Cassandra_batch_mutate_presult {
+ public:
+
+
+ virtual ~Cassandra_batch_mutate_presult() throw() {}
+
+ InvalidRequestException ire;
+ UnavailableException ue;
+ TimedOutException te;
+
+ _Cassandra_batch_mutate_presult__isset __isset;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+
+};
+
+
+class Cassandra_truncate_args {
+ public:
+
+ Cassandra_truncate_args() : cfname("") {
+ }
+
+ virtual ~Cassandra_truncate_args() throw() {}
+
+ std::string cfname;
+
+ void __set_cfname(const std::string& val) {
+ cfname = val;
+ }
+
+ bool operator == (const Cassandra_truncate_args & rhs) const
+ {
+ if (!(cfname == rhs.cfname))
+ return false;
+ return true;
+ }
+ bool operator != (const Cassandra_truncate_args &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const Cassandra_truncate_args & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+
+class Cassandra_truncate_pargs {
+ public:
+
+
+ virtual ~Cassandra_truncate_pargs() throw() {}
+
+ const std::string* cfname;
+
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+typedef struct _Cassandra_truncate_result__isset {
+ _Cassandra_truncate_result__isset() : ire(false), ue(false), te(false) {}
+ bool ire;
+ bool ue;
+ bool te;
+} _Cassandra_truncate_result__isset;
+
+class Cassandra_truncate_result {
+ public:
+
+ Cassandra_truncate_result() {
+ }
+
+ virtual ~Cassandra_truncate_result() throw() {}
+
+ InvalidRequestException ire;
+ UnavailableException ue;
+ TimedOutException te;
+
+ _Cassandra_truncate_result__isset __isset;
+
+ void __set_ire(const InvalidRequestException& val) {
+ ire = val;
+ }
+
+ void __set_ue(const UnavailableException& val) {
+ ue = val;
+ }
+
+ void __set_te(const TimedOutException& val) {
+ te = val;
+ }
+
+ bool operator == (const Cassandra_truncate_result & rhs) const
+ {
+ if (!(ire == rhs.ire))
+ return false;
+ if (!(ue == rhs.ue))
+ return false;
+ if (!(te == rhs.te))
+ return false;
+ return true;
+ }
+ bool operator != (const Cassandra_truncate_result &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const Cassandra_truncate_result & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+typedef struct _Cassandra_truncate_presult__isset {
+ _Cassandra_truncate_presult__isset() : ire(false), ue(false), te(false) {}
+ bool ire;
+ bool ue;
+ bool te;
+} _Cassandra_truncate_presult__isset;
+
+class Cassandra_truncate_presult {
+ public:
+
+
+ virtual ~Cassandra_truncate_presult() throw() {}
+
+ InvalidRequestException ire;
+ UnavailableException ue;
+ TimedOutException te;
+
+ _Cassandra_truncate_presult__isset __isset;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+
+};
+
+
+class Cassandra_describe_schema_versions_args {
+ public:
+
+ Cassandra_describe_schema_versions_args() {
+ }
+
+ virtual ~Cassandra_describe_schema_versions_args() throw() {}
+
+
+ bool operator == (const Cassandra_describe_schema_versions_args & /* rhs */) const
+ {
+ return true;
+ }
+ bool operator != (const Cassandra_describe_schema_versions_args &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const Cassandra_describe_schema_versions_args & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+
+class Cassandra_describe_schema_versions_pargs {
+ public:
+
+
+ virtual ~Cassandra_describe_schema_versions_pargs() throw() {}
+
+
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+typedef struct _Cassandra_describe_schema_versions_result__isset {
+ _Cassandra_describe_schema_versions_result__isset() : success(false), ire(false) {}
+ bool success;
+ bool ire;
+} _Cassandra_describe_schema_versions_result__isset;
+
+class Cassandra_describe_schema_versions_result {
+ public:
+
+ Cassandra_describe_schema_versions_result() {
+ }
+
+ virtual ~Cassandra_describe_schema_versions_result() throw() {}
+
+ std::map<std::string, std::vector<std::string> > success;
+ InvalidRequestException ire;
+
+ _Cassandra_describe_schema_versions_result__isset __isset;
+
+ void __set_success(const std::map<std::string, std::vector<std::string> > & val) {
+ success = val;
+ }
+
+ void __set_ire(const InvalidRequestException& val) {
+ ire = val;
+ }
+
+ bool operator == (const Cassandra_describe_schema_versions_result & rhs) const
+ {
+ if (!(success == rhs.success))
+ return false;
+ if (!(ire == rhs.ire))
+ return false;
+ return true;
+ }
+ bool operator != (const Cassandra_describe_schema_versions_result &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const Cassandra_describe_schema_versions_result & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+typedef struct _Cassandra_describe_schema_versions_presult__isset {
+ _Cassandra_describe_schema_versions_presult__isset() : success(false), ire(false) {}
+ bool success;
+ bool ire;
+} _Cassandra_describe_schema_versions_presult__isset;
+
+class Cassandra_describe_schema_versions_presult {
+ public:
+
+
+ virtual ~Cassandra_describe_schema_versions_presult() throw() {}
+
+ std::map<std::string, std::vector<std::string> > * success;
+ InvalidRequestException ire;
+
+ _Cassandra_describe_schema_versions_presult__isset __isset;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+
+};
+
+
+class Cassandra_describe_keyspaces_args {
+ public:
+
+ Cassandra_describe_keyspaces_args() {
+ }
+
+ virtual ~Cassandra_describe_keyspaces_args() throw() {}
+
+
+ bool operator == (const Cassandra_describe_keyspaces_args & /* rhs */) const
+ {
+ return true;
+ }
+ bool operator != (const Cassandra_describe_keyspaces_args &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const Cassandra_describe_keyspaces_args & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+
+class Cassandra_describe_keyspaces_pargs {
+ public:
+
+
+ virtual ~Cassandra_describe_keyspaces_pargs() throw() {}
+
+
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+typedef struct _Cassandra_describe_keyspaces_result__isset {
+ _Cassandra_describe_keyspaces_result__isset() : success(false), ire(false) {}
+ bool success;
+ bool ire;
+} _Cassandra_describe_keyspaces_result__isset;
+
+class Cassandra_describe_keyspaces_result {
+ public:
+
+ Cassandra_describe_keyspaces_result() {
+ }
+
+ virtual ~Cassandra_describe_keyspaces_result() throw() {}
+
+ std::vector<KsDef> success;
+ InvalidRequestException ire;
+
+ _Cassandra_describe_keyspaces_result__isset __isset;
+
+ void __set_success(const std::vector<KsDef> & val) {
+ success = val;
+ }
+
+ void __set_ire(const InvalidRequestException& val) {
+ ire = val;
+ }
+
+ bool operator == (const Cassandra_describe_keyspaces_result & rhs) const
+ {
+ if (!(success == rhs.success))
+ return false;
+ if (!(ire == rhs.ire))
+ return false;
+ return true;
+ }
+ bool operator != (const Cassandra_describe_keyspaces_result &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const Cassandra_describe_keyspaces_result & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+typedef struct _Cassandra_describe_keyspaces_presult__isset {
+ _Cassandra_describe_keyspaces_presult__isset() : success(false), ire(false) {}
+ bool success;
+ bool ire;
+} _Cassandra_describe_keyspaces_presult__isset;
+
+class Cassandra_describe_keyspaces_presult {
+ public:
+
+
+ virtual ~Cassandra_describe_keyspaces_presult() throw() {}
+
+ std::vector<KsDef> * success;
+ InvalidRequestException ire;
+
+ _Cassandra_describe_keyspaces_presult__isset __isset;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+
+};
+
+
+class Cassandra_describe_cluster_name_args {
+ public:
+
+ Cassandra_describe_cluster_name_args() {
+ }
+
+ virtual ~Cassandra_describe_cluster_name_args() throw() {}
+
+
+ bool operator == (const Cassandra_describe_cluster_name_args & /* rhs */) const
+ {
+ return true;
+ }
+ bool operator != (const Cassandra_describe_cluster_name_args &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const Cassandra_describe_cluster_name_args & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+
+class Cassandra_describe_cluster_name_pargs {
+ public:
+
+
+ virtual ~Cassandra_describe_cluster_name_pargs() throw() {}
+
+
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+typedef struct _Cassandra_describe_cluster_name_result__isset {
+ _Cassandra_describe_cluster_name_result__isset() : success(false) {}
+ bool success;
+} _Cassandra_describe_cluster_name_result__isset;
+
+class Cassandra_describe_cluster_name_result {
+ public:
+
+ Cassandra_describe_cluster_name_result() : success("") {
+ }
+
+ virtual ~Cassandra_describe_cluster_name_result() throw() {}
+
+ std::string success;
+
+ _Cassandra_describe_cluster_name_result__isset __isset;
+
+ void __set_success(const std::string& val) {
+ success = val;
+ }
+
+ bool operator == (const Cassandra_describe_cluster_name_result & rhs) const
+ {
+ if (!(success == rhs.success))
+ return false;
+ return true;
+ }
+ bool operator != (const Cassandra_describe_cluster_name_result &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const Cassandra_describe_cluster_name_result & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+typedef struct _Cassandra_describe_cluster_name_presult__isset {
+ _Cassandra_describe_cluster_name_presult__isset() : success(false) {}
+ bool success;
+} _Cassandra_describe_cluster_name_presult__isset;
+
+class Cassandra_describe_cluster_name_presult {
+ public:
+
+
+ virtual ~Cassandra_describe_cluster_name_presult() throw() {}
+
+ std::string* success;
+
+ _Cassandra_describe_cluster_name_presult__isset __isset;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+
+};
+
+
+class Cassandra_describe_version_args {
+ public:
+
+ Cassandra_describe_version_args() {
+ }
+
+ virtual ~Cassandra_describe_version_args() throw() {}
+
+
+ bool operator == (const Cassandra_describe_version_args & /* rhs */) const
+ {
+ return true;
+ }
+ bool operator != (const Cassandra_describe_version_args &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const Cassandra_describe_version_args & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+
+class Cassandra_describe_version_pargs {
+ public:
+
+
+ virtual ~Cassandra_describe_version_pargs() throw() {}
+
+
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+typedef struct _Cassandra_describe_version_result__isset {
+ _Cassandra_describe_version_result__isset() : success(false) {}
+ bool success;
+} _Cassandra_describe_version_result__isset;
+
+class Cassandra_describe_version_result {
+ public:
+
+ Cassandra_describe_version_result() : success("") {
+ }
+
+ virtual ~Cassandra_describe_version_result() throw() {}
+
+ std::string success;
+
+ _Cassandra_describe_version_result__isset __isset;
+
+ void __set_success(const std::string& val) {
+ success = val;
+ }
+
+ bool operator == (const Cassandra_describe_version_result & rhs) const
+ {
+ if (!(success == rhs.success))
+ return false;
+ return true;
+ }
+ bool operator != (const Cassandra_describe_version_result &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const Cassandra_describe_version_result & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+typedef struct _Cassandra_describe_version_presult__isset {
+ _Cassandra_describe_version_presult__isset() : success(false) {}
+ bool success;
+} _Cassandra_describe_version_presult__isset;
+
+class Cassandra_describe_version_presult {
+ public:
+
+
+ virtual ~Cassandra_describe_version_presult() throw() {}
+
+ std::string* success;
+
+ _Cassandra_describe_version_presult__isset __isset;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+
+};
+
+
+class Cassandra_describe_ring_args {
+ public:
+
+ Cassandra_describe_ring_args() : keyspace("") {
+ }
+
+ virtual ~Cassandra_describe_ring_args() throw() {}
+
+ std::string keyspace;
+
+ void __set_keyspace(const std::string& val) {
+ keyspace = val;
+ }
+
+ bool operator == (const Cassandra_describe_ring_args & rhs) const
+ {
+ if (!(keyspace == rhs.keyspace))
+ return false;
+ return true;
+ }
+ bool operator != (const Cassandra_describe_ring_args &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const Cassandra_describe_ring_args & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+
+class Cassandra_describe_ring_pargs {
+ public:
+
+
+ virtual ~Cassandra_describe_ring_pargs() throw() {}
+
+ const std::string* keyspace;
+
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+typedef struct _Cassandra_describe_ring_result__isset {
+ _Cassandra_describe_ring_result__isset() : success(false), ire(false) {}
+ bool success;
+ bool ire;
+} _Cassandra_describe_ring_result__isset;
+
+class Cassandra_describe_ring_result {
+ public:
+
+ Cassandra_describe_ring_result() {
+ }
+
+ virtual ~Cassandra_describe_ring_result() throw() {}
+
+ std::vector<TokenRange> success;
+ InvalidRequestException ire;
+
+ _Cassandra_describe_ring_result__isset __isset;
+
+ void __set_success(const std::vector<TokenRange> & val) {
+ success = val;
+ }
+
+ void __set_ire(const InvalidRequestException& val) {
+ ire = val;
+ }
+
+ bool operator == (const Cassandra_describe_ring_result & rhs) const
+ {
+ if (!(success == rhs.success))
+ return false;
+ if (!(ire == rhs.ire))
+ return false;
+ return true;
+ }
+ bool operator != (const Cassandra_describe_ring_result &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const Cassandra_describe_ring_result & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+typedef struct _Cassandra_describe_ring_presult__isset {
+ _Cassandra_describe_ring_presult__isset() : success(false), ire(false) {}
+ bool success;
+ bool ire;
+} _Cassandra_describe_ring_presult__isset;
+
+class Cassandra_describe_ring_presult {
+ public:
+
+
+ virtual ~Cassandra_describe_ring_presult() throw() {}
+
+ std::vector<TokenRange> * success;
+ InvalidRequestException ire;
+
+ _Cassandra_describe_ring_presult__isset __isset;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+
+};
+
+
+class Cassandra_describe_token_map_args {
+ public:
+
+ Cassandra_describe_token_map_args() {
+ }
+
+ virtual ~Cassandra_describe_token_map_args() throw() {}
+
+
+ bool operator == (const Cassandra_describe_token_map_args & /* rhs */) const
+ {
+ return true;
+ }
+ bool operator != (const Cassandra_describe_token_map_args &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const Cassandra_describe_token_map_args & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+
+class Cassandra_describe_token_map_pargs {
+ public:
+
+
+ virtual ~Cassandra_describe_token_map_pargs() throw() {}
+
+
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+typedef struct _Cassandra_describe_token_map_result__isset {
+ _Cassandra_describe_token_map_result__isset() : success(false), ire(false) {}
+ bool success;
+ bool ire;
+} _Cassandra_describe_token_map_result__isset;
+
+class Cassandra_describe_token_map_result {
+ public:
+
+ Cassandra_describe_token_map_result() {
+ }
+
+ virtual ~Cassandra_describe_token_map_result() throw() {}
+
+ std::map<std::string, std::string> success;
+ InvalidRequestException ire;
+
+ _Cassandra_describe_token_map_result__isset __isset;
+
+ void __set_success(const std::map<std::string, std::string> & val) {
+ success = val;
+ }
+
+ void __set_ire(const InvalidRequestException& val) {
+ ire = val;
+ }
+
+ bool operator == (const Cassandra_describe_token_map_result & rhs) const
+ {
+ if (!(success == rhs.success))
+ return false;
+ if (!(ire == rhs.ire))
+ return false;
+ return true;
+ }
+ bool operator != (const Cassandra_describe_token_map_result &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const Cassandra_describe_token_map_result & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+typedef struct _Cassandra_describe_token_map_presult__isset {
+ _Cassandra_describe_token_map_presult__isset() : success(false), ire(false) {}
+ bool success;
+ bool ire;
+} _Cassandra_describe_token_map_presult__isset;
+
+class Cassandra_describe_token_map_presult {
+ public:
+
+
+ virtual ~Cassandra_describe_token_map_presult() throw() {}
+
+ std::map<std::string, std::string> * success;
+ InvalidRequestException ire;
+
+ _Cassandra_describe_token_map_presult__isset __isset;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+
+};
+
+
+class Cassandra_describe_partitioner_args {
+ public:
+
+ Cassandra_describe_partitioner_args() {
+ }
+
+ virtual ~Cassandra_describe_partitioner_args() throw() {}
+
+
+ bool operator == (const Cassandra_describe_partitioner_args & /* rhs */) const
+ {
+ return true;
+ }
+ bool operator != (const Cassandra_describe_partitioner_args &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const Cassandra_describe_partitioner_args & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+
+class Cassandra_describe_partitioner_pargs {
+ public:
+
+
+ virtual ~Cassandra_describe_partitioner_pargs() throw() {}
+
+
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+typedef struct _Cassandra_describe_partitioner_result__isset {
+ _Cassandra_describe_partitioner_result__isset() : success(false) {}
+ bool success;
+} _Cassandra_describe_partitioner_result__isset;
+
+class Cassandra_describe_partitioner_result {
+ public:
+
+ Cassandra_describe_partitioner_result() : success("") {
+ }
+
+ virtual ~Cassandra_describe_partitioner_result() throw() {}
+
+ std::string success;
+
+ _Cassandra_describe_partitioner_result__isset __isset;
+
+ void __set_success(const std::string& val) {
+ success = val;
+ }
+
+ bool operator == (const Cassandra_describe_partitioner_result & rhs) const
+ {
+ if (!(success == rhs.success))
+ return false;
+ return true;
+ }
+ bool operator != (const Cassandra_describe_partitioner_result &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const Cassandra_describe_partitioner_result & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+typedef struct _Cassandra_describe_partitioner_presult__isset {
+ _Cassandra_describe_partitioner_presult__isset() : success(false) {}
+ bool success;
+} _Cassandra_describe_partitioner_presult__isset;
+
+class Cassandra_describe_partitioner_presult {
+ public:
+
+
+ virtual ~Cassandra_describe_partitioner_presult() throw() {}
+
+ std::string* success;
+
+ _Cassandra_describe_partitioner_presult__isset __isset;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+
+};
+
+
+class Cassandra_describe_snitch_args {
+ public:
+
+ Cassandra_describe_snitch_args() {
+ }
+
+ virtual ~Cassandra_describe_snitch_args() throw() {}
+
+
+ bool operator == (const Cassandra_describe_snitch_args & /* rhs */) const
+ {
+ return true;
+ }
+ bool operator != (const Cassandra_describe_snitch_args &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const Cassandra_describe_snitch_args & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+
+class Cassandra_describe_snitch_pargs {
+ public:
+
+
+ virtual ~Cassandra_describe_snitch_pargs() throw() {}
+
+
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+typedef struct _Cassandra_describe_snitch_result__isset {
+ _Cassandra_describe_snitch_result__isset() : success(false) {}
+ bool success;
+} _Cassandra_describe_snitch_result__isset;
+
+class Cassandra_describe_snitch_result {
+ public:
+
+ Cassandra_describe_snitch_result() : success("") {
+ }
+
+ virtual ~Cassandra_describe_snitch_result() throw() {}
+
+ std::string success;
+
+ _Cassandra_describe_snitch_result__isset __isset;
+
+ void __set_success(const std::string& val) {
+ success = val;
+ }
+
+ bool operator == (const Cassandra_describe_snitch_result & rhs) const
+ {
+ if (!(success == rhs.success))
+ return false;
+ return true;
+ }
+ bool operator != (const Cassandra_describe_snitch_result &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const Cassandra_describe_snitch_result & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+typedef struct _Cassandra_describe_snitch_presult__isset {
+ _Cassandra_describe_snitch_presult__isset() : success(false) {}
+ bool success;
+} _Cassandra_describe_snitch_presult__isset;
+
+class Cassandra_describe_snitch_presult {
+ public:
+
+
+ virtual ~Cassandra_describe_snitch_presult() throw() {}
+
+ std::string* success;
+
+ _Cassandra_describe_snitch_presult__isset __isset;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+
+};
+
+
+class Cassandra_describe_keyspace_args {
+ public:
+
+ Cassandra_describe_keyspace_args() : keyspace("") {
+ }
+
+ virtual ~Cassandra_describe_keyspace_args() throw() {}
+
+ std::string keyspace;
+
+ void __set_keyspace(const std::string& val) {
+ keyspace = val;
+ }
+
+ bool operator == (const Cassandra_describe_keyspace_args & rhs) const
+ {
+ if (!(keyspace == rhs.keyspace))
+ return false;
+ return true;
+ }
+ bool operator != (const Cassandra_describe_keyspace_args &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const Cassandra_describe_keyspace_args & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+
+class Cassandra_describe_keyspace_pargs {
+ public:
+
+
+ virtual ~Cassandra_describe_keyspace_pargs() throw() {}
+
+ const std::string* keyspace;
+
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+typedef struct _Cassandra_describe_keyspace_result__isset {
+ _Cassandra_describe_keyspace_result__isset() : success(false), nfe(false), ire(false) {}
+ bool success;
+ bool nfe;
+ bool ire;
+} _Cassandra_describe_keyspace_result__isset;
+
+class Cassandra_describe_keyspace_result {
+ public:
+
+ Cassandra_describe_keyspace_result() {
+ }
+
+ virtual ~Cassandra_describe_keyspace_result() throw() {}
+
+ KsDef success;
+ NotFoundException nfe;
+ InvalidRequestException ire;
+
+ _Cassandra_describe_keyspace_result__isset __isset;
+
+ void __set_success(const KsDef& val) {
+ success = val;
+ }
+
+ void __set_nfe(const NotFoundException& val) {
+ nfe = val;
+ }
+
+ void __set_ire(const InvalidRequestException& val) {
+ ire = val;
+ }
+
+ bool operator == (const Cassandra_describe_keyspace_result & rhs) const
+ {
+ if (!(success == rhs.success))
+ return false;
+ if (!(nfe == rhs.nfe))
+ return false;
+ if (!(ire == rhs.ire))
+ return false;
+ return true;
+ }
+ bool operator != (const Cassandra_describe_keyspace_result &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const Cassandra_describe_keyspace_result & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+typedef struct _Cassandra_describe_keyspace_presult__isset {
+ _Cassandra_describe_keyspace_presult__isset() : success(false), nfe(false), ire(false) {}
+ bool success;
+ bool nfe;
+ bool ire;
+} _Cassandra_describe_keyspace_presult__isset;
+
+class Cassandra_describe_keyspace_presult {
+ public:
+
+
+ virtual ~Cassandra_describe_keyspace_presult() throw() {}
+
+ KsDef* success;
+ NotFoundException nfe;
+ InvalidRequestException ire;
+
+ _Cassandra_describe_keyspace_presult__isset __isset;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+
+};
+
+
+class Cassandra_describe_splits_args {
+ public:
+
+ Cassandra_describe_splits_args() : cfName(""), start_token(""), end_token(""), keys_per_split(0) {
+ }
+
+ virtual ~Cassandra_describe_splits_args() throw() {}
+
+ std::string cfName;
+ std::string start_token;
+ std::string end_token;
+ int32_t keys_per_split;
+
+ void __set_cfName(const std::string& val) {
+ cfName = val;
+ }
+
+ void __set_start_token(const std::string& val) {
+ start_token = val;
+ }
+
+ void __set_end_token(const std::string& val) {
+ end_token = val;
+ }
+
+ void __set_keys_per_split(const int32_t val) {
+ keys_per_split = val;
+ }
+
+ bool operator == (const Cassandra_describe_splits_args & rhs) const
+ {
+ if (!(cfName == rhs.cfName))
+ return false;
+ if (!(start_token == rhs.start_token))
+ return false;
+ if (!(end_token == rhs.end_token))
+ return false;
+ if (!(keys_per_split == rhs.keys_per_split))
+ return false;
+ return true;
+ }
+ bool operator != (const Cassandra_describe_splits_args &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const Cassandra_describe_splits_args & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+
+class Cassandra_describe_splits_pargs {
+ public:
+
+
+ virtual ~Cassandra_describe_splits_pargs() throw() {}
+
+ const std::string* cfName;
+ const std::string* start_token;
+ const std::string* end_token;
+ const int32_t* keys_per_split;
+
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+typedef struct _Cassandra_describe_splits_result__isset {
+ _Cassandra_describe_splits_result__isset() : success(false), ire(false) {}
+ bool success;
+ bool ire;
+} _Cassandra_describe_splits_result__isset;
+
+class Cassandra_describe_splits_result {
+ public:
+
+ Cassandra_describe_splits_result() {
+ }
+
+ virtual ~Cassandra_describe_splits_result() throw() {}
+
+ std::vector<std::string> success;
+ InvalidRequestException ire;
+
+ _Cassandra_describe_splits_result__isset __isset;
+
+ void __set_success(const std::vector<std::string> & val) {
+ success = val;
+ }
+
+ void __set_ire(const InvalidRequestException& val) {
+ ire = val;
+ }
+
+ bool operator == (const Cassandra_describe_splits_result & rhs) const
+ {
+ if (!(success == rhs.success))
+ return false;
+ if (!(ire == rhs.ire))
+ return false;
+ return true;
+ }
+ bool operator != (const Cassandra_describe_splits_result &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const Cassandra_describe_splits_result & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+typedef struct _Cassandra_describe_splits_presult__isset {
+ _Cassandra_describe_splits_presult__isset() : success(false), ire(false) {}
+ bool success;
+ bool ire;
+} _Cassandra_describe_splits_presult__isset;
+
+class Cassandra_describe_splits_presult {
+ public:
+
+
+ virtual ~Cassandra_describe_splits_presult() throw() {}
+
+ std::vector<std::string> * success;
+ InvalidRequestException ire;
+
+ _Cassandra_describe_splits_presult__isset __isset;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+
+};
+
+
+class Cassandra_system_add_column_family_args {
+ public:
+
+ Cassandra_system_add_column_family_args() {
+ }
+
+ virtual ~Cassandra_system_add_column_family_args() throw() {}
+
+ CfDef cf_def;
+
+ void __set_cf_def(const CfDef& val) {
+ cf_def = val;
+ }
+
+ bool operator == (const Cassandra_system_add_column_family_args & rhs) const
+ {
+ if (!(cf_def == rhs.cf_def))
+ return false;
+ return true;
+ }
+ bool operator != (const Cassandra_system_add_column_family_args &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const Cassandra_system_add_column_family_args & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+
+class Cassandra_system_add_column_family_pargs {
+ public:
+
+
+ virtual ~Cassandra_system_add_column_family_pargs() throw() {}
+
+ const CfDef* cf_def;
+
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+typedef struct _Cassandra_system_add_column_family_result__isset {
+ _Cassandra_system_add_column_family_result__isset() : success(false), ire(false), sde(false) {}
+ bool success;
+ bool ire;
+ bool sde;
+} _Cassandra_system_add_column_family_result__isset;
+
+class Cassandra_system_add_column_family_result {
+ public:
+
+ Cassandra_system_add_column_family_result() : success("") {
+ }
+
+ virtual ~Cassandra_system_add_column_family_result() throw() {}
+
+ std::string success;
+ InvalidRequestException ire;
+ SchemaDisagreementException sde;
+
+ _Cassandra_system_add_column_family_result__isset __isset;
+
+ void __set_success(const std::string& val) {
+ success = val;
+ }
+
+ void __set_ire(const InvalidRequestException& val) {
+ ire = val;
+ }
+
+ void __set_sde(const SchemaDisagreementException& val) {
+ sde = val;
+ }
+
+ bool operator == (const Cassandra_system_add_column_family_result & rhs) const
+ {
+ if (!(success == rhs.success))
+ return false;
+ if (!(ire == rhs.ire))
+ return false;
+ if (!(sde == rhs.sde))
+ return false;
+ return true;
+ }
+ bool operator != (const Cassandra_system_add_column_family_result &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const Cassandra_system_add_column_family_result & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+typedef struct _Cassandra_system_add_column_family_presult__isset {
+ _Cassandra_system_add_column_family_presult__isset() : success(false), ire(false), sde(false) {}
+ bool success;
+ bool ire;
+ bool sde;
+} _Cassandra_system_add_column_family_presult__isset;
+
+class Cassandra_system_add_column_family_presult {
+ public:
+
+
+ virtual ~Cassandra_system_add_column_family_presult() throw() {}
+
+ std::string* success;
+ InvalidRequestException ire;
+ SchemaDisagreementException sde;
+
+ _Cassandra_system_add_column_family_presult__isset __isset;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+
+};
+
+
+class Cassandra_system_drop_column_family_args {
+ public:
+
+ Cassandra_system_drop_column_family_args() : column_family("") {
+ }
+
+ virtual ~Cassandra_system_drop_column_family_args() throw() {}
+
+ std::string column_family;
+
+ void __set_column_family(const std::string& val) {
+ column_family = val;
+ }
+
+ bool operator == (const Cassandra_system_drop_column_family_args & rhs) const
+ {
+ if (!(column_family == rhs.column_family))
+ return false;
+ return true;
+ }
+ bool operator != (const Cassandra_system_drop_column_family_args &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const Cassandra_system_drop_column_family_args & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+
+class Cassandra_system_drop_column_family_pargs {
+ public:
+
+
+ virtual ~Cassandra_system_drop_column_family_pargs() throw() {}
+
+ const std::string* column_family;
+
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+typedef struct _Cassandra_system_drop_column_family_result__isset {
+ _Cassandra_system_drop_column_family_result__isset() : success(false), ire(false), sde(false) {}
+ bool success;
+ bool ire;
+ bool sde;
+} _Cassandra_system_drop_column_family_result__isset;
+
+class Cassandra_system_drop_column_family_result {
+ public:
+
+ Cassandra_system_drop_column_family_result() : success("") {
+ }
+
+ virtual ~Cassandra_system_drop_column_family_result() throw() {}
+
+ std::string success;
+ InvalidRequestException ire;
+ SchemaDisagreementException sde;
+
+ _Cassandra_system_drop_column_family_result__isset __isset;
+
+ void __set_success(const std::string& val) {
+ success = val;
+ }
+
+ void __set_ire(const InvalidRequestException& val) {
+ ire = val;
+ }
+
+ void __set_sde(const SchemaDisagreementException& val) {
+ sde = val;
+ }
+
+ bool operator == (const Cassandra_system_drop_column_family_result & rhs) const
+ {
+ if (!(success == rhs.success))
+ return false;
+ if (!(ire == rhs.ire))
+ return false;
+ if (!(sde == rhs.sde))
+ return false;
+ return true;
+ }
+ bool operator != (const Cassandra_system_drop_column_family_result &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const Cassandra_system_drop_column_family_result & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+typedef struct _Cassandra_system_drop_column_family_presult__isset {
+ _Cassandra_system_drop_column_family_presult__isset() : success(false), ire(false), sde(false) {}
+ bool success;
+ bool ire;
+ bool sde;
+} _Cassandra_system_drop_column_family_presult__isset;
+
+class Cassandra_system_drop_column_family_presult {
+ public:
+
+
+ virtual ~Cassandra_system_drop_column_family_presult() throw() {}
+
+ std::string* success;
+ InvalidRequestException ire;
+ SchemaDisagreementException sde;
+
+ _Cassandra_system_drop_column_family_presult__isset __isset;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+
+};
+
+
+class Cassandra_system_add_keyspace_args {
+ public:
+
+ Cassandra_system_add_keyspace_args() {
+ }
+
+ virtual ~Cassandra_system_add_keyspace_args() throw() {}
+
+ KsDef ks_def;
+
+ void __set_ks_def(const KsDef& val) {
+ ks_def = val;
+ }
+
+ bool operator == (const Cassandra_system_add_keyspace_args & rhs) const
+ {
+ if (!(ks_def == rhs.ks_def))
+ return false;
+ return true;
+ }
+ bool operator != (const Cassandra_system_add_keyspace_args &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const Cassandra_system_add_keyspace_args & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+
+class Cassandra_system_add_keyspace_pargs {
+ public:
+
+
+ virtual ~Cassandra_system_add_keyspace_pargs() throw() {}
+
+ const KsDef* ks_def;
+
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+typedef struct _Cassandra_system_add_keyspace_result__isset {
+ _Cassandra_system_add_keyspace_result__isset() : success(false), ire(false), sde(false) {}
+ bool success;
+ bool ire;
+ bool sde;
+} _Cassandra_system_add_keyspace_result__isset;
+
+class Cassandra_system_add_keyspace_result {
+ public:
+
+ Cassandra_system_add_keyspace_result() : success("") {
+ }
+
+ virtual ~Cassandra_system_add_keyspace_result() throw() {}
+
+ std::string success;
+ InvalidRequestException ire;
+ SchemaDisagreementException sde;
+
+ _Cassandra_system_add_keyspace_result__isset __isset;
+
+ void __set_success(const std::string& val) {
+ success = val;
+ }
+
+ void __set_ire(const InvalidRequestException& val) {
+ ire = val;
+ }
+
+ void __set_sde(const SchemaDisagreementException& val) {
+ sde = val;
+ }
+
+ bool operator == (const Cassandra_system_add_keyspace_result & rhs) const
+ {
+ if (!(success == rhs.success))
+ return false;
+ if (!(ire == rhs.ire))
+ return false;
+ if (!(sde == rhs.sde))
+ return false;
+ return true;
+ }
+ bool operator != (const Cassandra_system_add_keyspace_result &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const Cassandra_system_add_keyspace_result & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+typedef struct _Cassandra_system_add_keyspace_presult__isset {
+ _Cassandra_system_add_keyspace_presult__isset() : success(false), ire(false), sde(false) {}
+ bool success;
+ bool ire;
+ bool sde;
+} _Cassandra_system_add_keyspace_presult__isset;
+
+class Cassandra_system_add_keyspace_presult {
+ public:
+
+
+ virtual ~Cassandra_system_add_keyspace_presult() throw() {}
+
+ std::string* success;
+ InvalidRequestException ire;
+ SchemaDisagreementException sde;
+
+ _Cassandra_system_add_keyspace_presult__isset __isset;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+
+};
+
+
+class Cassandra_system_drop_keyspace_args {
+ public:
+
+ Cassandra_system_drop_keyspace_args() : keyspace("") {
+ }
+
+ virtual ~Cassandra_system_drop_keyspace_args() throw() {}
+
+ std::string keyspace;
+
+ void __set_keyspace(const std::string& val) {
+ keyspace = val;
+ }
+
+ bool operator == (const Cassandra_system_drop_keyspace_args & rhs) const
+ {
+ if (!(keyspace == rhs.keyspace))
+ return false;
+ return true;
+ }
+ bool operator != (const Cassandra_system_drop_keyspace_args &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const Cassandra_system_drop_keyspace_args & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+
+class Cassandra_system_drop_keyspace_pargs {
+ public:
+
+
+ virtual ~Cassandra_system_drop_keyspace_pargs() throw() {}
+
+ const std::string* keyspace;
+
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+typedef struct _Cassandra_system_drop_keyspace_result__isset {
+ _Cassandra_system_drop_keyspace_result__isset() : success(false), ire(false), sde(false) {}
+ bool success;
+ bool ire;
+ bool sde;
+} _Cassandra_system_drop_keyspace_result__isset;
+
+class Cassandra_system_drop_keyspace_result {
+ public:
+
+ Cassandra_system_drop_keyspace_result() : success("") {
+ }
+
+ virtual ~Cassandra_system_drop_keyspace_result() throw() {}
+
+ std::string success;
+ InvalidRequestException ire;
+ SchemaDisagreementException sde;
+
+ _Cassandra_system_drop_keyspace_result__isset __isset;
+
+ void __set_success(const std::string& val) {
+ success = val;
+ }
+
+ void __set_ire(const InvalidRequestException& val) {
+ ire = val;
+ }
+
+ void __set_sde(const SchemaDisagreementException& val) {
+ sde = val;
+ }
+
+ bool operator == (const Cassandra_system_drop_keyspace_result & rhs) const
+ {
+ if (!(success == rhs.success))
+ return false;
+ if (!(ire == rhs.ire))
+ return false;
+ if (!(sde == rhs.sde))
+ return false;
+ return true;
+ }
+ bool operator != (const Cassandra_system_drop_keyspace_result &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const Cassandra_system_drop_keyspace_result & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+typedef struct _Cassandra_system_drop_keyspace_presult__isset {
+ _Cassandra_system_drop_keyspace_presult__isset() : success(false), ire(false), sde(false) {}
+ bool success;
+ bool ire;
+ bool sde;
+} _Cassandra_system_drop_keyspace_presult__isset;
+
+class Cassandra_system_drop_keyspace_presult {
+ public:
+
+
+ virtual ~Cassandra_system_drop_keyspace_presult() throw() {}
+
+ std::string* success;
+ InvalidRequestException ire;
+ SchemaDisagreementException sde;
+
+ _Cassandra_system_drop_keyspace_presult__isset __isset;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+
+};
+
+
+class Cassandra_system_update_keyspace_args {
+ public:
+
+ Cassandra_system_update_keyspace_args() {
+ }
+
+ virtual ~Cassandra_system_update_keyspace_args() throw() {}
+
+ KsDef ks_def;
+
+ void __set_ks_def(const KsDef& val) {
+ ks_def = val;
+ }
+
+ bool operator == (const Cassandra_system_update_keyspace_args & rhs) const
+ {
+ if (!(ks_def == rhs.ks_def))
+ return false;
+ return true;
+ }
+ bool operator != (const Cassandra_system_update_keyspace_args &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const Cassandra_system_update_keyspace_args & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+
+class Cassandra_system_update_keyspace_pargs {
+ public:
+
+
+ virtual ~Cassandra_system_update_keyspace_pargs() throw() {}
+
+ const KsDef* ks_def;
+
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+typedef struct _Cassandra_system_update_keyspace_result__isset {
+ _Cassandra_system_update_keyspace_result__isset() : success(false), ire(false), sde(false) {}
+ bool success;
+ bool ire;
+ bool sde;
+} _Cassandra_system_update_keyspace_result__isset;
+
+class Cassandra_system_update_keyspace_result {
+ public:
+
+ Cassandra_system_update_keyspace_result() : success("") {
+ }
+
+ virtual ~Cassandra_system_update_keyspace_result() throw() {}
+
+ std::string success;
+ InvalidRequestException ire;
+ SchemaDisagreementException sde;
+
+ _Cassandra_system_update_keyspace_result__isset __isset;
+
+ void __set_success(const std::string& val) {
+ success = val;
+ }
+
+ void __set_ire(const InvalidRequestException& val) {
+ ire = val;
+ }
+
+ void __set_sde(const SchemaDisagreementException& val) {
+ sde = val;
+ }
+
+ bool operator == (const Cassandra_system_update_keyspace_result & rhs) const
+ {
+ if (!(success == rhs.success))
+ return false;
+ if (!(ire == rhs.ire))
+ return false;
+ if (!(sde == rhs.sde))
+ return false;
+ return true;
+ }
+ bool operator != (const Cassandra_system_update_keyspace_result &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const Cassandra_system_update_keyspace_result & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+typedef struct _Cassandra_system_update_keyspace_presult__isset {
+ _Cassandra_system_update_keyspace_presult__isset() : success(false), ire(false), sde(false) {}
+ bool success;
+ bool ire;
+ bool sde;
+} _Cassandra_system_update_keyspace_presult__isset;
+
+class Cassandra_system_update_keyspace_presult {
+ public:
+
+
+ virtual ~Cassandra_system_update_keyspace_presult() throw() {}
+
+ std::string* success;
+ InvalidRequestException ire;
+ SchemaDisagreementException sde;
+
+ _Cassandra_system_update_keyspace_presult__isset __isset;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+
+};
+
+
+class Cassandra_system_update_column_family_args {
+ public:
+
+ Cassandra_system_update_column_family_args() {
+ }
+
+ virtual ~Cassandra_system_update_column_family_args() throw() {}
+
+ CfDef cf_def;
+
+ void __set_cf_def(const CfDef& val) {
+ cf_def = val;
+ }
+
+ bool operator == (const Cassandra_system_update_column_family_args & rhs) const
+ {
+ if (!(cf_def == rhs.cf_def))
+ return false;
+ return true;
+ }
+ bool operator != (const Cassandra_system_update_column_family_args &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const Cassandra_system_update_column_family_args & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+
+class Cassandra_system_update_column_family_pargs {
+ public:
+
+
+ virtual ~Cassandra_system_update_column_family_pargs() throw() {}
+
+ const CfDef* cf_def;
+
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+typedef struct _Cassandra_system_update_column_family_result__isset {
+ _Cassandra_system_update_column_family_result__isset() : success(false), ire(false), sde(false) {}
+ bool success;
+ bool ire;
+ bool sde;
+} _Cassandra_system_update_column_family_result__isset;
+
+class Cassandra_system_update_column_family_result {
+ public:
+
+ Cassandra_system_update_column_family_result() : success("") {
+ }
+
+ virtual ~Cassandra_system_update_column_family_result() throw() {}
+
+ std::string success;
+ InvalidRequestException ire;
+ SchemaDisagreementException sde;
+
+ _Cassandra_system_update_column_family_result__isset __isset;
+
+ void __set_success(const std::string& val) {
+ success = val;
+ }
+
+ void __set_ire(const InvalidRequestException& val) {
+ ire = val;
+ }
+
+ void __set_sde(const SchemaDisagreementException& val) {
+ sde = val;
+ }
+
+ bool operator == (const Cassandra_system_update_column_family_result & rhs) const
+ {
+ if (!(success == rhs.success))
+ return false;
+ if (!(ire == rhs.ire))
+ return false;
+ if (!(sde == rhs.sde))
+ return false;
+ return true;
+ }
+ bool operator != (const Cassandra_system_update_column_family_result &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const Cassandra_system_update_column_family_result & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+typedef struct _Cassandra_system_update_column_family_presult__isset {
+ _Cassandra_system_update_column_family_presult__isset() : success(false), ire(false), sde(false) {}
+ bool success;
+ bool ire;
+ bool sde;
+} _Cassandra_system_update_column_family_presult__isset;
+
+class Cassandra_system_update_column_family_presult {
+ public:
+
+
+ virtual ~Cassandra_system_update_column_family_presult() throw() {}
+
+ std::string* success;
+ InvalidRequestException ire;
+ SchemaDisagreementException sde;
+
+ _Cassandra_system_update_column_family_presult__isset __isset;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+
+};
+
+
+class Cassandra_execute_cql_query_args {
+ public:
+
+ Cassandra_execute_cql_query_args() : query(""), compression((Compression::type)0) {
+ }
+
+ virtual ~Cassandra_execute_cql_query_args() throw() {}
+
+ std::string query;
+ Compression::type compression;
+
+ void __set_query(const std::string& val) {
+ query = val;
+ }
+
+ void __set_compression(const Compression::type val) {
+ compression = val;
+ }
+
+ bool operator == (const Cassandra_execute_cql_query_args & rhs) const
+ {
+ if (!(query == rhs.query))
+ return false;
+ if (!(compression == rhs.compression))
+ return false;
+ return true;
+ }
+ bool operator != (const Cassandra_execute_cql_query_args &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const Cassandra_execute_cql_query_args & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+
+class Cassandra_execute_cql_query_pargs {
+ public:
+
+
+ virtual ~Cassandra_execute_cql_query_pargs() throw() {}
+
+ const std::string* query;
+ const Compression::type* compression;
+
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+typedef struct _Cassandra_execute_cql_query_result__isset {
+ _Cassandra_execute_cql_query_result__isset() : success(false), ire(false), ue(false), te(false), sde(false) {}
+ bool success;
+ bool ire;
+ bool ue;
+ bool te;
+ bool sde;
+} _Cassandra_execute_cql_query_result__isset;
+
+class Cassandra_execute_cql_query_result {
+ public:
+
+ Cassandra_execute_cql_query_result() {
+ }
+
+ virtual ~Cassandra_execute_cql_query_result() throw() {}
+
+ CqlResult success;
+ InvalidRequestException ire;
+ UnavailableException ue;
+ TimedOutException te;
+ SchemaDisagreementException sde;
+
+ _Cassandra_execute_cql_query_result__isset __isset;
+
+ void __set_success(const CqlResult& val) {
+ success = val;
+ }
+
+ void __set_ire(const InvalidRequestException& val) {
+ ire = val;
+ }
+
+ void __set_ue(const UnavailableException& val) {
+ ue = val;
+ }
+
+ void __set_te(const TimedOutException& val) {
+ te = val;
+ }
+
+ void __set_sde(const SchemaDisagreementException& val) {
+ sde = val;
+ }
+
+ bool operator == (const Cassandra_execute_cql_query_result & rhs) const
+ {
+ if (!(success == rhs.success))
+ return false;
+ if (!(ire == rhs.ire))
+ return false;
+ if (!(ue == rhs.ue))
+ return false;
+ if (!(te == rhs.te))
+ return false;
+ if (!(sde == rhs.sde))
+ return false;
+ return true;
+ }
+ bool operator != (const Cassandra_execute_cql_query_result &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const Cassandra_execute_cql_query_result & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+typedef struct _Cassandra_execute_cql_query_presult__isset {
+ _Cassandra_execute_cql_query_presult__isset() : success(false), ire(false), ue(false), te(false), sde(false) {}
+ bool success;
+ bool ire;
+ bool ue;
+ bool te;
+ bool sde;
+} _Cassandra_execute_cql_query_presult__isset;
+
+class Cassandra_execute_cql_query_presult {
+ public:
+
+
+ virtual ~Cassandra_execute_cql_query_presult() throw() {}
+
+ CqlResult* success;
+ InvalidRequestException ire;
+ UnavailableException ue;
+ TimedOutException te;
+ SchemaDisagreementException sde;
+
+ _Cassandra_execute_cql_query_presult__isset __isset;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+
+};
+
+
+class Cassandra_prepare_cql_query_args {
+ public:
+
+ Cassandra_prepare_cql_query_args() : query(""), compression((Compression::type)0) {
+ }
+
+ virtual ~Cassandra_prepare_cql_query_args() throw() {}
+
+ std::string query;
+ Compression::type compression;
+
+ void __set_query(const std::string& val) {
+ query = val;
+ }
+
+ void __set_compression(const Compression::type val) {
+ compression = val;
+ }
+
+ bool operator == (const Cassandra_prepare_cql_query_args & rhs) const
+ {
+ if (!(query == rhs.query))
+ return false;
+ if (!(compression == rhs.compression))
+ return false;
+ return true;
+ }
+ bool operator != (const Cassandra_prepare_cql_query_args &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const Cassandra_prepare_cql_query_args & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+
+class Cassandra_prepare_cql_query_pargs {
+ public:
+
+
+ virtual ~Cassandra_prepare_cql_query_pargs() throw() {}
+
+ const std::string* query;
+ const Compression::type* compression;
+
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+typedef struct _Cassandra_prepare_cql_query_result__isset {
+ _Cassandra_prepare_cql_query_result__isset() : success(false), ire(false) {}
+ bool success;
+ bool ire;
+} _Cassandra_prepare_cql_query_result__isset;
+
+class Cassandra_prepare_cql_query_result {
+ public:
+
+ Cassandra_prepare_cql_query_result() {
+ }
+
+ virtual ~Cassandra_prepare_cql_query_result() throw() {}
+
+ CqlPreparedResult success;
+ InvalidRequestException ire;
+
+ _Cassandra_prepare_cql_query_result__isset __isset;
+
+ void __set_success(const CqlPreparedResult& val) {
+ success = val;
+ }
+
+ void __set_ire(const InvalidRequestException& val) {
+ ire = val;
+ }
+
+ bool operator == (const Cassandra_prepare_cql_query_result & rhs) const
+ {
+ if (!(success == rhs.success))
+ return false;
+ if (!(ire == rhs.ire))
+ return false;
+ return true;
+ }
+ bool operator != (const Cassandra_prepare_cql_query_result &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const Cassandra_prepare_cql_query_result & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+typedef struct _Cassandra_prepare_cql_query_presult__isset {
+ _Cassandra_prepare_cql_query_presult__isset() : success(false), ire(false) {}
+ bool success;
+ bool ire;
+} _Cassandra_prepare_cql_query_presult__isset;
+
+class Cassandra_prepare_cql_query_presult {
+ public:
+
+
+ virtual ~Cassandra_prepare_cql_query_presult() throw() {}
+
+ CqlPreparedResult* success;
+ InvalidRequestException ire;
+
+ _Cassandra_prepare_cql_query_presult__isset __isset;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+
+};
+
+
+class Cassandra_execute_prepared_cql_query_args {
+ public:
+
+ Cassandra_execute_prepared_cql_query_args() : itemId(0) {
+ }
+
+ virtual ~Cassandra_execute_prepared_cql_query_args() throw() {}
+
+ int32_t itemId;
+ std::vector<std::string> values;
+
+ void __set_itemId(const int32_t val) {
+ itemId = val;
+ }
+
+ void __set_values(const std::vector<std::string> & val) {
+ values = val;
+ }
+
+ bool operator == (const Cassandra_execute_prepared_cql_query_args & rhs) const
+ {
+ if (!(itemId == rhs.itemId))
+ return false;
+ if (!(values == rhs.values))
+ return false;
+ return true;
+ }
+ bool operator != (const Cassandra_execute_prepared_cql_query_args &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const Cassandra_execute_prepared_cql_query_args & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+
+class Cassandra_execute_prepared_cql_query_pargs {
+ public:
+
+
+ virtual ~Cassandra_execute_prepared_cql_query_pargs() throw() {}
+
+ const int32_t* itemId;
+ const std::vector<std::string> * values;
+
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+typedef struct _Cassandra_execute_prepared_cql_query_result__isset {
+ _Cassandra_execute_prepared_cql_query_result__isset() : success(false), ire(false), ue(false), te(false), sde(false) {}
+ bool success;
+ bool ire;
+ bool ue;
+ bool te;
+ bool sde;
+} _Cassandra_execute_prepared_cql_query_result__isset;
+
+class Cassandra_execute_prepared_cql_query_result {
+ public:
+
+ Cassandra_execute_prepared_cql_query_result() {
+ }
+
+ virtual ~Cassandra_execute_prepared_cql_query_result() throw() {}
+
+ CqlResult success;
+ InvalidRequestException ire;
+ UnavailableException ue;
+ TimedOutException te;
+ SchemaDisagreementException sde;
+
+ _Cassandra_execute_prepared_cql_query_result__isset __isset;
+
+ void __set_success(const CqlResult& val) {
+ success = val;
+ }
+
+ void __set_ire(const InvalidRequestException& val) {
+ ire = val;
+ }
+
+ void __set_ue(const UnavailableException& val) {
+ ue = val;
+ }
+
+ void __set_te(const TimedOutException& val) {
+ te = val;
+ }
+
+ void __set_sde(const SchemaDisagreementException& val) {
+ sde = val;
+ }
+
+ bool operator == (const Cassandra_execute_prepared_cql_query_result & rhs) const
+ {
+ if (!(success == rhs.success))
+ return false;
+ if (!(ire == rhs.ire))
+ return false;
+ if (!(ue == rhs.ue))
+ return false;
+ if (!(te == rhs.te))
+ return false;
+ if (!(sde == rhs.sde))
+ return false;
+ return true;
+ }
+ bool operator != (const Cassandra_execute_prepared_cql_query_result &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const Cassandra_execute_prepared_cql_query_result & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+typedef struct _Cassandra_execute_prepared_cql_query_presult__isset {
+ _Cassandra_execute_prepared_cql_query_presult__isset() : success(false), ire(false), ue(false), te(false), sde(false) {}
+ bool success;
+ bool ire;
+ bool ue;
+ bool te;
+ bool sde;
+} _Cassandra_execute_prepared_cql_query_presult__isset;
+
+class Cassandra_execute_prepared_cql_query_presult {
+ public:
+
+
+ virtual ~Cassandra_execute_prepared_cql_query_presult() throw() {}
+
+ CqlResult* success;
+ InvalidRequestException ire;
+ UnavailableException ue;
+ TimedOutException te;
+ SchemaDisagreementException sde;
+
+ _Cassandra_execute_prepared_cql_query_presult__isset __isset;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+
+};
+
+
+class Cassandra_set_cql_version_args {
+ public:
+
+ Cassandra_set_cql_version_args() : version("") {
+ }
+
+ virtual ~Cassandra_set_cql_version_args() throw() {}
+
+ std::string version;
+
+ void __set_version(const std::string& val) {
+ version = val;
+ }
+
+ bool operator == (const Cassandra_set_cql_version_args & rhs) const
+ {
+ if (!(version == rhs.version))
+ return false;
+ return true;
+ }
+ bool operator != (const Cassandra_set_cql_version_args &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const Cassandra_set_cql_version_args & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+
+class Cassandra_set_cql_version_pargs {
+ public:
+
+
+ virtual ~Cassandra_set_cql_version_pargs() throw() {}
+
+ const std::string* version;
+
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+typedef struct _Cassandra_set_cql_version_result__isset {
+ _Cassandra_set_cql_version_result__isset() : ire(false) {}
+ bool ire;
+} _Cassandra_set_cql_version_result__isset;
+
+class Cassandra_set_cql_version_result {
+ public:
+
+ Cassandra_set_cql_version_result() {
+ }
+
+ virtual ~Cassandra_set_cql_version_result() throw() {}
+
+ InvalidRequestException ire;
+
+ _Cassandra_set_cql_version_result__isset __isset;
+
+ void __set_ire(const InvalidRequestException& val) {
+ ire = val;
+ }
+
+ bool operator == (const Cassandra_set_cql_version_result & rhs) const
+ {
+ if (!(ire == rhs.ire))
+ return false;
+ return true;
+ }
+ bool operator != (const Cassandra_set_cql_version_result &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const Cassandra_set_cql_version_result & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+typedef struct _Cassandra_set_cql_version_presult__isset {
+ _Cassandra_set_cql_version_presult__isset() : ire(false) {}
+ bool ire;
+} _Cassandra_set_cql_version_presult__isset;
+
+class Cassandra_set_cql_version_presult {
+ public:
+
+
+ virtual ~Cassandra_set_cql_version_presult() throw() {}
+
+ InvalidRequestException ire;
+
+ _Cassandra_set_cql_version_presult__isset __isset;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+
+};
+
+class CassandraClient : virtual public CassandraIf {
+ public:
+ CassandraClient(boost::shared_ptr< ::apache::thrift::protocol::TProtocol> prot) :
+ piprot_(prot),
+ poprot_(prot) {
+ iprot_ = prot.get();
+ oprot_ = prot.get();
+ }
+ CassandraClient(boost::shared_ptr< ::apache::thrift::protocol::TProtocol> iprot, boost::shared_ptr< ::apache::thrift::protocol::TProtocol> oprot) :
+ piprot_(iprot),
+ poprot_(oprot) {
+ iprot_ = iprot.get();
+ oprot_ = oprot.get();
+ }
+ boost::shared_ptr< ::apache::thrift::protocol::TProtocol> getInputProtocol() {
+ return piprot_;
+ }
+ boost::shared_ptr< ::apache::thrift::protocol::TProtocol> getOutputProtocol() {
+ return poprot_;
+ }
+ void login(const AuthenticationRequest& auth_request);
+ void send_login(const AuthenticationRequest& auth_request);
+ void recv_login();
+ void set_keyspace(const std::string& keyspace);
+ void send_set_keyspace(const std::string& keyspace);
+ void recv_set_keyspace();
+ void get(ColumnOrSuperColumn& _return, const std::string& key, const ColumnPath& column_path, const ConsistencyLevel::type consistency_level);
+ void send_get(const std::string& key, const ColumnPath& column_path, const ConsistencyLevel::type consistency_level);
+ void recv_get(ColumnOrSuperColumn& _return);
+ void get_slice(std::vector<ColumnOrSuperColumn> & _return, const std::string& key, const ColumnParent& column_parent, const SlicePredicate& predicate, const ConsistencyLevel::type consistency_level);
+ void send_get_slice(const std::string& key, const ColumnParent& column_parent, const SlicePredicate& predicate, const ConsistencyLevel::type consistency_level);
+ void recv_get_slice(std::vector<ColumnOrSuperColumn> & _return);
+ int32_t get_count(const std::string& key, const ColumnParent& column_parent, const SlicePredicate& predicate, const ConsistencyLevel::type consistency_level);
+ void send_get_count(const std::string& key, const ColumnParent& column_parent, const SlicePredicate& predicate, const ConsistencyLevel::type consistency_level);
+ int32_t recv_get_count();
+ void multiget_slice(std::map<std::string, std::vector<ColumnOrSuperColumn> > & _return, const std::vector<std::string> & keys, const ColumnParent& column_parent, const SlicePredicate& predicate, const ConsistencyLevel::type consistency_level);
+ void send_multiget_slice(const std::vector<std::string> & keys, const ColumnParent& column_parent, const SlicePredicate& predicate, const ConsistencyLevel::type consistency_level);
+ void recv_multiget_slice(std::map<std::string, std::vector<ColumnOrSuperColumn> > & _return);
+ void multiget_count(std::map<std::string, int32_t> & _return, const std::vector<std::string> & keys, const ColumnParent& column_parent, const SlicePredicate& predicate, const ConsistencyLevel::type consistency_level);
+ void send_multiget_count(const std::vector<std::string> & keys, const ColumnParent& column_parent, const SlicePredicate& predicate, const ConsistencyLevel::type consistency_level);
+ void recv_multiget_count(std::map<std::string, int32_t> & _return);
+ void get_range_slices(std::vector<KeySlice> & _return, const ColumnParent& column_parent, const SlicePredicate& predicate, const KeyRange& range, const ConsistencyLevel::type consistency_level);
+ void send_get_range_slices(const ColumnParent& column_parent, const SlicePredicate& predicate, const KeyRange& range, const ConsistencyLevel::type consistency_level);
+ void recv_get_range_slices(std::vector<KeySlice> & _return);
+ void get_paged_slice(std::vector<KeySlice> & _return, const std::string& column_family, const KeyRange& range, const std::string& start_column, const ConsistencyLevel::type consistency_level);
+ void send_get_paged_slice(const std::string& column_family, const KeyRange& range, const std::string& start_column, const ConsistencyLevel::type consistency_level);
+ void recv_get_paged_slice(std::vector<KeySlice> & _return);
+ void get_indexed_slices(std::vector<KeySlice> & _return, const ColumnParent& column_parent, const IndexClause& index_clause, const SlicePredicate& column_predicate, const ConsistencyLevel::type consistency_level);
+ void send_get_indexed_slices(const ColumnParent& column_parent, const IndexClause& index_clause, const SlicePredicate& column_predicate, const ConsistencyLevel::type consistency_level);
+ void recv_get_indexed_slices(std::vector<KeySlice> & _return);
+ void insert(const std::string& key, const ColumnParent& column_parent, const Column& column, const ConsistencyLevel::type consistency_level);
+ void send_insert(const std::string& key, const ColumnParent& column_parent, const Column& column, const ConsistencyLevel::type consistency_level);
+ void recv_insert();
+ void add(const std::string& key, const ColumnParent& column_parent, const CounterColumn& column, const ConsistencyLevel::type consistency_level);
+ void send_add(const std::string& key, const ColumnParent& column_parent, const CounterColumn& column, const ConsistencyLevel::type consistency_level);
+ void recv_add();
+ void remove(const std::string& key, const ColumnPath& column_path, const int64_t timestamp, const ConsistencyLevel::type consistency_level);
+ void send_remove(const std::string& key, const ColumnPath& column_path, const int64_t timestamp, const ConsistencyLevel::type consistency_level);
+ void recv_remove();
+ void remove_counter(const std::string& key, const ColumnPath& path, const ConsistencyLevel::type consistency_level);
+ void send_remove_counter(const std::string& key, const ColumnPath& path, const ConsistencyLevel::type consistency_level);
+ void recv_remove_counter();
+ void batch_mutate(const std::map<std::string, std::map<std::string, std::vector<Mutation> > > & mutation_map, const ConsistencyLevel::type consistency_level);
+ void send_batch_mutate(const std::map<std::string, std::map<std::string, std::vector<Mutation> > > & mutation_map, const ConsistencyLevel::type consistency_level);
+ void recv_batch_mutate();
+ void truncate(const std::string& cfname);
+ void send_truncate(const std::string& cfname);
+ void recv_truncate();
+ void describe_schema_versions(std::map<std::string, std::vector<std::string> > & _return);
+ void send_describe_schema_versions();
+ void recv_describe_schema_versions(std::map<std::string, std::vector<std::string> > & _return);
+ void describe_keyspaces(std::vector<KsDef> & _return);
+ void send_describe_keyspaces();
+ void recv_describe_keyspaces(std::vector<KsDef> & _return);
+ void describe_cluster_name(std::string& _return);
+ void send_describe_cluster_name();
+ void recv_describe_cluster_name(std::string& _return);
+ void describe_version(std::string& _return);
+ void send_describe_version();
+ void recv_describe_version(std::string& _return);
+ void describe_ring(std::vector<TokenRange> & _return, const std::string& keyspace);
+ void send_describe_ring(const std::string& keyspace);
+ void recv_describe_ring(std::vector<TokenRange> & _return);
+ void describe_token_map(std::map<std::string, std::string> & _return);
+ void send_describe_token_map();
+ void recv_describe_token_map(std::map<std::string, std::string> & _return);
+ void describe_partitioner(std::string& _return);
+ void send_describe_partitioner();
+ void recv_describe_partitioner(std::string& _return);
+ void describe_snitch(std::string& _return);
+ void send_describe_snitch();
+ void recv_describe_snitch(std::string& _return);
+ void describe_keyspace(KsDef& _return, const std::string& keyspace);
+ void send_describe_keyspace(const std::string& keyspace);
+ void recv_describe_keyspace(KsDef& _return);
+ void describe_splits(std::vector<std::string> & _return, const std::string& cfName, const std::string& start_token, const std::string& end_token, const int32_t keys_per_split);
+ void send_describe_splits(const std::string& cfName, const std::string& start_token, const std::string& end_token, const int32_t keys_per_split);
+ void recv_describe_splits(std::vector<std::string> & _return);
+ void system_add_column_family(std::string& _return, const CfDef& cf_def);
+ void send_system_add_column_family(const CfDef& cf_def);
+ void recv_system_add_column_family(std::string& _return);
+ void system_drop_column_family(std::string& _return, const std::string& column_family);
+ void send_system_drop_column_family(const std::string& column_family);
+ void recv_system_drop_column_family(std::string& _return);
+ void system_add_keyspace(std::string& _return, const KsDef& ks_def);
+ void send_system_add_keyspace(const KsDef& ks_def);
+ void recv_system_add_keyspace(std::string& _return);
+ void system_drop_keyspace(std::string& _return, const std::string& keyspace);
+ void send_system_drop_keyspace(const std::string& keyspace);
+ void recv_system_drop_keyspace(std::string& _return);
+ void system_update_keyspace(std::string& _return, const KsDef& ks_def);
+ void send_system_update_keyspace(const KsDef& ks_def);
+ void recv_system_update_keyspace(std::string& _return);
+ void system_update_column_family(std::string& _return, const CfDef& cf_def);
+ void send_system_update_column_family(const CfDef& cf_def);
+ void recv_system_update_column_family(std::string& _return);
+ void execute_cql_query(CqlResult& _return, const std::string& query, const Compression::type compression);
+ void send_execute_cql_query(const std::string& query, const Compression::type compression);
+ void recv_execute_cql_query(CqlResult& _return);
+ void prepare_cql_query(CqlPreparedResult& _return, const std::string& query, const Compression::type compression);
+ void send_prepare_cql_query(const std::string& query, const Compression::type compression);
+ void recv_prepare_cql_query(CqlPreparedResult& _return);
+ void execute_prepared_cql_query(CqlResult& _return, const int32_t itemId, const std::vector<std::string> & values);
+ void send_execute_prepared_cql_query(const int32_t itemId, const std::vector<std::string> & values);
+ void recv_execute_prepared_cql_query(CqlResult& _return);
+ void set_cql_version(const std::string& version);
+ void send_set_cql_version(const std::string& version);
+ void recv_set_cql_version();
+ protected:
+ boost::shared_ptr< ::apache::thrift::protocol::TProtocol> piprot_;
+ boost::shared_ptr< ::apache::thrift::protocol::TProtocol> poprot_;
+ ::apache::thrift::protocol::TProtocol* iprot_;
+ ::apache::thrift::protocol::TProtocol* oprot_;
+};
+
+class CassandraProcessor : public ::apache::thrift::TProcessor {
+ protected:
+ boost::shared_ptr<CassandraIf> iface_;
+ virtual bool process_fn(::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, std::string& fname, int32_t seqid, void* callContext);
+ private:
+ std::map<std::string, void (CassandraProcessor::*)(int32_t, ::apache::thrift::protocol::TProtocol*, ::apache::thrift::protocol::TProtocol*, void*)> processMap_;
+ void process_login(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext);
+ void process_set_keyspace(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext);
+ void process_get(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext);
+ void process_get_slice(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext);
+ void process_get_count(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext);
+ void process_multiget_slice(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext);
+ void process_multiget_count(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext);
+ void process_get_range_slices(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext);
+ void process_get_paged_slice(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext);
+ void process_get_indexed_slices(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext);
+ void process_insert(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext);
+ void process_add(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext);
+ void process_remove(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext);
+ void process_remove_counter(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext);
+ void process_batch_mutate(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext);
+ void process_truncate(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext);
+ void process_describe_schema_versions(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext);
+ void process_describe_keyspaces(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext);
+ void process_describe_cluster_name(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext);
+ void process_describe_version(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext);
+ void process_describe_ring(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext);
+ void process_describe_token_map(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext);
+ void process_describe_partitioner(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext);
+ void process_describe_snitch(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext);
+ void process_describe_keyspace(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext);
+ void process_describe_splits(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext);
+ void process_system_add_column_family(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext);
+ void process_system_drop_column_family(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext);
+ void process_system_add_keyspace(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext);
+ void process_system_drop_keyspace(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext);
+ void process_system_update_keyspace(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext);
+ void process_system_update_column_family(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext);
+ void process_execute_cql_query(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext);
+ void process_prepare_cql_query(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext);
+ void process_execute_prepared_cql_query(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext);
+ void process_set_cql_version(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext);
+ public:
+ CassandraProcessor(boost::shared_ptr<CassandraIf> iface) :
+ iface_(iface) {
+ processMap_["login"] = &CassandraProcessor::process_login;
+ processMap_["set_keyspace"] = &CassandraProcessor::process_set_keyspace;
+ processMap_["get"] = &CassandraProcessor::process_get;
+ processMap_["get_slice"] = &CassandraProcessor::process_get_slice;
+ processMap_["get_count"] = &CassandraProcessor::process_get_count;
+ processMap_["multiget_slice"] = &CassandraProcessor::process_multiget_slice;
+ processMap_["multiget_count"] = &CassandraProcessor::process_multiget_count;
+ processMap_["get_range_slices"] = &CassandraProcessor::process_get_range_slices;
+ processMap_["get_paged_slice"] = &CassandraProcessor::process_get_paged_slice;
+ processMap_["get_indexed_slices"] = &CassandraProcessor::process_get_indexed_slices;
+ processMap_["insert"] = &CassandraProcessor::process_insert;
+ processMap_["add"] = &CassandraProcessor::process_add;
+ processMap_["remove"] = &CassandraProcessor::process_remove;
+ processMap_["remove_counter"] = &CassandraProcessor::process_remove_counter;
+ processMap_["batch_mutate"] = &CassandraProcessor::process_batch_mutate;
+ processMap_["truncate"] = &CassandraProcessor::process_truncate;
+ processMap_["describe_schema_versions"] = &CassandraProcessor::process_describe_schema_versions;
+ processMap_["describe_keyspaces"] = &CassandraProcessor::process_describe_keyspaces;
+ processMap_["describe_cluster_name"] = &CassandraProcessor::process_describe_cluster_name;
+ processMap_["describe_version"] = &CassandraProcessor::process_describe_version;
+ processMap_["describe_ring"] = &CassandraProcessor::process_describe_ring;
+ processMap_["describe_token_map"] = &CassandraProcessor::process_describe_token_map;
+ processMap_["describe_partitioner"] = &CassandraProcessor::process_describe_partitioner;
+ processMap_["describe_snitch"] = &CassandraProcessor::process_describe_snitch;
+ processMap_["describe_keyspace"] = &CassandraProcessor::process_describe_keyspace;
+ processMap_["describe_splits"] = &CassandraProcessor::process_describe_splits;
+ processMap_["system_add_column_family"] = &CassandraProcessor::process_system_add_column_family;
+ processMap_["system_drop_column_family"] = &CassandraProcessor::process_system_drop_column_family;
+ processMap_["system_add_keyspace"] = &CassandraProcessor::process_system_add_keyspace;
+ processMap_["system_drop_keyspace"] = &CassandraProcessor::process_system_drop_keyspace;
+ processMap_["system_update_keyspace"] = &CassandraProcessor::process_system_update_keyspace;
+ processMap_["system_update_column_family"] = &CassandraProcessor::process_system_update_column_family;
+ processMap_["execute_cql_query"] = &CassandraProcessor::process_execute_cql_query;
+ processMap_["prepare_cql_query"] = &CassandraProcessor::process_prepare_cql_query;
+ processMap_["execute_prepared_cql_query"] = &CassandraProcessor::process_execute_prepared_cql_query;
+ processMap_["set_cql_version"] = &CassandraProcessor::process_set_cql_version;
+ }
+
+ virtual bool process(boost::shared_ptr< ::apache::thrift::protocol::TProtocol> piprot, boost::shared_ptr< ::apache::thrift::protocol::TProtocol> poprot, void* callContext);
+ virtual ~CassandraProcessor() {}
+};
+
+class CassandraProcessorFactory : public ::apache::thrift::TProcessorFactory {
+ public:
+ CassandraProcessorFactory(const ::boost::shared_ptr< CassandraIfFactory >& handlerFactory) :
+ handlerFactory_(handlerFactory) {}
+
+ ::boost::shared_ptr< ::apache::thrift::TProcessor > getProcessor(const ::apache::thrift::TConnectionInfo& connInfo);
+
+ protected:
+ ::boost::shared_ptr< CassandraIfFactory > handlerFactory_;
+};
+
+class CassandraMultiface : virtual public CassandraIf {
+ public:
+ CassandraMultiface(std::vector<boost::shared_ptr<CassandraIf> >& ifaces) : ifaces_(ifaces) {
+ }
+ virtual ~CassandraMultiface() {}
+ protected:
+ std::vector<boost::shared_ptr<CassandraIf> > ifaces_;
+ CassandraMultiface() {}
+ void add(boost::shared_ptr<CassandraIf> iface) {
+ ifaces_.push_back(iface);
+ }
+ public:
+ void login(const AuthenticationRequest& auth_request) {
+ size_t sz = ifaces_.size();
+ for (size_t i = 0; i < sz; ++i) {
+ ifaces_[i]->login(auth_request);
+ }
+ }
+
+ void set_keyspace(const std::string& keyspace) {
+ size_t sz = ifaces_.size();
+ for (size_t i = 0; i < sz; ++i) {
+ ifaces_[i]->set_keyspace(keyspace);
+ }
+ }
+
+ void get(ColumnOrSuperColumn& _return, const std::string& key, const ColumnPath& column_path, const ConsistencyLevel::type consistency_level) {
+ size_t sz = ifaces_.size();
+ for (size_t i = 0; i < sz; ++i) {
+ if (i == sz - 1) {
+ ifaces_[i]->get(_return, key, column_path, consistency_level);
+ return;
+ } else {
+ ifaces_[i]->get(_return, key, column_path, consistency_level);
+ }
+ }
+ }
+
+ void get_slice(std::vector<ColumnOrSuperColumn> & _return, const std::string& key, const ColumnParent& column_parent, const SlicePredicate& predicate, const ConsistencyLevel::type consistency_level) {
+ size_t sz = ifaces_.size();
+ for (size_t i = 0; i < sz; ++i) {
+ if (i == sz - 1) {
+ ifaces_[i]->get_slice(_return, key, column_parent, predicate, consistency_level);
+ return;
+ } else {
+ ifaces_[i]->get_slice(_return, key, column_parent, predicate, consistency_level);
+ }
+ }
+ }
+
+ int32_t get_count(const std::string& key, const ColumnParent& column_parent, const SlicePredicate& predicate, const ConsistencyLevel::type consistency_level) {
+ size_t sz = ifaces_.size();
+ for (size_t i = 0; i < sz; ++i) {
+ if (i == sz - 1) {
+ return ifaces_[i]->get_count(key, column_parent, predicate, consistency_level);
+ } else {
+ ifaces_[i]->get_count(key, column_parent, predicate, consistency_level);
+ }
+ }
+ return 0xDEADBEEF; //psergey: shut up the compiler
+ }
+
+ void multiget_slice(std::map<std::string, std::vector<ColumnOrSuperColumn> > & _return, const std::vector<std::string> & keys, const ColumnParent& column_parent, const SlicePredicate& predicate, const ConsistencyLevel::type consistency_level) {
+ size_t sz = ifaces_.size();
+ for (size_t i = 0; i < sz; ++i) {
+ if (i == sz - 1) {
+ ifaces_[i]->multiget_slice(_return, keys, column_parent, predicate, consistency_level);
+ return;
+ } else {
+ ifaces_[i]->multiget_slice(_return, keys, column_parent, predicate, consistency_level);
+ }
+ }
+ }
+
+ void multiget_count(std::map<std::string, int32_t> & _return, const std::vector<std::string> & keys, const ColumnParent& column_parent, const SlicePredicate& predicate, const ConsistencyLevel::type consistency_level) {
+ size_t sz = ifaces_.size();
+ for (size_t i = 0; i < sz; ++i) {
+ if (i == sz - 1) {
+ ifaces_[i]->multiget_count(_return, keys, column_parent, predicate, consistency_level);
+ return;
+ } else {
+ ifaces_[i]->multiget_count(_return, keys, column_parent, predicate, consistency_level);
+ }
+ }
+ }
+
+ void get_range_slices(std::vector<KeySlice> & _return, const ColumnParent& column_parent, const SlicePredicate& predicate, const KeyRange& range, const ConsistencyLevel::type consistency_level) {
+ size_t sz = ifaces_.size();
+ for (size_t i = 0; i < sz; ++i) {
+ if (i == sz - 1) {
+ ifaces_[i]->get_range_slices(_return, column_parent, predicate, range, consistency_level);
+ return;
+ } else {
+ ifaces_[i]->get_range_slices(_return, column_parent, predicate, range, consistency_level);
+ }
+ }
+ }
+
+ void get_paged_slice(std::vector<KeySlice> & _return, const std::string& column_family, const KeyRange& range, const std::string& start_column, const ConsistencyLevel::type consistency_level) {
+ size_t sz = ifaces_.size();
+ for (size_t i = 0; i < sz; ++i) {
+ if (i == sz - 1) {
+ ifaces_[i]->get_paged_slice(_return, column_family, range, start_column, consistency_level);
+ return;
+ } else {
+ ifaces_[i]->get_paged_slice(_return, column_family, range, start_column, consistency_level);
+ }
+ }
+ }
+
+ void get_indexed_slices(std::vector<KeySlice> & _return, const ColumnParent& column_parent, const IndexClause& index_clause, const SlicePredicate& column_predicate, const ConsistencyLevel::type consistency_level) {
+ size_t sz = ifaces_.size();
+ for (size_t i = 0; i < sz; ++i) {
+ if (i == sz - 1) {
+ ifaces_[i]->get_indexed_slices(_return, column_parent, index_clause, column_predicate, consistency_level);
+ return;
+ } else {
+ ifaces_[i]->get_indexed_slices(_return, column_parent, index_clause, column_predicate, consistency_level);
+ }
+ }
+ }
+
+ void insert(const std::string& key, const ColumnParent& column_parent, const Column& column, const ConsistencyLevel::type consistency_level) {
+ size_t sz = ifaces_.size();
+ for (size_t i = 0; i < sz; ++i) {
+ ifaces_[i]->insert(key, column_parent, column, consistency_level);
+ }
+ }
+
+ void add(const std::string& key, const ColumnParent& column_parent, const CounterColumn& column, const ConsistencyLevel::type consistency_level) {
+ size_t sz = ifaces_.size();
+ for (size_t i = 0; i < sz; ++i) {
+ ifaces_[i]->add(key, column_parent, column, consistency_level);
+ }
+ }
+
+ void remove(const std::string& key, const ColumnPath& column_path, const int64_t timestamp, const ConsistencyLevel::type consistency_level) {
+ size_t sz = ifaces_.size();
+ for (size_t i = 0; i < sz; ++i) {
+ ifaces_[i]->remove(key, column_path, timestamp, consistency_level);
+ }
+ }
+
+ void remove_counter(const std::string& key, const ColumnPath& path, const ConsistencyLevel::type consistency_level) {
+ size_t sz = ifaces_.size();
+ for (size_t i = 0; i < sz; ++i) {
+ ifaces_[i]->remove_counter(key, path, consistency_level);
+ }
+ }
+
+ void batch_mutate(const std::map<std::string, std::map<std::string, std::vector<Mutation> > > & mutation_map, const ConsistencyLevel::type consistency_level) {
+ size_t sz = ifaces_.size();
+ for (size_t i = 0; i < sz; ++i) {
+ ifaces_[i]->batch_mutate(mutation_map, consistency_level);
+ }
+ }
+
+ void truncate(const std::string& cfname) {
+ size_t sz = ifaces_.size();
+ for (size_t i = 0; i < sz; ++i) {
+ ifaces_[i]->truncate(cfname);
+ }
+ }
+
+ void describe_schema_versions(std::map<std::string, std::vector<std::string> > & _return) {
+ size_t sz = ifaces_.size();
+ for (size_t i = 0; i < sz; ++i) {
+ if (i == sz - 1) {
+ ifaces_[i]->describe_schema_versions(_return);
+ return;
+ } else {
+ ifaces_[i]->describe_schema_versions(_return);
+ }
+ }
+ }
+
+ void describe_keyspaces(std::vector<KsDef> & _return) {
+ size_t sz = ifaces_.size();
+ for (size_t i = 0; i < sz; ++i) {
+ if (i == sz - 1) {
+ ifaces_[i]->describe_keyspaces(_return);
+ return;
+ } else {
+ ifaces_[i]->describe_keyspaces(_return);
+ }
+ }
+ }
+
+ void describe_cluster_name(std::string& _return) {
+ size_t sz = ifaces_.size();
+ for (size_t i = 0; i < sz; ++i) {
+ if (i == sz - 1) {
+ ifaces_[i]->describe_cluster_name(_return);
+ return;
+ } else {
+ ifaces_[i]->describe_cluster_name(_return);
+ }
+ }
+ }
+
+ void describe_version(std::string& _return) {
+ size_t sz = ifaces_.size();
+ for (size_t i = 0; i < sz; ++i) {
+ if (i == sz - 1) {
+ ifaces_[i]->describe_version(_return);
+ return;
+ } else {
+ ifaces_[i]->describe_version(_return);
+ }
+ }
+ }
+
+ void describe_ring(std::vector<TokenRange> & _return, const std::string& keyspace) {
+ size_t sz = ifaces_.size();
+ for (size_t i = 0; i < sz; ++i) {
+ if (i == sz - 1) {
+ ifaces_[i]->describe_ring(_return, keyspace);
+ return;
+ } else {
+ ifaces_[i]->describe_ring(_return, keyspace);
+ }
+ }
+ }
+
+ void describe_token_map(std::map<std::string, std::string> & _return) {
+ size_t sz = ifaces_.size();
+ for (size_t i = 0; i < sz; ++i) {
+ if (i == sz - 1) {
+ ifaces_[i]->describe_token_map(_return);
+ return;
+ } else {
+ ifaces_[i]->describe_token_map(_return);
+ }
+ }
+ }
+
+ void describe_partitioner(std::string& _return) {
+ size_t sz = ifaces_.size();
+ for (size_t i = 0; i < sz; ++i) {
+ if (i == sz - 1) {
+ ifaces_[i]->describe_partitioner(_return);
+ return;
+ } else {
+ ifaces_[i]->describe_partitioner(_return);
+ }
+ }
+ }
+
+ void describe_snitch(std::string& _return) {
+ size_t sz = ifaces_.size();
+ for (size_t i = 0; i < sz; ++i) {
+ if (i == sz - 1) {
+ ifaces_[i]->describe_snitch(_return);
+ return;
+ } else {
+ ifaces_[i]->describe_snitch(_return);
+ }
+ }
+ }
+
+ void describe_keyspace(KsDef& _return, const std::string& keyspace) {
+ size_t sz = ifaces_.size();
+ for (size_t i = 0; i < sz; ++i) {
+ if (i == sz - 1) {
+ ifaces_[i]->describe_keyspace(_return, keyspace);
+ return;
+ } else {
+ ifaces_[i]->describe_keyspace(_return, keyspace);
+ }
+ }
+ }
+
+ void describe_splits(std::vector<std::string> & _return, const std::string& cfName, const std::string& start_token, const std::string& end_token, const int32_t keys_per_split) {
+ size_t sz = ifaces_.size();
+ for (size_t i = 0; i < sz; ++i) {
+ if (i == sz - 1) {
+ ifaces_[i]->describe_splits(_return, cfName, start_token, end_token, keys_per_split);
+ return;
+ } else {
+ ifaces_[i]->describe_splits(_return, cfName, start_token, end_token, keys_per_split);
+ }
+ }
+ }
+
+ void system_add_column_family(std::string& _return, const CfDef& cf_def) {
+ size_t sz = ifaces_.size();
+ for (size_t i = 0; i < sz; ++i) {
+ if (i == sz - 1) {
+ ifaces_[i]->system_add_column_family(_return, cf_def);
+ return;
+ } else {
+ ifaces_[i]->system_add_column_family(_return, cf_def);
+ }
+ }
+ }
+
+ void system_drop_column_family(std::string& _return, const std::string& column_family) {
+ size_t sz = ifaces_.size();
+ for (size_t i = 0; i < sz; ++i) {
+ if (i == sz - 1) {
+ ifaces_[i]->system_drop_column_family(_return, column_family);
+ return;
+ } else {
+ ifaces_[i]->system_drop_column_family(_return, column_family);
+ }
+ }
+ }
+
+ void system_add_keyspace(std::string& _return, const KsDef& ks_def) {
+ size_t sz = ifaces_.size();
+ for (size_t i = 0; i < sz; ++i) {
+ if (i == sz - 1) {
+ ifaces_[i]->system_add_keyspace(_return, ks_def);
+ return;
+ } else {
+ ifaces_[i]->system_add_keyspace(_return, ks_def);
+ }
+ }
+ }
+
+ void system_drop_keyspace(std::string& _return, const std::string& keyspace) {
+ size_t sz = ifaces_.size();
+ for (size_t i = 0; i < sz; ++i) {
+ if (i == sz - 1) {
+ ifaces_[i]->system_drop_keyspace(_return, keyspace);
+ return;
+ } else {
+ ifaces_[i]->system_drop_keyspace(_return, keyspace);
+ }
+ }
+ }
+
+ void system_update_keyspace(std::string& _return, const KsDef& ks_def) {
+ size_t sz = ifaces_.size();
+ for (size_t i = 0; i < sz; ++i) {
+ if (i == sz - 1) {
+ ifaces_[i]->system_update_keyspace(_return, ks_def);
+ return;
+ } else {
+ ifaces_[i]->system_update_keyspace(_return, ks_def);
+ }
+ }
+ }
+
+ void system_update_column_family(std::string& _return, const CfDef& cf_def) {
+ size_t sz = ifaces_.size();
+ for (size_t i = 0; i < sz; ++i) {
+ if (i == sz - 1) {
+ ifaces_[i]->system_update_column_family(_return, cf_def);
+ return;
+ } else {
+ ifaces_[i]->system_update_column_family(_return, cf_def);
+ }
+ }
+ }
+
+ void execute_cql_query(CqlResult& _return, const std::string& query, const Compression::type compression) {
+ size_t sz = ifaces_.size();
+ for (size_t i = 0; i < sz; ++i) {
+ if (i == sz - 1) {
+ ifaces_[i]->execute_cql_query(_return, query, compression);
+ return;
+ } else {
+ ifaces_[i]->execute_cql_query(_return, query, compression);
+ }
+ }
+ }
+
+ void prepare_cql_query(CqlPreparedResult& _return, const std::string& query, const Compression::type compression) {
+ size_t sz = ifaces_.size();
+ for (size_t i = 0; i < sz; ++i) {
+ if (i == sz - 1) {
+ ifaces_[i]->prepare_cql_query(_return, query, compression);
+ return;
+ } else {
+ ifaces_[i]->prepare_cql_query(_return, query, compression);
+ }
+ }
+ }
+
+ void execute_prepared_cql_query(CqlResult& _return, const int32_t itemId, const std::vector<std::string> & values) {
+ size_t sz = ifaces_.size();
+ for (size_t i = 0; i < sz; ++i) {
+ if (i == sz - 1) {
+ ifaces_[i]->execute_prepared_cql_query(_return, itemId, values);
+ return;
+ } else {
+ ifaces_[i]->execute_prepared_cql_query(_return, itemId, values);
+ }
+ }
+ }
+
+ void set_cql_version(const std::string& version) {
+ size_t sz = ifaces_.size();
+ for (size_t i = 0; i < sz; ++i) {
+ ifaces_[i]->set_cql_version(version);
+ }
+ }
+
+};
+
+}}} // namespace
+
+#endif
diff --git a/storage/cassandra/gen-cpp/Cassandra_server.skeleton.cpp b/storage/cassandra/gen-cpp/Cassandra_server.skeleton.cpp
new file mode 100644
index 00000000000..4d4e489ef4d
--- /dev/null
+++ b/storage/cassandra/gen-cpp/Cassandra_server.skeleton.cpp
@@ -0,0 +1,219 @@
+// This autogenerated skeleton file illustrates how to build a server.
+// You should copy it to another filename to avoid overwriting it.
+
+#include "Cassandra.h"
+#include <protocol/TBinaryProtocol.h>
+#include <server/TSimpleServer.h>
+#include <transport/TServerSocket.h>
+#include <transport/TBufferTransports.h>
+
+using namespace ::apache::thrift;
+using namespace ::apache::thrift::protocol;
+using namespace ::apache::thrift::transport;
+using namespace ::apache::thrift::server;
+
+using boost::shared_ptr;
+
+using namespace ::org::apache::cassandra;
+
+class CassandraHandler : virtual public CassandraIf {
+ public:
+ CassandraHandler() {
+ // Your initialization goes here
+ }
+
+ void login(const AuthenticationRequest& auth_request) {
+ // Your implementation goes here
+ printf("login\n");
+ }
+
+ void set_keyspace(const std::string& keyspace) {
+ // Your implementation goes here
+ printf("set_keyspace\n");
+ }
+
+ void get(ColumnOrSuperColumn& _return, const std::string& key, const ColumnPath& column_path, const ConsistencyLevel::type consistency_level) {
+ // Your implementation goes here
+ printf("get\n");
+ }
+
+ void get_slice(std::vector<ColumnOrSuperColumn> & _return, const std::string& key, const ColumnParent& column_parent, const SlicePredicate& predicate, const ConsistencyLevel::type consistency_level) {
+ // Your implementation goes here
+ printf("get_slice\n");
+ }
+
+ int32_t get_count(const std::string& key, const ColumnParent& column_parent, const SlicePredicate& predicate, const ConsistencyLevel::type consistency_level) {
+ // Your implementation goes here
+ printf("get_count\n");
+ }
+
+ void multiget_slice(std::map<std::string, std::vector<ColumnOrSuperColumn> > & _return, const std::vector<std::string> & keys, const ColumnParent& column_parent, const SlicePredicate& predicate, const ConsistencyLevel::type consistency_level) {
+ // Your implementation goes here
+ printf("multiget_slice\n");
+ }
+
+ void multiget_count(std::map<std::string, int32_t> & _return, const std::vector<std::string> & keys, const ColumnParent& column_parent, const SlicePredicate& predicate, const ConsistencyLevel::type consistency_level) {
+ // Your implementation goes here
+ printf("multiget_count\n");
+ }
+
+ void get_range_slices(std::vector<KeySlice> & _return, const ColumnParent& column_parent, const SlicePredicate& predicate, const KeyRange& range, const ConsistencyLevel::type consistency_level) {
+ // Your implementation goes here
+ printf("get_range_slices\n");
+ }
+
+ void get_paged_slice(std::vector<KeySlice> & _return, const std::string& column_family, const KeyRange& range, const std::string& start_column, const ConsistencyLevel::type consistency_level) {
+ // Your implementation goes here
+ printf("get_paged_slice\n");
+ }
+
+ void get_indexed_slices(std::vector<KeySlice> & _return, const ColumnParent& column_parent, const IndexClause& index_clause, const SlicePredicate& column_predicate, const ConsistencyLevel::type consistency_level) {
+ // Your implementation goes here
+ printf("get_indexed_slices\n");
+ }
+
+ void insert(const std::string& key, const ColumnParent& column_parent, const Column& column, const ConsistencyLevel::type consistency_level) {
+ // Your implementation goes here
+ printf("insert\n");
+ }
+
+ void add(const std::string& key, const ColumnParent& column_parent, const CounterColumn& column, const ConsistencyLevel::type consistency_level) {
+ // Your implementation goes here
+ printf("add\n");
+ }
+
+ void remove(const std::string& key, const ColumnPath& column_path, const int64_t timestamp, const ConsistencyLevel::type consistency_level) {
+ // Your implementation goes here
+ printf("remove\n");
+ }
+
+ void remove_counter(const std::string& key, const ColumnPath& path, const ConsistencyLevel::type consistency_level) {
+ // Your implementation goes here
+ printf("remove_counter\n");
+ }
+
+ void batch_mutate(const std::map<std::string, std::map<std::string, std::vector<Mutation> > > & mutation_map, const ConsistencyLevel::type consistency_level) {
+ // Your implementation goes here
+ printf("batch_mutate\n");
+ }
+
+ void truncate(const std::string& cfname) {
+ // Your implementation goes here
+ printf("truncate\n");
+ }
+
+ void describe_schema_versions(std::map<std::string, std::vector<std::string> > & _return) {
+ // Your implementation goes here
+ printf("describe_schema_versions\n");
+ }
+
+ void describe_keyspaces(std::vector<KsDef> & _return) {
+ // Your implementation goes here
+ printf("describe_keyspaces\n");
+ }
+
+ void describe_cluster_name(std::string& _return) {
+ // Your implementation goes here
+ printf("describe_cluster_name\n");
+ }
+
+ void describe_version(std::string& _return) {
+ // Your implementation goes here
+ printf("describe_version\n");
+ }
+
+ void describe_ring(std::vector<TokenRange> & _return, const std::string& keyspace) {
+ // Your implementation goes here
+ printf("describe_ring\n");
+ }
+
+ void describe_token_map(std::map<std::string, std::string> & _return) {
+ // Your implementation goes here
+ printf("describe_token_map\n");
+ }
+
+ void describe_partitioner(std::string& _return) {
+ // Your implementation goes here
+ printf("describe_partitioner\n");
+ }
+
+ void describe_snitch(std::string& _return) {
+ // Your implementation goes here
+ printf("describe_snitch\n");
+ }
+
+ void describe_keyspace(KsDef& _return, const std::string& keyspace) {
+ // Your implementation goes here
+ printf("describe_keyspace\n");
+ }
+
+ void describe_splits(std::vector<std::string> & _return, const std::string& cfName, const std::string& start_token, const std::string& end_token, const int32_t keys_per_split) {
+ // Your implementation goes here
+ printf("describe_splits\n");
+ }
+
+ void system_add_column_family(std::string& _return, const CfDef& cf_def) {
+ // Your implementation goes here
+ printf("system_add_column_family\n");
+ }
+
+ void system_drop_column_family(std::string& _return, const std::string& column_family) {
+ // Your implementation goes here
+ printf("system_drop_column_family\n");
+ }
+
+ void system_add_keyspace(std::string& _return, const KsDef& ks_def) {
+ // Your implementation goes here
+ printf("system_add_keyspace\n");
+ }
+
+ void system_drop_keyspace(std::string& _return, const std::string& keyspace) {
+ // Your implementation goes here
+ printf("system_drop_keyspace\n");
+ }
+
+ void system_update_keyspace(std::string& _return, const KsDef& ks_def) {
+ // Your implementation goes here
+ printf("system_update_keyspace\n");
+ }
+
+ void system_update_column_family(std::string& _return, const CfDef& cf_def) {
+ // Your implementation goes here
+ printf("system_update_column_family\n");
+ }
+
+ void execute_cql_query(CqlResult& _return, const std::string& query, const Compression::type compression) {
+ // Your implementation goes here
+ printf("execute_cql_query\n");
+ }
+
+ void prepare_cql_query(CqlPreparedResult& _return, const std::string& query, const Compression::type compression) {
+ // Your implementation goes here
+ printf("prepare_cql_query\n");
+ }
+
+ void execute_prepared_cql_query(CqlResult& _return, const int32_t itemId, const std::vector<std::string> & values) {
+ // Your implementation goes here
+ printf("execute_prepared_cql_query\n");
+ }
+
+ void set_cql_version(const std::string& version) {
+ // Your implementation goes here
+ printf("set_cql_version\n");
+ }
+
+};
+
+int main(int argc, char **argv) {
+ int port = 9090;
+ shared_ptr<CassandraHandler> handler(new CassandraHandler());
+ shared_ptr<TProcessor> processor(new CassandraProcessor(handler));
+ shared_ptr<TServerTransport> serverTransport(new TServerSocket(port));
+ shared_ptr<TTransportFactory> transportFactory(new TBufferedTransportFactory());
+ shared_ptr<TProtocolFactory> protocolFactory(new TBinaryProtocolFactory());
+
+ TSimpleServer server(processor, serverTransport, transportFactory, protocolFactory);
+ server.serve();
+ return 0;
+}
+
diff --git a/storage/cassandra/gen-cpp/cassandra_constants.cpp b/storage/cassandra/gen-cpp/cassandra_constants.cpp
new file mode 100644
index 00000000000..49a01d2773e
--- /dev/null
+++ b/storage/cassandra/gen-cpp/cassandra_constants.cpp
@@ -0,0 +1,18 @@
+/**
+ * Autogenerated by Thrift Compiler (0.8.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+#include "cassandra_constants.h"
+
+namespace org { namespace apache { namespace cassandra {
+
+const cassandraConstants g_cassandra_constants;
+
+cassandraConstants::cassandraConstants() {
+ cassandra_const_VERSION = (char *)"19.32.0";
+}
+
+}}} // namespace
+
diff --git a/storage/cassandra/gen-cpp/cassandra_constants.h b/storage/cassandra/gen-cpp/cassandra_constants.h
new file mode 100644
index 00000000000..fa12a1676ae
--- /dev/null
+++ b/storage/cassandra/gen-cpp/cassandra_constants.h
@@ -0,0 +1,26 @@
+/**
+ * Autogenerated by Thrift Compiler (0.8.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+#ifndef cassandra_CONSTANTS_H
+#define cassandra_CONSTANTS_H
+
+#include "cassandra_types.h"
+
+namespace org { namespace apache { namespace cassandra {
+
+class cassandraConstants {
+ public:
+ cassandraConstants();
+
+// std::string VERSION;
+ char* cassandra_const_VERSION;
+};
+
+extern const cassandraConstants g_cassandra_constants;
+
+}}} // namespace
+
+#endif
diff --git a/storage/cassandra/gen-cpp/cassandra_types.cpp b/storage/cassandra/gen-cpp/cassandra_types.cpp
new file mode 100644
index 00000000000..4b51c21a320
--- /dev/null
+++ b/storage/cassandra/gen-cpp/cassandra_types.cpp
@@ -0,0 +1,3512 @@
+/**
+ * Autogenerated by Thrift Compiler (0.8.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+#include "cassandra_types.h"
+
+namespace org { namespace apache { namespace cassandra {
+
+int _kConsistencyLevelValues[] = {
+ ConsistencyLevel::ONE,
+ ConsistencyLevel::QUORUM,
+ ConsistencyLevel::LOCAL_QUORUM,
+ ConsistencyLevel::EACH_QUORUM,
+ ConsistencyLevel::ALL,
+ ConsistencyLevel::ANY,
+ ConsistencyLevel::TWO,
+ ConsistencyLevel::THREE
+};
+const char* _kConsistencyLevelNames[] = {
+ "ONE",
+ "QUORUM",
+ "LOCAL_QUORUM",
+ "EACH_QUORUM",
+ "ALL",
+ "ANY",
+ "TWO",
+ "THREE"
+};
+const std::map<int, const char*> _ConsistencyLevel_VALUES_TO_NAMES(::apache::thrift::TEnumIterator(8, _kConsistencyLevelValues, _kConsistencyLevelNames), ::apache::thrift::TEnumIterator(-1, NULL, NULL));
+
+int _kIndexOperatorValues[] = {
+ IndexOperator::EQ,
+ IndexOperator::GTE,
+ IndexOperator::GT,
+ IndexOperator::LTE,
+ IndexOperator::LT
+};
+const char* _kIndexOperatorNames[] = {
+ "EQ",
+ "GTE",
+ "GT",
+ "LTE",
+ "LT"
+};
+const std::map<int, const char*> _IndexOperator_VALUES_TO_NAMES(::apache::thrift::TEnumIterator(5, _kIndexOperatorValues, _kIndexOperatorNames), ::apache::thrift::TEnumIterator(-1, NULL, NULL));
+
+int _kIndexTypeValues[] = {
+ IndexType::KEYS,
+ IndexType::CUSTOM
+};
+const char* _kIndexTypeNames[] = {
+ "KEYS",
+ "CUSTOM"
+};
+const std::map<int, const char*> _IndexType_VALUES_TO_NAMES(::apache::thrift::TEnumIterator(2, _kIndexTypeValues, _kIndexTypeNames), ::apache::thrift::TEnumIterator(-1, NULL, NULL));
+
+int _kCompressionValues[] = {
+ Compression::GZIP,
+ Compression::NONE
+};
+const char* _kCompressionNames[] = {
+ "GZIP",
+ "NONE"
+};
+const std::map<int, const char*> _Compression_VALUES_TO_NAMES(::apache::thrift::TEnumIterator(2, _kCompressionValues, _kCompressionNames), ::apache::thrift::TEnumIterator(-1, NULL, NULL));
+
+int _kCqlResultTypeValues[] = {
+ CqlResultType::ROWS,
+ CqlResultType::VOID,
+ CqlResultType::INT
+};
+const char* _kCqlResultTypeNames[] = {
+ "ROWS",
+ "VOID",
+ "INT"
+};
+const std::map<int, const char*> _CqlResultType_VALUES_TO_NAMES(::apache::thrift::TEnumIterator(3, _kCqlResultTypeValues, _kCqlResultTypeNames), ::apache::thrift::TEnumIterator(-1, NULL, NULL));
+
+const char* Column::ascii_fingerprint = "3EE0E1C5C844001B62F08125068292CC";
+const uint8_t Column::binary_fingerprint[16] = {0x3E,0xE0,0xE1,0xC5,0xC8,0x44,0x00,0x1B,0x62,0xF0,0x81,0x25,0x06,0x82,0x92,0xCC};
+
+uint32_t Column::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+ bool isset_name = false;
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readBinary(this->name);
+ isset_name = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 2:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readBinary(this->value);
+ this->__isset.value = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 3:
+ if (ftype == ::apache::thrift::protocol::T_I64) {
+ xfer += iprot->readI64(this->timestamp);
+ this->__isset.timestamp = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 4:
+ if (ftype == ::apache::thrift::protocol::T_I32) {
+ xfer += iprot->readI32(this->ttl);
+ this->__isset.ttl = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ if (!isset_name)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ return xfer;
+}
+
+uint32_t Column::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("Column");
+ xfer += oprot->writeFieldBegin("name", ::apache::thrift::protocol::T_STRING, 1);
+ xfer += oprot->writeBinary(this->name);
+ xfer += oprot->writeFieldEnd();
+ if (this->__isset.value) {
+ xfer += oprot->writeFieldBegin("value", ::apache::thrift::protocol::T_STRING, 2);
+ xfer += oprot->writeBinary(this->value);
+ xfer += oprot->writeFieldEnd();
+ }
+ if (this->__isset.timestamp) {
+ xfer += oprot->writeFieldBegin("timestamp", ::apache::thrift::protocol::T_I64, 3);
+ xfer += oprot->writeI64(this->timestamp);
+ xfer += oprot->writeFieldEnd();
+ }
+ if (this->__isset.ttl) {
+ xfer += oprot->writeFieldBegin("ttl", ::apache::thrift::protocol::T_I32, 4);
+ xfer += oprot->writeI32(this->ttl);
+ xfer += oprot->writeFieldEnd();
+ }
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+const char* SuperColumn::ascii_fingerprint = "470EFC558004E98D92D604898305C04E";
+const uint8_t SuperColumn::binary_fingerprint[16] = {0x47,0x0E,0xFC,0x55,0x80,0x04,0xE9,0x8D,0x92,0xD6,0x04,0x89,0x83,0x05,0xC0,0x4E};
+
+uint32_t SuperColumn::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+ bool isset_name = false;
+ bool isset_columns = false;
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readBinary(this->name);
+ isset_name = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 2:
+ if (ftype == ::apache::thrift::protocol::T_LIST) {
+ {
+ this->columns.clear();
+ uint32_t _size0;
+ ::apache::thrift::protocol::TType _etype3;
+ iprot->readListBegin(_etype3, _size0);
+ this->columns.resize(_size0);
+ uint32_t _i4;
+ for (_i4 = 0; _i4 < _size0; ++_i4)
+ {
+ xfer += this->columns[_i4].read(iprot);
+ }
+ iprot->readListEnd();
+ }
+ isset_columns = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ if (!isset_name)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ if (!isset_columns)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ return xfer;
+}
+
+uint32_t SuperColumn::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("SuperColumn");
+ xfer += oprot->writeFieldBegin("name", ::apache::thrift::protocol::T_STRING, 1);
+ xfer += oprot->writeBinary(this->name);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldBegin("columns", ::apache::thrift::protocol::T_LIST, 2);
+ {
+ xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast<uint32_t>(this->columns.size()));
+ std::vector<Column> ::const_iterator _iter5;
+ for (_iter5 = this->columns.begin(); _iter5 != this->columns.end(); ++_iter5)
+ {
+ xfer += (*_iter5).write(oprot);
+ }
+ xfer += oprot->writeListEnd();
+ }
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+const char* CounterColumn::ascii_fingerprint = "1CCCF6FC31CFD1D61BBBB1BAF3590620";
+const uint8_t CounterColumn::binary_fingerprint[16] = {0x1C,0xCC,0xF6,0xFC,0x31,0xCF,0xD1,0xD6,0x1B,0xBB,0xB1,0xBA,0xF3,0x59,0x06,0x20};
+
+uint32_t CounterColumn::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+ bool isset_name = false;
+ bool isset_value = false;
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readBinary(this->name);
+ isset_name = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 2:
+ if (ftype == ::apache::thrift::protocol::T_I64) {
+ xfer += iprot->readI64(this->value);
+ isset_value = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ if (!isset_name)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ if (!isset_value)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ return xfer;
+}
+
+uint32_t CounterColumn::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("CounterColumn");
+ xfer += oprot->writeFieldBegin("name", ::apache::thrift::protocol::T_STRING, 1);
+ xfer += oprot->writeBinary(this->name);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldBegin("value", ::apache::thrift::protocol::T_I64, 2);
+ xfer += oprot->writeI64(this->value);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+const char* CounterSuperColumn::ascii_fingerprint = "CD4C8C4BF7753E46DE417CDE369343A4";
+const uint8_t CounterSuperColumn::binary_fingerprint[16] = {0xCD,0x4C,0x8C,0x4B,0xF7,0x75,0x3E,0x46,0xDE,0x41,0x7C,0xDE,0x36,0x93,0x43,0xA4};
+
+uint32_t CounterSuperColumn::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+ bool isset_name = false;
+ bool isset_columns = false;
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readBinary(this->name);
+ isset_name = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 2:
+ if (ftype == ::apache::thrift::protocol::T_LIST) {
+ {
+ this->columns.clear();
+ uint32_t _size6;
+ ::apache::thrift::protocol::TType _etype9;
+ iprot->readListBegin(_etype9, _size6);
+ this->columns.resize(_size6);
+ uint32_t _i10;
+ for (_i10 = 0; _i10 < _size6; ++_i10)
+ {
+ xfer += this->columns[_i10].read(iprot);
+ }
+ iprot->readListEnd();
+ }
+ isset_columns = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ if (!isset_name)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ if (!isset_columns)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ return xfer;
+}
+
+uint32_t CounterSuperColumn::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("CounterSuperColumn");
+ xfer += oprot->writeFieldBegin("name", ::apache::thrift::protocol::T_STRING, 1);
+ xfer += oprot->writeBinary(this->name);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldBegin("columns", ::apache::thrift::protocol::T_LIST, 2);
+ {
+ xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast<uint32_t>(this->columns.size()));
+ std::vector<CounterColumn> ::const_iterator _iter11;
+ for (_iter11 = this->columns.begin(); _iter11 != this->columns.end(); ++_iter11)
+ {
+ xfer += (*_iter11).write(oprot);
+ }
+ xfer += oprot->writeListEnd();
+ }
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+const char* ColumnOrSuperColumn::ascii_fingerprint = "2B34AC9E80F1DAA3A2A63B1AB1841E61";
+const uint8_t ColumnOrSuperColumn::binary_fingerprint[16] = {0x2B,0x34,0xAC,0x9E,0x80,0xF1,0xDA,0xA3,0xA2,0xA6,0x3B,0x1A,0xB1,0x84,0x1E,0x61};
+
+uint32_t ColumnOrSuperColumn::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->column.read(iprot);
+ this->__isset.column = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 2:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->super_column.read(iprot);
+ this->__isset.super_column = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 3:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->counter_column.read(iprot);
+ this->__isset.counter_column = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 4:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->counter_super_column.read(iprot);
+ this->__isset.counter_super_column = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
+uint32_t ColumnOrSuperColumn::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("ColumnOrSuperColumn");
+ if (this->__isset.column) {
+ xfer += oprot->writeFieldBegin("column", ::apache::thrift::protocol::T_STRUCT, 1);
+ xfer += this->column.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ }
+ if (this->__isset.super_column) {
+ xfer += oprot->writeFieldBegin("super_column", ::apache::thrift::protocol::T_STRUCT, 2);
+ xfer += this->super_column.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ }
+ if (this->__isset.counter_column) {
+ xfer += oprot->writeFieldBegin("counter_column", ::apache::thrift::protocol::T_STRUCT, 3);
+ xfer += this->counter_column.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ }
+ if (this->__isset.counter_super_column) {
+ xfer += oprot->writeFieldBegin("counter_super_column", ::apache::thrift::protocol::T_STRUCT, 4);
+ xfer += this->counter_super_column.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ }
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+const char* NotFoundException::ascii_fingerprint = "99914B932BD37A50B983C5E7C90AE93B";
+const uint8_t NotFoundException::binary_fingerprint[16] = {0x99,0x91,0x4B,0x93,0x2B,0xD3,0x7A,0x50,0xB9,0x83,0xC5,0xE7,0xC9,0x0A,0xE9,0x3B};
+
+uint32_t NotFoundException::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
+uint32_t NotFoundException::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("NotFoundException");
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+const char* InvalidRequestException::ascii_fingerprint = "EFB929595D312AC8F305D5A794CFEDA1";
+const uint8_t InvalidRequestException::binary_fingerprint[16] = {0xEF,0xB9,0x29,0x59,0x5D,0x31,0x2A,0xC8,0xF3,0x05,0xD5,0xA7,0x94,0xCF,0xED,0xA1};
+
+uint32_t InvalidRequestException::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+ bool isset_why = false;
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readString(this->why);
+ isset_why = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ if (!isset_why)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ return xfer;
+}
+
+uint32_t InvalidRequestException::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("InvalidRequestException");
+ xfer += oprot->writeFieldBegin("why", ::apache::thrift::protocol::T_STRING, 1);
+ xfer += oprot->writeString(this->why);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+const char* UnavailableException::ascii_fingerprint = "99914B932BD37A50B983C5E7C90AE93B";
+const uint8_t UnavailableException::binary_fingerprint[16] = {0x99,0x91,0x4B,0x93,0x2B,0xD3,0x7A,0x50,0xB9,0x83,0xC5,0xE7,0xC9,0x0A,0xE9,0x3B};
+
+uint32_t UnavailableException::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
+uint32_t UnavailableException::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("UnavailableException");
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+const char* TimedOutException::ascii_fingerprint = "99914B932BD37A50B983C5E7C90AE93B";
+const uint8_t TimedOutException::binary_fingerprint[16] = {0x99,0x91,0x4B,0x93,0x2B,0xD3,0x7A,0x50,0xB9,0x83,0xC5,0xE7,0xC9,0x0A,0xE9,0x3B};
+
+uint32_t TimedOutException::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
+uint32_t TimedOutException::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("TimedOutException");
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+const char* AuthenticationException::ascii_fingerprint = "EFB929595D312AC8F305D5A794CFEDA1";
+const uint8_t AuthenticationException::binary_fingerprint[16] = {0xEF,0xB9,0x29,0x59,0x5D,0x31,0x2A,0xC8,0xF3,0x05,0xD5,0xA7,0x94,0xCF,0xED,0xA1};
+
+uint32_t AuthenticationException::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+ bool isset_why = false;
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readString(this->why);
+ isset_why = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ if (!isset_why)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ return xfer;
+}
+
+uint32_t AuthenticationException::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("AuthenticationException");
+ xfer += oprot->writeFieldBegin("why", ::apache::thrift::protocol::T_STRING, 1);
+ xfer += oprot->writeString(this->why);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+const char* AuthorizationException::ascii_fingerprint = "EFB929595D312AC8F305D5A794CFEDA1";
+const uint8_t AuthorizationException::binary_fingerprint[16] = {0xEF,0xB9,0x29,0x59,0x5D,0x31,0x2A,0xC8,0xF3,0x05,0xD5,0xA7,0x94,0xCF,0xED,0xA1};
+
+uint32_t AuthorizationException::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+ bool isset_why = false;
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readString(this->why);
+ isset_why = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ if (!isset_why)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ return xfer;
+}
+
+uint32_t AuthorizationException::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("AuthorizationException");
+ xfer += oprot->writeFieldBegin("why", ::apache::thrift::protocol::T_STRING, 1);
+ xfer += oprot->writeString(this->why);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+const char* SchemaDisagreementException::ascii_fingerprint = "99914B932BD37A50B983C5E7C90AE93B";
+const uint8_t SchemaDisagreementException::binary_fingerprint[16] = {0x99,0x91,0x4B,0x93,0x2B,0xD3,0x7A,0x50,0xB9,0x83,0xC5,0xE7,0xC9,0x0A,0xE9,0x3B};
+
+uint32_t SchemaDisagreementException::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
+uint32_t SchemaDisagreementException::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("SchemaDisagreementException");
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+const char* ColumnParent::ascii_fingerprint = "0A13AE61181713A4100DFFB3EC293822";
+const uint8_t ColumnParent::binary_fingerprint[16] = {0x0A,0x13,0xAE,0x61,0x18,0x17,0x13,0xA4,0x10,0x0D,0xFF,0xB3,0xEC,0x29,0x38,0x22};
+
+uint32_t ColumnParent::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+ bool isset_column_family = false;
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 3:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readString(this->column_family);
+ isset_column_family = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 4:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readBinary(this->super_column);
+ this->__isset.super_column = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ if (!isset_column_family)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ return xfer;
+}
+
+uint32_t ColumnParent::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("ColumnParent");
+ xfer += oprot->writeFieldBegin("column_family", ::apache::thrift::protocol::T_STRING, 3);
+ xfer += oprot->writeString(this->column_family);
+ xfer += oprot->writeFieldEnd();
+ if (this->__isset.super_column) {
+ xfer += oprot->writeFieldBegin("super_column", ::apache::thrift::protocol::T_STRING, 4);
+ xfer += oprot->writeBinary(this->super_column);
+ xfer += oprot->writeFieldEnd();
+ }
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+const char* ColumnPath::ascii_fingerprint = "606212895BCF63C757913CF35AEB3462";
+const uint8_t ColumnPath::binary_fingerprint[16] = {0x60,0x62,0x12,0x89,0x5B,0xCF,0x63,0xC7,0x57,0x91,0x3C,0xF3,0x5A,0xEB,0x34,0x62};
+
+uint32_t ColumnPath::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+ bool isset_column_family = false;
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 3:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readString(this->column_family);
+ isset_column_family = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 4:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readBinary(this->super_column);
+ this->__isset.super_column = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 5:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readBinary(this->column);
+ this->__isset.column = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ if (!isset_column_family)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ return xfer;
+}
+
+uint32_t ColumnPath::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("ColumnPath");
+ xfer += oprot->writeFieldBegin("column_family", ::apache::thrift::protocol::T_STRING, 3);
+ xfer += oprot->writeString(this->column_family);
+ xfer += oprot->writeFieldEnd();
+ if (this->__isset.super_column) {
+ xfer += oprot->writeFieldBegin("super_column", ::apache::thrift::protocol::T_STRING, 4);
+ xfer += oprot->writeBinary(this->super_column);
+ xfer += oprot->writeFieldEnd();
+ }
+ if (this->__isset.column) {
+ xfer += oprot->writeFieldBegin("column", ::apache::thrift::protocol::T_STRING, 5);
+ xfer += oprot->writeBinary(this->column);
+ xfer += oprot->writeFieldEnd();
+ }
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+const char* SliceRange::ascii_fingerprint = "184D24C9A0B8D4415E234DB649CAE740";
+const uint8_t SliceRange::binary_fingerprint[16] = {0x18,0x4D,0x24,0xC9,0xA0,0xB8,0xD4,0x41,0x5E,0x23,0x4D,0xB6,0x49,0xCA,0xE7,0x40};
+
+uint32_t SliceRange::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+ bool isset_start = false;
+ bool isset_finish = false;
+ bool isset_reversed = false;
+ bool isset_count = false;
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readBinary(this->start);
+ isset_start = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 2:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readBinary(this->finish);
+ isset_finish = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 3:
+ if (ftype == ::apache::thrift::protocol::T_BOOL) {
+ xfer += iprot->readBool(this->reversed);
+ isset_reversed = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 4:
+ if (ftype == ::apache::thrift::protocol::T_I32) {
+ xfer += iprot->readI32(this->count);
+ isset_count = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ if (!isset_start)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ if (!isset_finish)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ if (!isset_reversed)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ if (!isset_count)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ return xfer;
+}
+
+uint32_t SliceRange::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("SliceRange");
+ xfer += oprot->writeFieldBegin("start", ::apache::thrift::protocol::T_STRING, 1);
+ xfer += oprot->writeBinary(this->start);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldBegin("finish", ::apache::thrift::protocol::T_STRING, 2);
+ xfer += oprot->writeBinary(this->finish);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldBegin("reversed", ::apache::thrift::protocol::T_BOOL, 3);
+ xfer += oprot->writeBool(this->reversed);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldBegin("count", ::apache::thrift::protocol::T_I32, 4);
+ xfer += oprot->writeI32(this->count);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+const char* SlicePredicate::ascii_fingerprint = "F59D1D81C17DFFAF09988BF1C9CE5E27";
+const uint8_t SlicePredicate::binary_fingerprint[16] = {0xF5,0x9D,0x1D,0x81,0xC1,0x7D,0xFF,0xAF,0x09,0x98,0x8B,0xF1,0xC9,0xCE,0x5E,0x27};
+
+uint32_t SlicePredicate::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_LIST) {
+ {
+ this->column_names.clear();
+ uint32_t _size12;
+ ::apache::thrift::protocol::TType _etype15;
+ iprot->readListBegin(_etype15, _size12);
+ this->column_names.resize(_size12);
+ uint32_t _i16;
+ for (_i16 = 0; _i16 < _size12; ++_i16)
+ {
+ xfer += iprot->readBinary(this->column_names[_i16]);
+ }
+ iprot->readListEnd();
+ }
+ this->__isset.column_names = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 2:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->slice_range.read(iprot);
+ this->__isset.slice_range = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
+uint32_t SlicePredicate::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("SlicePredicate");
+ if (this->__isset.column_names) {
+ xfer += oprot->writeFieldBegin("column_names", ::apache::thrift::protocol::T_LIST, 1);
+ {
+ xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast<uint32_t>(this->column_names.size()));
+ std::vector<std::string> ::const_iterator _iter17;
+ for (_iter17 = this->column_names.begin(); _iter17 != this->column_names.end(); ++_iter17)
+ {
+ xfer += oprot->writeBinary((*_iter17));
+ }
+ xfer += oprot->writeListEnd();
+ }
+ xfer += oprot->writeFieldEnd();
+ }
+ if (this->__isset.slice_range) {
+ xfer += oprot->writeFieldBegin("slice_range", ::apache::thrift::protocol::T_STRUCT, 2);
+ xfer += this->slice_range.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ }
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+const char* IndexExpression::ascii_fingerprint = "D9F4CFE2F293A8B1052FD3031DD2C847";
+const uint8_t IndexExpression::binary_fingerprint[16] = {0xD9,0xF4,0xCF,0xE2,0xF2,0x93,0xA8,0xB1,0x05,0x2F,0xD3,0x03,0x1D,0xD2,0xC8,0x47};
+
+uint32_t IndexExpression::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+ bool isset_column_name = false;
+ bool isset_op = false;
+ bool isset_value = false;
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readBinary(this->column_name);
+ isset_column_name = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 2:
+ if (ftype == ::apache::thrift::protocol::T_I32) {
+ int32_t ecast18;
+ xfer += iprot->readI32(ecast18);
+ this->op = (IndexOperator::type)ecast18;
+ isset_op = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 3:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readBinary(this->value);
+ isset_value = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ if (!isset_column_name)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ if (!isset_op)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ if (!isset_value)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ return xfer;
+}
+
+uint32_t IndexExpression::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("IndexExpression");
+ xfer += oprot->writeFieldBegin("column_name", ::apache::thrift::protocol::T_STRING, 1);
+ xfer += oprot->writeBinary(this->column_name);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldBegin("op", ::apache::thrift::protocol::T_I32, 2);
+ xfer += oprot->writeI32((int32_t)this->op);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldBegin("value", ::apache::thrift::protocol::T_STRING, 3);
+ xfer += oprot->writeBinary(this->value);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+const char* IndexClause::ascii_fingerprint = "9B551B9AB86120B0EEA9005C77FD3C1F";
+const uint8_t IndexClause::binary_fingerprint[16] = {0x9B,0x55,0x1B,0x9A,0xB8,0x61,0x20,0xB0,0xEE,0xA9,0x00,0x5C,0x77,0xFD,0x3C,0x1F};
+
+uint32_t IndexClause::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+ bool isset_expressions = false;
+ bool isset_start_key = false;
+ bool isset_count = false;
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_LIST) {
+ {
+ this->expressions.clear();
+ uint32_t _size19;
+ ::apache::thrift::protocol::TType _etype22;
+ iprot->readListBegin(_etype22, _size19);
+ this->expressions.resize(_size19);
+ uint32_t _i23;
+ for (_i23 = 0; _i23 < _size19; ++_i23)
+ {
+ xfer += this->expressions[_i23].read(iprot);
+ }
+ iprot->readListEnd();
+ }
+ isset_expressions = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 2:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readBinary(this->start_key);
+ isset_start_key = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 3:
+ if (ftype == ::apache::thrift::protocol::T_I32) {
+ xfer += iprot->readI32(this->count);
+ isset_count = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ if (!isset_expressions)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ if (!isset_start_key)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ if (!isset_count)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ return xfer;
+}
+
+uint32_t IndexClause::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("IndexClause");
+ xfer += oprot->writeFieldBegin("expressions", ::apache::thrift::protocol::T_LIST, 1);
+ {
+ xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast<uint32_t>(this->expressions.size()));
+ std::vector<IndexExpression> ::const_iterator _iter24;
+ for (_iter24 = this->expressions.begin(); _iter24 != this->expressions.end(); ++_iter24)
+ {
+ xfer += (*_iter24).write(oprot);
+ }
+ xfer += oprot->writeListEnd();
+ }
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldBegin("start_key", ::apache::thrift::protocol::T_STRING, 2);
+ xfer += oprot->writeBinary(this->start_key);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldBegin("count", ::apache::thrift::protocol::T_I32, 3);
+ xfer += oprot->writeI32(this->count);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+const char* KeyRange::ascii_fingerprint = "A6EC82FA0980B91C7C8EB013C61CA1B0";
+const uint8_t KeyRange::binary_fingerprint[16] = {0xA6,0xEC,0x82,0xFA,0x09,0x80,0xB9,0x1C,0x7C,0x8E,0xB0,0x13,0xC6,0x1C,0xA1,0xB0};
+
+uint32_t KeyRange::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+ bool isset_count = false;
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readBinary(this->start_key);
+ this->__isset.start_key = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 2:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readBinary(this->end_key);
+ this->__isset.end_key = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 3:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readString(this->start_token);
+ this->__isset.start_token = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 4:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readString(this->end_token);
+ this->__isset.end_token = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 6:
+ if (ftype == ::apache::thrift::protocol::T_LIST) {
+ {
+ this->row_filter.clear();
+ uint32_t _size25;
+ ::apache::thrift::protocol::TType _etype28;
+ iprot->readListBegin(_etype28, _size25);
+ this->row_filter.resize(_size25);
+ uint32_t _i29;
+ for (_i29 = 0; _i29 < _size25; ++_i29)
+ {
+ xfer += this->row_filter[_i29].read(iprot);
+ }
+ iprot->readListEnd();
+ }
+ this->__isset.row_filter = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 5:
+ if (ftype == ::apache::thrift::protocol::T_I32) {
+ xfer += iprot->readI32(this->count);
+ isset_count = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ if (!isset_count)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ return xfer;
+}
+
+uint32_t KeyRange::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("KeyRange");
+ if (this->__isset.start_key) {
+ xfer += oprot->writeFieldBegin("start_key", ::apache::thrift::protocol::T_STRING, 1);
+ xfer += oprot->writeBinary(this->start_key);
+ xfer += oprot->writeFieldEnd();
+ }
+ if (this->__isset.end_key) {
+ xfer += oprot->writeFieldBegin("end_key", ::apache::thrift::protocol::T_STRING, 2);
+ xfer += oprot->writeBinary(this->end_key);
+ xfer += oprot->writeFieldEnd();
+ }
+ if (this->__isset.start_token) {
+ xfer += oprot->writeFieldBegin("start_token", ::apache::thrift::protocol::T_STRING, 3);
+ xfer += oprot->writeString(this->start_token);
+ xfer += oprot->writeFieldEnd();
+ }
+ if (this->__isset.end_token) {
+ xfer += oprot->writeFieldBegin("end_token", ::apache::thrift::protocol::T_STRING, 4);
+ xfer += oprot->writeString(this->end_token);
+ xfer += oprot->writeFieldEnd();
+ }
+ xfer += oprot->writeFieldBegin("count", ::apache::thrift::protocol::T_I32, 5);
+ xfer += oprot->writeI32(this->count);
+ xfer += oprot->writeFieldEnd();
+ if (this->__isset.row_filter) {
+ xfer += oprot->writeFieldBegin("row_filter", ::apache::thrift::protocol::T_LIST, 6);
+ {
+ xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast<uint32_t>(this->row_filter.size()));
+ std::vector<IndexExpression> ::const_iterator _iter30;
+ for (_iter30 = this->row_filter.begin(); _iter30 != this->row_filter.end(); ++_iter30)
+ {
+ xfer += (*_iter30).write(oprot);
+ }
+ xfer += oprot->writeListEnd();
+ }
+ xfer += oprot->writeFieldEnd();
+ }
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+const char* KeySlice::ascii_fingerprint = "D1568675B0C135C909E3169B72A4DA3D";
+const uint8_t KeySlice::binary_fingerprint[16] = {0xD1,0x56,0x86,0x75,0xB0,0xC1,0x35,0xC9,0x09,0xE3,0x16,0x9B,0x72,0xA4,0xDA,0x3D};
+
+uint32_t KeySlice::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+ bool isset_key = false;
+ bool isset_columns = false;
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readBinary(this->key);
+ isset_key = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 2:
+ if (ftype == ::apache::thrift::protocol::T_LIST) {
+ {
+ this->columns.clear();
+ uint32_t _size31;
+ ::apache::thrift::protocol::TType _etype34;
+ iprot->readListBegin(_etype34, _size31);
+ this->columns.resize(_size31);
+ uint32_t _i35;
+ for (_i35 = 0; _i35 < _size31; ++_i35)
+ {
+ xfer += this->columns[_i35].read(iprot);
+ }
+ iprot->readListEnd();
+ }
+ isset_columns = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ if (!isset_key)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ if (!isset_columns)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ return xfer;
+}
+
+uint32_t KeySlice::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("KeySlice");
+ xfer += oprot->writeFieldBegin("key", ::apache::thrift::protocol::T_STRING, 1);
+ xfer += oprot->writeBinary(this->key);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldBegin("columns", ::apache::thrift::protocol::T_LIST, 2);
+ {
+ xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast<uint32_t>(this->columns.size()));
+ std::vector<ColumnOrSuperColumn> ::const_iterator _iter36;
+ for (_iter36 = this->columns.begin(); _iter36 != this->columns.end(); ++_iter36)
+ {
+ xfer += (*_iter36).write(oprot);
+ }
+ xfer += oprot->writeListEnd();
+ }
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+const char* KeyCount::ascii_fingerprint = "EEBC915CE44901401D881E6091423036";
+const uint8_t KeyCount::binary_fingerprint[16] = {0xEE,0xBC,0x91,0x5C,0xE4,0x49,0x01,0x40,0x1D,0x88,0x1E,0x60,0x91,0x42,0x30,0x36};
+
+uint32_t KeyCount::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+ bool isset_key = false;
+ bool isset_count = false;
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readBinary(this->key);
+ isset_key = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 2:
+ if (ftype == ::apache::thrift::protocol::T_I32) {
+ xfer += iprot->readI32(this->count);
+ isset_count = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ if (!isset_key)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ if (!isset_count)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ return xfer;
+}
+
+uint32_t KeyCount::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("KeyCount");
+ xfer += oprot->writeFieldBegin("key", ::apache::thrift::protocol::T_STRING, 1);
+ xfer += oprot->writeBinary(this->key);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldBegin("count", ::apache::thrift::protocol::T_I32, 2);
+ xfer += oprot->writeI32(this->count);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+const char* Deletion::ascii_fingerprint = "40F33ECF1C932CA77C2414C4E6C60CBE";
+const uint8_t Deletion::binary_fingerprint[16] = {0x40,0xF3,0x3E,0xCF,0x1C,0x93,0x2C,0xA7,0x7C,0x24,0x14,0xC4,0xE6,0xC6,0x0C,0xBE};
+
+uint32_t Deletion::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_I64) {
+ xfer += iprot->readI64(this->timestamp);
+ this->__isset.timestamp = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 2:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readBinary(this->super_column);
+ this->__isset.super_column = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 3:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->predicate.read(iprot);
+ this->__isset.predicate = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
+uint32_t Deletion::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("Deletion");
+ if (this->__isset.timestamp) {
+ xfer += oprot->writeFieldBegin("timestamp", ::apache::thrift::protocol::T_I64, 1);
+ xfer += oprot->writeI64(this->timestamp);
+ xfer += oprot->writeFieldEnd();
+ }
+ if (this->__isset.super_column) {
+ xfer += oprot->writeFieldBegin("super_column", ::apache::thrift::protocol::T_STRING, 2);
+ xfer += oprot->writeBinary(this->super_column);
+ xfer += oprot->writeFieldEnd();
+ }
+ if (this->__isset.predicate) {
+ xfer += oprot->writeFieldBegin("predicate", ::apache::thrift::protocol::T_STRUCT, 3);
+ xfer += this->predicate.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ }
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+const char* Mutation::ascii_fingerprint = "E8B65DF3979C6868F80DF81F8E769E63";
+const uint8_t Mutation::binary_fingerprint[16] = {0xE8,0xB6,0x5D,0xF3,0x97,0x9C,0x68,0x68,0xF8,0x0D,0xF8,0x1F,0x8E,0x76,0x9E,0x63};
+
+uint32_t Mutation::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->column_or_supercolumn.read(iprot);
+ this->__isset.column_or_supercolumn = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 2:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->deletion.read(iprot);
+ this->__isset.deletion = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
+uint32_t Mutation::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("Mutation");
+ if (this->__isset.column_or_supercolumn) {
+ xfer += oprot->writeFieldBegin("column_or_supercolumn", ::apache::thrift::protocol::T_STRUCT, 1);
+ xfer += this->column_or_supercolumn.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ }
+ if (this->__isset.deletion) {
+ xfer += oprot->writeFieldBegin("deletion", ::apache::thrift::protocol::T_STRUCT, 2);
+ xfer += this->deletion.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ }
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+const char* EndpointDetails::ascii_fingerprint = "F4A50F0EC638C7F66026F9B6678FD89B";
+const uint8_t EndpointDetails::binary_fingerprint[16] = {0xF4,0xA5,0x0F,0x0E,0xC6,0x38,0xC7,0xF6,0x60,0x26,0xF9,0xB6,0x67,0x8F,0xD8,0x9B};
+
+uint32_t EndpointDetails::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readString(this->host);
+ this->__isset.host = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 2:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readString(this->datacenter);
+ this->__isset.datacenter = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 3:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readString(this->rack);
+ this->__isset.rack = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
+uint32_t EndpointDetails::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("EndpointDetails");
+ xfer += oprot->writeFieldBegin("host", ::apache::thrift::protocol::T_STRING, 1);
+ xfer += oprot->writeString(this->host);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldBegin("datacenter", ::apache::thrift::protocol::T_STRING, 2);
+ xfer += oprot->writeString(this->datacenter);
+ xfer += oprot->writeFieldEnd();
+ if (this->__isset.rack) {
+ xfer += oprot->writeFieldBegin("rack", ::apache::thrift::protocol::T_STRING, 3);
+ xfer += oprot->writeString(this->rack);
+ xfer += oprot->writeFieldEnd();
+ }
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+const char* TokenRange::ascii_fingerprint = "832268DC4CD6B17EE8881FC57EA04679";
+const uint8_t TokenRange::binary_fingerprint[16] = {0x83,0x22,0x68,0xDC,0x4C,0xD6,0xB1,0x7E,0xE8,0x88,0x1F,0xC5,0x7E,0xA0,0x46,0x79};
+
+uint32_t TokenRange::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+ bool isset_start_token = false;
+ bool isset_end_token = false;
+ bool isset_endpoints = false;
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readString(this->start_token);
+ isset_start_token = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 2:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readString(this->end_token);
+ isset_end_token = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 3:
+ if (ftype == ::apache::thrift::protocol::T_LIST) {
+ {
+ this->endpoints.clear();
+ uint32_t _size37;
+ ::apache::thrift::protocol::TType _etype40;
+ iprot->readListBegin(_etype40, _size37);
+ this->endpoints.resize(_size37);
+ uint32_t _i41;
+ for (_i41 = 0; _i41 < _size37; ++_i41)
+ {
+ xfer += iprot->readString(this->endpoints[_i41]);
+ }
+ iprot->readListEnd();
+ }
+ isset_endpoints = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 4:
+ if (ftype == ::apache::thrift::protocol::T_LIST) {
+ {
+ this->rpc_endpoints.clear();
+ uint32_t _size42;
+ ::apache::thrift::protocol::TType _etype45;
+ iprot->readListBegin(_etype45, _size42);
+ this->rpc_endpoints.resize(_size42);
+ uint32_t _i46;
+ for (_i46 = 0; _i46 < _size42; ++_i46)
+ {
+ xfer += iprot->readString(this->rpc_endpoints[_i46]);
+ }
+ iprot->readListEnd();
+ }
+ this->__isset.rpc_endpoints = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 5:
+ if (ftype == ::apache::thrift::protocol::T_LIST) {
+ {
+ this->endpoint_details.clear();
+ uint32_t _size47;
+ ::apache::thrift::protocol::TType _etype50;
+ iprot->readListBegin(_etype50, _size47);
+ this->endpoint_details.resize(_size47);
+ uint32_t _i51;
+ for (_i51 = 0; _i51 < _size47; ++_i51)
+ {
+ xfer += this->endpoint_details[_i51].read(iprot);
+ }
+ iprot->readListEnd();
+ }
+ this->__isset.endpoint_details = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ if (!isset_start_token)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ if (!isset_end_token)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ if (!isset_endpoints)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ return xfer;
+}
+
+uint32_t TokenRange::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("TokenRange");
+ xfer += oprot->writeFieldBegin("start_token", ::apache::thrift::protocol::T_STRING, 1);
+ xfer += oprot->writeString(this->start_token);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldBegin("end_token", ::apache::thrift::protocol::T_STRING, 2);
+ xfer += oprot->writeString(this->end_token);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldBegin("endpoints", ::apache::thrift::protocol::T_LIST, 3);
+ {
+ xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast<uint32_t>(this->endpoints.size()));
+ std::vector<std::string> ::const_iterator _iter52;
+ for (_iter52 = this->endpoints.begin(); _iter52 != this->endpoints.end(); ++_iter52)
+ {
+ xfer += oprot->writeString((*_iter52));
+ }
+ xfer += oprot->writeListEnd();
+ }
+ xfer += oprot->writeFieldEnd();
+ if (this->__isset.rpc_endpoints) {
+ xfer += oprot->writeFieldBegin("rpc_endpoints", ::apache::thrift::protocol::T_LIST, 4);
+ {
+ xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast<uint32_t>(this->rpc_endpoints.size()));
+ std::vector<std::string> ::const_iterator _iter53;
+ for (_iter53 = this->rpc_endpoints.begin(); _iter53 != this->rpc_endpoints.end(); ++_iter53)
+ {
+ xfer += oprot->writeString((*_iter53));
+ }
+ xfer += oprot->writeListEnd();
+ }
+ xfer += oprot->writeFieldEnd();
+ }
+ if (this->__isset.endpoint_details) {
+ xfer += oprot->writeFieldBegin("endpoint_details", ::apache::thrift::protocol::T_LIST, 5);
+ {
+ xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast<uint32_t>(this->endpoint_details.size()));
+ std::vector<EndpointDetails> ::const_iterator _iter54;
+ for (_iter54 = this->endpoint_details.begin(); _iter54 != this->endpoint_details.end(); ++_iter54)
+ {
+ xfer += (*_iter54).write(oprot);
+ }
+ xfer += oprot->writeListEnd();
+ }
+ xfer += oprot->writeFieldEnd();
+ }
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+const char* AuthenticationRequest::ascii_fingerprint = "5EA2D527ECA3BA20C77AFC023EE8C05F";
+const uint8_t AuthenticationRequest::binary_fingerprint[16] = {0x5E,0xA2,0xD5,0x27,0xEC,0xA3,0xBA,0x20,0xC7,0x7A,0xFC,0x02,0x3E,0xE8,0xC0,0x5F};
+
+uint32_t AuthenticationRequest::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+ bool isset_credentials = false;
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_MAP) {
+ {
+ this->credentials.clear();
+ uint32_t _size55;
+ ::apache::thrift::protocol::TType _ktype56;
+ ::apache::thrift::protocol::TType _vtype57;
+ iprot->readMapBegin(_ktype56, _vtype57, _size55);
+ uint32_t _i59;
+ for (_i59 = 0; _i59 < _size55; ++_i59)
+ {
+ std::string _key60;
+ xfer += iprot->readString(_key60);
+ std::string& _val61 = this->credentials[_key60];
+ xfer += iprot->readString(_val61);
+ }
+ iprot->readMapEnd();
+ }
+ isset_credentials = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ if (!isset_credentials)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ return xfer;
+}
+
+uint32_t AuthenticationRequest::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("AuthenticationRequest");
+ xfer += oprot->writeFieldBegin("credentials", ::apache::thrift::protocol::T_MAP, 1);
+ {
+ xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_STRING, static_cast<uint32_t>(this->credentials.size()));
+ std::map<std::string, std::string> ::const_iterator _iter62;
+ for (_iter62 = this->credentials.begin(); _iter62 != this->credentials.end(); ++_iter62)
+ {
+ xfer += oprot->writeString(_iter62->first);
+ xfer += oprot->writeString(_iter62->second);
+ }
+ xfer += oprot->writeMapEnd();
+ }
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+const char* ColumnDef::ascii_fingerprint = "0D89CE83D7EDAD079AC3213ED1DCAA58";
+const uint8_t ColumnDef::binary_fingerprint[16] = {0x0D,0x89,0xCE,0x83,0xD7,0xED,0xAD,0x07,0x9A,0xC3,0x21,0x3E,0xD1,0xDC,0xAA,0x58};
+
+uint32_t ColumnDef::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+ bool isset_name = false;
+ bool isset_validation_class = false;
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readBinary(this->name);
+ isset_name = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 2:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readString(this->validation_class);
+ isset_validation_class = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 3:
+ if (ftype == ::apache::thrift::protocol::T_I32) {
+ int32_t ecast63;
+ xfer += iprot->readI32(ecast63);
+ this->index_type = (IndexType::type)ecast63;
+ this->__isset.index_type = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 4:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readString(this->index_name);
+ this->__isset.index_name = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 5:
+ if (ftype == ::apache::thrift::protocol::T_MAP) {
+ {
+ this->index_options.clear();
+ uint32_t _size64;
+ ::apache::thrift::protocol::TType _ktype65;
+ ::apache::thrift::protocol::TType _vtype66;
+ iprot->readMapBegin(_ktype65, _vtype66, _size64);
+ uint32_t _i68;
+ for (_i68 = 0; _i68 < _size64; ++_i68)
+ {
+ std::string _key69;
+ xfer += iprot->readString(_key69);
+ std::string& _val70 = this->index_options[_key69];
+ xfer += iprot->readString(_val70);
+ }
+ iprot->readMapEnd();
+ }
+ this->__isset.index_options = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ if (!isset_name)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ if (!isset_validation_class)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ return xfer;
+}
+
+uint32_t ColumnDef::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("ColumnDef");
+ xfer += oprot->writeFieldBegin("name", ::apache::thrift::protocol::T_STRING, 1);
+ xfer += oprot->writeBinary(this->name);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldBegin("validation_class", ::apache::thrift::protocol::T_STRING, 2);
+ xfer += oprot->writeString(this->validation_class);
+ xfer += oprot->writeFieldEnd();
+ if (this->__isset.index_type) {
+ xfer += oprot->writeFieldBegin("index_type", ::apache::thrift::protocol::T_I32, 3);
+ xfer += oprot->writeI32((int32_t)this->index_type);
+ xfer += oprot->writeFieldEnd();
+ }
+ if (this->__isset.index_name) {
+ xfer += oprot->writeFieldBegin("index_name", ::apache::thrift::protocol::T_STRING, 4);
+ xfer += oprot->writeString(this->index_name);
+ xfer += oprot->writeFieldEnd();
+ }
+ if (this->__isset.index_options) {
+ xfer += oprot->writeFieldBegin("index_options", ::apache::thrift::protocol::T_MAP, 5);
+ {
+ xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_STRING, static_cast<uint32_t>(this->index_options.size()));
+ std::map<std::string, std::string> ::const_iterator _iter71;
+ for (_iter71 = this->index_options.begin(); _iter71 != this->index_options.end(); ++_iter71)
+ {
+ xfer += oprot->writeString(_iter71->first);
+ xfer += oprot->writeString(_iter71->second);
+ }
+ xfer += oprot->writeMapEnd();
+ }
+ xfer += oprot->writeFieldEnd();
+ }
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+const char* CfDef::ascii_fingerprint = "231A260521B5DD99EFBCCBDD8768CA7D";
+const uint8_t CfDef::binary_fingerprint[16] = {0x23,0x1A,0x26,0x05,0x21,0xB5,0xDD,0x99,0xEF,0xBC,0xCB,0xDD,0x87,0x68,0xCA,0x7D};
+
+uint32_t CfDef::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+ bool isset_keyspace = false;
+ bool isset_name = false;
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readString(this->keyspace);
+ isset_keyspace = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 2:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readString(this->name);
+ isset_name = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 3:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readString(this->column_type);
+ this->__isset.column_type = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 5:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readString(this->comparator_type);
+ this->__isset.comparator_type = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 6:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readString(this->subcomparator_type);
+ this->__isset.subcomparator_type = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 8:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readString(this->comment);
+ this->__isset.comment = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 12:
+ if (ftype == ::apache::thrift::protocol::T_DOUBLE) {
+ xfer += iprot->readDouble(this->read_repair_chance);
+ this->__isset.read_repair_chance = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 13:
+ if (ftype == ::apache::thrift::protocol::T_LIST) {
+ {
+ this->column_metadata.clear();
+ uint32_t _size72;
+ ::apache::thrift::protocol::TType _etype75;
+ iprot->readListBegin(_etype75, _size72);
+ this->column_metadata.resize(_size72);
+ uint32_t _i76;
+ for (_i76 = 0; _i76 < _size72; ++_i76)
+ {
+ xfer += this->column_metadata[_i76].read(iprot);
+ }
+ iprot->readListEnd();
+ }
+ this->__isset.column_metadata = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 14:
+ if (ftype == ::apache::thrift::protocol::T_I32) {
+ xfer += iprot->readI32(this->gc_grace_seconds);
+ this->__isset.gc_grace_seconds = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 15:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readString(this->default_validation_class);
+ this->__isset.default_validation_class = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 16:
+ if (ftype == ::apache::thrift::protocol::T_I32) {
+ xfer += iprot->readI32(this->id);
+ this->__isset.id = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 17:
+ if (ftype == ::apache::thrift::protocol::T_I32) {
+ xfer += iprot->readI32(this->min_compaction_threshold);
+ this->__isset.min_compaction_threshold = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 18:
+ if (ftype == ::apache::thrift::protocol::T_I32) {
+ xfer += iprot->readI32(this->max_compaction_threshold);
+ this->__isset.max_compaction_threshold = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 24:
+ if (ftype == ::apache::thrift::protocol::T_BOOL) {
+ xfer += iprot->readBool(this->replicate_on_write);
+ this->__isset.replicate_on_write = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 26:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readString(this->key_validation_class);
+ this->__isset.key_validation_class = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 28:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readBinary(this->key_alias);
+ this->__isset.key_alias = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 29:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readString(this->compaction_strategy);
+ this->__isset.compaction_strategy = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 30:
+ if (ftype == ::apache::thrift::protocol::T_MAP) {
+ {
+ this->compaction_strategy_options.clear();
+ uint32_t _size77;
+ ::apache::thrift::protocol::TType _ktype78;
+ ::apache::thrift::protocol::TType _vtype79;
+ iprot->readMapBegin(_ktype78, _vtype79, _size77);
+ uint32_t _i81;
+ for (_i81 = 0; _i81 < _size77; ++_i81)
+ {
+ std::string _key82;
+ xfer += iprot->readString(_key82);
+ std::string& _val83 = this->compaction_strategy_options[_key82];
+ xfer += iprot->readString(_val83);
+ }
+ iprot->readMapEnd();
+ }
+ this->__isset.compaction_strategy_options = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 32:
+ if (ftype == ::apache::thrift::protocol::T_MAP) {
+ {
+ this->compression_options.clear();
+ uint32_t _size84;
+ ::apache::thrift::protocol::TType _ktype85;
+ ::apache::thrift::protocol::TType _vtype86;
+ iprot->readMapBegin(_ktype85, _vtype86, _size84);
+ uint32_t _i88;
+ for (_i88 = 0; _i88 < _size84; ++_i88)
+ {
+ std::string _key89;
+ xfer += iprot->readString(_key89);
+ std::string& _val90 = this->compression_options[_key89];
+ xfer += iprot->readString(_val90);
+ }
+ iprot->readMapEnd();
+ }
+ this->__isset.compression_options = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 33:
+ if (ftype == ::apache::thrift::protocol::T_DOUBLE) {
+ xfer += iprot->readDouble(this->bloom_filter_fp_chance);
+ this->__isset.bloom_filter_fp_chance = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 34:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readString(this->caching);
+ this->__isset.caching = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 37:
+ if (ftype == ::apache::thrift::protocol::T_DOUBLE) {
+ xfer += iprot->readDouble(this->dclocal_read_repair_chance);
+ this->__isset.dclocal_read_repair_chance = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 9:
+ if (ftype == ::apache::thrift::protocol::T_DOUBLE) {
+ xfer += iprot->readDouble(this->row_cache_size);
+ this->__isset.row_cache_size = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 11:
+ if (ftype == ::apache::thrift::protocol::T_DOUBLE) {
+ xfer += iprot->readDouble(this->key_cache_size);
+ this->__isset.key_cache_size = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 19:
+ if (ftype == ::apache::thrift::protocol::T_I32) {
+ xfer += iprot->readI32(this->row_cache_save_period_in_seconds);
+ this->__isset.row_cache_save_period_in_seconds = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 20:
+ if (ftype == ::apache::thrift::protocol::T_I32) {
+ xfer += iprot->readI32(this->key_cache_save_period_in_seconds);
+ this->__isset.key_cache_save_period_in_seconds = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 21:
+ if (ftype == ::apache::thrift::protocol::T_I32) {
+ xfer += iprot->readI32(this->memtable_flush_after_mins);
+ this->__isset.memtable_flush_after_mins = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 22:
+ if (ftype == ::apache::thrift::protocol::T_I32) {
+ xfer += iprot->readI32(this->memtable_throughput_in_mb);
+ this->__isset.memtable_throughput_in_mb = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 23:
+ if (ftype == ::apache::thrift::protocol::T_DOUBLE) {
+ xfer += iprot->readDouble(this->memtable_operations_in_millions);
+ this->__isset.memtable_operations_in_millions = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 25:
+ if (ftype == ::apache::thrift::protocol::T_DOUBLE) {
+ xfer += iprot->readDouble(this->merge_shards_chance);
+ this->__isset.merge_shards_chance = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 27:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readString(this->row_cache_provider);
+ this->__isset.row_cache_provider = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 31:
+ if (ftype == ::apache::thrift::protocol::T_I32) {
+ xfer += iprot->readI32(this->row_cache_keys_to_save);
+ this->__isset.row_cache_keys_to_save = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ if (!isset_keyspace)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ if (!isset_name)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ return xfer;
+}
+
+uint32_t CfDef::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("CfDef");
+ xfer += oprot->writeFieldBegin("keyspace", ::apache::thrift::protocol::T_STRING, 1);
+ xfer += oprot->writeString(this->keyspace);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldBegin("name", ::apache::thrift::protocol::T_STRING, 2);
+ xfer += oprot->writeString(this->name);
+ xfer += oprot->writeFieldEnd();
+ if (this->__isset.column_type) {
+ xfer += oprot->writeFieldBegin("column_type", ::apache::thrift::protocol::T_STRING, 3);
+ xfer += oprot->writeString(this->column_type);
+ xfer += oprot->writeFieldEnd();
+ }
+ if (this->__isset.comparator_type) {
+ xfer += oprot->writeFieldBegin("comparator_type", ::apache::thrift::protocol::T_STRING, 5);
+ xfer += oprot->writeString(this->comparator_type);
+ xfer += oprot->writeFieldEnd();
+ }
+ if (this->__isset.subcomparator_type) {
+ xfer += oprot->writeFieldBegin("subcomparator_type", ::apache::thrift::protocol::T_STRING, 6);
+ xfer += oprot->writeString(this->subcomparator_type);
+ xfer += oprot->writeFieldEnd();
+ }
+ if (this->__isset.comment) {
+ xfer += oprot->writeFieldBegin("comment", ::apache::thrift::protocol::T_STRING, 8);
+ xfer += oprot->writeString(this->comment);
+ xfer += oprot->writeFieldEnd();
+ }
+ if (this->__isset.row_cache_size) {
+ xfer += oprot->writeFieldBegin("row_cache_size", ::apache::thrift::protocol::T_DOUBLE, 9);
+ xfer += oprot->writeDouble(this->row_cache_size);
+ xfer += oprot->writeFieldEnd();
+ }
+ if (this->__isset.key_cache_size) {
+ xfer += oprot->writeFieldBegin("key_cache_size", ::apache::thrift::protocol::T_DOUBLE, 11);
+ xfer += oprot->writeDouble(this->key_cache_size);
+ xfer += oprot->writeFieldEnd();
+ }
+ if (this->__isset.read_repair_chance) {
+ xfer += oprot->writeFieldBegin("read_repair_chance", ::apache::thrift::protocol::T_DOUBLE, 12);
+ xfer += oprot->writeDouble(this->read_repair_chance);
+ xfer += oprot->writeFieldEnd();
+ }
+ if (this->__isset.column_metadata) {
+ xfer += oprot->writeFieldBegin("column_metadata", ::apache::thrift::protocol::T_LIST, 13);
+ {
+ xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast<uint32_t>(this->column_metadata.size()));
+ std::vector<ColumnDef> ::const_iterator _iter91;
+ for (_iter91 = this->column_metadata.begin(); _iter91 != this->column_metadata.end(); ++_iter91)
+ {
+ xfer += (*_iter91).write(oprot);
+ }
+ xfer += oprot->writeListEnd();
+ }
+ xfer += oprot->writeFieldEnd();
+ }
+ if (this->__isset.gc_grace_seconds) {
+ xfer += oprot->writeFieldBegin("gc_grace_seconds", ::apache::thrift::protocol::T_I32, 14);
+ xfer += oprot->writeI32(this->gc_grace_seconds);
+ xfer += oprot->writeFieldEnd();
+ }
+ if (this->__isset.default_validation_class) {
+ xfer += oprot->writeFieldBegin("default_validation_class", ::apache::thrift::protocol::T_STRING, 15);
+ xfer += oprot->writeString(this->default_validation_class);
+ xfer += oprot->writeFieldEnd();
+ }
+ if (this->__isset.id) {
+ xfer += oprot->writeFieldBegin("id", ::apache::thrift::protocol::T_I32, 16);
+ xfer += oprot->writeI32(this->id);
+ xfer += oprot->writeFieldEnd();
+ }
+ if (this->__isset.min_compaction_threshold) {
+ xfer += oprot->writeFieldBegin("min_compaction_threshold", ::apache::thrift::protocol::T_I32, 17);
+ xfer += oprot->writeI32(this->min_compaction_threshold);
+ xfer += oprot->writeFieldEnd();
+ }
+ if (this->__isset.max_compaction_threshold) {
+ xfer += oprot->writeFieldBegin("max_compaction_threshold", ::apache::thrift::protocol::T_I32, 18);
+ xfer += oprot->writeI32(this->max_compaction_threshold);
+ xfer += oprot->writeFieldEnd();
+ }
+ if (this->__isset.row_cache_save_period_in_seconds) {
+ xfer += oprot->writeFieldBegin("row_cache_save_period_in_seconds", ::apache::thrift::protocol::T_I32, 19);
+ xfer += oprot->writeI32(this->row_cache_save_period_in_seconds);
+ xfer += oprot->writeFieldEnd();
+ }
+ if (this->__isset.key_cache_save_period_in_seconds) {
+ xfer += oprot->writeFieldBegin("key_cache_save_period_in_seconds", ::apache::thrift::protocol::T_I32, 20);
+ xfer += oprot->writeI32(this->key_cache_save_period_in_seconds);
+ xfer += oprot->writeFieldEnd();
+ }
+ if (this->__isset.memtable_flush_after_mins) {
+ xfer += oprot->writeFieldBegin("memtable_flush_after_mins", ::apache::thrift::protocol::T_I32, 21);
+ xfer += oprot->writeI32(this->memtable_flush_after_mins);
+ xfer += oprot->writeFieldEnd();
+ }
+ if (this->__isset.memtable_throughput_in_mb) {
+ xfer += oprot->writeFieldBegin("memtable_throughput_in_mb", ::apache::thrift::protocol::T_I32, 22);
+ xfer += oprot->writeI32(this->memtable_throughput_in_mb);
+ xfer += oprot->writeFieldEnd();
+ }
+ if (this->__isset.memtable_operations_in_millions) {
+ xfer += oprot->writeFieldBegin("memtable_operations_in_millions", ::apache::thrift::protocol::T_DOUBLE, 23);
+ xfer += oprot->writeDouble(this->memtable_operations_in_millions);
+ xfer += oprot->writeFieldEnd();
+ }
+ if (this->__isset.replicate_on_write) {
+ xfer += oprot->writeFieldBegin("replicate_on_write", ::apache::thrift::protocol::T_BOOL, 24);
+ xfer += oprot->writeBool(this->replicate_on_write);
+ xfer += oprot->writeFieldEnd();
+ }
+ if (this->__isset.merge_shards_chance) {
+ xfer += oprot->writeFieldBegin("merge_shards_chance", ::apache::thrift::protocol::T_DOUBLE, 25);
+ xfer += oprot->writeDouble(this->merge_shards_chance);
+ xfer += oprot->writeFieldEnd();
+ }
+ if (this->__isset.key_validation_class) {
+ xfer += oprot->writeFieldBegin("key_validation_class", ::apache::thrift::protocol::T_STRING, 26);
+ xfer += oprot->writeString(this->key_validation_class);
+ xfer += oprot->writeFieldEnd();
+ }
+ if (this->__isset.row_cache_provider) {
+ xfer += oprot->writeFieldBegin("row_cache_provider", ::apache::thrift::protocol::T_STRING, 27);
+ xfer += oprot->writeString(this->row_cache_provider);
+ xfer += oprot->writeFieldEnd();
+ }
+ if (this->__isset.key_alias) {
+ xfer += oprot->writeFieldBegin("key_alias", ::apache::thrift::protocol::T_STRING, 28);
+ xfer += oprot->writeBinary(this->key_alias);
+ xfer += oprot->writeFieldEnd();
+ }
+ if (this->__isset.compaction_strategy) {
+ xfer += oprot->writeFieldBegin("compaction_strategy", ::apache::thrift::protocol::T_STRING, 29);
+ xfer += oprot->writeString(this->compaction_strategy);
+ xfer += oprot->writeFieldEnd();
+ }
+ if (this->__isset.compaction_strategy_options) {
+ xfer += oprot->writeFieldBegin("compaction_strategy_options", ::apache::thrift::protocol::T_MAP, 30);
+ {
+ xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_STRING, static_cast<uint32_t>(this->compaction_strategy_options.size()));
+ std::map<std::string, std::string> ::const_iterator _iter92;
+ for (_iter92 = this->compaction_strategy_options.begin(); _iter92 != this->compaction_strategy_options.end(); ++_iter92)
+ {
+ xfer += oprot->writeString(_iter92->first);
+ xfer += oprot->writeString(_iter92->second);
+ }
+ xfer += oprot->writeMapEnd();
+ }
+ xfer += oprot->writeFieldEnd();
+ }
+ if (this->__isset.row_cache_keys_to_save) {
+ xfer += oprot->writeFieldBegin("row_cache_keys_to_save", ::apache::thrift::protocol::T_I32, 31);
+ xfer += oprot->writeI32(this->row_cache_keys_to_save);
+ xfer += oprot->writeFieldEnd();
+ }
+ if (this->__isset.compression_options) {
+ xfer += oprot->writeFieldBegin("compression_options", ::apache::thrift::protocol::T_MAP, 32);
+ {
+ xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_STRING, static_cast<uint32_t>(this->compression_options.size()));
+ std::map<std::string, std::string> ::const_iterator _iter93;
+ for (_iter93 = this->compression_options.begin(); _iter93 != this->compression_options.end(); ++_iter93)
+ {
+ xfer += oprot->writeString(_iter93->first);
+ xfer += oprot->writeString(_iter93->second);
+ }
+ xfer += oprot->writeMapEnd();
+ }
+ xfer += oprot->writeFieldEnd();
+ }
+ if (this->__isset.bloom_filter_fp_chance) {
+ xfer += oprot->writeFieldBegin("bloom_filter_fp_chance", ::apache::thrift::protocol::T_DOUBLE, 33);
+ xfer += oprot->writeDouble(this->bloom_filter_fp_chance);
+ xfer += oprot->writeFieldEnd();
+ }
+ if (this->__isset.caching) {
+ xfer += oprot->writeFieldBegin("caching", ::apache::thrift::protocol::T_STRING, 34);
+ xfer += oprot->writeString(this->caching);
+ xfer += oprot->writeFieldEnd();
+ }
+ if (this->__isset.dclocal_read_repair_chance) {
+ xfer += oprot->writeFieldBegin("dclocal_read_repair_chance", ::apache::thrift::protocol::T_DOUBLE, 37);
+ xfer += oprot->writeDouble(this->dclocal_read_repair_chance);
+ xfer += oprot->writeFieldEnd();
+ }
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+const char* KsDef::ascii_fingerprint = "0767851B6476EB3777A21E59E912E11A";
+const uint8_t KsDef::binary_fingerprint[16] = {0x07,0x67,0x85,0x1B,0x64,0x76,0xEB,0x37,0x77,0xA2,0x1E,0x59,0xE9,0x12,0xE1,0x1A};
+
+uint32_t KsDef::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+ bool isset_name = false;
+ bool isset_strategy_class = false;
+ bool isset_cf_defs = false;
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readString(this->name);
+ isset_name = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 2:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readString(this->strategy_class);
+ isset_strategy_class = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 3:
+ if (ftype == ::apache::thrift::protocol::T_MAP) {
+ {
+ this->strategy_options.clear();
+ uint32_t _size94;
+ ::apache::thrift::protocol::TType _ktype95;
+ ::apache::thrift::protocol::TType _vtype96;
+ iprot->readMapBegin(_ktype95, _vtype96, _size94);
+ uint32_t _i98;
+ for (_i98 = 0; _i98 < _size94; ++_i98)
+ {
+ std::string _key99;
+ xfer += iprot->readString(_key99);
+ std::string& _val100 = this->strategy_options[_key99];
+ xfer += iprot->readString(_val100);
+ }
+ iprot->readMapEnd();
+ }
+ this->__isset.strategy_options = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 4:
+ if (ftype == ::apache::thrift::protocol::T_I32) {
+ xfer += iprot->readI32(this->replication_factor);
+ this->__isset.replication_factor = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 5:
+ if (ftype == ::apache::thrift::protocol::T_LIST) {
+ {
+ this->cf_defs.clear();
+ uint32_t _size101;
+ ::apache::thrift::protocol::TType _etype104;
+ iprot->readListBegin(_etype104, _size101);
+ this->cf_defs.resize(_size101);
+ uint32_t _i105;
+ for (_i105 = 0; _i105 < _size101; ++_i105)
+ {
+ xfer += this->cf_defs[_i105].read(iprot);
+ }
+ iprot->readListEnd();
+ }
+ isset_cf_defs = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 6:
+ if (ftype == ::apache::thrift::protocol::T_BOOL) {
+ xfer += iprot->readBool(this->durable_writes);
+ this->__isset.durable_writes = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ if (!isset_name)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ if (!isset_strategy_class)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ if (!isset_cf_defs)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ return xfer;
+}
+
+uint32_t KsDef::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("KsDef");
+ xfer += oprot->writeFieldBegin("name", ::apache::thrift::protocol::T_STRING, 1);
+ xfer += oprot->writeString(this->name);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldBegin("strategy_class", ::apache::thrift::protocol::T_STRING, 2);
+ xfer += oprot->writeString(this->strategy_class);
+ xfer += oprot->writeFieldEnd();
+ if (this->__isset.strategy_options) {
+ xfer += oprot->writeFieldBegin("strategy_options", ::apache::thrift::protocol::T_MAP, 3);
+ {
+ xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_STRING, static_cast<uint32_t>(this->strategy_options.size()));
+ std::map<std::string, std::string> ::const_iterator _iter106;
+ for (_iter106 = this->strategy_options.begin(); _iter106 != this->strategy_options.end(); ++_iter106)
+ {
+ xfer += oprot->writeString(_iter106->first);
+ xfer += oprot->writeString(_iter106->second);
+ }
+ xfer += oprot->writeMapEnd();
+ }
+ xfer += oprot->writeFieldEnd();
+ }
+ if (this->__isset.replication_factor) {
+ xfer += oprot->writeFieldBegin("replication_factor", ::apache::thrift::protocol::T_I32, 4);
+ xfer += oprot->writeI32(this->replication_factor);
+ xfer += oprot->writeFieldEnd();
+ }
+ xfer += oprot->writeFieldBegin("cf_defs", ::apache::thrift::protocol::T_LIST, 5);
+ {
+ xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast<uint32_t>(this->cf_defs.size()));
+ std::vector<CfDef> ::const_iterator _iter107;
+ for (_iter107 = this->cf_defs.begin(); _iter107 != this->cf_defs.end(); ++_iter107)
+ {
+ xfer += (*_iter107).write(oprot);
+ }
+ xfer += oprot->writeListEnd();
+ }
+ xfer += oprot->writeFieldEnd();
+ if (this->__isset.durable_writes) {
+ xfer += oprot->writeFieldBegin("durable_writes", ::apache::thrift::protocol::T_BOOL, 6);
+ xfer += oprot->writeBool(this->durable_writes);
+ xfer += oprot->writeFieldEnd();
+ }
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+const char* CqlRow::ascii_fingerprint = "470EFC558004E98D92D604898305C04E";
+const uint8_t CqlRow::binary_fingerprint[16] = {0x47,0x0E,0xFC,0x55,0x80,0x04,0xE9,0x8D,0x92,0xD6,0x04,0x89,0x83,0x05,0xC0,0x4E};
+
+uint32_t CqlRow::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+ bool isset_key = false;
+ bool isset_columns = false;
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readBinary(this->key);
+ isset_key = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 2:
+ if (ftype == ::apache::thrift::protocol::T_LIST) {
+ {
+ this->columns.clear();
+ uint32_t _size108;
+ ::apache::thrift::protocol::TType _etype111;
+ iprot->readListBegin(_etype111, _size108);
+ this->columns.resize(_size108);
+ uint32_t _i112;
+ for (_i112 = 0; _i112 < _size108; ++_i112)
+ {
+ xfer += this->columns[_i112].read(iprot);
+ }
+ iprot->readListEnd();
+ }
+ isset_columns = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ if (!isset_key)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ if (!isset_columns)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ return xfer;
+}
+
+uint32_t CqlRow::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("CqlRow");
+ xfer += oprot->writeFieldBegin("key", ::apache::thrift::protocol::T_STRING, 1);
+ xfer += oprot->writeBinary(this->key);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldBegin("columns", ::apache::thrift::protocol::T_LIST, 2);
+ {
+ xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast<uint32_t>(this->columns.size()));
+ std::vector<Column> ::const_iterator _iter113;
+ for (_iter113 = this->columns.begin(); _iter113 != this->columns.end(); ++_iter113)
+ {
+ xfer += (*_iter113).write(oprot);
+ }
+ xfer += oprot->writeListEnd();
+ }
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+const char* CqlMetadata::ascii_fingerprint = "B7C5A4AA9652C744A48EBC1C12D531E7";
+const uint8_t CqlMetadata::binary_fingerprint[16] = {0xB7,0xC5,0xA4,0xAA,0x96,0x52,0xC7,0x44,0xA4,0x8E,0xBC,0x1C,0x12,0xD5,0x31,0xE7};
+
+uint32_t CqlMetadata::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+ bool isset_name_types = false;
+ bool isset_value_types = false;
+ bool isset_default_name_type = false;
+ bool isset_default_value_type = false;
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_MAP) {
+ {
+ this->name_types.clear();
+ uint32_t _size114;
+ ::apache::thrift::protocol::TType _ktype115;
+ ::apache::thrift::protocol::TType _vtype116;
+ iprot->readMapBegin(_ktype115, _vtype116, _size114);
+ uint32_t _i118;
+ for (_i118 = 0; _i118 < _size114; ++_i118)
+ {
+ std::string _key119;
+ xfer += iprot->readBinary(_key119);
+ std::string& _val120 = this->name_types[_key119];
+ xfer += iprot->readString(_val120);
+ }
+ iprot->readMapEnd();
+ }
+ isset_name_types = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 2:
+ if (ftype == ::apache::thrift::protocol::T_MAP) {
+ {
+ this->value_types.clear();
+ uint32_t _size121;
+ ::apache::thrift::protocol::TType _ktype122;
+ ::apache::thrift::protocol::TType _vtype123;
+ iprot->readMapBegin(_ktype122, _vtype123, _size121);
+ uint32_t _i125;
+ for (_i125 = 0; _i125 < _size121; ++_i125)
+ {
+ std::string _key126;
+ xfer += iprot->readBinary(_key126);
+ std::string& _val127 = this->value_types[_key126];
+ xfer += iprot->readString(_val127);
+ }
+ iprot->readMapEnd();
+ }
+ isset_value_types = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 3:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readString(this->default_name_type);
+ isset_default_name_type = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 4:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readString(this->default_value_type);
+ isset_default_value_type = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ if (!isset_name_types)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ if (!isset_value_types)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ if (!isset_default_name_type)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ if (!isset_default_value_type)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ return xfer;
+}
+
+uint32_t CqlMetadata::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("CqlMetadata");
+ xfer += oprot->writeFieldBegin("name_types", ::apache::thrift::protocol::T_MAP, 1);
+ {
+ xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_STRING, static_cast<uint32_t>(this->name_types.size()));
+ std::map<std::string, std::string> ::const_iterator _iter128;
+ for (_iter128 = this->name_types.begin(); _iter128 != this->name_types.end(); ++_iter128)
+ {
+ xfer += oprot->writeBinary(_iter128->first);
+ xfer += oprot->writeString(_iter128->second);
+ }
+ xfer += oprot->writeMapEnd();
+ }
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldBegin("value_types", ::apache::thrift::protocol::T_MAP, 2);
+ {
+ xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_STRING, static_cast<uint32_t>(this->value_types.size()));
+ std::map<std::string, std::string> ::const_iterator _iter129;
+ for (_iter129 = this->value_types.begin(); _iter129 != this->value_types.end(); ++_iter129)
+ {
+ xfer += oprot->writeBinary(_iter129->first);
+ xfer += oprot->writeString(_iter129->second);
+ }
+ xfer += oprot->writeMapEnd();
+ }
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldBegin("default_name_type", ::apache::thrift::protocol::T_STRING, 3);
+ xfer += oprot->writeString(this->default_name_type);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldBegin("default_value_type", ::apache::thrift::protocol::T_STRING, 4);
+ xfer += oprot->writeString(this->default_value_type);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+const char* CqlResult::ascii_fingerprint = "521B9CE5AF77539F7267F6952B609E81";
+const uint8_t CqlResult::binary_fingerprint[16] = {0x52,0x1B,0x9C,0xE5,0xAF,0x77,0x53,0x9F,0x72,0x67,0xF6,0x95,0x2B,0x60,0x9E,0x81};
+
+uint32_t CqlResult::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+ bool isset_type = false;
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_I32) {
+ int32_t ecast130;
+ xfer += iprot->readI32(ecast130);
+ this->type = (CqlResultType::type)ecast130;
+ isset_type = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 2:
+ if (ftype == ::apache::thrift::protocol::T_LIST) {
+ {
+ this->rows.clear();
+ uint32_t _size131;
+ ::apache::thrift::protocol::TType _etype134;
+ iprot->readListBegin(_etype134, _size131);
+ this->rows.resize(_size131);
+ uint32_t _i135;
+ for (_i135 = 0; _i135 < _size131; ++_i135)
+ {
+ xfer += this->rows[_i135].read(iprot);
+ }
+ iprot->readListEnd();
+ }
+ this->__isset.rows = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 3:
+ if (ftype == ::apache::thrift::protocol::T_I32) {
+ xfer += iprot->readI32(this->num);
+ this->__isset.num = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 4:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->schema.read(iprot);
+ this->__isset.schema = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ if (!isset_type)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ return xfer;
+}
+
+uint32_t CqlResult::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("CqlResult");
+ xfer += oprot->writeFieldBegin("type", ::apache::thrift::protocol::T_I32, 1);
+ xfer += oprot->writeI32((int32_t)this->type);
+ xfer += oprot->writeFieldEnd();
+ if (this->__isset.rows) {
+ xfer += oprot->writeFieldBegin("rows", ::apache::thrift::protocol::T_LIST, 2);
+ {
+ xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast<uint32_t>(this->rows.size()));
+ std::vector<CqlRow> ::const_iterator _iter136;
+ for (_iter136 = this->rows.begin(); _iter136 != this->rows.end(); ++_iter136)
+ {
+ xfer += (*_iter136).write(oprot);
+ }
+ xfer += oprot->writeListEnd();
+ }
+ xfer += oprot->writeFieldEnd();
+ }
+ if (this->__isset.num) {
+ xfer += oprot->writeFieldBegin("num", ::apache::thrift::protocol::T_I32, 3);
+ xfer += oprot->writeI32(this->num);
+ xfer += oprot->writeFieldEnd();
+ }
+ if (this->__isset.schema) {
+ xfer += oprot->writeFieldBegin("schema", ::apache::thrift::protocol::T_STRUCT, 4);
+ xfer += this->schema.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ }
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+const char* CqlPreparedResult::ascii_fingerprint = "7E1663EC688DFDC28722BF36F9F64E6F";
+const uint8_t CqlPreparedResult::binary_fingerprint[16] = {0x7E,0x16,0x63,0xEC,0x68,0x8D,0xFD,0xC2,0x87,0x22,0xBF,0x36,0xF9,0xF6,0x4E,0x6F};
+
+uint32_t CqlPreparedResult::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+ bool isset_itemId = false;
+ bool isset_count = false;
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_I32) {
+ xfer += iprot->readI32(this->itemId);
+ isset_itemId = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 2:
+ if (ftype == ::apache::thrift::protocol::T_I32) {
+ xfer += iprot->readI32(this->count);
+ isset_count = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 3:
+ if (ftype == ::apache::thrift::protocol::T_LIST) {
+ {
+ this->variable_types.clear();
+ uint32_t _size137;
+ ::apache::thrift::protocol::TType _etype140;
+ iprot->readListBegin(_etype140, _size137);
+ this->variable_types.resize(_size137);
+ uint32_t _i141;
+ for (_i141 = 0; _i141 < _size137; ++_i141)
+ {
+ xfer += iprot->readString(this->variable_types[_i141]);
+ }
+ iprot->readListEnd();
+ }
+ this->__isset.variable_types = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 4:
+ if (ftype == ::apache::thrift::protocol::T_LIST) {
+ {
+ this->variable_names.clear();
+ uint32_t _size142;
+ ::apache::thrift::protocol::TType _etype145;
+ iprot->readListBegin(_etype145, _size142);
+ this->variable_names.resize(_size142);
+ uint32_t _i146;
+ for (_i146 = 0; _i146 < _size142; ++_i146)
+ {
+ xfer += iprot->readString(this->variable_names[_i146]);
+ }
+ iprot->readListEnd();
+ }
+ this->__isset.variable_names = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ if (!isset_itemId)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ if (!isset_count)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ return xfer;
+}
+
+uint32_t CqlPreparedResult::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("CqlPreparedResult");
+ xfer += oprot->writeFieldBegin("itemId", ::apache::thrift::protocol::T_I32, 1);
+ xfer += oprot->writeI32(this->itemId);
+ xfer += oprot->writeFieldEnd();
+ xfer += oprot->writeFieldBegin("count", ::apache::thrift::protocol::T_I32, 2);
+ xfer += oprot->writeI32(this->count);
+ xfer += oprot->writeFieldEnd();
+ if (this->__isset.variable_types) {
+ xfer += oprot->writeFieldBegin("variable_types", ::apache::thrift::protocol::T_LIST, 3);
+ {
+ xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast<uint32_t>(this->variable_types.size()));
+ std::vector<std::string> ::const_iterator _iter147;
+ for (_iter147 = this->variable_types.begin(); _iter147 != this->variable_types.end(); ++_iter147)
+ {
+ xfer += oprot->writeString((*_iter147));
+ }
+ xfer += oprot->writeListEnd();
+ }
+ xfer += oprot->writeFieldEnd();
+ }
+ if (this->__isset.variable_names) {
+ xfer += oprot->writeFieldBegin("variable_names", ::apache::thrift::protocol::T_LIST, 4);
+ {
+ xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast<uint32_t>(this->variable_names.size()));
+ std::vector<std::string> ::const_iterator _iter148;
+ for (_iter148 = this->variable_names.begin(); _iter148 != this->variable_names.end(); ++_iter148)
+ {
+ xfer += oprot->writeString((*_iter148));
+ }
+ xfer += oprot->writeListEnd();
+ }
+ xfer += oprot->writeFieldEnd();
+ }
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+}}} // namespace
diff --git a/storage/cassandra/gen-cpp/cassandra_types.h b/storage/cassandra/gen-cpp/cassandra_types.h
new file mode 100644
index 00000000000..d675198dcc8
--- /dev/null
+++ b/storage/cassandra/gen-cpp/cassandra_types.h
@@ -0,0 +1,2149 @@
+/**
+ * Autogenerated by Thrift Compiler (0.8.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+#ifndef cassandra_TYPES_H
+#define cassandra_TYPES_H
+
+#include <inttypes.h>
+#include <netinet/in.h>
+
+#include <Thrift.h>
+#include <TApplicationException.h>
+#include <protocol/TProtocol.h>
+#include <transport/TTransport.h>
+
+
+
+namespace org { namespace apache { namespace cassandra {
+
+struct ConsistencyLevel {
+ enum type {
+ ONE = 1,
+ QUORUM = 2,
+ LOCAL_QUORUM = 3,
+ EACH_QUORUM = 4,
+ ALL = 5,
+ ANY = 6,
+ TWO = 7,
+ THREE = 8
+ };
+};
+
+extern const std::map<int, const char*> _ConsistencyLevel_VALUES_TO_NAMES;
+
+struct IndexOperator {
+ enum type {
+ EQ = 0,
+ GTE = 1,
+ GT = 2,
+ LTE = 3,
+ LT = 4
+ };
+};
+
+extern const std::map<int, const char*> _IndexOperator_VALUES_TO_NAMES;
+
+struct IndexType {
+ enum type {
+ KEYS = 0,
+ CUSTOM = 1
+ };
+};
+
+extern const std::map<int, const char*> _IndexType_VALUES_TO_NAMES;
+
+struct Compression {
+ enum type {
+ GZIP = 1,
+ NONE = 2
+ };
+};
+
+extern const std::map<int, const char*> _Compression_VALUES_TO_NAMES;
+
+struct CqlResultType {
+ enum type {
+ ROWS = 1,
+ VOID = 2,
+ INT = 3
+ };
+};
+
+extern const std::map<int, const char*> _CqlResultType_VALUES_TO_NAMES;
+
+typedef struct _Column__isset {
+ _Column__isset() : value(false), timestamp(false), ttl(false) {}
+ bool value;
+ bool timestamp;
+ bool ttl;
+} _Column__isset;
+
+class Column {
+ public:
+
+ static const char* ascii_fingerprint; // = "3EE0E1C5C844001B62F08125068292CC";
+ static const uint8_t binary_fingerprint[16]; // = {0x3E,0xE0,0xE1,0xC5,0xC8,0x44,0x00,0x1B,0x62,0xF0,0x81,0x25,0x06,0x82,0x92,0xCC};
+
+ Column() : name(""), value(""), timestamp(0), ttl(0) {
+ }
+
+ virtual ~Column() throw() {}
+
+ std::string name;
+ std::string value;
+ int64_t timestamp;
+ int32_t ttl;
+
+ _Column__isset __isset;
+
+ void __set_name(const std::string& val) {
+ name = val;
+ }
+
+ void __set_value(const std::string& val) {
+ value = val;
+ __isset.value = true;
+ }
+
+ void __set_timestamp(const int64_t val) {
+ timestamp = val;
+ __isset.timestamp = true;
+ }
+
+ void __set_ttl(const int32_t val) {
+ ttl = val;
+ __isset.ttl = true;
+ }
+
+ bool operator == (const Column & rhs) const
+ {
+ if (!(name == rhs.name))
+ return false;
+ if (__isset.value != rhs.__isset.value)
+ return false;
+ else if (__isset.value && !(value == rhs.value))
+ return false;
+ if (__isset.timestamp != rhs.__isset.timestamp)
+ return false;
+ else if (__isset.timestamp && !(timestamp == rhs.timestamp))
+ return false;
+ if (__isset.ttl != rhs.__isset.ttl)
+ return false;
+ else if (__isset.ttl && !(ttl == rhs.ttl))
+ return false;
+ return true;
+ }
+ bool operator != (const Column &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const Column & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+
+class SuperColumn {
+ public:
+
+ static const char* ascii_fingerprint; // = "470EFC558004E98D92D604898305C04E";
+ static const uint8_t binary_fingerprint[16]; // = {0x47,0x0E,0xFC,0x55,0x80,0x04,0xE9,0x8D,0x92,0xD6,0x04,0x89,0x83,0x05,0xC0,0x4E};
+
+ SuperColumn() : name("") {
+ }
+
+ virtual ~SuperColumn() throw() {}
+
+ std::string name;
+ std::vector<Column> columns;
+
+ void __set_name(const std::string& val) {
+ name = val;
+ }
+
+ void __set_columns(const std::vector<Column> & val) {
+ columns = val;
+ }
+
+ bool operator == (const SuperColumn & rhs) const
+ {
+ if (!(name == rhs.name))
+ return false;
+ if (!(columns == rhs.columns))
+ return false;
+ return true;
+ }
+ bool operator != (const SuperColumn &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const SuperColumn & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+
+class CounterColumn {
+ public:
+
+ static const char* ascii_fingerprint; // = "1CCCF6FC31CFD1D61BBBB1BAF3590620";
+ static const uint8_t binary_fingerprint[16]; // = {0x1C,0xCC,0xF6,0xFC,0x31,0xCF,0xD1,0xD6,0x1B,0xBB,0xB1,0xBA,0xF3,0x59,0x06,0x20};
+
+ CounterColumn() : name(""), value(0) {
+ }
+
+ virtual ~CounterColumn() throw() {}
+
+ std::string name;
+ int64_t value;
+
+ void __set_name(const std::string& val) {
+ name = val;
+ }
+
+ void __set_value(const int64_t val) {
+ value = val;
+ }
+
+ bool operator == (const CounterColumn & rhs) const
+ {
+ if (!(name == rhs.name))
+ return false;
+ if (!(value == rhs.value))
+ return false;
+ return true;
+ }
+ bool operator != (const CounterColumn &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const CounterColumn & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+
+class CounterSuperColumn {
+ public:
+
+ static const char* ascii_fingerprint; // = "CD4C8C4BF7753E46DE417CDE369343A4";
+ static const uint8_t binary_fingerprint[16]; // = {0xCD,0x4C,0x8C,0x4B,0xF7,0x75,0x3E,0x46,0xDE,0x41,0x7C,0xDE,0x36,0x93,0x43,0xA4};
+
+ CounterSuperColumn() : name("") {
+ }
+
+ virtual ~CounterSuperColumn() throw() {}
+
+ std::string name;
+ std::vector<CounterColumn> columns;
+
+ void __set_name(const std::string& val) {
+ name = val;
+ }
+
+ void __set_columns(const std::vector<CounterColumn> & val) {
+ columns = val;
+ }
+
+ bool operator == (const CounterSuperColumn & rhs) const
+ {
+ if (!(name == rhs.name))
+ return false;
+ if (!(columns == rhs.columns))
+ return false;
+ return true;
+ }
+ bool operator != (const CounterSuperColumn &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const CounterSuperColumn & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+typedef struct _ColumnOrSuperColumn__isset {
+ _ColumnOrSuperColumn__isset() : column(false), super_column(false), counter_column(false), counter_super_column(false) {}
+ bool column;
+ bool super_column;
+ bool counter_column;
+ bool counter_super_column;
+} _ColumnOrSuperColumn__isset;
+
+class ColumnOrSuperColumn {
+ public:
+
+ static const char* ascii_fingerprint; // = "2B34AC9E80F1DAA3A2A63B1AB1841E61";
+ static const uint8_t binary_fingerprint[16]; // = {0x2B,0x34,0xAC,0x9E,0x80,0xF1,0xDA,0xA3,0xA2,0xA6,0x3B,0x1A,0xB1,0x84,0x1E,0x61};
+
+ ColumnOrSuperColumn() {
+ }
+
+ virtual ~ColumnOrSuperColumn() throw() {}
+
+ Column column;
+ SuperColumn super_column;
+ CounterColumn counter_column;
+ CounterSuperColumn counter_super_column;
+
+ _ColumnOrSuperColumn__isset __isset;
+
+ void __set_column(const Column& val) {
+ column = val;
+ __isset.column = true;
+ }
+
+ void __set_super_column(const SuperColumn& val) {
+ super_column = val;
+ __isset.super_column = true;
+ }
+
+ void __set_counter_column(const CounterColumn& val) {
+ counter_column = val;
+ __isset.counter_column = true;
+ }
+
+ void __set_counter_super_column(const CounterSuperColumn& val) {
+ counter_super_column = val;
+ __isset.counter_super_column = true;
+ }
+
+ bool operator == (const ColumnOrSuperColumn & rhs) const
+ {
+ if (__isset.column != rhs.__isset.column)
+ return false;
+ else if (__isset.column && !(column == rhs.column))
+ return false;
+ if (__isset.super_column != rhs.__isset.super_column)
+ return false;
+ else if (__isset.super_column && !(super_column == rhs.super_column))
+ return false;
+ if (__isset.counter_column != rhs.__isset.counter_column)
+ return false;
+ else if (__isset.counter_column && !(counter_column == rhs.counter_column))
+ return false;
+ if (__isset.counter_super_column != rhs.__isset.counter_super_column)
+ return false;
+ else if (__isset.counter_super_column && !(counter_super_column == rhs.counter_super_column))
+ return false;
+ return true;
+ }
+ bool operator != (const ColumnOrSuperColumn &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const ColumnOrSuperColumn & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+
+class NotFoundException : public ::apache::thrift::TException {
+ public:
+
+ static const char* ascii_fingerprint; // = "99914B932BD37A50B983C5E7C90AE93B";
+ static const uint8_t binary_fingerprint[16]; // = {0x99,0x91,0x4B,0x93,0x2B,0xD3,0x7A,0x50,0xB9,0x83,0xC5,0xE7,0xC9,0x0A,0xE9,0x3B};
+
+ NotFoundException() {
+ }
+
+ virtual ~NotFoundException() throw() {}
+
+
+ bool operator == (const NotFoundException & /* rhs */) const
+ {
+ return true;
+ }
+ bool operator != (const NotFoundException &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const NotFoundException & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+
+class InvalidRequestException : public ::apache::thrift::TException {
+ public:
+
+ static const char* ascii_fingerprint; // = "EFB929595D312AC8F305D5A794CFEDA1";
+ static const uint8_t binary_fingerprint[16]; // = {0xEF,0xB9,0x29,0x59,0x5D,0x31,0x2A,0xC8,0xF3,0x05,0xD5,0xA7,0x94,0xCF,0xED,0xA1};
+
+ InvalidRequestException() : why("") {
+ }
+
+ virtual ~InvalidRequestException() throw() {}
+
+ std::string why;
+
+ void __set_why(const std::string& val) {
+ why = val;
+ }
+
+ bool operator == (const InvalidRequestException & rhs) const
+ {
+ if (!(why == rhs.why))
+ return false;
+ return true;
+ }
+ bool operator != (const InvalidRequestException &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const InvalidRequestException & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+
+class UnavailableException : public ::apache::thrift::TException {
+ public:
+
+ static const char* ascii_fingerprint; // = "99914B932BD37A50B983C5E7C90AE93B";
+ static const uint8_t binary_fingerprint[16]; // = {0x99,0x91,0x4B,0x93,0x2B,0xD3,0x7A,0x50,0xB9,0x83,0xC5,0xE7,0xC9,0x0A,0xE9,0x3B};
+
+ UnavailableException() {
+ }
+
+ virtual ~UnavailableException() throw() {}
+
+
+ bool operator == (const UnavailableException & /* rhs */) const
+ {
+ return true;
+ }
+ bool operator != (const UnavailableException &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const UnavailableException & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+
+class TimedOutException : public ::apache::thrift::TException {
+ public:
+
+ static const char* ascii_fingerprint; // = "99914B932BD37A50B983C5E7C90AE93B";
+ static const uint8_t binary_fingerprint[16]; // = {0x99,0x91,0x4B,0x93,0x2B,0xD3,0x7A,0x50,0xB9,0x83,0xC5,0xE7,0xC9,0x0A,0xE9,0x3B};
+
+ TimedOutException() {
+ }
+
+ virtual ~TimedOutException() throw() {}
+
+
+ bool operator == (const TimedOutException & /* rhs */) const
+ {
+ return true;
+ }
+ bool operator != (const TimedOutException &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const TimedOutException & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+
+class AuthenticationException : public ::apache::thrift::TException {
+ public:
+
+ static const char* ascii_fingerprint; // = "EFB929595D312AC8F305D5A794CFEDA1";
+ static const uint8_t binary_fingerprint[16]; // = {0xEF,0xB9,0x29,0x59,0x5D,0x31,0x2A,0xC8,0xF3,0x05,0xD5,0xA7,0x94,0xCF,0xED,0xA1};
+
+ AuthenticationException() : why("") {
+ }
+
+ virtual ~AuthenticationException() throw() {}
+
+ std::string why;
+
+ void __set_why(const std::string& val) {
+ why = val;
+ }
+
+ bool operator == (const AuthenticationException & rhs) const
+ {
+ if (!(why == rhs.why))
+ return false;
+ return true;
+ }
+ bool operator != (const AuthenticationException &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const AuthenticationException & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+
+class AuthorizationException : public ::apache::thrift::TException {
+ public:
+
+ static const char* ascii_fingerprint; // = "EFB929595D312AC8F305D5A794CFEDA1";
+ static const uint8_t binary_fingerprint[16]; // = {0xEF,0xB9,0x29,0x59,0x5D,0x31,0x2A,0xC8,0xF3,0x05,0xD5,0xA7,0x94,0xCF,0xED,0xA1};
+
+ AuthorizationException() : why("") {
+ }
+
+ virtual ~AuthorizationException() throw() {}
+
+ std::string why;
+
+ void __set_why(const std::string& val) {
+ why = val;
+ }
+
+ bool operator == (const AuthorizationException & rhs) const
+ {
+ if (!(why == rhs.why))
+ return false;
+ return true;
+ }
+ bool operator != (const AuthorizationException &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const AuthorizationException & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+
+class SchemaDisagreementException : public ::apache::thrift::TException {
+ public:
+
+ static const char* ascii_fingerprint; // = "99914B932BD37A50B983C5E7C90AE93B";
+ static const uint8_t binary_fingerprint[16]; // = {0x99,0x91,0x4B,0x93,0x2B,0xD3,0x7A,0x50,0xB9,0x83,0xC5,0xE7,0xC9,0x0A,0xE9,0x3B};
+
+ SchemaDisagreementException() {
+ }
+
+ virtual ~SchemaDisagreementException() throw() {}
+
+
+ bool operator == (const SchemaDisagreementException & /* rhs */) const
+ {
+ return true;
+ }
+ bool operator != (const SchemaDisagreementException &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const SchemaDisagreementException & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+typedef struct _ColumnParent__isset {
+ _ColumnParent__isset() : super_column(false) {}
+ bool super_column;
+} _ColumnParent__isset;
+
+class ColumnParent {
+ public:
+
+ static const char* ascii_fingerprint; // = "0A13AE61181713A4100DFFB3EC293822";
+ static const uint8_t binary_fingerprint[16]; // = {0x0A,0x13,0xAE,0x61,0x18,0x17,0x13,0xA4,0x10,0x0D,0xFF,0xB3,0xEC,0x29,0x38,0x22};
+
+ ColumnParent() : column_family(""), super_column("") {
+ }
+
+ virtual ~ColumnParent() throw() {}
+
+ std::string column_family;
+ std::string super_column;
+
+ _ColumnParent__isset __isset;
+
+ void __set_column_family(const std::string& val) {
+ column_family = val;
+ }
+
+ void __set_super_column(const std::string& val) {
+ super_column = val;
+ __isset.super_column = true;
+ }
+
+ bool operator == (const ColumnParent & rhs) const
+ {
+ if (!(column_family == rhs.column_family))
+ return false;
+ if (__isset.super_column != rhs.__isset.super_column)
+ return false;
+ else if (__isset.super_column && !(super_column == rhs.super_column))
+ return false;
+ return true;
+ }
+ bool operator != (const ColumnParent &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const ColumnParent & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+typedef struct _ColumnPath__isset {
+ _ColumnPath__isset() : super_column(false), column(false) {}
+ bool super_column;
+ bool column;
+} _ColumnPath__isset;
+
+class ColumnPath {
+ public:
+
+ static const char* ascii_fingerprint; // = "606212895BCF63C757913CF35AEB3462";
+ static const uint8_t binary_fingerprint[16]; // = {0x60,0x62,0x12,0x89,0x5B,0xCF,0x63,0xC7,0x57,0x91,0x3C,0xF3,0x5A,0xEB,0x34,0x62};
+
+ ColumnPath() : column_family(""), super_column(""), column("") {
+ }
+
+ virtual ~ColumnPath() throw() {}
+
+ std::string column_family;
+ std::string super_column;
+ std::string column;
+
+ _ColumnPath__isset __isset;
+
+ void __set_column_family(const std::string& val) {
+ column_family = val;
+ }
+
+ void __set_super_column(const std::string& val) {
+ super_column = val;
+ __isset.super_column = true;
+ }
+
+ void __set_column(const std::string& val) {
+ column = val;
+ __isset.column = true;
+ }
+
+ bool operator == (const ColumnPath & rhs) const
+ {
+ if (!(column_family == rhs.column_family))
+ return false;
+ if (__isset.super_column != rhs.__isset.super_column)
+ return false;
+ else if (__isset.super_column && !(super_column == rhs.super_column))
+ return false;
+ if (__isset.column != rhs.__isset.column)
+ return false;
+ else if (__isset.column && !(column == rhs.column))
+ return false;
+ return true;
+ }
+ bool operator != (const ColumnPath &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const ColumnPath & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+
+class SliceRange {
+ public:
+
+ static const char* ascii_fingerprint; // = "184D24C9A0B8D4415E234DB649CAE740";
+ static const uint8_t binary_fingerprint[16]; // = {0x18,0x4D,0x24,0xC9,0xA0,0xB8,0xD4,0x41,0x5E,0x23,0x4D,0xB6,0x49,0xCA,0xE7,0x40};
+
+ SliceRange() : start(""), finish(""), reversed(false), count(100) {
+ }
+
+ virtual ~SliceRange() throw() {}
+
+ std::string start;
+ std::string finish;
+ bool reversed;
+ int32_t count;
+
+ void __set_start(const std::string& val) {
+ start = val;
+ }
+
+ void __set_finish(const std::string& val) {
+ finish = val;
+ }
+
+ void __set_reversed(const bool val) {
+ reversed = val;
+ }
+
+ void __set_count(const int32_t val) {
+ count = val;
+ }
+
+ bool operator == (const SliceRange & rhs) const
+ {
+ if (!(start == rhs.start))
+ return false;
+ if (!(finish == rhs.finish))
+ return false;
+ if (!(reversed == rhs.reversed))
+ return false;
+ if (!(count == rhs.count))
+ return false;
+ return true;
+ }
+ bool operator != (const SliceRange &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const SliceRange & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+typedef struct _SlicePredicate__isset {
+ _SlicePredicate__isset() : column_names(false), slice_range(false) {}
+ bool column_names;
+ bool slice_range;
+} _SlicePredicate__isset;
+
+class SlicePredicate {
+ public:
+
+ static const char* ascii_fingerprint; // = "F59D1D81C17DFFAF09988BF1C9CE5E27";
+ static const uint8_t binary_fingerprint[16]; // = {0xF5,0x9D,0x1D,0x81,0xC1,0x7D,0xFF,0xAF,0x09,0x98,0x8B,0xF1,0xC9,0xCE,0x5E,0x27};
+
+ SlicePredicate() {
+ }
+
+ virtual ~SlicePredicate() throw() {}
+
+ std::vector<std::string> column_names;
+ SliceRange slice_range;
+
+ _SlicePredicate__isset __isset;
+
+ void __set_column_names(const std::vector<std::string> & val) {
+ column_names = val;
+ __isset.column_names = true;
+ }
+
+ void __set_slice_range(const SliceRange& val) {
+ slice_range = val;
+ __isset.slice_range = true;
+ }
+
+ bool operator == (const SlicePredicate & rhs) const
+ {
+ if (__isset.column_names != rhs.__isset.column_names)
+ return false;
+ else if (__isset.column_names && !(column_names == rhs.column_names))
+ return false;
+ if (__isset.slice_range != rhs.__isset.slice_range)
+ return false;
+ else if (__isset.slice_range && !(slice_range == rhs.slice_range))
+ return false;
+ return true;
+ }
+ bool operator != (const SlicePredicate &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const SlicePredicate & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+
+class IndexExpression {
+ public:
+
+ static const char* ascii_fingerprint; // = "D9F4CFE2F293A8B1052FD3031DD2C847";
+ static const uint8_t binary_fingerprint[16]; // = {0xD9,0xF4,0xCF,0xE2,0xF2,0x93,0xA8,0xB1,0x05,0x2F,0xD3,0x03,0x1D,0xD2,0xC8,0x47};
+
+ IndexExpression() : column_name(""), op((IndexOperator::type)0), value("") {
+ }
+
+ virtual ~IndexExpression() throw() {}
+
+ std::string column_name;
+ IndexOperator::type op;
+ std::string value;
+
+ void __set_column_name(const std::string& val) {
+ column_name = val;
+ }
+
+ void __set_op(const IndexOperator::type val) {
+ op = val;
+ }
+
+ void __set_value(const std::string& val) {
+ value = val;
+ }
+
+ bool operator == (const IndexExpression & rhs) const
+ {
+ if (!(column_name == rhs.column_name))
+ return false;
+ if (!(op == rhs.op))
+ return false;
+ if (!(value == rhs.value))
+ return false;
+ return true;
+ }
+ bool operator != (const IndexExpression &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const IndexExpression & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+
+class IndexClause {
+ public:
+
+ static const char* ascii_fingerprint; // = "9B551B9AB86120B0EEA9005C77FD3C1F";
+ static const uint8_t binary_fingerprint[16]; // = {0x9B,0x55,0x1B,0x9A,0xB8,0x61,0x20,0xB0,0xEE,0xA9,0x00,0x5C,0x77,0xFD,0x3C,0x1F};
+
+ IndexClause() : start_key(""), count(100) {
+ }
+
+ virtual ~IndexClause() throw() {}
+
+ std::vector<IndexExpression> expressions;
+ std::string start_key;
+ int32_t count;
+
+ void __set_expressions(const std::vector<IndexExpression> & val) {
+ expressions = val;
+ }
+
+ void __set_start_key(const std::string& val) {
+ start_key = val;
+ }
+
+ void __set_count(const int32_t val) {
+ count = val;
+ }
+
+ bool operator == (const IndexClause & rhs) const
+ {
+ if (!(expressions == rhs.expressions))
+ return false;
+ if (!(start_key == rhs.start_key))
+ return false;
+ if (!(count == rhs.count))
+ return false;
+ return true;
+ }
+ bool operator != (const IndexClause &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const IndexClause & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+typedef struct _KeyRange__isset {
+ _KeyRange__isset() : start_key(false), end_key(false), start_token(false), end_token(false), row_filter(false) {}
+ bool start_key;
+ bool end_key;
+ bool start_token;
+ bool end_token;
+ bool row_filter;
+} _KeyRange__isset;
+
+class KeyRange {
+ public:
+
+ static const char* ascii_fingerprint; // = "A6EC82FA0980B91C7C8EB013C61CA1B0";
+ static const uint8_t binary_fingerprint[16]; // = {0xA6,0xEC,0x82,0xFA,0x09,0x80,0xB9,0x1C,0x7C,0x8E,0xB0,0x13,0xC6,0x1C,0xA1,0xB0};
+
+ KeyRange() : start_key(""), end_key(""), start_token(""), end_token(""), count(100) {
+ }
+
+ virtual ~KeyRange() throw() {}
+
+ std::string start_key;
+ std::string end_key;
+ std::string start_token;
+ std::string end_token;
+ std::vector<IndexExpression> row_filter;
+ int32_t count;
+
+ _KeyRange__isset __isset;
+
+ void __set_start_key(const std::string& val) {
+ start_key = val;
+ __isset.start_key = true;
+ }
+
+ void __set_end_key(const std::string& val) {
+ end_key = val;
+ __isset.end_key = true;
+ }
+
+ void __set_start_token(const std::string& val) {
+ start_token = val;
+ __isset.start_token = true;
+ }
+
+ void __set_end_token(const std::string& val) {
+ end_token = val;
+ __isset.end_token = true;
+ }
+
+ void __set_row_filter(const std::vector<IndexExpression> & val) {
+ row_filter = val;
+ __isset.row_filter = true;
+ }
+
+ void __set_count(const int32_t val) {
+ count = val;
+ }
+
+ bool operator == (const KeyRange & rhs) const
+ {
+ if (__isset.start_key != rhs.__isset.start_key)
+ return false;
+ else if (__isset.start_key && !(start_key == rhs.start_key))
+ return false;
+ if (__isset.end_key != rhs.__isset.end_key)
+ return false;
+ else if (__isset.end_key && !(end_key == rhs.end_key))
+ return false;
+ if (__isset.start_token != rhs.__isset.start_token)
+ return false;
+ else if (__isset.start_token && !(start_token == rhs.start_token))
+ return false;
+ if (__isset.end_token != rhs.__isset.end_token)
+ return false;
+ else if (__isset.end_token && !(end_token == rhs.end_token))
+ return false;
+ if (__isset.row_filter != rhs.__isset.row_filter)
+ return false;
+ else if (__isset.row_filter && !(row_filter == rhs.row_filter))
+ return false;
+ if (!(count == rhs.count))
+ return false;
+ return true;
+ }
+ bool operator != (const KeyRange &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const KeyRange & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+
+class KeySlice {
+ public:
+
+ static const char* ascii_fingerprint; // = "D1568675B0C135C909E3169B72A4DA3D";
+ static const uint8_t binary_fingerprint[16]; // = {0xD1,0x56,0x86,0x75,0xB0,0xC1,0x35,0xC9,0x09,0xE3,0x16,0x9B,0x72,0xA4,0xDA,0x3D};
+
+ KeySlice() : key("") {
+ }
+
+ virtual ~KeySlice() throw() {}
+
+ std::string key;
+ std::vector<ColumnOrSuperColumn> columns;
+
+ void __set_key(const std::string& val) {
+ key = val;
+ }
+
+ void __set_columns(const std::vector<ColumnOrSuperColumn> & val) {
+ columns = val;
+ }
+
+ bool operator == (const KeySlice & rhs) const
+ {
+ if (!(key == rhs.key))
+ return false;
+ if (!(columns == rhs.columns))
+ return false;
+ return true;
+ }
+ bool operator != (const KeySlice &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const KeySlice & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+
+class KeyCount {
+ public:
+
+ static const char* ascii_fingerprint; // = "EEBC915CE44901401D881E6091423036";
+ static const uint8_t binary_fingerprint[16]; // = {0xEE,0xBC,0x91,0x5C,0xE4,0x49,0x01,0x40,0x1D,0x88,0x1E,0x60,0x91,0x42,0x30,0x36};
+
+ KeyCount() : key(""), count(0) {
+ }
+
+ virtual ~KeyCount() throw() {}
+
+ std::string key;
+ int32_t count;
+
+ void __set_key(const std::string& val) {
+ key = val;
+ }
+
+ void __set_count(const int32_t val) {
+ count = val;
+ }
+
+ bool operator == (const KeyCount & rhs) const
+ {
+ if (!(key == rhs.key))
+ return false;
+ if (!(count == rhs.count))
+ return false;
+ return true;
+ }
+ bool operator != (const KeyCount &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const KeyCount & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+typedef struct _Deletion__isset {
+ _Deletion__isset() : timestamp(false), super_column(false), predicate(false) {}
+ bool timestamp;
+ bool super_column;
+ bool predicate;
+} _Deletion__isset;
+
+class Deletion {
+ public:
+
+ static const char* ascii_fingerprint; // = "40F33ECF1C932CA77C2414C4E6C60CBE";
+ static const uint8_t binary_fingerprint[16]; // = {0x40,0xF3,0x3E,0xCF,0x1C,0x93,0x2C,0xA7,0x7C,0x24,0x14,0xC4,0xE6,0xC6,0x0C,0xBE};
+
+ Deletion() : timestamp(0), super_column("") {
+ }
+
+ virtual ~Deletion() throw() {}
+
+ int64_t timestamp;
+ std::string super_column;
+ SlicePredicate predicate;
+
+ _Deletion__isset __isset;
+
+ void __set_timestamp(const int64_t val) {
+ timestamp = val;
+ __isset.timestamp = true;
+ }
+
+ void __set_super_column(const std::string& val) {
+ super_column = val;
+ __isset.super_column = true;
+ }
+
+ void __set_predicate(const SlicePredicate& val) {
+ predicate = val;
+ __isset.predicate = true;
+ }
+
+ bool operator == (const Deletion & rhs) const
+ {
+ if (__isset.timestamp != rhs.__isset.timestamp)
+ return false;
+ else if (__isset.timestamp && !(timestamp == rhs.timestamp))
+ return false;
+ if (__isset.super_column != rhs.__isset.super_column)
+ return false;
+ else if (__isset.super_column && !(super_column == rhs.super_column))
+ return false;
+ if (__isset.predicate != rhs.__isset.predicate)
+ return false;
+ else if (__isset.predicate && !(predicate == rhs.predicate))
+ return false;
+ return true;
+ }
+ bool operator != (const Deletion &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const Deletion & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+typedef struct _Mutation__isset {
+ _Mutation__isset() : column_or_supercolumn(false), deletion(false) {}
+ bool column_or_supercolumn;
+ bool deletion;
+} _Mutation__isset;
+
+class Mutation {
+ public:
+
+ static const char* ascii_fingerprint; // = "E8B65DF3979C6868F80DF81F8E769E63";
+ static const uint8_t binary_fingerprint[16]; // = {0xE8,0xB6,0x5D,0xF3,0x97,0x9C,0x68,0x68,0xF8,0x0D,0xF8,0x1F,0x8E,0x76,0x9E,0x63};
+
+ Mutation() {
+ }
+
+ virtual ~Mutation() throw() {}
+
+ ColumnOrSuperColumn column_or_supercolumn;
+ Deletion deletion;
+
+ _Mutation__isset __isset;
+
+ void __set_column_or_supercolumn(const ColumnOrSuperColumn& val) {
+ column_or_supercolumn = val;
+ __isset.column_or_supercolumn = true;
+ }
+
+ void __set_deletion(const Deletion& val) {
+ deletion = val;
+ __isset.deletion = true;
+ }
+
+ bool operator == (const Mutation & rhs) const
+ {
+ if (__isset.column_or_supercolumn != rhs.__isset.column_or_supercolumn)
+ return false;
+ else if (__isset.column_or_supercolumn && !(column_or_supercolumn == rhs.column_or_supercolumn))
+ return false;
+ if (__isset.deletion != rhs.__isset.deletion)
+ return false;
+ else if (__isset.deletion && !(deletion == rhs.deletion))
+ return false;
+ return true;
+ }
+ bool operator != (const Mutation &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const Mutation & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+typedef struct _EndpointDetails__isset {
+ _EndpointDetails__isset() : host(false), datacenter(false), rack(false) {}
+ bool host;
+ bool datacenter;
+ bool rack;
+} _EndpointDetails__isset;
+
+class EndpointDetails {
+ public:
+
+ static const char* ascii_fingerprint; // = "F4A50F0EC638C7F66026F9B6678FD89B";
+ static const uint8_t binary_fingerprint[16]; // = {0xF4,0xA5,0x0F,0x0E,0xC6,0x38,0xC7,0xF6,0x60,0x26,0xF9,0xB6,0x67,0x8F,0xD8,0x9B};
+
+ EndpointDetails() : host(""), datacenter(""), rack("") {
+ }
+
+ virtual ~EndpointDetails() throw() {}
+
+ std::string host;
+ std::string datacenter;
+ std::string rack;
+
+ _EndpointDetails__isset __isset;
+
+ void __set_host(const std::string& val) {
+ host = val;
+ }
+
+ void __set_datacenter(const std::string& val) {
+ datacenter = val;
+ }
+
+ void __set_rack(const std::string& val) {
+ rack = val;
+ __isset.rack = true;
+ }
+
+ bool operator == (const EndpointDetails & rhs) const
+ {
+ if (!(host == rhs.host))
+ return false;
+ if (!(datacenter == rhs.datacenter))
+ return false;
+ if (__isset.rack != rhs.__isset.rack)
+ return false;
+ else if (__isset.rack && !(rack == rhs.rack))
+ return false;
+ return true;
+ }
+ bool operator != (const EndpointDetails &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const EndpointDetails & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+typedef struct _TokenRange__isset {
+ _TokenRange__isset() : rpc_endpoints(false), endpoint_details(false) {}
+ bool rpc_endpoints;
+ bool endpoint_details;
+} _TokenRange__isset;
+
+class TokenRange {
+ public:
+
+ static const char* ascii_fingerprint; // = "832268DC4CD6B17EE8881FC57EA04679";
+ static const uint8_t binary_fingerprint[16]; // = {0x83,0x22,0x68,0xDC,0x4C,0xD6,0xB1,0x7E,0xE8,0x88,0x1F,0xC5,0x7E,0xA0,0x46,0x79};
+
+ TokenRange() : start_token(""), end_token("") {
+ }
+
+ virtual ~TokenRange() throw() {}
+
+ std::string start_token;
+ std::string end_token;
+ std::vector<std::string> endpoints;
+ std::vector<std::string> rpc_endpoints;
+ std::vector<EndpointDetails> endpoint_details;
+
+ _TokenRange__isset __isset;
+
+ void __set_start_token(const std::string& val) {
+ start_token = val;
+ }
+
+ void __set_end_token(const std::string& val) {
+ end_token = val;
+ }
+
+ void __set_endpoints(const std::vector<std::string> & val) {
+ endpoints = val;
+ }
+
+ void __set_rpc_endpoints(const std::vector<std::string> & val) {
+ rpc_endpoints = val;
+ __isset.rpc_endpoints = true;
+ }
+
+ void __set_endpoint_details(const std::vector<EndpointDetails> & val) {
+ endpoint_details = val;
+ __isset.endpoint_details = true;
+ }
+
+ bool operator == (const TokenRange & rhs) const
+ {
+ if (!(start_token == rhs.start_token))
+ return false;
+ if (!(end_token == rhs.end_token))
+ return false;
+ if (!(endpoints == rhs.endpoints))
+ return false;
+ if (__isset.rpc_endpoints != rhs.__isset.rpc_endpoints)
+ return false;
+ else if (__isset.rpc_endpoints && !(rpc_endpoints == rhs.rpc_endpoints))
+ return false;
+ if (__isset.endpoint_details != rhs.__isset.endpoint_details)
+ return false;
+ else if (__isset.endpoint_details && !(endpoint_details == rhs.endpoint_details))
+ return false;
+ return true;
+ }
+ bool operator != (const TokenRange &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const TokenRange & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+
+class AuthenticationRequest {
+ public:
+
+ static const char* ascii_fingerprint; // = "5EA2D527ECA3BA20C77AFC023EE8C05F";
+ static const uint8_t binary_fingerprint[16]; // = {0x5E,0xA2,0xD5,0x27,0xEC,0xA3,0xBA,0x20,0xC7,0x7A,0xFC,0x02,0x3E,0xE8,0xC0,0x5F};
+
+ AuthenticationRequest() {
+ }
+
+ virtual ~AuthenticationRequest() throw() {}
+
+ std::map<std::string, std::string> credentials;
+
+ void __set_credentials(const std::map<std::string, std::string> & val) {
+ credentials = val;
+ }
+
+ bool operator == (const AuthenticationRequest & rhs) const
+ {
+ if (!(credentials == rhs.credentials))
+ return false;
+ return true;
+ }
+ bool operator != (const AuthenticationRequest &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const AuthenticationRequest & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+typedef struct _ColumnDef__isset {
+ _ColumnDef__isset() : index_type(false), index_name(false), index_options(false) {}
+ bool index_type;
+ bool index_name;
+ bool index_options;
+} _ColumnDef__isset;
+
+class ColumnDef {
+ public:
+
+ static const char* ascii_fingerprint; // = "0D89CE83D7EDAD079AC3213ED1DCAA58";
+ static const uint8_t binary_fingerprint[16]; // = {0x0D,0x89,0xCE,0x83,0xD7,0xED,0xAD,0x07,0x9A,0xC3,0x21,0x3E,0xD1,0xDC,0xAA,0x58};
+
+ ColumnDef() : name(""), validation_class(""), index_type((IndexType::type)0), index_name("") {
+ }
+
+ virtual ~ColumnDef() throw() {}
+
+ std::string name;
+ std::string validation_class;
+ IndexType::type index_type;
+ std::string index_name;
+ std::map<std::string, std::string> index_options;
+
+ _ColumnDef__isset __isset;
+
+ void __set_name(const std::string& val) {
+ name = val;
+ }
+
+ void __set_validation_class(const std::string& val) {
+ validation_class = val;
+ }
+
+ void __set_index_type(const IndexType::type val) {
+ index_type = val;
+ __isset.index_type = true;
+ }
+
+ void __set_index_name(const std::string& val) {
+ index_name = val;
+ __isset.index_name = true;
+ }
+
+ void __set_index_options(const std::map<std::string, std::string> & val) {
+ index_options = val;
+ __isset.index_options = true;
+ }
+
+ bool operator == (const ColumnDef & rhs) const
+ {
+ if (!(name == rhs.name))
+ return false;
+ if (!(validation_class == rhs.validation_class))
+ return false;
+ if (__isset.index_type != rhs.__isset.index_type)
+ return false;
+ else if (__isset.index_type && !(index_type == rhs.index_type))
+ return false;
+ if (__isset.index_name != rhs.__isset.index_name)
+ return false;
+ else if (__isset.index_name && !(index_name == rhs.index_name))
+ return false;
+ if (__isset.index_options != rhs.__isset.index_options)
+ return false;
+ else if (__isset.index_options && !(index_options == rhs.index_options))
+ return false;
+ return true;
+ }
+ bool operator != (const ColumnDef &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const ColumnDef & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+typedef struct _CfDef__isset {
+ _CfDef__isset() : column_type(false), comparator_type(false), subcomparator_type(false), comment(false), read_repair_chance(false), column_metadata(false), gc_grace_seconds(false), default_validation_class(false), id(false), min_compaction_threshold(false), max_compaction_threshold(false), replicate_on_write(false), key_validation_class(false), key_alias(false), compaction_strategy(false), compaction_strategy_options(false), compression_options(false), bloom_filter_fp_chance(false), caching(false), dclocal_read_repair_chance(false), row_cache_size(false), key_cache_size(false), row_cache_save_period_in_seconds(false), key_cache_save_period_in_seconds(false), memtable_flush_after_mins(false), memtable_throughput_in_mb(false), memtable_operations_in_millions(false), merge_shards_chance(false), row_cache_provider(false), row_cache_keys_to_save(false) {}
+ bool column_type;
+ bool comparator_type;
+ bool subcomparator_type;
+ bool comment;
+ bool read_repair_chance;
+ bool column_metadata;
+ bool gc_grace_seconds;
+ bool default_validation_class;
+ bool id;
+ bool min_compaction_threshold;
+ bool max_compaction_threshold;
+ bool replicate_on_write;
+ bool key_validation_class;
+ bool key_alias;
+ bool compaction_strategy;
+ bool compaction_strategy_options;
+ bool compression_options;
+ bool bloom_filter_fp_chance;
+ bool caching;
+ bool dclocal_read_repair_chance;
+ bool row_cache_size;
+ bool key_cache_size;
+ bool row_cache_save_period_in_seconds;
+ bool key_cache_save_period_in_seconds;
+ bool memtable_flush_after_mins;
+ bool memtable_throughput_in_mb;
+ bool memtable_operations_in_millions;
+ bool merge_shards_chance;
+ bool row_cache_provider;
+ bool row_cache_keys_to_save;
+} _CfDef__isset;
+
+class CfDef {
+ public:
+
+ static const char* ascii_fingerprint; // = "231A260521B5DD99EFBCCBDD8768CA7D";
+ static const uint8_t binary_fingerprint[16]; // = {0x23,0x1A,0x26,0x05,0x21,0xB5,0xDD,0x99,0xEF,0xBC,0xCB,0xDD,0x87,0x68,0xCA,0x7D};
+
+ CfDef() : keyspace(""), name(""), column_type("Standard"), comparator_type("BytesType"), subcomparator_type(""), comment(""), read_repair_chance(0), gc_grace_seconds(0), default_validation_class(""), id(0), min_compaction_threshold(0), max_compaction_threshold(0), replicate_on_write(0), key_validation_class(""), key_alias(""), compaction_strategy(""), bloom_filter_fp_chance(0), caching("keys_only"), dclocal_read_repair_chance(0), row_cache_size(0), key_cache_size(0), row_cache_save_period_in_seconds(0), key_cache_save_period_in_seconds(0), memtable_flush_after_mins(0), memtable_throughput_in_mb(0), memtable_operations_in_millions(0), merge_shards_chance(0), row_cache_provider(""), row_cache_keys_to_save(0) {
+ }
+
+ virtual ~CfDef() throw() {}
+
+ std::string keyspace;
+ std::string name;
+ std::string column_type;
+ std::string comparator_type;
+ std::string subcomparator_type;
+ std::string comment;
+ double read_repair_chance;
+ std::vector<ColumnDef> column_metadata;
+ int32_t gc_grace_seconds;
+ std::string default_validation_class;
+ int32_t id;
+ int32_t min_compaction_threshold;
+ int32_t max_compaction_threshold;
+ bool replicate_on_write;
+ std::string key_validation_class;
+ std::string key_alias;
+ std::string compaction_strategy;
+ std::map<std::string, std::string> compaction_strategy_options;
+ std::map<std::string, std::string> compression_options;
+ double bloom_filter_fp_chance;
+ std::string caching;
+ double dclocal_read_repair_chance;
+ double row_cache_size;
+ double key_cache_size;
+ int32_t row_cache_save_period_in_seconds;
+ int32_t key_cache_save_period_in_seconds;
+ int32_t memtable_flush_after_mins;
+ int32_t memtable_throughput_in_mb;
+ double memtable_operations_in_millions;
+ double merge_shards_chance;
+ std::string row_cache_provider;
+ int32_t row_cache_keys_to_save;
+
+ _CfDef__isset __isset;
+
+ void __set_keyspace(const std::string& val) {
+ keyspace = val;
+ }
+
+ void __set_name(const std::string& val) {
+ name = val;
+ }
+
+ void __set_column_type(const std::string& val) {
+ column_type = val;
+ __isset.column_type = true;
+ }
+
+ void __set_comparator_type(const std::string& val) {
+ comparator_type = val;
+ __isset.comparator_type = true;
+ }
+
+ void __set_subcomparator_type(const std::string& val) {
+ subcomparator_type = val;
+ __isset.subcomparator_type = true;
+ }
+
+ void __set_comment(const std::string& val) {
+ comment = val;
+ __isset.comment = true;
+ }
+
+ void __set_read_repair_chance(const double val) {
+ read_repair_chance = val;
+ __isset.read_repair_chance = true;
+ }
+
+ void __set_column_metadata(const std::vector<ColumnDef> & val) {
+ column_metadata = val;
+ __isset.column_metadata = true;
+ }
+
+ void __set_gc_grace_seconds(const int32_t val) {
+ gc_grace_seconds = val;
+ __isset.gc_grace_seconds = true;
+ }
+
+ void __set_default_validation_class(const std::string& val) {
+ default_validation_class = val;
+ __isset.default_validation_class = true;
+ }
+
+ void __set_id(const int32_t val) {
+ id = val;
+ __isset.id = true;
+ }
+
+ void __set_min_compaction_threshold(const int32_t val) {
+ min_compaction_threshold = val;
+ __isset.min_compaction_threshold = true;
+ }
+
+ void __set_max_compaction_threshold(const int32_t val) {
+ max_compaction_threshold = val;
+ __isset.max_compaction_threshold = true;
+ }
+
+ void __set_replicate_on_write(const bool val) {
+ replicate_on_write = val;
+ __isset.replicate_on_write = true;
+ }
+
+ void __set_key_validation_class(const std::string& val) {
+ key_validation_class = val;
+ __isset.key_validation_class = true;
+ }
+
+ void __set_key_alias(const std::string& val) {
+ key_alias = val;
+ __isset.key_alias = true;
+ }
+
+ void __set_compaction_strategy(const std::string& val) {
+ compaction_strategy = val;
+ __isset.compaction_strategy = true;
+ }
+
+ void __set_compaction_strategy_options(const std::map<std::string, std::string> & val) {
+ compaction_strategy_options = val;
+ __isset.compaction_strategy_options = true;
+ }
+
+ void __set_compression_options(const std::map<std::string, std::string> & val) {
+ compression_options = val;
+ __isset.compression_options = true;
+ }
+
+ void __set_bloom_filter_fp_chance(const double val) {
+ bloom_filter_fp_chance = val;
+ __isset.bloom_filter_fp_chance = true;
+ }
+
+ void __set_caching(const std::string& val) {
+ caching = val;
+ __isset.caching = true;
+ }
+
+ void __set_dclocal_read_repair_chance(const double val) {
+ dclocal_read_repair_chance = val;
+ __isset.dclocal_read_repair_chance = true;
+ }
+
+ void __set_row_cache_size(const double val) {
+ row_cache_size = val;
+ __isset.row_cache_size = true;
+ }
+
+ void __set_key_cache_size(const double val) {
+ key_cache_size = val;
+ __isset.key_cache_size = true;
+ }
+
+ void __set_row_cache_save_period_in_seconds(const int32_t val) {
+ row_cache_save_period_in_seconds = val;
+ __isset.row_cache_save_period_in_seconds = true;
+ }
+
+ void __set_key_cache_save_period_in_seconds(const int32_t val) {
+ key_cache_save_period_in_seconds = val;
+ __isset.key_cache_save_period_in_seconds = true;
+ }
+
+ void __set_memtable_flush_after_mins(const int32_t val) {
+ memtable_flush_after_mins = val;
+ __isset.memtable_flush_after_mins = true;
+ }
+
+ void __set_memtable_throughput_in_mb(const int32_t val) {
+ memtable_throughput_in_mb = val;
+ __isset.memtable_throughput_in_mb = true;
+ }
+
+ void __set_memtable_operations_in_millions(const double val) {
+ memtable_operations_in_millions = val;
+ __isset.memtable_operations_in_millions = true;
+ }
+
+ void __set_merge_shards_chance(const double val) {
+ merge_shards_chance = val;
+ __isset.merge_shards_chance = true;
+ }
+
+ void __set_row_cache_provider(const std::string& val) {
+ row_cache_provider = val;
+ __isset.row_cache_provider = true;
+ }
+
+ void __set_row_cache_keys_to_save(const int32_t val) {
+ row_cache_keys_to_save = val;
+ __isset.row_cache_keys_to_save = true;
+ }
+
+ bool operator == (const CfDef & rhs) const
+ {
+ if (!(keyspace == rhs.keyspace))
+ return false;
+ if (!(name == rhs.name))
+ return false;
+ if (__isset.column_type != rhs.__isset.column_type)
+ return false;
+ else if (__isset.column_type && !(column_type == rhs.column_type))
+ return false;
+ if (__isset.comparator_type != rhs.__isset.comparator_type)
+ return false;
+ else if (__isset.comparator_type && !(comparator_type == rhs.comparator_type))
+ return false;
+ if (__isset.subcomparator_type != rhs.__isset.subcomparator_type)
+ return false;
+ else if (__isset.subcomparator_type && !(subcomparator_type == rhs.subcomparator_type))
+ return false;
+ if (__isset.comment != rhs.__isset.comment)
+ return false;
+ else if (__isset.comment && !(comment == rhs.comment))
+ return false;
+ if (__isset.read_repair_chance != rhs.__isset.read_repair_chance)
+ return false;
+ else if (__isset.read_repair_chance && !(read_repair_chance == rhs.read_repair_chance))
+ return false;
+ if (__isset.column_metadata != rhs.__isset.column_metadata)
+ return false;
+ else if (__isset.column_metadata && !(column_metadata == rhs.column_metadata))
+ return false;
+ if (__isset.gc_grace_seconds != rhs.__isset.gc_grace_seconds)
+ return false;
+ else if (__isset.gc_grace_seconds && !(gc_grace_seconds == rhs.gc_grace_seconds))
+ return false;
+ if (__isset.default_validation_class != rhs.__isset.default_validation_class)
+ return false;
+ else if (__isset.default_validation_class && !(default_validation_class == rhs.default_validation_class))
+ return false;
+ if (__isset.id != rhs.__isset.id)
+ return false;
+ else if (__isset.id && !(id == rhs.id))
+ return false;
+ if (__isset.min_compaction_threshold != rhs.__isset.min_compaction_threshold)
+ return false;
+ else if (__isset.min_compaction_threshold && !(min_compaction_threshold == rhs.min_compaction_threshold))
+ return false;
+ if (__isset.max_compaction_threshold != rhs.__isset.max_compaction_threshold)
+ return false;
+ else if (__isset.max_compaction_threshold && !(max_compaction_threshold == rhs.max_compaction_threshold))
+ return false;
+ if (__isset.replicate_on_write != rhs.__isset.replicate_on_write)
+ return false;
+ else if (__isset.replicate_on_write && !(replicate_on_write == rhs.replicate_on_write))
+ return false;
+ if (__isset.key_validation_class != rhs.__isset.key_validation_class)
+ return false;
+ else if (__isset.key_validation_class && !(key_validation_class == rhs.key_validation_class))
+ return false;
+ if (__isset.key_alias != rhs.__isset.key_alias)
+ return false;
+ else if (__isset.key_alias && !(key_alias == rhs.key_alias))
+ return false;
+ if (__isset.compaction_strategy != rhs.__isset.compaction_strategy)
+ return false;
+ else if (__isset.compaction_strategy && !(compaction_strategy == rhs.compaction_strategy))
+ return false;
+ if (__isset.compaction_strategy_options != rhs.__isset.compaction_strategy_options)
+ return false;
+ else if (__isset.compaction_strategy_options && !(compaction_strategy_options == rhs.compaction_strategy_options))
+ return false;
+ if (__isset.compression_options != rhs.__isset.compression_options)
+ return false;
+ else if (__isset.compression_options && !(compression_options == rhs.compression_options))
+ return false;
+ if (__isset.bloom_filter_fp_chance != rhs.__isset.bloom_filter_fp_chance)
+ return false;
+ else if (__isset.bloom_filter_fp_chance && !(bloom_filter_fp_chance == rhs.bloom_filter_fp_chance))
+ return false;
+ if (__isset.caching != rhs.__isset.caching)
+ return false;
+ else if (__isset.caching && !(caching == rhs.caching))
+ return false;
+ if (__isset.dclocal_read_repair_chance != rhs.__isset.dclocal_read_repair_chance)
+ return false;
+ else if (__isset.dclocal_read_repair_chance && !(dclocal_read_repair_chance == rhs.dclocal_read_repair_chance))
+ return false;
+ if (__isset.row_cache_size != rhs.__isset.row_cache_size)
+ return false;
+ else if (__isset.row_cache_size && !(row_cache_size == rhs.row_cache_size))
+ return false;
+ if (__isset.key_cache_size != rhs.__isset.key_cache_size)
+ return false;
+ else if (__isset.key_cache_size && !(key_cache_size == rhs.key_cache_size))
+ return false;
+ if (__isset.row_cache_save_period_in_seconds != rhs.__isset.row_cache_save_period_in_seconds)
+ return false;
+ else if (__isset.row_cache_save_period_in_seconds && !(row_cache_save_period_in_seconds == rhs.row_cache_save_period_in_seconds))
+ return false;
+ if (__isset.key_cache_save_period_in_seconds != rhs.__isset.key_cache_save_period_in_seconds)
+ return false;
+ else if (__isset.key_cache_save_period_in_seconds && !(key_cache_save_period_in_seconds == rhs.key_cache_save_period_in_seconds))
+ return false;
+ if (__isset.memtable_flush_after_mins != rhs.__isset.memtable_flush_after_mins)
+ return false;
+ else if (__isset.memtable_flush_after_mins && !(memtable_flush_after_mins == rhs.memtable_flush_after_mins))
+ return false;
+ if (__isset.memtable_throughput_in_mb != rhs.__isset.memtable_throughput_in_mb)
+ return false;
+ else if (__isset.memtable_throughput_in_mb && !(memtable_throughput_in_mb == rhs.memtable_throughput_in_mb))
+ return false;
+ if (__isset.memtable_operations_in_millions != rhs.__isset.memtable_operations_in_millions)
+ return false;
+ else if (__isset.memtable_operations_in_millions && !(memtable_operations_in_millions == rhs.memtable_operations_in_millions))
+ return false;
+ if (__isset.merge_shards_chance != rhs.__isset.merge_shards_chance)
+ return false;
+ else if (__isset.merge_shards_chance && !(merge_shards_chance == rhs.merge_shards_chance))
+ return false;
+ if (__isset.row_cache_provider != rhs.__isset.row_cache_provider)
+ return false;
+ else if (__isset.row_cache_provider && !(row_cache_provider == rhs.row_cache_provider))
+ return false;
+ if (__isset.row_cache_keys_to_save != rhs.__isset.row_cache_keys_to_save)
+ return false;
+ else if (__isset.row_cache_keys_to_save && !(row_cache_keys_to_save == rhs.row_cache_keys_to_save))
+ return false;
+ return true;
+ }
+ bool operator != (const CfDef &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const CfDef & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+typedef struct _KsDef__isset {
+ _KsDef__isset() : strategy_options(false), replication_factor(false), durable_writes(false) {}
+ bool strategy_options;
+ bool replication_factor;
+ bool durable_writes;
+} _KsDef__isset;
+
+class KsDef {
+ public:
+
+ static const char* ascii_fingerprint; // = "0767851B6476EB3777A21E59E912E11A";
+ static const uint8_t binary_fingerprint[16]; // = {0x07,0x67,0x85,0x1B,0x64,0x76,0xEB,0x37,0x77,0xA2,0x1E,0x59,0xE9,0x12,0xE1,0x1A};
+
+ KsDef() : name(""), strategy_class(""), replication_factor(0), durable_writes(true) {
+ }
+
+ virtual ~KsDef() throw() {}
+
+ std::string name;
+ std::string strategy_class;
+ std::map<std::string, std::string> strategy_options;
+ int32_t replication_factor;
+ std::vector<CfDef> cf_defs;
+ bool durable_writes;
+
+ _KsDef__isset __isset;
+
+ void __set_name(const std::string& val) {
+ name = val;
+ }
+
+ void __set_strategy_class(const std::string& val) {
+ strategy_class = val;
+ }
+
+ void __set_strategy_options(const std::map<std::string, std::string> & val) {
+ strategy_options = val;
+ __isset.strategy_options = true;
+ }
+
+ void __set_replication_factor(const int32_t val) {
+ replication_factor = val;
+ __isset.replication_factor = true;
+ }
+
+ void __set_cf_defs(const std::vector<CfDef> & val) {
+ cf_defs = val;
+ }
+
+ void __set_durable_writes(const bool val) {
+ durable_writes = val;
+ __isset.durable_writes = true;
+ }
+
+ bool operator == (const KsDef & rhs) const
+ {
+ if (!(name == rhs.name))
+ return false;
+ if (!(strategy_class == rhs.strategy_class))
+ return false;
+ if (__isset.strategy_options != rhs.__isset.strategy_options)
+ return false;
+ else if (__isset.strategy_options && !(strategy_options == rhs.strategy_options))
+ return false;
+ if (__isset.replication_factor != rhs.__isset.replication_factor)
+ return false;
+ else if (__isset.replication_factor && !(replication_factor == rhs.replication_factor))
+ return false;
+ if (!(cf_defs == rhs.cf_defs))
+ return false;
+ if (__isset.durable_writes != rhs.__isset.durable_writes)
+ return false;
+ else if (__isset.durable_writes && !(durable_writes == rhs.durable_writes))
+ return false;
+ return true;
+ }
+ bool operator != (const KsDef &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const KsDef & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+
+class CqlRow {
+ public:
+
+ static const char* ascii_fingerprint; // = "470EFC558004E98D92D604898305C04E";
+ static const uint8_t binary_fingerprint[16]; // = {0x47,0x0E,0xFC,0x55,0x80,0x04,0xE9,0x8D,0x92,0xD6,0x04,0x89,0x83,0x05,0xC0,0x4E};
+
+ CqlRow() : key("") {
+ }
+
+ virtual ~CqlRow() throw() {}
+
+ std::string key;
+ std::vector<Column> columns;
+
+ void __set_key(const std::string& val) {
+ key = val;
+ }
+
+ void __set_columns(const std::vector<Column> & val) {
+ columns = val;
+ }
+
+ bool operator == (const CqlRow & rhs) const
+ {
+ if (!(key == rhs.key))
+ return false;
+ if (!(columns == rhs.columns))
+ return false;
+ return true;
+ }
+ bool operator != (const CqlRow &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const CqlRow & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+
+class CqlMetadata {
+ public:
+
+ static const char* ascii_fingerprint; // = "B7C5A4AA9652C744A48EBC1C12D531E7";
+ static const uint8_t binary_fingerprint[16]; // = {0xB7,0xC5,0xA4,0xAA,0x96,0x52,0xC7,0x44,0xA4,0x8E,0xBC,0x1C,0x12,0xD5,0x31,0xE7};
+
+ CqlMetadata() : default_name_type(""), default_value_type("") {
+ }
+
+ virtual ~CqlMetadata() throw() {}
+
+ std::map<std::string, std::string> name_types;
+ std::map<std::string, std::string> value_types;
+ std::string default_name_type;
+ std::string default_value_type;
+
+ void __set_name_types(const std::map<std::string, std::string> & val) {
+ name_types = val;
+ }
+
+ void __set_value_types(const std::map<std::string, std::string> & val) {
+ value_types = val;
+ }
+
+ void __set_default_name_type(const std::string& val) {
+ default_name_type = val;
+ }
+
+ void __set_default_value_type(const std::string& val) {
+ default_value_type = val;
+ }
+
+ bool operator == (const CqlMetadata & rhs) const
+ {
+ if (!(name_types == rhs.name_types))
+ return false;
+ if (!(value_types == rhs.value_types))
+ return false;
+ if (!(default_name_type == rhs.default_name_type))
+ return false;
+ if (!(default_value_type == rhs.default_value_type))
+ return false;
+ return true;
+ }
+ bool operator != (const CqlMetadata &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const CqlMetadata & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+typedef struct _CqlResult__isset {
+ _CqlResult__isset() : rows(false), num(false), schema(false) {}
+ bool rows;
+ bool num;
+ bool schema;
+} _CqlResult__isset;
+
+class CqlResult {
+ public:
+
+ static const char* ascii_fingerprint; // = "521B9CE5AF77539F7267F6952B609E81";
+ static const uint8_t binary_fingerprint[16]; // = {0x52,0x1B,0x9C,0xE5,0xAF,0x77,0x53,0x9F,0x72,0x67,0xF6,0x95,0x2B,0x60,0x9E,0x81};
+
+ CqlResult() : type((CqlResultType::type)0), num(0) {
+ }
+
+ virtual ~CqlResult() throw() {}
+
+ CqlResultType::type type;
+ std::vector<CqlRow> rows;
+ int32_t num;
+ CqlMetadata schema;
+
+ _CqlResult__isset __isset;
+
+ void __set_type(const CqlResultType::type val) {
+ type = val;
+ }
+
+ void __set_rows(const std::vector<CqlRow> & val) {
+ rows = val;
+ __isset.rows = true;
+ }
+
+ void __set_num(const int32_t val) {
+ num = val;
+ __isset.num = true;
+ }
+
+ void __set_schema(const CqlMetadata& val) {
+ schema = val;
+ __isset.schema = true;
+ }
+
+ bool operator == (const CqlResult & rhs) const
+ {
+ if (!(type == rhs.type))
+ return false;
+ if (__isset.rows != rhs.__isset.rows)
+ return false;
+ else if (__isset.rows && !(rows == rhs.rows))
+ return false;
+ if (__isset.num != rhs.__isset.num)
+ return false;
+ else if (__isset.num && !(num == rhs.num))
+ return false;
+ if (__isset.schema != rhs.__isset.schema)
+ return false;
+ else if (__isset.schema && !(schema == rhs.schema))
+ return false;
+ return true;
+ }
+ bool operator != (const CqlResult &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const CqlResult & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+typedef struct _CqlPreparedResult__isset {
+ _CqlPreparedResult__isset() : variable_types(false), variable_names(false) {}
+ bool variable_types;
+ bool variable_names;
+} _CqlPreparedResult__isset;
+
+class CqlPreparedResult {
+ public:
+
+ static const char* ascii_fingerprint; // = "7E1663EC688DFDC28722BF36F9F64E6F";
+ static const uint8_t binary_fingerprint[16]; // = {0x7E,0x16,0x63,0xEC,0x68,0x8D,0xFD,0xC2,0x87,0x22,0xBF,0x36,0xF9,0xF6,0x4E,0x6F};
+
+ CqlPreparedResult() : itemId(0), count(0) {
+ }
+
+ virtual ~CqlPreparedResult() throw() {}
+
+ int32_t itemId;
+ int32_t count;
+ std::vector<std::string> variable_types;
+ std::vector<std::string> variable_names;
+
+ _CqlPreparedResult__isset __isset;
+
+ void __set_itemId(const int32_t val) {
+ itemId = val;
+ }
+
+ void __set_count(const int32_t val) {
+ count = val;
+ }
+
+ void __set_variable_types(const std::vector<std::string> & val) {
+ variable_types = val;
+ __isset.variable_types = true;
+ }
+
+ void __set_variable_names(const std::vector<std::string> & val) {
+ variable_names = val;
+ __isset.variable_names = true;
+ }
+
+ bool operator == (const CqlPreparedResult & rhs) const
+ {
+ if (!(itemId == rhs.itemId))
+ return false;
+ if (!(count == rhs.count))
+ return false;
+ if (__isset.variable_types != rhs.__isset.variable_types)
+ return false;
+ else if (__isset.variable_types && !(variable_types == rhs.variable_types))
+ return false;
+ if (__isset.variable_names != rhs.__isset.variable_names)
+ return false;
+ else if (__isset.variable_names && !(variable_names == rhs.variable_names))
+ return false;
+ return true;
+ }
+ bool operator != (const CqlPreparedResult &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const CqlPreparedResult & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+}}} // namespace
+
+#endif
diff --git a/storage/cassandra/ha_cassandra.cc b/storage/cassandra/ha_cassandra.cc
new file mode 100644
index 00000000000..e8c5b844e3d
--- /dev/null
+++ b/storage/cassandra/ha_cassandra.cc
@@ -0,0 +1,2619 @@
+/*
+ Copyright (c) 2012, Monty Program Ab
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
+#ifdef USE_PRAGMA_IMPLEMENTATION
+#pragma implementation // gcc: Class implementation
+#endif
+
+#include <mysql/plugin.h>
+#include "ha_cassandra.h"
+#include "sql_class.h"
+
+#define DYNCOL_USUAL 20
+#define DYNCOL_DELTA 100
+#define DYNCOL_USUAL_REC 1024
+#define DYNCOL_DELTA_REC 1024
+
+static handler *cassandra_create_handler(handlerton *hton,
+ TABLE_SHARE *table,
+ MEM_ROOT *mem_root);
+
+extern int dynamic_column_error_message(enum_dyncol_func_result rc);
+
+handlerton *cassandra_hton;
+
+
+/*
+ Hash used to track the number of open tables; variable for example share
+ methods
+*/
+static HASH cassandra_open_tables;
+
+/* The mutex used to init the hash; variable for example share methods */
+mysql_mutex_t cassandra_mutex;
+
+
+/**
+ Structure for CREATE TABLE options (table options).
+ It needs to be called ha_table_option_struct.
+
+ The option values can be specified in the CREATE TABLE at the end:
+ CREATE TABLE ( ... ) *here*
+*/
+
+struct ha_table_option_struct
+{
+ const char *thrift_host;
+ int thrift_port;
+ const char *keyspace;
+ const char *column_family;
+};
+
+
+ha_create_table_option cassandra_table_option_list[]=
+{
+ /*
+ one option that takes an arbitrary string
+ */
+ HA_TOPTION_STRING("thrift_host", thrift_host),
+ HA_TOPTION_NUMBER("thrift_port", thrift_port, 9160, 1, 65535, 0),
+ HA_TOPTION_STRING("keyspace", keyspace),
+ HA_TOPTION_STRING("column_family", column_family),
+ HA_TOPTION_END
+};
+
+/**
+ Structure for CREATE TABLE options (field options).
+*/
+
+struct ha_field_option_struct
+{
+ bool dyncol_field;
+};
+
+ha_create_table_option cassandra_field_option_list[]=
+{
+ /*
+ Collect all other columns as dynamic here,
+ the valid values are YES/NO, ON/OFF, 1/0.
+ The default is 0, that is false, no, off.
+ */
+ HA_FOPTION_BOOL("DYNAMIC_COLUMN_STORAGE", dyncol_field, 0),
+ HA_FOPTION_END
+};
+
+static MYSQL_THDVAR_ULONG(insert_batch_size, PLUGIN_VAR_RQCMDARG,
+ "Number of rows in an INSERT batch",
+ NULL, NULL, /*default*/ 100, /*min*/ 1, /*max*/ 1024*1024*1024, 0);
+
+static MYSQL_THDVAR_ULONG(multiget_batch_size, PLUGIN_VAR_RQCMDARG,
+ "Number of rows in a multiget(MRR) batch",
+ NULL, NULL, /*default*/ 100, /*min*/ 1, /*max*/ 1024*1024*1024, 0);
+
+static MYSQL_THDVAR_ULONG(rnd_batch_size, PLUGIN_VAR_RQCMDARG,
+ "Number of rows in an rnd_read (full scan) batch",
+ NULL, NULL, /*default*/ 10*1000, /*min*/ 1, /*max*/ 1024*1024*1024, 0);
+
+static MYSQL_THDVAR_ULONG(failure_retries, PLUGIN_VAR_RQCMDARG,
+ "Number of times to retry Cassandra calls that failed due to timeouts or "
+ "network communication problems. The default, 0, means not to retry.",
+ NULL, NULL, /*default*/ 0, /*min*/ 0, /*max*/ 1024*1024*1024, 0);
+
+/* These match values in enum_cassandra_consistency_level */
+const char *cassandra_consistency_level[] =
+{
+ "ONE",
+ "QUORUM",
+ "LOCAL_QUORUM",
+ "EACH_QUORUM",
+ "ALL",
+ "ANY",
+ "TWO",
+ "THREE",
+ NullS
+};
+
+TYPELIB cassandra_consistency_level_typelib= {
+ array_elements(cassandra_consistency_level) - 1, "",
+ cassandra_consistency_level, NULL
+};
+
+
+static MYSQL_THDVAR_ENUM(write_consistency, PLUGIN_VAR_RQCMDARG,
+ "Cassandra consistency level to use for write operations", NULL, NULL,
+ ONE, &cassandra_consistency_level_typelib);
+
+static MYSQL_THDVAR_ENUM(read_consistency, PLUGIN_VAR_RQCMDARG,
+ "Cassandra consistency level to use for read operations", NULL, NULL,
+ ONE, &cassandra_consistency_level_typelib);
+
+
+mysql_mutex_t cassandra_default_host_lock;
+static char* cassandra_default_thrift_host = NULL;
+static char cassandra_default_host_buf[256]="";
+
+static void
+cassandra_default_thrift_host_update(THD *thd,
+ struct st_mysql_sys_var* var,
+ void* var_ptr, /*!< out: where the
+ formal string goes */
+ const void* save) /*!< in: immediate result
+ from check function */
+{
+ const char *new_host= *((char**)save);
+ const size_t max_len= sizeof(cassandra_default_host_buf);
+
+ mysql_mutex_lock(&cassandra_default_host_lock);
+
+ if (new_host)
+ {
+ strncpy(cassandra_default_host_buf, new_host, max_len-1);
+ cassandra_default_host_buf[max_len-1]= 0;
+ cassandra_default_thrift_host= cassandra_default_host_buf;
+ }
+ else
+ {
+ cassandra_default_host_buf[0]= 0;
+ cassandra_default_thrift_host= NULL;
+ }
+
+ *((const char**)var_ptr)= cassandra_default_thrift_host;
+
+ mysql_mutex_unlock(&cassandra_default_host_lock);
+}
+
+
+static MYSQL_SYSVAR_STR(default_thrift_host, cassandra_default_thrift_host,
+ PLUGIN_VAR_RQCMDARG,
+ "Default host for Cassandra thrift connections",
+ /*check*/NULL,
+ cassandra_default_thrift_host_update,
+ /*default*/NULL);
+
+static struct st_mysql_sys_var* cassandra_system_variables[]= {
+ MYSQL_SYSVAR(insert_batch_size),
+ MYSQL_SYSVAR(multiget_batch_size),
+ MYSQL_SYSVAR(rnd_batch_size),
+
+ MYSQL_SYSVAR(default_thrift_host),
+ MYSQL_SYSVAR(write_consistency),
+ MYSQL_SYSVAR(read_consistency),
+ MYSQL_SYSVAR(failure_retries),
+ NULL
+};
+
+Cassandra_status_vars cassandra_counters;
+
+/**
+ @brief
+ Function we use in the creation of our hash to get key.
+*/
+
+static uchar* cassandra_get_key(CASSANDRA_SHARE *share, size_t *length,
+ my_bool not_used __attribute__((unused)))
+{
+ *length=share->table_name_length;
+ return (uchar*) share->table_name;
+}
+
+#ifdef HAVE_PSI_INTERFACE
+static PSI_mutex_key ex_key_mutex_example, ex_key_mutex_CASSANDRA_SHARE_mutex;
+
+static PSI_mutex_info all_cassandra_mutexes[]=
+{
+ { &ex_key_mutex_example, "cassandra", PSI_FLAG_GLOBAL},
+ { &ex_key_mutex_CASSANDRA_SHARE_mutex, "CASSANDRA_SHARE::mutex", 0}
+};
+
+static void init_cassandra_psi_keys()
+{
+ const char* category= "cassandra";
+ int count;
+
+ if (PSI_server == NULL)
+ return;
+
+ count= array_elements(all_cassandra_mutexes);
+ PSI_server->register_mutex(category, all_cassandra_mutexes, count);
+}
+#endif
+
+static int cassandra_init_func(void *p)
+{
+ DBUG_ENTER("cassandra_init_func");
+
+#ifdef HAVE_PSI_INTERFACE
+ init_cassandra_psi_keys();
+#endif
+
+ cassandra_hton= (handlerton *)p;
+ mysql_mutex_init(ex_key_mutex_example, &cassandra_mutex, MY_MUTEX_INIT_FAST);
+ (void) my_hash_init(&cassandra_open_tables,system_charset_info,32,0,0,
+ (my_hash_get_key) cassandra_get_key,0,0);
+
+ cassandra_hton->state= SHOW_OPTION_YES;
+ cassandra_hton->create= cassandra_create_handler;
+ /*
+ Don't specify HTON_CAN_RECREATE in flags. re-create is used by TRUNCATE
+ TABLE to create an *empty* table from scratch. Cassandra table won't be
+ emptied if re-created.
+ */
+ cassandra_hton->flags= 0;
+ cassandra_hton->table_options= cassandra_table_option_list;
+ cassandra_hton->field_options= cassandra_field_option_list;
+
+ mysql_mutex_init(0 /* no instrumentation */,
+ &cassandra_default_host_lock, MY_MUTEX_INIT_FAST);
+
+ DBUG_RETURN(0);
+}
+
+
+static int cassandra_done_func(void *p)
+{
+ int error= 0;
+ DBUG_ENTER("cassandra_done_func");
+ if (cassandra_open_tables.records)
+ error= 1;
+ my_hash_free(&cassandra_open_tables);
+ mysql_mutex_destroy(&cassandra_mutex);
+ mysql_mutex_destroy(&cassandra_default_host_lock);
+ DBUG_RETURN(error);
+}
+
+
+/**
+ @brief
+ Example of simple lock controls. The "share" it creates is a
+ structure we will pass to each cassandra handler. Do you have to have
+ one of these? Well, you have pieces that are used for locking, and
+ they are needed to function.
+*/
+
+static CASSANDRA_SHARE *get_share(const char *table_name, TABLE *table)
+{
+ CASSANDRA_SHARE *share;
+ uint length;
+ char *tmp_name;
+
+ mysql_mutex_lock(&cassandra_mutex);
+ length=(uint) strlen(table_name);
+
+ if (!(share=(CASSANDRA_SHARE*) my_hash_search(&cassandra_open_tables,
+ (uchar*) table_name,
+ length)))
+ {
+ if (!(share=(CASSANDRA_SHARE *)
+ my_multi_malloc(MYF(MY_WME | MY_ZEROFILL),
+ &share, sizeof(*share),
+ &tmp_name, length+1,
+ NullS)))
+ {
+ mysql_mutex_unlock(&cassandra_mutex);
+ return NULL;
+ }
+
+ share->use_count=0;
+ share->table_name_length=length;
+ share->table_name=tmp_name;
+ strmov(share->table_name,table_name);
+ if (my_hash_insert(&cassandra_open_tables, (uchar*) share))
+ goto error;
+ thr_lock_init(&share->lock);
+ mysql_mutex_init(ex_key_mutex_CASSANDRA_SHARE_mutex,
+ &share->mutex, MY_MUTEX_INIT_FAST);
+ }
+ share->use_count++;
+ mysql_mutex_unlock(&cassandra_mutex);
+
+ return share;
+
+error:
+ mysql_mutex_destroy(&share->mutex);
+ my_free(share);
+
+ return NULL;
+}
+
+
+/**
+ @brief
+ Free lock controls. We call this whenever we close a table. If the table had
+ the last reference to the share, then we free memory associated with it.
+*/
+
+static int free_share(CASSANDRA_SHARE *share)
+{
+ mysql_mutex_lock(&cassandra_mutex);
+ if (!--share->use_count)
+ {
+ my_hash_delete(&cassandra_open_tables, (uchar*) share);
+ thr_lock_delete(&share->lock);
+ mysql_mutex_destroy(&share->mutex);
+ my_free(share);
+ }
+ mysql_mutex_unlock(&cassandra_mutex);
+
+ return 0;
+}
+
+
+static handler* cassandra_create_handler(handlerton *hton,
+ TABLE_SHARE *table,
+ MEM_ROOT *mem_root)
+{
+ return new (mem_root) ha_cassandra(hton, table);
+}
+
+
+ha_cassandra::ha_cassandra(handlerton *hton, TABLE_SHARE *table_arg)
+ :handler(hton, table_arg),
+ se(NULL), field_converters(NULL),
+ special_type_field_converters(NULL),
+ special_type_field_names(NULL), n_special_type_fields(0),
+ rowkey_converter(NULL),
+ dyncol_field(0), dyncol_set(0)
+{}
+
+
+static const char *ha_cassandra_exts[] = {
+ NullS
+};
+
+const char **ha_cassandra::bas_ext() const
+{
+ return ha_cassandra_exts;
+}
+
+
+int ha_cassandra::connect_and_check_options(TABLE *table_arg)
+{
+ ha_table_option_struct *options= table_arg->s->option_struct;
+ int res;
+ DBUG_ENTER("ha_cassandra::connect_and_check_options");
+
+ if ((res= check_field_options(table_arg->s->field)) ||
+ (res= check_table_options(options)))
+ DBUG_RETURN(res);
+
+ se= create_cassandra_se();
+ se->set_column_family(options->column_family);
+ const char *thrift_host= options->thrift_host? options->thrift_host:
+ cassandra_default_thrift_host;
+ if (se->connect(thrift_host, options->thrift_port, options->keyspace))
+ {
+ my_error(ER_CONNECT_TO_FOREIGN_DATA_SOURCE, MYF(0), se->error_str());
+ DBUG_RETURN(HA_ERR_NO_CONNECTION);
+ }
+
+ if (setup_field_converters(table_arg->field, table_arg->s->fields))
+ {
+ DBUG_RETURN(HA_ERR_NO_CONNECTION);
+ }
+
+ DBUG_RETURN(0);
+}
+
+
+int ha_cassandra::check_field_options(Field **fields)
+{
+ Field **field;
+ uint i;
+ DBUG_ENTER("ha_cassandra::check_field_options");
+ for (field= fields, i= 0; *field; field++, i++)
+ {
+ ha_field_option_struct *field_options= (*field)->option_struct;
+ if (field_options && field_options->dyncol_field)
+ {
+ if (dyncol_set || (*field)->type() != MYSQL_TYPE_BLOB)
+ {
+ my_error(ER_WRONG_FIELD_SPEC, MYF(0), (*field)->field_name);
+ DBUG_RETURN(HA_WRONG_CREATE_OPTION);
+ }
+ dyncol_set= 1;
+ dyncol_field= i;
+ bzero(&dynamic_values, sizeof(dynamic_values));
+ bzero(&dynamic_names, sizeof(dynamic_names));
+ bzero(&dynamic_rec, sizeof(dynamic_rec));
+ }
+ }
+ DBUG_RETURN(0);
+}
+
+
+int ha_cassandra::open(const char *name, int mode, uint test_if_locked)
+{
+ DBUG_ENTER("ha_cassandra::open");
+
+ if (!(share = get_share(name, table)))
+ DBUG_RETURN(1);
+ thr_lock_data_init(&share->lock,&lock,NULL);
+
+ DBUG_ASSERT(!se);
+ /*
+ Don't do the following on open: it prevents SHOW CREATE TABLE when the server
+ has gone away.
+ */
+ /*
+ int res;
+ if ((res= connect_and_check_options(table)))
+ {
+ DBUG_RETURN(res);
+ }
+ */
+
+ info(HA_STATUS_NO_LOCK | HA_STATUS_VARIABLE | HA_STATUS_CONST);
+ insert_lineno= 0;
+
+ DBUG_RETURN(0);
+}
+
+
+int ha_cassandra::close(void)
+{
+ DBUG_ENTER("ha_cassandra::close");
+ delete se;
+ se= NULL;
+ free_field_converters();
+ DBUG_RETURN(free_share(share));
+}
+
+
+int ha_cassandra::check_table_options(ha_table_option_struct *options)
+{
+ if (!options->thrift_host && (!cassandra_default_thrift_host ||
+ !cassandra_default_thrift_host[0]))
+ {
+ my_error(ER_CONNECT_TO_FOREIGN_DATA_SOURCE, MYF(0),
+ "thrift_host table option must be specified, or "
+ "@@cassandra_default_thrift_host must be set");
+ return HA_WRONG_CREATE_OPTION;
+ }
+
+ if (!options->keyspace || !options->column_family)
+ {
+ my_error(ER_CONNECT_TO_FOREIGN_DATA_SOURCE, MYF(0),
+ "keyspace and column_family table options must be specified");
+ return HA_WRONG_CREATE_OPTION;
+ }
+ return 0;
+}
+
+
+/**
+ @brief
+ create() is called to create a table. The variable name will have the name
+ of the table.
+
+ @details
+ When create() is called you do not need to worry about
+ opening the table. Also, the .frm file will have already been
+ created so adjusting create_info is not necessary. You can overwrite
+ the .frm file at this point if you wish to change the table
+ definition, but there are no methods currently provided for doing
+ so.
+
+ Called from handle.cc by ha_create_table().
+
+ @see
+ ha_create_table() in handle.cc
+*/
+
+int ha_cassandra::create(const char *name, TABLE *table_arg,
+ HA_CREATE_INFO *create_info)
+{
+ int res;
+ DBUG_ENTER("ha_cassandra::create");
+
+ if (table_arg->s->keys != 1 || table_arg->s->primary_key !=0 ||
+ table_arg->key_info[0].key_parts != 1 ||
+ table_arg->key_info[0].key_part[0].fieldnr != 1)
+ {
+ my_error(ER_WRONG_COLUMN_NAME, MYF(0),
+ "Table must have PRIMARY KEY defined over the first column");
+ DBUG_RETURN(HA_WRONG_CREATE_OPTION);
+ }
+
+ DBUG_ASSERT(!se);
+ if ((res= connect_and_check_options(table_arg)))
+ DBUG_RETURN(res);
+
+ insert_lineno= 0;
+ DBUG_RETURN(0);
+}
+
+/*
+ Mapping needs to
+ - copy value from MySQL record to Thrift buffer
+ - copy value from Thrift bufer to MySQL record..
+
+*/
+
+/* Converter base */
+class ColumnDataConverter
+{
+public:
+ Field *field;
+
+ /* This will save Cassandra's data in the Field */
+ virtual int cassandra_to_mariadb(const char *cass_data,
+ int cass_data_len)=0;
+
+ /*
+ This will get data from the Field pointer, store Cassandra's form
+ in internal buffer, and return pointer/size.
+
+ @return
+ false - OK
+ true - Failed to convert value (completely, there is no value to insert
+ at all).
+ */
+ virtual bool mariadb_to_cassandra(char **cass_data, int *cass_data_len)=0;
+ virtual ~ColumnDataConverter() {};
+};
+
+
+class DoubleDataConverter : public ColumnDataConverter
+{
+ double buf;
+public:
+ int cassandra_to_mariadb(const char *cass_data, int cass_data_len)
+ {
+ DBUG_ASSERT(cass_data_len == sizeof(double));
+ double *pdata= (double*) cass_data;
+ field->store(*pdata);
+ return 0;
+ }
+
+ bool mariadb_to_cassandra(char **cass_data, int *cass_data_len)
+ {
+ buf= field->val_real();
+ *cass_data= (char*)&buf;
+ *cass_data_len=sizeof(double);
+ return false;
+ }
+ ~DoubleDataConverter(){}
+};
+
+
+class FloatDataConverter : public ColumnDataConverter
+{
+ float buf;
+public:
+ int cassandra_to_mariadb(const char *cass_data, int cass_data_len)
+ {
+ DBUG_ASSERT(cass_data_len == sizeof(float));
+ float *pdata= (float*) cass_data;
+ field->store(*pdata);
+ return 0;
+ }
+
+ bool mariadb_to_cassandra(char **cass_data, int *cass_data_len)
+ {
+ buf= field->val_real();
+ *cass_data= (char*)&buf;
+ *cass_data_len=sizeof(float);
+ return false;
+ }
+ ~FloatDataConverter(){}
+};
+
+static void flip64(const char *from, char* to)
+{
+ to[0]= from[7];
+ to[1]= from[6];
+ to[2]= from[5];
+ to[3]= from[4];
+ to[4]= from[3];
+ to[5]= from[2];
+ to[6]= from[1];
+ to[7]= from[0];
+}
+
+class BigintDataConverter : public ColumnDataConverter
+{
+ longlong buf;
+ bool flip; /* is false when reading counter columns */
+public:
+ int cassandra_to_mariadb(const char *cass_data, int cass_data_len)
+ {
+ longlong tmp;
+ DBUG_ASSERT(cass_data_len == sizeof(longlong));
+ if (flip)
+ flip64(cass_data, (char*)&tmp);
+ else
+ memcpy(&tmp, cass_data, sizeof(longlong));
+ field->store(tmp);
+ return 0;
+ }
+
+ bool mariadb_to_cassandra(char **cass_data, int *cass_data_len)
+ {
+ longlong tmp= field->val_int();
+ if (flip)
+ flip64((const char*)&tmp, (char*)&buf);
+ else
+ memcpy(&buf, &tmp, sizeof(longlong));
+ *cass_data= (char*)&buf;
+ *cass_data_len=sizeof(longlong);
+ return false;
+ }
+ BigintDataConverter(bool flip_arg) : flip(flip_arg) {}
+ ~BigintDataConverter(){}
+};
+
+static void flip32(const char *from, char* to)
+{
+ to[0]= from[3];
+ to[1]= from[2];
+ to[2]= from[1];
+ to[3]= from[0];
+}
+
+
+class TinyintDataConverter : public ColumnDataConverter
+{
+ char buf;
+public:
+ int cassandra_to_mariadb(const char *cass_data, int cass_data_len)
+ {
+ DBUG_ASSERT(cass_data_len == 1);
+ field->store(cass_data[0]);
+ return 0;
+ }
+
+ bool mariadb_to_cassandra(char **cass_data, int *cass_data_len)
+ {
+ buf= field->val_int()? 1 : 0; /* TODO: error handling? */
+ *cass_data= (char*)&buf;
+ *cass_data_len= 1;
+ return false;
+ }
+ ~TinyintDataConverter(){}
+};
+
+
+class Int32DataConverter : public ColumnDataConverter
+{
+ int32_t buf;
+public:
+ int cassandra_to_mariadb(const char *cass_data, int cass_data_len)
+ {
+ int32_t tmp;
+ DBUG_ASSERT(cass_data_len == sizeof(int32_t));
+ flip32(cass_data, (char*)&tmp);
+ field->store(tmp);
+ return 0;
+ }
+
+ bool mariadb_to_cassandra(char **cass_data, int *cass_data_len)
+ {
+ int32_t tmp= field->val_int();
+ flip32((const char*)&tmp, (char*)&buf);
+ *cass_data= (char*)&buf;
+ *cass_data_len=sizeof(int32_t);
+ return false;
+ }
+ ~Int32DataConverter(){}
+};
+
+
+class StringCopyConverter : public ColumnDataConverter
+{
+ String buf;
+ size_t max_length;
+public:
+ int cassandra_to_mariadb(const char *cass_data, int cass_data_len)
+ {
+ if ((size_t)cass_data_len > max_length)
+ return 1;
+ field->store(cass_data, cass_data_len,field->charset());
+ return 0;
+ }
+
+ bool mariadb_to_cassandra(char **cass_data, int *cass_data_len)
+ {
+ String *pstr= field->val_str(&buf);
+ *cass_data= (char*)pstr->ptr();
+ *cass_data_len= pstr->length();
+ return false;
+ }
+ StringCopyConverter(size_t max_length_arg) : max_length(max_length_arg) {}
+ ~StringCopyConverter(){}
+};
+
+
+class TimestampDataConverter : public ColumnDataConverter
+{
+ int64_t buf;
+public:
+ int cassandra_to_mariadb(const char *cass_data, int cass_data_len)
+ {
+ /* Cassandra data is milliseconds-since-epoch in network byte order */
+ int64_t tmp;
+ DBUG_ASSERT(cass_data_len==8);
+ flip64(cass_data, (char*)&tmp);
+ /*
+ store_TIME's arguments:
+ - seconds since epoch
+ - microsecond fraction of a second.
+ */
+ ((Field_timestamp*)field)->store_TIME(tmp / 1000, (tmp % 1000)*1000);
+ return 0;
+ }
+
+ bool mariadb_to_cassandra(char **cass_data, int *cass_data_len)
+ {
+ my_time_t ts_time;
+ ulong ts_microsec;
+ int64_t tmp;
+ ts_time= ((Field_timestamp*)field)->get_timestamp(&ts_microsec);
+
+ /* Cassandra needs milliseconds-since-epoch */
+ tmp= ((int64_t)ts_time) * 1000 + ts_microsec/1000;
+ flip64((const char*)&tmp, (char*)&buf);
+
+ *cass_data= (char*)&buf;
+ *cass_data_len= 8;
+ return false;
+ }
+ ~TimestampDataConverter(){}
+};
+
+
+
+static int convert_hex_digit(const char c)
+{
+ int num;
+ if (c >= '0' && c <= '9')
+ num= c - '0';
+ else if (c >= 'A' && c <= 'F')
+ num= c - 'A' + 10;
+ else if (c >= 'a' && c <= 'f')
+ num= c - 'a' + 10;
+ else
+ return -1; /* Couldn't convert */
+ return num;
+}
+
+
+const char map2number[]="0123456789abcdef";
+
+static void convert_uuid2string(char *str, const char *cass_data)
+{
+ char *ptr= str;
+ /* UUID arrives as 16-byte number in network byte order */
+ for (uint i=0; i < 16; i++)
+ {
+ *(ptr++)= map2number[(cass_data[i] >> 4) & 0xF];
+ *(ptr++)= map2number[cass_data[i] & 0xF];
+ if (i == 3 || i == 5 || i == 7 || i == 9)
+ *(ptr++)= '-';
+ }
+ *ptr= 0;
+}
+
+static bool convert_string2uuid(char *buf, const char *str)
+{
+ int lower, upper;
+ for (uint i= 0; i < 16; i++)
+ {
+ if ((upper= convert_hex_digit(str[0])) == -1 ||
+ (lower= convert_hex_digit(str[1])) == -1)
+ {
+ return true;
+ }
+ buf[i]= lower | (upper << 4);
+ str += 2;
+ if (i == 3 || i == 5 || i == 7 || i == 9)
+ {
+ if (str[0] != '-')
+ return true;
+ str++;
+ }
+ }
+ return false;
+}
+
+
+class UuidDataConverter : public ColumnDataConverter
+{
+ char buf[16]; /* Binary UUID representation */
+ String str_buf;
+public:
+ int cassandra_to_mariadb(const char *cass_data, int cass_data_len)
+ {
+ DBUG_ASSERT(cass_data_len==16);
+ char str[37];
+ convert_uuid2string(str, cass_data);
+ field->store(str, 36,field->charset());
+ return 0;
+ }
+
+ bool mariadb_to_cassandra(char **cass_data, int *cass_data_len)
+ {
+ String *uuid_str= field->val_str(&str_buf);
+
+ if (uuid_str->length() != 36)
+ return true;
+
+ if (convert_string2uuid(buf, (char*)uuid_str->c_ptr()))
+ return true;
+ *cass_data= buf;
+ *cass_data_len= 16;
+ return false;
+ }
+ ~UuidDataConverter(){}
+};
+
+/**
+ Converting dynamic columns types to/from casandra types
+*/
+
+
+/**
+ Check and initialize (if it is needed) string MEM_ROOT
+*/
+static void alloc_strings_memroot(MEM_ROOT *mem_root)
+{
+ if (!alloc_root_inited(mem_root))
+ {
+ /*
+ The mem_root used to allocate UUID (of length 36 + \0) so make
+ appropriate allocated size
+ */
+ init_alloc_root(mem_root,
+ (36 + 1 + ALIGN_SIZE(sizeof(USED_MEM))) * 10 +
+ ALLOC_ROOT_MIN_BLOCK_SIZE,
+ (36 + 1 + ALIGN_SIZE(sizeof(USED_MEM))) * 10 +
+ ALLOC_ROOT_MIN_BLOCK_SIZE, MYF(MY_THREAD_SPECIFIC));
+ }
+}
+
+static void free_strings_memroot(MEM_ROOT *mem_root)
+{
+ if (alloc_root_inited(mem_root))
+ free_root(mem_root, MYF(0));
+}
+
+bool cassandra_to_dyncol_intLong(const char *cass_data,
+ int cass_data_len __attribute__((unused)),
+ DYNAMIC_COLUMN_VALUE *value,
+ MEM_ROOT *mem_root __attribute__((unused)))
+{
+ value->type= DYN_COL_INT;
+#ifdef WORDS_BIGENDIAN
+ value->x.long_value= (longlong *)*cass_data;
+#else
+ flip64(cass_data, (char *)&value->x.long_value);
+#endif
+ return 0;
+}
+
+bool dyncol_to_cassandraLong(DYNAMIC_COLUMN_VALUE *value,
+ char **cass_data, int *cass_data_len,
+ void* buff, void **freemem)
+{
+ longlong *tmp= (longlong *) buff;
+ enum enum_dyncol_func_result rc=
+ mariadb_dyncol_val_long(tmp, value);
+ if (rc < 0)
+ return true;
+ *cass_data_len= sizeof(longlong);
+#ifdef WORDS_BIGENDIAN
+ *cass_data= (char *)buff;
+#else
+ flip64((char *)buff, (char *)buff + sizeof(longlong));
+ *cass_data= (char *)buff + sizeof(longlong);
+#endif
+ *freemem= NULL;
+ return false;
+}
+
+bool cassandra_to_dyncol_intInt32(const char *cass_data,
+ int cass_data_len __attribute__((unused)),
+ DYNAMIC_COLUMN_VALUE *value,
+ MEM_ROOT *mem_root __attribute__((unused)))
+{
+ int32 tmp;
+ value->type= DYN_COL_INT;
+#ifdef WORDS_BIGENDIAN
+ tmp= *((int32 *)cass_data);
+#else
+ flip32(cass_data, (char *)&tmp);
+#endif
+ value->x.long_value= tmp;
+ return 0;
+}
+
+
+bool dyncol_to_cassandraInt32(DYNAMIC_COLUMN_VALUE *value,
+ char **cass_data, int *cass_data_len,
+ void* buff, void **freemem)
+{
+ longlong *tmp= (longlong *) ((char *)buff + sizeof(longlong));
+ enum enum_dyncol_func_result rc=
+ mariadb_dyncol_val_long(tmp, value);
+ if (rc < 0)
+ return true;
+ *cass_data_len= sizeof(int32);
+ *cass_data= (char *)buff;
+#ifdef WORDS_BIGENDIAN
+ *((int32 *) buff) = (int32) *tmp;
+#else
+ {
+ int32 tmp2= (int32) *tmp;
+ flip32((char *)&tmp2, (char *)buff);
+ }
+#endif
+ *freemem= NULL;
+ return false;
+}
+
+
+bool cassandra_to_dyncol_intCounter(const char *cass_data,
+ int cass_data_len __attribute__((unused)),
+ DYNAMIC_COLUMN_VALUE *value,
+ MEM_ROOT *mem_root __attribute__((unused)))
+{
+ value->type= DYN_COL_INT;
+ value->x.long_value= *((longlong *)cass_data);
+ return 0;
+}
+
+
+bool dyncol_to_cassandraCounter(DYNAMIC_COLUMN_VALUE *value,
+ char **cass_data, int *cass_data_len,
+ void* buff, void **freemem)
+{
+ longlong *tmp= (longlong *)buff;
+ enum enum_dyncol_func_result rc=
+ mariadb_dyncol_val_long(tmp, value);
+ if (rc < 0)
+ return true;
+ *cass_data_len= sizeof(longlong);
+ *cass_data= (char *)buff;
+ *freemem= NULL;
+ return false;
+}
+
+bool cassandra_to_dyncol_doubleFloat(const char *cass_data,
+ int cass_data_len __attribute__((unused)),
+ DYNAMIC_COLUMN_VALUE *value,
+ MEM_ROOT *mem_root __attribute__((unused)))
+{
+ value->type= DYN_COL_DOUBLE;
+ value->x.double_value= *((float *)cass_data);
+ return 0;
+}
+
+bool dyncol_to_cassandraFloat(DYNAMIC_COLUMN_VALUE *value,
+ char **cass_data, int *cass_data_len,
+ void* buff, void **freemem)
+{
+ double tmp;
+ enum enum_dyncol_func_result rc=
+ mariadb_dyncol_val_double(&tmp, value);
+ if (rc < 0)
+ return true;
+ *((float *)buff)= (float) tmp;
+ *cass_data_len= sizeof(float);
+ *cass_data= (char *)buff;
+ *freemem= NULL;
+ return false;
+}
+
+bool cassandra_to_dyncol_doubleDouble(const char *cass_data,
+ int cass_data_len __attribute__((unused)),
+ DYNAMIC_COLUMN_VALUE *value,
+ MEM_ROOT *mem_root
+ __attribute__((unused)))
+{
+ value->type= DYN_COL_DOUBLE;
+ value->x.double_value= *((double *)cass_data);
+ return 0;
+}
+
+bool dyncol_to_cassandraDouble(DYNAMIC_COLUMN_VALUE *value,
+ char **cass_data, int *cass_data_len,
+ void* buff, void **freemem)
+{
+ double *tmp= (double *)buff;
+ enum enum_dyncol_func_result rc=
+ mariadb_dyncol_val_double(tmp, value);
+ if (rc < 0)
+ return true;
+ *cass_data_len= sizeof(double);
+ *cass_data= (char *)buff;
+ *freemem= NULL;
+ return false;
+}
+
+bool cassandra_to_dyncol_strStr(const char *cass_data,
+ int cass_data_len,
+ DYNAMIC_COLUMN_VALUE *value,
+ CHARSET_INFO *cs)
+{
+ value->type= DYN_COL_STRING;
+ value->x.string.charset= cs;
+ value->x.string.value.str= (char *)cass_data;
+ value->x.string.value.length= cass_data_len;
+ return 0;
+}
+
+bool dyncol_to_cassandraStr(DYNAMIC_COLUMN_VALUE *value,
+ char **cass_data, int *cass_data_len,
+ void* buff, void **freemem, CHARSET_INFO *cs)
+{
+ DYNAMIC_STRING tmp;
+ if (init_dynamic_string(&tmp, NULL, 1024, 1024))
+ return 1;
+ enum enum_dyncol_func_result rc=
+ mariadb_dyncol_val_str(&tmp, value, cs, '\0');
+ if (rc < 0)
+ {
+ dynstr_free(&tmp);
+ return 1;
+ }
+ *cass_data_len= tmp.length;
+ *(cass_data)= tmp.str;
+ *freemem= tmp.str;
+ return 0;
+}
+
+bool cassandra_to_dyncol_strBytes(const char *cass_data,
+ int cass_data_len,
+ DYNAMIC_COLUMN_VALUE *value,
+ MEM_ROOT *mem_root __attribute__((unused)))
+{
+ return cassandra_to_dyncol_strStr(cass_data, cass_data_len, value,
+ &my_charset_bin);
+}
+
+bool dyncol_to_cassandraBytes(DYNAMIC_COLUMN_VALUE *value,
+ char **cass_data, int *cass_data_len,
+ void* buff, void **freemem)
+{
+ return dyncol_to_cassandraStr(value, cass_data, cass_data_len,
+ buff, freemem, &my_charset_bin);
+}
+
+bool cassandra_to_dyncol_strAscii(const char *cass_data,
+ int cass_data_len,
+ DYNAMIC_COLUMN_VALUE *value,
+ MEM_ROOT *mem_root __attribute__((unused)))
+{
+ return cassandra_to_dyncol_strStr(cass_data, cass_data_len, value,
+ &my_charset_latin1_bin);
+}
+
+bool dyncol_to_cassandraAscii(DYNAMIC_COLUMN_VALUE *value,
+ char **cass_data, int *cass_data_len,
+ void* buff, void **freemem)
+{
+ return dyncol_to_cassandraStr(value, cass_data, cass_data_len,
+ buff, freemem, &my_charset_latin1_bin);
+}
+
+bool cassandra_to_dyncol_strUTF8(const char *cass_data,
+ int cass_data_len,
+ DYNAMIC_COLUMN_VALUE *value,
+ MEM_ROOT *mem_root __attribute__((unused)))
+{
+ return cassandra_to_dyncol_strStr(cass_data, cass_data_len, value,
+ &my_charset_utf8_unicode_ci);
+}
+
+bool dyncol_to_cassandraUTF8(DYNAMIC_COLUMN_VALUE *value,
+ char **cass_data, int *cass_data_len,
+ void* buff, void **freemem)
+{
+ return dyncol_to_cassandraStr(value, cass_data, cass_data_len,
+ buff, freemem, &my_charset_utf8_unicode_ci);
+}
+
+bool cassandra_to_dyncol_strUUID(const char *cass_data,
+ int cass_data_len,
+ DYNAMIC_COLUMN_VALUE *value,
+ MEM_ROOT *mem_root)
+{
+ value->type= DYN_COL_STRING;
+ value->x.string.charset= &my_charset_bin;
+ alloc_strings_memroot(mem_root);
+ value->x.string.value.str= (char *)alloc_root(mem_root, 37);
+ if (!value->x.string.value.str)
+ {
+ value->x.string.value.length= 0;
+ return 1;
+ }
+ convert_uuid2string(value->x.string.value.str, cass_data);
+ value->x.string.value.length= 36;
+ return 0;
+}
+
+bool dyncol_to_cassandraUUID(DYNAMIC_COLUMN_VALUE *value,
+ char **cass_data, int *cass_data_len,
+ void* buff, void **freemem)
+{
+ DYNAMIC_STRING tmp;
+ if (init_dynamic_string(&tmp, NULL, 1024, 1024))
+ return true;
+ enum enum_dyncol_func_result rc=
+ mariadb_dyncol_val_str(&tmp, value, &my_charset_latin1_bin, '\0');
+ if (rc < 0 || tmp.length != 36 || convert_string2uuid((char *)buff, tmp.str))
+ {
+ dynstr_free(&tmp);
+ return true;
+ }
+
+ *cass_data_len= tmp.length;
+ *(cass_data)= tmp.str;
+ *freemem= tmp.str;
+ return 0;
+}
+
+bool cassandra_to_dyncol_intBool(const char *cass_data,
+ int cass_data_len,
+ DYNAMIC_COLUMN_VALUE *value,
+ MEM_ROOT *mem_root __attribute__((unused)))
+{
+ value->type= DYN_COL_INT;
+ value->x.long_value= (cass_data[0] ? 1 : 0);
+ return 0;
+}
+
+bool dyncol_to_cassandraBool(DYNAMIC_COLUMN_VALUE *value,
+ char **cass_data, int *cass_data_len,
+ void* buff, void **freemem)
+{
+ longlong tmp;
+ enum enum_dyncol_func_result rc=
+ mariadb_dyncol_val_long(&tmp, value);
+ if (rc < 0)
+ return true;
+ ((char *)buff)[0]= (tmp ? 1 : 0);
+ *cass_data_len= 1;
+ *(cass_data)= (char *)buff;
+ *freemem= 0;
+ return 0;
+}
+
+
+const char * const validator_bigint= "org.apache.cassandra.db.marshal.LongType";
+const char * const validator_int= "org.apache.cassandra.db.marshal.Int32Type";
+const char * const validator_counter= "org.apache.cassandra.db.marshal.CounterColumnType";
+
+const char * const validator_float= "org.apache.cassandra.db.marshal.FloatType";
+const char * const validator_double= "org.apache.cassandra.db.marshal.DoubleType";
+
+const char * const validator_blob= "org.apache.cassandra.db.marshal.BytesType";
+const char * const validator_ascii= "org.apache.cassandra.db.marshal.AsciiType";
+const char * const validator_text= "org.apache.cassandra.db.marshal.UTF8Type";
+
+const char * const validator_timestamp="org.apache.cassandra.db.marshal.DateType";
+
+const char * const validator_uuid= "org.apache.cassandra.db.marshal.UUIDType";
+
+const char * const validator_boolean= "org.apache.cassandra.db.marshal.BooleanType";
+
+/* VARINTs are stored as big-endian big numbers. */
+const char * const validator_varint= "org.apache.cassandra.db.marshal.IntegerType";
+const char * const validator_decimal= "org.apache.cassandra.db.marshal.DecimalType";
+
+
+static CASSANDRA_TYPE_DEF cassandra_types[]=
+{
+ {
+ validator_bigint,
+ &cassandra_to_dyncol_intLong,
+ &dyncol_to_cassandraLong
+ },
+ {
+ validator_int,
+ &cassandra_to_dyncol_intInt32,
+ &dyncol_to_cassandraInt32
+ },
+ {
+ validator_counter,
+ cassandra_to_dyncol_intCounter,
+ &dyncol_to_cassandraCounter
+ },
+ {
+ validator_float,
+ &cassandra_to_dyncol_doubleFloat,
+ &dyncol_to_cassandraFloat
+ },
+ {
+ validator_double,
+ &cassandra_to_dyncol_doubleDouble,
+ &dyncol_to_cassandraDouble
+ },
+ {
+ validator_blob,
+ &cassandra_to_dyncol_strBytes,
+ &dyncol_to_cassandraBytes
+ },
+ {
+ validator_ascii,
+ &cassandra_to_dyncol_strAscii,
+ &dyncol_to_cassandraAscii
+ },
+ {
+ validator_text,
+ &cassandra_to_dyncol_strUTF8,
+ &dyncol_to_cassandraUTF8
+ },
+ {
+ validator_timestamp,
+ &cassandra_to_dyncol_intLong,
+ &dyncol_to_cassandraLong
+ },
+ {
+ validator_uuid,
+ &cassandra_to_dyncol_strUUID,
+ &dyncol_to_cassandraUUID
+ },
+ {
+ validator_boolean,
+ &cassandra_to_dyncol_intBool,
+ &dyncol_to_cassandraBool
+ },
+ {
+ validator_varint,
+ &cassandra_to_dyncol_strBytes,
+ &dyncol_to_cassandraBytes
+ },
+ {
+ validator_decimal,
+ &cassandra_to_dyncol_strBytes,
+ &dyncol_to_cassandraBytes
+ }
+};
+
+CASSANDRA_TYPE get_cassandra_type(const char *validator)
+{
+ CASSANDRA_TYPE rc;
+ switch(validator[32])
+ {
+ case 'L':
+ rc= CT_BIGINT;
+ break;
+ case 'I':
+ rc= (validator[35] == '3' ? CT_INT : CT_VARINT);
+ rc= CT_INT;
+ break;
+ case 'C':
+ rc= CT_COUNTER;
+ break;
+ case 'F':
+ rc= CT_FLOAT;
+ break;
+ case 'D':
+ switch (validator[33])
+ {
+ case 'o':
+ rc= CT_DOUBLE;
+ break;
+ case 'a':
+ rc= CT_TIMESTAMP;
+ break;
+ case 'e':
+ rc= CT_DECIMAL;
+ break;
+ default:
+ rc= CT_BLOB;
+ break;
+ }
+ break;
+ case 'B':
+ rc= (validator[33] == 'o' ? CT_BOOLEAN : CT_BLOB);
+ break;
+ case 'A':
+ rc= CT_ASCII;
+ break;
+ case 'U':
+ rc= (validator[33] == 'T' ? CT_TEXT : CT_UUID);
+ break;
+ default:
+ rc= CT_BLOB;
+ }
+ DBUG_ASSERT(strcmp(cassandra_types[rc].name, validator) == 0);
+ return rc;
+}
+
+ColumnDataConverter *map_field_to_validator(Field *field, const char *validator_name)
+{
+ ColumnDataConverter *res= NULL;
+
+ switch(field->type()) {
+ case MYSQL_TYPE_TINY:
+ if (!strcmp(validator_name, validator_boolean))
+ {
+ res= new TinyintDataConverter;
+ break;
+ }
+ /* fall through: */
+ case MYSQL_TYPE_SHORT:
+ case MYSQL_TYPE_LONGLONG:
+ {
+ bool is_counter= false;
+ if (!strcmp(validator_name, validator_bigint) ||
+ !strcmp(validator_name, validator_timestamp) ||
+ (is_counter= !strcmp(validator_name, validator_counter)))
+ res= new BigintDataConverter(!is_counter);
+ break;
+ }
+ case MYSQL_TYPE_FLOAT:
+ if (!strcmp(validator_name, validator_float))
+ res= new FloatDataConverter;
+ break;
+
+ case MYSQL_TYPE_DOUBLE:
+ if (!strcmp(validator_name, validator_double))
+ res= new DoubleDataConverter;
+ break;
+
+ case MYSQL_TYPE_TIMESTAMP:
+ if (!strcmp(validator_name, validator_timestamp))
+ res= new TimestampDataConverter;
+ break;
+
+ case MYSQL_TYPE_STRING: // these are space padded CHAR(n) strings.
+ if (!strcmp(validator_name, validator_uuid) &&
+ field->real_type() == MYSQL_TYPE_STRING &&
+ field->field_length == 36)
+ {
+ // UUID maps to CHAR(36), its text representation
+ res= new UuidDataConverter;
+ break;
+ }
+ /* fall through: */
+ case MYSQL_TYPE_VAR_STRING:
+ case MYSQL_TYPE_VARCHAR:
+ {
+ /*
+ Cassandra's "varint" type is a binary-encoded arbitary-length
+ big-endian number.
+ - It can be mapped to VARBINARY(N), with sufficiently big N.
+ - If the value does not fit into N bytes, it is an error. We should not
+ truncate it, because that is just as good as returning garbage.
+ - varint should not be mapped to BINARY(N), because BINARY(N) values
+ are zero-padded, which will work as multiplying the value by
+ 2^k for some value of k.
+ */
+ if (field->type() == MYSQL_TYPE_VARCHAR &&
+ field->binary() &&
+ (!strcmp(validator_name, validator_varint) ||
+ !strcmp(validator_name, validator_decimal)))
+ {
+ res= new StringCopyConverter(field->field_length);
+ break;
+ }
+
+ if (!strcmp(validator_name, validator_blob) ||
+ !strcmp(validator_name, validator_ascii) ||
+ !strcmp(validator_name, validator_text))
+ {
+ res= new StringCopyConverter((size_t)-1);
+ }
+ break;
+ }
+ case MYSQL_TYPE_LONG:
+ if (!strcmp(validator_name, validator_int))
+ res= new Int32DataConverter;
+ break;
+
+ default:;
+ }
+ return res;
+}
+
+
+bool ha_cassandra::setup_field_converters(Field **field_arg, uint n_fields)
+{
+ char *col_name;
+ int col_name_len;
+ char *col_type;
+ int col_type_len;
+ size_t ddl_fields= se->get_ddl_size();
+ const char *default_type= se->get_default_validator();
+ uint max_non_default_fields;
+ DBUG_ENTER("ha_cassandra::setup_field_converters");
+ DBUG_ASSERT(default_type);
+
+ DBUG_ASSERT(!field_converters);
+ DBUG_ASSERT(dyncol_set == 0 || dyncol_set == 1);
+
+ /*
+ We always should take into account that in case of using dynamic columns
+ sql description contain one field which does not described in
+ Cassandra DDL also key field is described separately. So that
+ is why we use "n_fields - dyncol_set - 1" or "ddl_fields + 2".
+ */
+ max_non_default_fields= ddl_fields + 2 - n_fields;
+ if (ddl_fields < (n_fields - dyncol_set - 1))
+ {
+ se->print_error("Some of SQL fields were not mapped to Cassandra's fields");
+ my_error(ER_INTERNAL_ERROR, MYF(0), se->error_str());
+ DBUG_RETURN(true);
+ }
+
+ /* allocate memory in one chunk */
+ size_t memsize= sizeof(ColumnDataConverter*) * n_fields +
+ (sizeof(LEX_STRING) + sizeof(CASSANDRA_TYPE_DEF))*
+ (dyncol_set ? max_non_default_fields : 0);
+ if (!(field_converters= (ColumnDataConverter**)my_malloc(memsize, MYF(0))))
+ DBUG_RETURN(true);
+ bzero(field_converters, memsize);
+ n_field_converters= n_fields;
+
+ if (dyncol_set)
+ {
+ special_type_field_converters=
+ (CASSANDRA_TYPE_DEF *)(field_converters + n_fields);
+ special_type_field_names=
+ ((LEX_STRING*)(special_type_field_converters + max_non_default_fields));
+
+ if (my_init_dynamic_array(&dynamic_values,
+ sizeof(DYNAMIC_COLUMN_VALUE),
+ DYNCOL_USUAL, DYNCOL_DELTA, MYF(0)))
+ DBUG_RETURN(true);
+ else
+ if (my_init_dynamic_array(&dynamic_names,
+ sizeof(LEX_STRING),
+ DYNCOL_USUAL, DYNCOL_DELTA,MYF(0)))
+ {
+ delete_dynamic(&dynamic_values);
+ DBUG_RETURN(true);
+ }
+ else
+ if (init_dynamic_string(&dynamic_rec, NULL,
+ DYNCOL_USUAL_REC, DYNCOL_DELTA_REC))
+ {
+ delete_dynamic(&dynamic_values);
+ delete_dynamic(&dynamic_names);
+ DBUG_RETURN(true);
+ }
+
+ /* Dynamic column field has special processing */
+ field_converters[dyncol_field]= NULL;
+
+ default_type_def= cassandra_types + get_cassandra_type(default_type);
+ }
+
+ se->first_ddl_column();
+ uint n_mapped= 0;
+ while (!se->next_ddl_column(&col_name, &col_name_len, &col_type,
+ &col_type_len))
+ {
+ Field **field;
+ uint i;
+ /* Mapping for the 1st field is already known */
+ for (field= field_arg + 1, i= 1; *field; field++, i++)
+ {
+ if ((!dyncol_set || dyncol_field != i) &&
+ !strcmp((*field)->field_name, col_name))
+ {
+ n_mapped++;
+ ColumnDataConverter **conv= field_converters + (*field)->field_index;
+ if (!(*conv= map_field_to_validator(*field, col_type)))
+ {
+ se->print_error("Failed to map column %s to datatype %s",
+ (*field)->field_name, col_type);
+ my_error(ER_INTERNAL_ERROR, MYF(0), se->error_str());
+ DBUG_RETURN(true);
+ }
+ (*conv)->field= *field;
+ break;
+ }
+ }
+ if (dyncol_set && !(*field)) // is needed and not found
+ {
+ DBUG_PRINT("info",("Field not found: %s", col_name));
+ if (strcmp(col_type, default_type))
+ {
+ DBUG_PRINT("info",("Field '%s' non-default type: '%s'",
+ col_name, col_type));
+ special_type_field_names[n_special_type_fields].length= col_name_len;
+ special_type_field_names[n_special_type_fields].str= col_name;
+ special_type_field_converters[n_special_type_fields]=
+ cassandra_types[get_cassandra_type(col_type)];
+ n_special_type_fields++;
+ }
+ }
+ }
+
+ if (n_mapped != n_fields - 1 - dyncol_set)
+ {
+ Field *first_unmapped= NULL;
+ /* Find the first field */
+ for (uint i= 1; i < n_fields;i++)
+ {
+ if (!field_converters[i])
+ {
+ first_unmapped= field_arg[i];
+ break;
+ }
+ }
+ DBUG_ASSERT(first_unmapped);
+
+ se->print_error("Field `%s` could not be mapped to any field in Cassandra",
+ first_unmapped->field_name);
+ my_error(ER_INTERNAL_ERROR, MYF(0), se->error_str());
+ DBUG_RETURN(true);
+ }
+
+ /*
+ Setup type conversion for row_key.
+ */
+ se->get_rowkey_type(&col_name, &col_type);
+ if (col_name && strcmp(col_name, (*field_arg)->field_name))
+ {
+ se->print_error("PRIMARY KEY column must match Cassandra's name '%s'",
+ col_name);
+ my_error(ER_INTERNAL_ERROR, MYF(0), se->error_str());
+ DBUG_RETURN(true);
+ }
+ if (!col_name && strcmp("rowkey", (*field_arg)->field_name))
+ {
+ se->print_error("target column family has no key_alias defined, "
+ "PRIMARY KEY column must be named 'rowkey'");
+ my_error(ER_INTERNAL_ERROR, MYF(0), se->error_str());
+ DBUG_RETURN(true);
+ }
+
+ if (col_type != NULL)
+ {
+ if (!(rowkey_converter= map_field_to_validator(*field_arg, col_type)))
+ {
+ se->print_error("Failed to map PRIMARY KEY to datatype %s", col_type);
+ my_error(ER_INTERNAL_ERROR, MYF(0), se->error_str());
+ DBUG_RETURN(true);
+ }
+ rowkey_converter->field= *field_arg;
+ }
+ else
+ {
+ se->print_error("Cassandra's rowkey has no defined datatype (todo: support this)");
+ my_error(ER_INTERNAL_ERROR, MYF(0), se->error_str());
+ DBUG_RETURN(true);
+ }
+
+ DBUG_RETURN(false);
+}
+
+
+void ha_cassandra::free_field_converters()
+{
+ delete rowkey_converter;
+ rowkey_converter= NULL;
+
+ if (dyncol_set)
+ {
+ delete_dynamic(&dynamic_values);
+ delete_dynamic(&dynamic_names);
+ dynstr_free(&dynamic_rec);
+ }
+ if (field_converters)
+ {
+ for (uint i=0; i < n_field_converters; i++)
+ if (field_converters[i])
+ {
+ DBUG_ASSERT(!dyncol_set || i != dyncol_field);
+ delete field_converters[i];
+ }
+ my_free(field_converters);
+ field_converters= NULL;
+ }
+}
+
+
+int ha_cassandra::index_init(uint idx, bool sorted)
+{
+ int ires;
+ if (!se && (ires= connect_and_check_options(table)))
+ return ires;
+ return 0;
+}
+
+void store_key_image_to_rec(Field *field, uchar *ptr, uint len);
+
+int ha_cassandra::index_read_map(uchar *buf, const uchar *key,
+ key_part_map keypart_map,
+ enum ha_rkey_function find_flag)
+{
+ int rc= 0;
+ DBUG_ENTER("ha_cassandra::index_read_map");
+
+ if (find_flag != HA_READ_KEY_EXACT)
+ {
+ DBUG_ASSERT(0); /* Non-equality lookups should never be done */
+ DBUG_RETURN(HA_ERR_WRONG_COMMAND);
+ }
+
+ uint key_len= calculate_key_len(table, active_index, key, keypart_map);
+ store_key_image_to_rec(table->field[0], (uchar*)key, key_len);
+
+ char *cass_key;
+ int cass_key_len;
+ my_bitmap_map *old_map;
+
+ old_map= dbug_tmp_use_all_columns(table, table->read_set);
+
+ if (rowkey_converter->mariadb_to_cassandra(&cass_key, &cass_key_len))
+ {
+ /* We get here when making lookups like uuid_column='not-an-uuid' */
+ dbug_tmp_restore_column_map(table->read_set, old_map);
+ DBUG_RETURN(HA_ERR_KEY_NOT_FOUND);
+ }
+
+ dbug_tmp_restore_column_map(table->read_set, old_map);
+
+ bool found;
+ if (se->get_slice(cass_key, cass_key_len, &found))
+ {
+ my_error(ER_INTERNAL_ERROR, MYF(0), se->error_str());
+ rc= HA_ERR_INTERNAL_ERROR;
+ }
+
+ /* TODO: what if we're not reading all columns?? */
+ if (!found)
+ rc= HA_ERR_KEY_NOT_FOUND;
+ else
+ rc= read_cassandra_columns(false);
+
+ DBUG_RETURN(rc);
+}
+
+
+void ha_cassandra::print_conversion_error(const char *field_name,
+ char *cass_value,
+ int cass_value_len)
+{
+ char buf[32];
+ char *p= cass_value;
+ size_t i= 0;
+ for (; (i < sizeof(buf)-1) && (p < cass_value + cass_value_len); p++)
+ {
+ buf[i++]= map2number[(*p >> 4) & 0xF];
+ buf[i++]= map2number[*p & 0xF];
+ }
+ buf[i]=0;
+
+ se->print_error("Unable to convert value for field `%s` from Cassandra's data"
+ " format. Source data is %d bytes, 0x%s%s",
+ field_name, cass_value_len, buf,
+ (i == sizeof(buf) - 1)? "..." : "");
+ my_error(ER_INTERNAL_ERROR, MYF(0), se->error_str());
+}
+
+
+
+CASSANDRA_TYPE_DEF * ha_cassandra::get_cassandra_field_def(char *cass_name,
+ int cass_name_len)
+{
+ CASSANDRA_TYPE_DEF *type= default_type_def;
+ for(uint i= 0; i < n_special_type_fields; i++)
+ {
+ if (cass_name_len == (int)special_type_field_names[i].length &&
+ memcmp(cass_name, special_type_field_names[i].str,
+ cass_name_len) == 0)
+ {
+ type= special_type_field_converters + i;
+ break;
+ }
+ }
+ return type;
+}
+
+int ha_cassandra::read_cassandra_columns(bool unpack_pk)
+{
+ MEM_ROOT strings_root;
+ char *cass_name;
+ char *cass_value;
+ int cass_value_len, cass_name_len;
+ Field **field;
+ int res= 0;
+ ulong total_name_len= 0;
+
+ clear_alloc_root(&strings_root);
+ /*
+ cassandra_to_mariadb() calls will use field->store(...) methods, which
+ require that the column is in the table->write_set
+ */
+ my_bitmap_map *old_map;
+ old_map= dbug_tmp_use_all_columns(table, table->write_set);
+
+ /* Start with all fields being NULL */
+ for (field= table->field + 1; *field; field++)
+ (*field)->set_null();
+
+ while (!se->get_next_read_column(&cass_name, &cass_name_len,
+ &cass_value, &cass_value_len))
+ {
+ // map to our column. todo: use hash or something..
+ bool found= 0;
+ for (field= table->field + 1; *field; field++)
+ {
+ uint fieldnr= (*field)->field_index;
+ if ((!dyncol_set || dyncol_field != fieldnr) &&
+ !strcmp((*field)->field_name, cass_name))
+ {
+ found= 1;
+ (*field)->set_notnull();
+ if (field_converters[fieldnr]->cassandra_to_mariadb(cass_value,
+ cass_value_len))
+ {
+ print_conversion_error((*field)->field_name, cass_value,
+ cass_value_len);
+ res=1;
+ goto err;
+ }
+ break;
+ }
+ }
+ if (dyncol_set && !found)
+ {
+ DYNAMIC_COLUMN_VALUE val;
+ LEX_STRING nm;
+ CASSANDRA_TYPE_DEF *type= get_cassandra_field_def(cass_name,
+ cass_name_len);
+ nm.str= cass_name;
+ nm.length= cass_name_len;
+ if (nm.length > MAX_NAME_LENGTH)
+ {
+ se->print_error("Unable to convert value for field `%s`"
+ " from Cassandra's data format. Name"
+ " length exceed limit of %u: '%s'",
+ table->field[dyncol_field]->field_name,
+ (uint)MAX_NAME_LENGTH, cass_name);
+ my_error(ER_INTERNAL_ERROR, MYF(0), se->error_str());
+ res=1;
+ goto err;
+ }
+ total_name_len+= cass_name_len;
+ if (nm.length > MAX_TOTAL_NAME_LENGTH)
+ {
+ se->print_error("Unable to convert value for field `%s`"
+ " from Cassandra's data format. Sum of all names"
+ " length exceed limit of %lu",
+ table->field[dyncol_field]->field_name,
+ cass_name, (uint)MAX_TOTAL_NAME_LENGTH);
+ my_error(ER_INTERNAL_ERROR, MYF(0), se->error_str());
+ res=1;
+ goto err;
+ }
+
+ if ((res= (*(type->cassandra_to_dynamic))(cass_value,
+ cass_value_len, &val,
+ &strings_root)) ||
+ insert_dynamic(&dynamic_names, (uchar *) &nm) ||
+ insert_dynamic(&dynamic_values, (uchar *) &val))
+ {
+ if (res)
+ {
+ print_conversion_error(cass_name, cass_value, cass_value_len);
+ }
+ free_strings_memroot(&strings_root);
+ // EOM shouldm be already reported if happened
+ res= 1;
+ goto err;
+ }
+ }
+ }
+
+ dynamic_rec.length= 0;
+ if (dyncol_set)
+ {
+ if (mariadb_dyncol_create_many_named(&dynamic_rec,
+ dynamic_names.elements,
+ (LEX_STRING *)dynamic_names.buffer,
+ (DYNAMIC_COLUMN_VALUE *)
+ dynamic_values.buffer,
+ FALSE) < 0)
+ dynamic_rec.length= 0;
+
+ free_strings_memroot(&strings_root);
+ dynamic_values.elements= dynamic_names.elements= 0;
+
+ if (dynamic_rec.length == 0)
+ table->field[dyncol_field]->set_null();
+ else
+ {
+ Field_blob *blob= (Field_blob *)table->field[dyncol_field];
+ blob->set_notnull();
+ blob->store_length(dynamic_rec.length);
+ *((char **)(((char *)blob->ptr) + blob->pack_length_no_ptr()))=
+ dynamic_rec.str;
+ }
+ }
+
+ if (unpack_pk)
+ {
+ /* Unpack rowkey to primary key */
+ field= table->field;
+ (*field)->set_notnull();
+ se->get_read_rowkey(&cass_value, &cass_value_len);
+ if (rowkey_converter->cassandra_to_mariadb(cass_value, cass_value_len))
+ {
+ print_conversion_error((*field)->field_name, cass_value, cass_value_len);
+ res=1;
+ goto err;
+ }
+ }
+
+err:
+ dbug_tmp_restore_column_map(table->write_set, old_map);
+ return res;
+}
+
+int ha_cassandra::read_dyncol(uint *count,
+ DYNAMIC_COLUMN_VALUE **vals,
+ LEX_STRING **names,
+ String *valcol)
+{
+ String *strcol;
+ DYNAMIC_COLUMN col;
+
+ enum enum_dyncol_func_result rc;
+ DBUG_ENTER("ha_cassandra::read_dyncol");
+
+ Field *field= table->field[dyncol_field];
+ DBUG_ASSERT(field->type() == MYSQL_TYPE_BLOB);
+ /* It is blob and it does not use buffer */
+ strcol= field->val_str(NULL, valcol);
+ if (field->is_null())
+ {
+ *count= 0;
+ *names= 0;
+ *vals= 0;
+ DBUG_RETURN(0); // nothing to write
+ }
+ /*
+ dynamic_column_vals only read the string so we can
+ cheat here with assignment
+ */
+ bzero(&col, sizeof(col));
+ col.str= (char *)strcol->ptr();
+ col.length= strcol->length();
+ if ((rc= mariadb_dyncol_unpack(&col, count, names, vals)) < 0)
+ {
+ dynamic_column_error_message(rc);
+ DBUG_RETURN(HA_ERR_INTERNAL_ERROR);
+ }
+ DBUG_RETURN(0);
+}
+
+int ha_cassandra::write_dynamic_row(uint count,
+ DYNAMIC_COLUMN_VALUE *vals,
+ LEX_STRING *names)
+{
+ uint i;
+ DBUG_ENTER("ha_cassandra::write_dynamic_row");
+ DBUG_ASSERT(dyncol_set);
+
+
+ for (i= 0; i < count; i++)
+ {
+ char buff[16];
+ CASSANDRA_TYPE_DEF *type;
+ void *freemem= NULL;
+ char *cass_data;
+ int cass_data_len;
+
+ DBUG_PRINT("info", ("field %*s", (int)names[i].length, names[i].str));
+ type= get_cassandra_field_def(names[i].str, (int) names[i].length);
+ if ((*type->dynamic_to_cassandra)(vals +i, &cass_data, &cass_data_len,
+ buff, &freemem))
+ {
+ my_error(ER_WARN_DATA_OUT_OF_RANGE, MYF(0),
+ names[i].str, insert_lineno);
+ DBUG_RETURN(HA_ERR_GENERIC);
+ }
+ se->add_insert_column(names[i].str, names[i].length,
+ cass_data, cass_data_len);
+ if (freemem)
+ my_free(freemem);
+ }
+ DBUG_RETURN(0);
+}
+
+void ha_cassandra::free_dynamic_row(DYNAMIC_COLUMN_VALUE **vals,
+ LEX_STRING **names)
+{
+ if (*vals)
+ {
+ my_free(*vals);
+ *vals= 0;
+ }
+ if (*names)
+ {
+ my_free(*names);
+ *names= 0;
+ }
+}
+
+int ha_cassandra::write_row(uchar *buf)
+{
+ my_bitmap_map *old_map;
+ int ires;
+ DBUG_ENTER("ha_cassandra::write_row");
+
+ if (!se && (ires= connect_and_check_options(table)))
+ DBUG_RETURN(ires);
+
+ if (!doing_insert_batch)
+ se->clear_insert_buffer();
+
+ old_map= dbug_tmp_use_all_columns(table, table->read_set);
+
+ insert_lineno++;
+
+ /* Convert the key */
+ char *cass_key;
+ int cass_key_len;
+ if (rowkey_converter->mariadb_to_cassandra(&cass_key, &cass_key_len))
+ {
+ my_error(ER_WARN_DATA_OUT_OF_RANGE, MYF(0),
+ rowkey_converter->field->field_name, insert_lineno);
+ dbug_tmp_restore_column_map(table->read_set, old_map);
+ DBUG_RETURN(HA_ERR_INTERNAL_ERROR);
+ }
+ se->start_row_insert(cass_key, cass_key_len);
+
+ /* Convert other fields */
+ for (uint i= 1; i < table->s->fields; i++)
+ {
+ char *cass_data;
+ int cass_data_len;
+ if (dyncol_set && dyncol_field == i)
+ {
+ String valcol;
+ DYNAMIC_COLUMN_VALUE *vals;
+ LEX_STRING *names;
+ uint count;
+ int rc;
+ DBUG_ASSERT(field_converters[i] == NULL);
+ if (!(rc= read_dyncol(&count, &vals, &names, &valcol)))
+ rc= write_dynamic_row(count, vals, names);
+ free_dynamic_row(&vals, &names);
+ if (rc)
+ {
+ dbug_tmp_restore_column_map(table->read_set, old_map);
+ DBUG_RETURN(rc);
+ }
+ }
+ else
+ {
+ if (field_converters[i]->mariadb_to_cassandra(&cass_data,
+ &cass_data_len))
+ {
+ my_error(ER_WARN_DATA_OUT_OF_RANGE, MYF(0),
+ field_converters[i]->field->field_name, insert_lineno);
+ dbug_tmp_restore_column_map(table->read_set, old_map);
+ DBUG_RETURN(HA_ERR_INTERNAL_ERROR);
+ }
+ se->add_insert_column(field_converters[i]->field->field_name, 0,
+ cass_data, cass_data_len);
+ }
+ }
+
+ dbug_tmp_restore_column_map(table->read_set, old_map);
+
+ bool res;
+
+ if (doing_insert_batch)
+ {
+ res= 0;
+ if (++insert_rows_batched >= THDVAR(table->in_use, insert_batch_size))
+ {
+ res= se->do_insert();
+ insert_rows_batched= 0;
+ }
+ }
+ else
+ res= se->do_insert();
+
+ if (res)
+ my_error(ER_INTERNAL_ERROR, MYF(0), se->error_str());
+
+ DBUG_RETURN(res? HA_ERR_INTERNAL_ERROR: 0);
+}
+
+
+void ha_cassandra::start_bulk_insert(ha_rows rows, uint flags)
+{
+ int ires;
+ if (!se && (ires= connect_and_check_options(table)))
+ return;
+
+ doing_insert_batch= true;
+ insert_rows_batched= 0;
+
+ se->clear_insert_buffer();
+}
+
+
+int ha_cassandra::end_bulk_insert()
+{
+ DBUG_ENTER("ha_cassandra::end_bulk_insert");
+
+ /* Flush out the insert buffer */
+ doing_insert_batch= false;
+ bool bres= se->do_insert();
+ se->clear_insert_buffer();
+
+ DBUG_RETURN(bres? HA_ERR_INTERNAL_ERROR: 0);
+}
+
+
+int ha_cassandra::rnd_init(bool scan)
+{
+ bool bres;
+ int ires;
+ DBUG_ENTER("ha_cassandra::rnd_init");
+
+ if (!se && (ires= connect_and_check_options(table)))
+ DBUG_RETURN(ires);
+
+ if (!scan)
+ {
+ /* Prepare for rnd_pos() calls. We don't need to anything. */
+ DBUG_RETURN(0);
+ }
+
+ if (dyncol_set)
+ {
+ se->clear_read_all_columns();
+ }
+ else
+ {
+ se->clear_read_columns();
+ for (uint i= 1; i < table->s->fields; i++)
+ se->add_read_column(table->field[i]->field_name);
+ }
+
+ se->read_batch_size= THDVAR(table->in_use, rnd_batch_size);
+ bres= se->get_range_slices(false);
+ if (bres)
+ my_error(ER_INTERNAL_ERROR, MYF(0), se->error_str());
+
+ DBUG_RETURN(bres? HA_ERR_INTERNAL_ERROR: 0);
+}
+
+
+int ha_cassandra::rnd_end()
+{
+ DBUG_ENTER("ha_cassandra::rnd_end");
+
+ se->finish_reading_range_slices();
+ DBUG_RETURN(0);
+}
+
+
+int ha_cassandra::rnd_next(uchar *buf)
+{
+ int rc;
+ bool reached_eof;
+ DBUG_ENTER("ha_cassandra::rnd_next");
+
+ // Unpack and return the next record.
+ if (se->get_next_range_slice_row(&reached_eof))
+ {
+ rc= HA_ERR_INTERNAL_ERROR;
+ }
+ else
+ {
+ if (reached_eof)
+ rc= HA_ERR_END_OF_FILE;
+ else
+ rc= read_cassandra_columns(true);
+ }
+
+ DBUG_RETURN(rc);
+}
+
+
+int ha_cassandra::delete_all_rows()
+{
+ bool bres;
+ int ires;
+ DBUG_ENTER("ha_cassandra::delete_all_rows");
+
+ if (!se && (ires= connect_and_check_options(table)))
+ DBUG_RETURN(ires);
+
+ bres= se->truncate();
+
+ if (bres)
+ my_error(ER_INTERNAL_ERROR, MYF(0), se->error_str());
+
+ DBUG_RETURN(bres? HA_ERR_INTERNAL_ERROR: 0);
+}
+
+
+int ha_cassandra::delete_row(const uchar *buf)
+{
+ bool bres;
+ DBUG_ENTER("ha_cassandra::delete_row");
+
+ bres= se->remove_row();
+
+ if (bres)
+ my_error(ER_INTERNAL_ERROR, MYF(0), se->error_str());
+
+ DBUG_RETURN(bres? HA_ERR_INTERNAL_ERROR: 0);
+}
+
+
+int ha_cassandra::info(uint flag)
+{
+ DBUG_ENTER("ha_cassandra::info");
+
+ if (!table)
+ return 1;
+
+ if (flag & HA_STATUS_VARIABLE)
+ {
+ stats.records= 1000;
+ stats.deleted= 0;
+ }
+ if (flag & HA_STATUS_CONST)
+ {
+ ref_length= table->field[0]->key_length();
+ }
+
+ DBUG_RETURN(0);
+}
+
+
+void key_copy(uchar *to_key, uchar *from_record, KEY *key_info,
+ uint key_length, bool with_zerofill);
+
+
+void ha_cassandra::position(const uchar *record)
+{
+ DBUG_ENTER("ha_cassandra::position");
+
+ /* Copy the primary key to rowid */
+ key_copy(ref, (uchar*)record, &table->key_info[0],
+ table->field[0]->key_length(), true);
+
+ DBUG_VOID_RETURN;
+}
+
+
+int ha_cassandra::rnd_pos(uchar *buf, uchar *pos)
+{
+ int rc;
+ DBUG_ENTER("ha_cassandra::rnd_pos");
+
+ int save_active_index= active_index;
+ active_index= 0; /* The primary key */
+ rc= index_read_map(buf, pos, key_part_map(1), HA_READ_KEY_EXACT);
+
+ active_index= save_active_index;
+
+ DBUG_RETURN(rc);
+}
+
+
+int ha_cassandra::reset()
+{
+ doing_insert_batch= false;
+ insert_lineno= 0;
+ if (se)
+ {
+ se->set_consistency_levels(THDVAR(table->in_use, read_consistency),
+ THDVAR(table->in_use, write_consistency));
+ }
+ return 0;
+}
+
+/////////////////////////////////////////////////////////////////////////////
+// MRR implementation
+/////////////////////////////////////////////////////////////////////////////
+
+
+/*
+ - The key can be only primary key
+ - allow equality-ranges only.
+ - anything else?
+*/
+ha_rows ha_cassandra::multi_range_read_info_const(uint keyno, RANGE_SEQ_IF *seq,
+ void *seq_init_param,
+ uint n_ranges, uint *bufsz,
+ uint *flags, Cost_estimate *cost)
+{
+ /* No support for const ranges so far */
+ return HA_POS_ERROR;
+}
+
+
+ha_rows ha_cassandra::multi_range_read_info(uint keyno, uint n_ranges, uint keys,
+ uint key_parts, uint *bufsz,
+ uint *flags, Cost_estimate *cost)
+{
+ /* Can only be equality lookups on the primary key... */
+ // TODO anything else?
+ *flags &= ~HA_MRR_USE_DEFAULT_IMPL;
+ *flags |= HA_MRR_NO_ASSOCIATION;
+
+ return 10;
+}
+
+
+int ha_cassandra::multi_range_read_init(RANGE_SEQ_IF *seq, void *seq_init_param,
+ uint n_ranges, uint mode, HANDLER_BUFFER *buf)
+{
+ int res;
+ mrr_iter= seq->init(seq_init_param, n_ranges, mode);
+ mrr_funcs= *seq;
+ res= mrr_start_read();
+ return (res? HA_ERR_INTERNAL_ERROR: 0);
+}
+
+
+bool ha_cassandra::mrr_start_read()
+{
+ uint key_len;
+
+ my_bitmap_map *old_map;
+ old_map= dbug_tmp_use_all_columns(table, table->read_set);
+
+ se->new_lookup_keys();
+
+ while (!(source_exhausted= mrr_funcs.next(mrr_iter, &mrr_cur_range)))
+ {
+ char *cass_key;
+ int cass_key_len;
+
+ DBUG_ASSERT(mrr_cur_range.range_flag & EQ_RANGE);
+
+ uchar *key= (uchar*)mrr_cur_range.start_key.key;
+ key_len= mrr_cur_range.start_key.length;
+ //key_len= calculate_key_len(table, active_index, key, keypart_map); // NEED THIS??
+ store_key_image_to_rec(table->field[0], (uchar*)key, key_len);
+
+ rowkey_converter->mariadb_to_cassandra(&cass_key, &cass_key_len);
+
+ // Primitive buffer control
+ if (se->add_lookup_key(cass_key, cass_key_len) >
+ THDVAR(table->in_use, multiget_batch_size))
+ break;
+ }
+
+ dbug_tmp_restore_column_map(table->read_set, old_map);
+
+ return se->multiget_slice();
+}
+
+
+int ha_cassandra::multi_range_read_next(range_id_t *range_info)
+{
+ int res;
+ while(1)
+ {
+ if (!se->get_next_multiget_row())
+ {
+ res= read_cassandra_columns(true);
+ break;
+ }
+ else
+ {
+ if (source_exhausted)
+ {
+ res= HA_ERR_END_OF_FILE;
+ break;
+ }
+ else
+ {
+ if (mrr_start_read())
+ {
+ res= HA_ERR_INTERNAL_ERROR;
+ break;
+ }
+ }
+ }
+ /*
+ We get here if we've refilled the buffer and done another read. Try
+ reading from results again
+ */
+ }
+ return res;
+}
+
+
+int ha_cassandra::multi_range_read_explain_info(uint mrr_mode, char *str, size_t size)
+{
+ const char *mrr_str= "multiget_slice";
+
+ if (!(mrr_mode & HA_MRR_USE_DEFAULT_IMPL))
+ {
+ uint mrr_str_len= strlen(mrr_str);
+ uint copy_len= min(mrr_str_len, size);
+ memcpy(str, mrr_str, size);
+ return copy_len;
+ }
+ return 0;
+}
+
+
+class Column_name_enumerator_impl : public Column_name_enumerator
+{
+ ha_cassandra *obj;
+ uint idx;
+public:
+ Column_name_enumerator_impl(ha_cassandra *obj_arg) : obj(obj_arg), idx(1) {}
+ const char* get_next_name()
+ {
+ if (idx == obj->table->s->fields)
+ return NULL;
+ else
+ return obj->table->field[idx++]->field_name;
+ }
+};
+
+
+int ha_cassandra::update_row(const uchar *old_data, uchar *new_data)
+{
+ DYNAMIC_COLUMN_VALUE *oldvals, *vals;
+ LEX_STRING *oldnames, *names;
+ uint oldcount, count;
+ String oldvalcol, valcol;
+ my_bitmap_map *old_map;
+ int res;
+ DBUG_ENTER("ha_cassandra::update_row");
+ /* Currently, it is guaranteed that new_data == table->record[0] */
+ DBUG_ASSERT(new_data == table->record[0]);
+ /* For now, just rewrite the full record */
+ se->clear_insert_buffer();
+
+ old_map= dbug_tmp_use_all_columns(table, table->read_set);
+
+ char *old_key;
+ int old_key_len;
+ se->get_read_rowkey(&old_key, &old_key_len);
+
+ /* Get the key we're going to write */
+ char *new_key;
+ int new_key_len;
+ if (rowkey_converter->mariadb_to_cassandra(&new_key, &new_key_len))
+ {
+ my_error(ER_WARN_DATA_OUT_OF_RANGE, MYF(0),
+ rowkey_converter->field->field_name, insert_lineno);
+ dbug_tmp_restore_column_map(table->read_set, old_map);
+ DBUG_RETURN(HA_ERR_INTERNAL_ERROR);
+ }
+
+ /*
+ Compare it to the key we've read. For all types that Cassandra supports,
+ binary byte-wise comparison can be used
+ */
+ bool new_primary_key;
+ if (new_key_len != old_key_len || memcmp(old_key, new_key, new_key_len))
+ new_primary_key= true;
+ else
+ new_primary_key= false;
+
+ if (dyncol_set)
+ {
+ Field *field= table->field[dyncol_field];
+ /* move to get old_data */
+ my_ptrdiff_t diff;
+ diff= (my_ptrdiff_t) (old_data - new_data);
+ field->move_field_offset(diff); // Points now at old_data
+ if ((res= read_dyncol(&oldcount, &oldvals, &oldnames, &oldvalcol)))
+ DBUG_RETURN(res);
+ field->move_field_offset(-diff); // back to new_data
+ if ((res= read_dyncol(&count, &vals, &names, &valcol)))
+ {
+ free_dynamic_row(&oldvals, &oldnames);
+ DBUG_RETURN(res);
+ }
+ }
+
+ if (new_primary_key)
+ {
+ /*
+ Primary key value changed. This is essentially a DELETE + INSERT.
+ Add a DELETE operation into the batch
+ */
+ Column_name_enumerator_impl name_enumerator(this);
+ se->add_row_deletion(old_key, old_key_len, &name_enumerator,
+ oldnames,
+ (dyncol_set ? oldcount : 0));
+ oldcount= 0; // they will be deleted
+ }
+
+ se->start_row_insert(new_key, new_key_len);
+
+ /* Convert other fields */
+ for (uint i= 1; i < table->s->fields; i++)
+ {
+ char *cass_data;
+ int cass_data_len;
+ if (dyncol_set && dyncol_field == i)
+ {
+ DBUG_ASSERT(field_converters[i] == NULL);
+ if ((res= write_dynamic_row(count, vals, names)))
+ goto err;
+ }
+ else
+ {
+ if (field_converters[i]->mariadb_to_cassandra(&cass_data, &cass_data_len))
+ {
+ my_error(ER_WARN_DATA_OUT_OF_RANGE, MYF(0),
+ field_converters[i]->field->field_name, insert_lineno);
+ dbug_tmp_restore_column_map(table->read_set, old_map);
+ DBUG_RETURN(HA_ERR_INTERNAL_ERROR);
+ }
+ se->add_insert_column(field_converters[i]->field->field_name, 0,
+ cass_data, cass_data_len);
+ }
+ }
+ if (dyncol_set)
+ {
+ /* find removed fields */
+ uint i= 0, j= 0;
+ /* both array are sorted */
+ for(; i < oldcount; i++)
+ {
+ int scmp= 0;
+ while (j < count &&
+ (scmp = mariadb_dyncol_column_cmp_named(names + j,
+ oldnames + i)) < 0)
+ j++;
+ if (j < count &&
+ scmp == 0)
+ j++;
+ else
+ se->add_insert_delete_column(oldnames[i].str, oldnames[i].length);
+ }
+ }
+
+ dbug_tmp_restore_column_map(table->read_set, old_map);
+
+ res= se->do_insert();
+
+ if (res)
+ my_error(ER_INTERNAL_ERROR, MYF(0), se->error_str());
+
+err:
+ if (dyncol_set)
+ {
+ free_dynamic_row(&oldvals, &oldnames);
+ free_dynamic_row(&vals, &names);
+ }
+
+ DBUG_RETURN(res? HA_ERR_INTERNAL_ERROR: 0);
+}
+
+
+/*
+ We can't really have any locks for Cassandra Storage Engine. We're reading
+ from Cassandra cluster, and other clients can asynchronously modify the data.
+
+ We can enforce locking within this process, but this will not be useful.
+
+ Thus, store_lock() should express that:
+ - Writes do not block other writes
+ - Reads should not block anything either, including INSERTs.
+*/
+THR_LOCK_DATA **ha_cassandra::store_lock(THD *thd,
+ THR_LOCK_DATA **to,
+ enum thr_lock_type lock_type)
+{
+ DBUG_ENTER("ha_cassandra::store_lock");
+ if (lock_type != TL_IGNORE && lock.type == TL_UNLOCK)
+ {
+ /* Writes allow other writes */
+ if ((lock_type >= TL_WRITE_CONCURRENT_INSERT &&
+ lock_type <= TL_WRITE))
+ lock_type = TL_WRITE_ALLOW_WRITE;
+
+ /* Reads allow everything, including INSERTs */
+ if (lock_type == TL_READ_NO_INSERT)
+ lock_type = TL_READ;
+
+ lock.type= lock_type;
+ }
+ *to++= &lock;
+ DBUG_RETURN(to);
+}
+
+
+ha_rows ha_cassandra::records_in_range(uint inx, key_range *min_key,
+ key_range *max_key)
+{
+ DBUG_ENTER("ha_cassandra::records_in_range");
+ DBUG_RETURN(HA_POS_ERROR); /* Range scans are not supported */
+}
+
+
+/**
+ check_if_incompatible_data() called if ALTER TABLE can't detect otherwise
+ if new and old definition are compatible
+
+ @details If there are no other explicit signs like changed number of
+ fields this function will be called by compare_tables()
+ (sql/sql_tables.cc) to decide should we rewrite whole table or only .frm
+ file.
+
+*/
+
+bool ha_cassandra::check_if_incompatible_data(HA_CREATE_INFO *info,
+ uint table_changes)
+{
+ DBUG_ENTER("ha_cassandra::check_if_incompatible_data");
+ /* Checked, we intend to have this empty for Cassandra SE. */
+ DBUG_RETURN(COMPATIBLE_DATA_YES);
+}
+
+
+void Cassandra_se_interface::print_error(const char *format, ...)
+{
+ va_list ap;
+ va_start(ap, format);
+ // it's not a problem if output was truncated
+ my_vsnprintf(err_buffer, sizeof(err_buffer), format, ap);
+ va_end(ap);
+}
+
+
+struct st_mysql_storage_engine cassandra_storage_engine=
+{ MYSQL_HANDLERTON_INTERFACE_VERSION };
+
+static SHOW_VAR cassandra_status_variables[]= {
+ {"Cassandra_row_inserts",
+ (char*) &cassandra_counters.row_inserts, SHOW_LONG},
+ {"Cassandra_row_insert_batches",
+ (char*) &cassandra_counters.row_insert_batches, SHOW_LONG},
+
+ {"Cassandra_multiget_keys_scanned",
+ (char*) &cassandra_counters.multiget_keys_scanned, SHOW_LONG},
+ {"Cassandra_multiget_reads",
+ (char*) &cassandra_counters.multiget_reads, SHOW_LONG},
+ {"Cassandra_multiget_rows_read",
+ (char*) &cassandra_counters.multiget_rows_read, SHOW_LONG},
+
+ {"Cassandra_timeout_exceptions",
+ (char*) &cassandra_counters.timeout_exceptions, SHOW_LONG},
+ {"Cassandra_unavailable_exceptions",
+ (char*) &cassandra_counters.unavailable_exceptions, SHOW_LONG},
+ {NullS, NullS, SHOW_LONG}
+};
+
+
+
+
+maria_declare_plugin(cassandra)
+{
+ MYSQL_STORAGE_ENGINE_PLUGIN,
+ &cassandra_storage_engine,
+ "CASSANDRA",
+ "Monty Program Ab",
+ "Cassandra storage engine",
+ PLUGIN_LICENSE_GPL,
+ cassandra_init_func, /* Plugin Init */
+ cassandra_done_func, /* Plugin Deinit */
+ 0x0001, /* version number (0.1) */
+ cassandra_status_variables, /* status variables */
+ cassandra_system_variables, /* system variables */
+ "0.1", /* string version */
+ MariaDB_PLUGIN_MATURITY_EXPERIMENTAL /* maturity */
+}
+maria_declare_plugin_end;
diff --git a/storage/cassandra/ha_cassandra.h b/storage/cassandra/ha_cassandra.h
new file mode 100644
index 00000000000..cc42234e385
--- /dev/null
+++ b/storage/cassandra/ha_cassandra.h
@@ -0,0 +1,275 @@
+/*
+ Copyright (c) 2012, Monty Program Ab
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+#ifdef USE_PRAGMA_INTERFACE
+#pragma interface /* gcc class implementation */
+#endif
+
+
+#include "my_global.h" /* ulonglong */
+#include "thr_lock.h" /* THR_LOCK, THR_LOCK_DATA */
+#include "handler.h" /* handler */
+#include "my_base.h" /* ha_rows */
+
+#include "cassandra_se.h"
+
+/** @brief
+ CASSANDRA_SHARE is a structure that will be shared among all open handlers.
+ This example implements the minimum of what you will probably need.
+*/
+typedef struct st_cassandra_share {
+ char *table_name;
+ uint table_name_length,use_count;
+ mysql_mutex_t mutex;
+ THR_LOCK lock;
+} CASSANDRA_SHARE;
+
+class ColumnDataConverter;
+struct st_dynamic_column_value;
+typedef struct st_dynamic_column_value DYNAMIC_COLUMN_VALUE;
+
+struct ha_table_option_struct;
+
+
+struct st_dynamic_column_value;
+
+typedef bool (* CAS2DYN_CONVERTER)(const char *cass_data,
+ int cass_data_len,
+ struct st_dynamic_column_value *value,
+ MEM_ROOT *mem_root);
+typedef bool (* DYN2CAS_CONVERTER)(struct st_dynamic_column_value *value,
+ char **cass_data,
+ int *cass_data_len,
+ void *buf, void **freemem);
+struct cassandra_type_def
+{
+ const char *name;
+ CAS2DYN_CONVERTER cassandra_to_dynamic;
+ DYN2CAS_CONVERTER dynamic_to_cassandra;
+};
+
+typedef struct cassandra_type_def CASSANDRA_TYPE_DEF;
+
+enum cassandtra_type_enum {CT_BIGINT, CT_INT, CT_COUNTER, CT_FLOAT, CT_DOUBLE,
+ CT_BLOB, CT_ASCII, CT_TEXT, CT_TIMESTAMP, CT_UUID, CT_BOOLEAN, CT_VARINT,
+ CT_DECIMAL};
+
+typedef enum cassandtra_type_enum CASSANDRA_TYPE;
+
+
+
+/** @brief
+ Class definition for the storage engine
+*/
+class ha_cassandra: public handler
+{
+ friend class Column_name_enumerator_impl;
+ THR_LOCK_DATA lock; ///< MySQL lock
+ CASSANDRA_SHARE *share; ///< Shared lock info
+
+ Cassandra_se_interface *se;
+
+ /* description of static part of the table definition */
+ ColumnDataConverter **field_converters;
+ uint n_field_converters;
+
+ CASSANDRA_TYPE_DEF *default_type_def;
+ /* description of dynamic columns part */
+ CASSANDRA_TYPE_DEF *special_type_field_converters;
+ LEX_STRING *special_type_field_names;
+ uint n_special_type_fields;
+ DYNAMIC_ARRAY dynamic_values, dynamic_names;
+ DYNAMIC_STRING dynamic_rec;
+
+ ColumnDataConverter *rowkey_converter;
+
+ bool setup_field_converters(Field **field, uint n_fields);
+ void free_field_converters();
+
+ int read_cassandra_columns(bool unpack_pk);
+ int check_table_options(struct ha_table_option_struct* options);
+
+ bool doing_insert_batch;
+ ha_rows insert_rows_batched;
+
+ uint dyncol_field;
+ bool dyncol_set;
+
+ /* Used to produce 'wrong column %s at row %lu' warnings */
+ ha_rows insert_lineno;
+ void print_conversion_error(const char *field_name,
+ char *cass_value, int cass_value_len);
+ int connect_and_check_options(TABLE *table_arg);
+public:
+ ha_cassandra(handlerton *hton, TABLE_SHARE *table_arg);
+ ~ha_cassandra()
+ {
+ free_field_converters();
+ delete se;
+ }
+
+ /** @brief
+ The name that will be used for display purposes.
+ */
+ const char *table_type() const { return "CASSANDRA"; }
+
+ /** @brief
+ The name of the index type that will be used for display.
+ Don't implement this method unless you really have indexes.
+ */
+ const char *index_type(uint inx) { return "HASH"; }
+
+ /** @brief
+ The file extensions.
+ */
+ const char **bas_ext() const;
+
+ /** @brief
+ This is a list of flags that indicate what functionality the storage engine
+ implements. The current table flags are documented in handler.h
+ */
+ ulonglong table_flags() const
+ {
+ return HA_BINLOG_STMT_CAPABLE |
+ HA_REC_NOT_IN_SEQ |
+ HA_NO_TRANSACTIONS |
+ HA_REQUIRE_PRIMARY_KEY |
+ HA_PRIMARY_KEY_IN_READ_INDEX |
+ HA_PRIMARY_KEY_REQUIRED_FOR_POSITION |
+ HA_NO_AUTO_INCREMENT |
+ HA_TABLE_SCAN_ON_INDEX;
+ }
+
+ /** @brief
+ This is a bitmap of flags that indicates how the storage engine
+ implements indexes. The current index flags are documented in
+ handler.h. If you do not implement indexes, just return zero here.
+
+ @details
+ part is the key part to check. First key part is 0.
+ If all_parts is set, MySQL wants to know the flags for the combined
+ index, up to and including 'part'.
+ */
+ ulong index_flags(uint inx, uint part, bool all_parts) const
+ {
+ return 0;
+ }
+
+ /** @brief
+ unireg.cc will call max_supported_record_length(), max_supported_keys(),
+ max_supported_key_parts(), uint max_supported_key_length()
+ to make sure that the storage engine can handle the data it is about to
+ send. Return *real* limits of your storage engine here; MySQL will do
+ min(your_limits, MySQL_limits) automatically.
+ */
+ uint max_supported_record_length() const { return HA_MAX_REC_LENGTH; }
+
+ /* Support only one Primary Key, for now */
+ uint max_supported_keys() const { return 1; }
+ uint max_supported_key_parts() const { return 1; }
+
+ /** @brief
+ unireg.cc will call this to make sure that the storage engine can handle
+ the data it is about to send. Return *real* limits of your storage engine
+ here; MySQL will do min(your_limits, MySQL_limits) automatically.
+
+ @details
+ There is no need to implement ..._key_... methods if your engine doesn't
+ support indexes.
+ */
+ uint max_supported_key_length() const { return 16*1024; /* just to return something*/ }
+
+ int index_init(uint idx, bool sorted);
+
+ int index_read_map(uchar * buf, const uchar * key,
+ key_part_map keypart_map,
+ enum ha_rkey_function find_flag);
+
+ /** @brief
+ Called in test_quick_select to determine if indexes should be used.
+ */
+ virtual double scan_time() { return (double) (stats.records+stats.deleted) / 20.0+10; }
+
+ /** @brief
+ This method will never be called if you do not implement indexes.
+ */
+ virtual double read_time(uint, uint, ha_rows rows)
+ { return (double) rows / 20.0+1; }
+
+ virtual void start_bulk_insert(ha_rows rows, uint flags);
+ virtual int end_bulk_insert();
+
+ virtual int reset();
+
+
+ int multi_range_read_init(RANGE_SEQ_IF *seq, void *seq_init_param,
+ uint n_ranges, uint mode, HANDLER_BUFFER *buf);
+ int multi_range_read_next(range_id_t *range_info);
+ ha_rows multi_range_read_info_const(uint keyno, RANGE_SEQ_IF *seq,
+ void *seq_init_param,
+ uint n_ranges, uint *bufsz,
+ uint *flags, Cost_estimate *cost);
+ ha_rows multi_range_read_info(uint keyno, uint n_ranges, uint keys,
+ uint key_parts, uint *bufsz,
+ uint *flags, Cost_estimate *cost);
+ int multi_range_read_explain_info(uint mrr_mode, char *str, size_t size);
+
+private:
+ bool source_exhausted;
+ bool mrr_start_read();
+ int check_field_options(Field **fields);
+ int read_dyncol(uint *count,
+ DYNAMIC_COLUMN_VALUE **vals, LEX_STRING **names,
+ String *valcol);
+ int write_dynamic_row(uint count,
+ DYNAMIC_COLUMN_VALUE *vals,
+ LEX_STRING *names);
+ void static free_dynamic_row(DYNAMIC_COLUMN_VALUE **vals,
+ LEX_STRING **names);
+ CASSANDRA_TYPE_DEF * get_cassandra_field_def(char *cass_name,
+ int cass_name_length);
+public:
+ int open(const char *name, int mode, uint test_if_locked);
+ int close(void);
+
+ int write_row(uchar *buf);
+ int update_row(const uchar *old_data, uchar *new_data);
+ int delete_row(const uchar *buf);
+
+ /** @brief
+ Unlike index_init(), rnd_init() can be called two consecutive times
+ without rnd_end() in between (it only makes sense if scan=1). In this
+ case, the second call should prepare for the new table scan (e.g if
+ rnd_init() allocates the cursor, the second call should position the
+ cursor to the start of the table; no need to deallocate and allocate
+ it again. This is a required method.
+ */
+ int rnd_init(bool scan); //required
+ int rnd_end();
+ int rnd_next(uchar *buf); ///< required
+ int rnd_pos(uchar *buf, uchar *pos); ///< required
+ void position(const uchar *record); ///< required
+ int info(uint); ///< required
+ int delete_all_rows(void);
+ ha_rows records_in_range(uint inx, key_range *min_key,
+ key_range *max_key);
+ int create(const char *name, TABLE *form,
+ HA_CREATE_INFO *create_info); ///< required
+ bool check_if_incompatible_data(HA_CREATE_INFO *info,
+ uint table_changes);
+
+ THR_LOCK_DATA **store_lock(THD *thd, THR_LOCK_DATA **to,
+ enum thr_lock_type lock_type); ///< required
+};
diff --git a/storage/csv/ha_tina.cc b/storage/csv/ha_tina.cc
index 5277dc9bf40..916c7b151de 100644
--- a/storage/csv/ha_tina.cc
+++ b/storage/csv/ha_tina.cc
@@ -489,7 +489,7 @@ ha_tina::ha_tina(handlerton *hton, TABLE_SHARE *table_arg)
buffer.set((char*)byte_buffer, IO_SIZE, &my_charset_bin);
chain= chain_buffer;
file_buff= new Transparent_file();
- init_alloc_root(&blobroot, BLOB_MEMROOT_ALLOC_SIZE, 0);;
+ init_alloc_root(&blobroot, BLOB_MEMROOT_ALLOC_SIZE, 0, MYF(0));
}
@@ -953,7 +953,7 @@ int ha_tina::open(const char *name, int mode, uint open_options)
*/
thr_lock_data_init(&share->lock, &lock, (void*) this);
ref_length= sizeof(my_off_t);
- init_alloc_root(&blobroot, BLOB_MEMROOT_ALLOC_SIZE, 0);
+ init_alloc_root(&blobroot, BLOB_MEMROOT_ALLOC_SIZE, 0, MYF(0));
share->lock.get_status= tina_get_status;
share->lock.update_status= tina_update_status;
diff --git a/storage/federated/ha_federated.cc b/storage/federated/ha_federated.cc
index 211a77e2891..0c07af0a554 100644
--- a/storage/federated/ha_federated.cc
+++ b/storage/federated/ha_federated.cc
@@ -1515,7 +1515,7 @@ static FEDERATED_SHARE *get_share(const char *table_name, TABLE *table)
*/
query.length(0);
- init_alloc_root(&mem_root, 256, 0);
+ init_alloc_root(&mem_root, 256, 0, MYF(0));
mysql_mutex_lock(&federated_mutex);
@@ -1656,7 +1656,7 @@ int ha_federated::open(const char *name, int mode, uint test_if_locked)
ref_length= sizeof(MYSQL_RES *) + sizeof(MYSQL_ROW_OFFSET);
DBUG_PRINT("info", ("ref_length: %u", ref_length));
- my_init_dynamic_array(&results, sizeof(MYSQL_RES *), 4, 4);
+ my_init_dynamic_array(&results, sizeof(MYSQL_RES *), 4, 4, MYF(0));
reset();
DBUG_RETURN(0);
@@ -1978,7 +1978,7 @@ int ha_federated::write_row(uchar *buf)
@details Initializes memory structures required for bulk insert.
*/
-void ha_federated::start_bulk_insert(ha_rows rows)
+void ha_federated::start_bulk_insert(ha_rows rows, uint flags)
{
uint page_size;
DBUG_ENTER("ha_federated::start_bulk_insert");
@@ -3160,7 +3160,6 @@ int ha_federated::real_connect()
this->table->s->table_charset->csname);
sql_query.length(0);
-
if (!mysql_real_connect(mysql,
share->hostname,
share->username,
diff --git a/storage/federated/ha_federated.h b/storage/federated/ha_federated.h
index 6583d438c4d..fc2c4740cc0 100644
--- a/storage/federated/ha_federated.h
+++ b/storage/federated/ha_federated.h
@@ -209,7 +209,7 @@ public:
int open(const char *name, int mode, uint test_if_locked); // required
int close(void); // required
- void start_bulk_insert(ha_rows rows);
+ void start_bulk_insert(ha_rows rows, uint flags);
int end_bulk_insert();
int write_row(uchar *buf);
int update_row(const uchar *old_data, uchar *new_data);
diff --git a/storage/federatedx/federatedx_io_mysql.cc b/storage/federatedx/federatedx_io_mysql.cc
index a2ba496ea47..effbe899e7f 100644
--- a/storage/federatedx/federatedx_io_mysql.cc
+++ b/storage/federatedx/federatedx_io_mysql.cc
@@ -136,7 +136,7 @@ federatedx_io_mysql::federatedx_io_mysql(FEDERATEDX_SERVER *aserver)
bzero(&mysql, sizeof(MYSQL));
bzero(&savepoints, sizeof(DYNAMIC_ARRAY));
- my_init_dynamic_array(&savepoints, sizeof(SAVEPT), 16, 16);
+ my_init_dynamic_array(&savepoints, sizeof(SAVEPT), 16, 16, MYF(0));
DBUG_VOID_RETURN;
}
diff --git a/storage/federatedx/ha_federatedx.cc b/storage/federatedx/ha_federatedx.cc
index 7f095a9b96e..e1c2a38964a 100644
--- a/storage/federatedx/ha_federatedx.cc
+++ b/storage/federatedx/ha_federatedx.cc
@@ -1519,7 +1519,7 @@ static FEDERATEDX_SERVER *get_server(FEDERATEDX_SHARE *share, TABLE *table)
mysql_mutex_assert_owner(&federatedx_mutex);
- init_alloc_root(&mem_root, 4096, 4096);
+ init_alloc_root(&mem_root, 4096, 4096, MYF(0));
fill_server(&mem_root, &tmp_server, share, table ? table->s->table_charset : 0);
@@ -1577,7 +1577,7 @@ static FEDERATEDX_SHARE *get_share(const char *table_name, TABLE *table)
query.length(0);
bzero(&tmp_share, sizeof(tmp_share));
- init_alloc_root(&mem_root, 256, 0);
+ init_alloc_root(&mem_root, 256, 0, MYF(0));
mysql_mutex_lock(&federatedx_mutex);
@@ -1791,7 +1791,7 @@ int ha_federatedx::open(const char *name, int mode, uint test_if_locked)
DBUG_PRINT("info", ("ref_length: %u", ref_length));
- my_init_dynamic_array(&results, sizeof(FEDERATEDX_IO_RESULT*), 4, 4);
+ my_init_dynamic_array(&results, sizeof(FEDERATEDX_IO_RESULT*), 4, 4, MYF(0));
reset();
@@ -2126,7 +2126,7 @@ int ha_federatedx::write_row(uchar *buf)
@details Initializes memory structures required for bulk insert.
*/
-void ha_federatedx::start_bulk_insert(ha_rows rows)
+void ha_federatedx::start_bulk_insert(ha_rows rows, uint flags)
{
uint page_size;
DBUG_ENTER("ha_federatedx::start_bulk_insert");
diff --git a/storage/federatedx/ha_federatedx.h b/storage/federatedx/ha_federatedx.h
index 3af05387cb2..dcbbe534262 100644
--- a/storage/federatedx/ha_federatedx.h
+++ b/storage/federatedx/ha_federatedx.h
@@ -390,7 +390,7 @@ public:
int open(const char *name, int mode, uint test_if_locked); // required
int close(void); // required
- void start_bulk_insert(ha_rows rows);
+ void start_bulk_insert(ha_rows rows, uint flags);
int end_bulk_insert();
int write_row(uchar *buf);
int update_row(const uchar *old_data, uchar *new_data);
diff --git a/storage/heap/ha_heap.cc b/storage/heap/ha_heap.cc
index b9eef0d155b..8e63799680b 100644
--- a/storage/heap/ha_heap.cc
+++ b/storage/heap/ha_heap.cc
@@ -634,7 +634,7 @@ heap_prepare_hp_create_info(TABLE *table_arg, bool internal_table,
if (!(keydef= (HP_KEYDEF*) my_malloc(keys * sizeof(HP_KEYDEF) +
parts * sizeof(HA_KEYSEG),
- MYF(MY_WME))))
+ MYF(MY_WME | MY_THREAD_SPECIFIC))))
return my_errno;
seg= reinterpret_cast<HA_KEYSEG*>(keydef + keys);
for (key= 0; key < keys; key++)
diff --git a/storage/heap/heapdef.h b/storage/heap/heapdef.h
index db00ea87a01..d5c0ad96b05 100644
--- a/storage/heap/heapdef.h
+++ b/storage/heap/heapdef.h
@@ -62,7 +62,8 @@ typedef struct {
extern HP_SHARE *hp_find_named_heap(const char *name);
extern int hp_rectest(HP_INFO *info,const uchar *old);
extern uchar *hp_find_block(HP_BLOCK *info,ulong pos);
-extern int hp_get_new_block(HP_BLOCK *info, size_t* alloc_length);
+extern int hp_get_new_block(HP_SHARE *info, HP_BLOCK *block,
+ size_t* alloc_length);
extern void hp_free(HP_SHARE *info);
extern uchar *hp_free_level(HP_BLOCK *block,uint level,HP_PTRS *pos,
uchar *last_pos);
diff --git a/storage/heap/hp_block.c b/storage/heap/hp_block.c
index 01978e2b4e8..1c40f982422 100644
--- a/storage/heap/hp_block.c
+++ b/storage/heap/hp_block.c
@@ -45,6 +45,7 @@ uchar *hp_find_block(HP_BLOCK *block, ulong pos)
SYNOPSIS
hp_get_new_block()
+ info heap handle
block HP_BLOCK tree-like block
alloc_length OUT Amount of memory allocated from the heap
@@ -54,7 +55,7 @@ uchar *hp_find_block(HP_BLOCK *block, ulong pos)
1 Out of memory
*/
-int hp_get_new_block(HP_BLOCK *block, size_t *alloc_length)
+int hp_get_new_block(HP_SHARE *info, HP_BLOCK *block, size_t *alloc_length)
{
reg1 uint i,j;
HP_PTRS *root;
@@ -77,7 +78,10 @@ int hp_get_new_block(HP_BLOCK *block, size_t *alloc_length)
*/
*alloc_length= (sizeof(HP_PTRS)* ((i == block->levels) ? i : i - 1) +
block->records_in_block* block->recbuffer);
- if (!(root=(HP_PTRS*) my_malloc(*alloc_length,MYF(MY_WME))))
+ if (!(root=(HP_PTRS*) my_malloc(*alloc_length,
+ MYF(MY_WME |
+ (info->internal ?
+ MY_THREAD_SPECIFIC : 0)))))
return 1;
if (i == 0)
diff --git a/storage/heap/hp_create.c b/storage/heap/hp_create.c
index d170d1abc65..a8bc8e63810 100644
--- a/storage/heap/hp_create.c
+++ b/storage/heap/hp_create.c
@@ -146,7 +146,9 @@ int heap_create(const char *name, HP_CREATE_INFO *create_info,
if (!(share= (HP_SHARE*) my_malloc((uint) sizeof(HP_SHARE)+
keys*sizeof(HP_KEYDEF)+
key_segs*sizeof(HA_KEYSEG),
- MYF(MY_ZEROFILL))))
+ MYF(MY_ZEROFILL |
+ (create_info->internal_table ?
+ MY_THREAD_SPECIFIC : 0)))))
goto err;
share->keydef= (HP_KEYDEF*) (share + 1);
share->key_stat_version= 1;
@@ -171,7 +173,9 @@ int heap_create(const char *name, HP_CREATE_INFO *create_info,
keyseg++;
init_tree(&keyinfo->rb_tree, 0, 0, sizeof(uchar*),
- (qsort_cmp2)keys_compare, 1, NULL, NULL);
+ (qsort_cmp2)keys_compare, NULL, NULL,
+ MYF((create_info->internal_table ? MY_THREAD_SPECIFIC : 0) |
+ MY_TREE_WITH_DELETE));
keyinfo->delete_key= hp_rb_delete_key;
keyinfo->write_key= hp_rb_write_key;
}
@@ -199,6 +203,7 @@ int heap_create(const char *name, HP_CREATE_INFO *create_info,
share->auto_key_type= create_info->auto_key_type;
share->auto_increment= create_info->auto_increment;
share->create_time= (long) time((time_t*) 0);
+ share->internal= create_info->internal_table;
/* Must be allocated separately for rename to work */
if (!(share->name= my_strdup(name,MYF(0))))
{
diff --git a/storage/heap/hp_open.c b/storage/heap/hp_open.c
index c456dbdfc84..fc7397989f2 100644
--- a/storage/heap/hp_open.c
+++ b/storage/heap/hp_open.c
@@ -32,7 +32,9 @@ HP_INFO *heap_open_from_share(HP_SHARE *share, int mode)
if (!(info= (HP_INFO*) my_malloc((uint) sizeof(HP_INFO) +
2 * share->max_key_length,
- MYF(MY_ZEROFILL))))
+ MYF(MY_ZEROFILL +
+ (share->internal ?
+ MY_THREAD_SPECIFIC : 0)))))
{
DBUG_RETURN(0);
}
diff --git a/storage/heap/hp_write.c b/storage/heap/hp_write.c
index 8bfecc7747c..c84fc4b6104 100644
--- a/storage/heap/hp_write.c
+++ b/storage/heap/hp_write.c
@@ -162,7 +162,7 @@ static uchar *next_free_record_pos(HP_SHARE *info)
my_errno=HA_ERR_RECORD_FILE_FULL;
DBUG_RETURN(NULL);
}
- if (hp_get_new_block(&info->block,&length))
+ if (hp_get_new_block(info, &info->block,&length))
DBUG_RETURN(NULL);
info->data_length+=length;
}
@@ -407,7 +407,7 @@ static HASH_INFO *hp_find_free_hash(HP_SHARE *info,
return hp_find_hash(block,records);
if (!(block_pos=(records % block->records_in_block)))
{
- if (hp_get_new_block(block,&length))
+ if (hp_get_new_block(info, block, &length))
return(NULL);
info->index_length+=length;
}
diff --git a/storage/innobase/btr/btr0btr.cc b/storage/innobase/btr/btr0btr.cc
index 3f29f403622..8b7a19777ab 100644
--- a/storage/innobase/btr/btr0btr.cc
+++ b/storage/innobase/btr/btr0btr.cc
@@ -1605,7 +1605,7 @@ btr_page_reorganize_low(
ut_ad(mtr_memo_contains(mtr, block, MTR_MEMO_PAGE_X_FIX));
btr_assert_not_corrupted(block, index);
#ifdef UNIV_ZIP_DEBUG
- ut_a(!page_zip || page_zip_validate(page_zip, page));
+ ut_a(!page_zip || page_zip_validate(page_zip, page, index));
#endif /* UNIV_ZIP_DEBUG */
data_size1 = page_get_data_size(page);
max_ins_size1 = page_get_max_insert_size_after_reorganize(page, 1);
@@ -1722,7 +1722,7 @@ btr_page_reorganize_low(
func_exit:
#ifdef UNIV_ZIP_DEBUG
- ut_a(!page_zip || page_zip_validate(page_zip, page));
+ ut_a(!page_zip || page_zip_validate(page_zip, page, index));
#endif /* UNIV_ZIP_DEBUG */
#ifndef UNIV_HOTBACKUP
buf_block_free(temp_block);
@@ -1797,7 +1797,7 @@ btr_page_empty(
ut_ad(mtr_memo_contains(mtr, block, MTR_MEMO_PAGE_X_FIX));
ut_ad(page_zip == buf_block_get_page_zip(block));
#ifdef UNIV_ZIP_DEBUG
- ut_a(!page_zip || page_zip_validate(page_zip, page));
+ ut_a(!page_zip || page_zip_validate(page_zip, page, index));
#endif /* UNIV_ZIP_DEBUG */
btr_search_drop_page_hash_index(block);
@@ -1854,10 +1854,10 @@ btr_root_raise_and_insert(
root_block = btr_cur_get_block(cursor);
root_page_zip = buf_block_get_page_zip(root_block);
ut_ad(page_get_n_recs(root) > 0);
+ index = btr_cur_get_index(cursor);
#ifdef UNIV_ZIP_DEBUG
- ut_a(!root_page_zip || page_zip_validate(root_page_zip, root));
+ ut_a(!root_page_zip || page_zip_validate(root_page_zip, root, index));
#endif /* UNIV_ZIP_DEBUG */
- index = btr_cur_get_index(cursor);
#ifdef UNIV_BTR_DEBUG
if (!dict_index_is_ibuf(index)) {
ulint space = dict_index_get_space(index);
@@ -2782,8 +2782,8 @@ insert_empty:
#ifdef UNIV_ZIP_DEBUG
if (page_zip) {
- ut_a(page_zip_validate(page_zip, page));
- ut_a(page_zip_validate(new_page_zip, new_page));
+ ut_a(page_zip_validate(page_zip, page, cursor->index));
+ ut_a(page_zip_validate(new_page_zip, new_page, cursor->index));
}
#endif /* UNIV_ZIP_DEBUG */
@@ -2817,7 +2817,8 @@ insert_empty:
= buf_block_get_page_zip(insert_block);
ut_a(!insert_page_zip
- || page_zip_validate(insert_page_zip, insert_page));
+ || page_zip_validate(insert_page_zip, insert_page,
+ cursor->index));
}
#endif /* UNIV_ZIP_DEBUG */
@@ -3181,7 +3182,7 @@ btr_lift_page_up(
btr_page_set_level(page, page_zip, page_level, mtr);
#ifdef UNIV_ZIP_DEBUG
- ut_a(!page_zip || page_zip_validate(page_zip, page));
+ ut_a(!page_zip || page_zip_validate(page_zip, page, index));
#endif /* UNIV_ZIP_DEBUG */
}
@@ -3355,8 +3356,8 @@ err_exit:
const page_zip_des_t* page_zip
= buf_block_get_page_zip(block);
ut_a(page_zip);
- ut_a(page_zip_validate(merge_page_zip, merge_page));
- ut_a(page_zip_validate(page_zip, page));
+ ut_a(page_zip_validate(merge_page_zip, merge_page, index));
+ ut_a(page_zip_validate(page_zip, page, index));
}
#endif /* UNIV_ZIP_DEBUG */
@@ -3489,7 +3490,8 @@ err_exit:
ut_ad(page_validate(merge_page, index));
#ifdef UNIV_ZIP_DEBUG
- ut_a(!merge_page_zip || page_zip_validate(merge_page_zip, merge_page));
+ ut_a(!merge_page_zip || page_zip_validate(merge_page_zip, merge_page,
+ index));
#endif /* UNIV_ZIP_DEBUG */
/* Free the file page */
@@ -3671,7 +3673,7 @@ btr_discard_page(
page_zip_des_t* merge_page_zip
= buf_block_get_page_zip(merge_block);
ut_a(!merge_page_zip
- || page_zip_validate(merge_page_zip, merge_page));
+ || page_zip_validate(merge_page_zip, merge_page, index));
}
#endif /* UNIV_ZIP_DEBUG */
@@ -4123,7 +4125,7 @@ btr_validate_level(
ut_a(space == page_get_space_id(page));
#ifdef UNIV_ZIP_DEBUG
page_zip = buf_block_get_page_zip(block);
- ut_a(!page_zip || page_zip_validate(page_zip, page));
+ ut_a(!page_zip || page_zip_validate(page_zip, page, index));
#endif /* UNIV_ZIP_DEBUG */
ut_a(!page_is_leaf(page));
@@ -4151,7 +4153,7 @@ loop:
#ifdef UNIV_ZIP_DEBUG
page_zip = buf_block_get_page_zip(block);
- ut_a(!page_zip || page_zip_validate(page_zip, page));
+ ut_a(!page_zip || page_zip_validate(page_zip, page, index));
#endif /* UNIV_ZIP_DEBUG */
/* Check ordering etc. of records */
diff --git a/storage/innobase/btr/btr0cur.cc b/storage/innobase/btr/btr0cur.cc
index 95193546115..aeb16200f80 100644
--- a/storage/innobase/btr/btr0cur.cc
+++ b/storage/innobase/btr/btr0cur.cc
@@ -679,7 +679,7 @@ retry_page_get:
#ifdef UNIV_ZIP_DEBUG
const page_zip_des_t* page_zip
= buf_block_get_page_zip(block);
- ut_a(!page_zip || page_zip_validate(page_zip, page));
+ ut_a(!page_zip || page_zip_validate(page_zip, page, index));
#endif /* UNIV_ZIP_DEBUG */
buf_block_dbg_add_level(
@@ -2045,7 +2045,7 @@ any_extern:
page_zip = buf_block_get_page_zip(block);
#ifdef UNIV_ZIP_DEBUG
- ut_a(!page_zip || page_zip_validate(page_zip, page));
+ ut_a(!page_zip || page_zip_validate(page_zip, page, index));
#endif /* UNIV_ZIP_DEBUG */
if (page_zip
@@ -2254,7 +2254,7 @@ btr_cur_pessimistic_update(
MTR_MEMO_X_LOCK));
ut_ad(mtr_memo_contains(mtr, block, MTR_MEMO_PAGE_X_FIX));
#ifdef UNIV_ZIP_DEBUG
- ut_a(!page_zip || page_zip_validate(page_zip, page));
+ ut_a(!page_zip || page_zip_validate(page_zip, page, index));
#endif /* UNIV_ZIP_DEBUG */
/* The insert buffer tree should never be updated in place. */
ut_ad(!dict_index_is_ibuf(index));
@@ -2392,7 +2392,7 @@ make_external:
btr_search_update_hash_on_delete(cursor);
#ifdef UNIV_ZIP_DEBUG
- ut_a(!page_zip || page_zip_validate(page_zip, page));
+ ut_a(!page_zip || page_zip_validate(page_zip, page, index));
#endif /* UNIV_ZIP_DEBUG */
page_cursor = btr_cur_get_page_cur(cursor);
@@ -2499,7 +2499,7 @@ make_external:
buf_block_t* rec_block = btr_cur_get_block(cursor);
#ifdef UNIV_ZIP_DEBUG
- ut_a(!page_zip || page_zip_validate(page_zip, page));
+ ut_a(!page_zip || page_zip_validate(page_zip, page, index));
page = buf_block_get_frame(rec_block);
#endif /* UNIV_ZIP_DEBUG */
page_zip = buf_block_get_page_zip(rec_block);
@@ -2525,7 +2525,7 @@ make_external:
return_after_reservations:
#ifdef UNIV_ZIP_DEBUG
- ut_a(!page_zip || page_zip_validate(page_zip, page));
+ ut_a(!page_zip || page_zip_validate(page_zip, page, index));
#endif /* UNIV_ZIP_DEBUG */
if (n_extents > 0) {
@@ -2887,7 +2887,7 @@ btr_cur_set_deleted_flag_for_ibuf(
when the tablespace is
uncompressed */
ibool val, /*!< in: value to set */
- mtr_t* mtr) /*!< in: mtr */
+ mtr_t* mtr) /*!< in/out: mini-transaction */
{
/* We do not need to reserve btr_search_latch, as the page
has just been read to the buffer pool and there cannot be
@@ -2987,12 +2987,14 @@ btr_cur_optimistic_delete(
page, 1);
}
#ifdef UNIV_ZIP_DEBUG
- ut_a(!page_zip || page_zip_validate(page_zip, page));
+ ut_a(!page_zip
+ || page_zip_validate(page_zip, page, cursor->index));
#endif /* UNIV_ZIP_DEBUG */
page_cur_delete_rec(btr_cur_get_page_cur(cursor),
cursor->index, offsets, mtr);
#ifdef UNIV_ZIP_DEBUG
- ut_a(!page_zip || page_zip_validate(page_zip, page));
+ ut_a(!page_zip
+ || page_zip_validate(page_zip, page, cursor->index));
#endif /* UNIV_ZIP_DEBUG */
if (dict_index_is_clust(cursor->index)
@@ -3087,7 +3089,7 @@ btr_cur_pessimistic_delete(
rec = btr_cur_get_rec(cursor);
page_zip = buf_block_get_page_zip(block);
#ifdef UNIV_ZIP_DEBUG
- ut_a(!page_zip || page_zip_validate(page_zip, page));
+ ut_a(!page_zip || page_zip_validate(page_zip, page, index));
#endif /* UNIV_ZIP_DEBUG */
offsets = rec_get_offsets(rec, index, NULL, ULINT_UNDEFINED, &heap);
@@ -3097,7 +3099,7 @@ btr_cur_pessimistic_delete(
rec, offsets, page_zip,
rb_ctx, mtr);
#ifdef UNIV_ZIP_DEBUG
- ut_a(!page_zip || page_zip_validate(page_zip, page));
+ ut_a(!page_zip || page_zip_validate(page_zip, page, index));
#endif /* UNIV_ZIP_DEBUG */
}
@@ -3158,7 +3160,7 @@ btr_cur_pessimistic_delete(
page_cur_delete_rec(btr_cur_get_page_cur(cursor), index, offsets, mtr);
#ifdef UNIV_ZIP_DEBUG
- ut_a(!page_zip || page_zip_validate(page_zip, page));
+ ut_a(!page_zip || page_zip_validate(page_zip, page, index));
#endif /* UNIV_ZIP_DEBUG */
ut_ad(btr_check_node_ptr(index, block, mtr));
diff --git a/storage/innobase/buf/buf0buf.cc b/storage/innobase/buf/buf0buf.cc
index 2b543d8d1cf..96821478e60 100644
--- a/storage/innobase/buf/buf0buf.cc
+++ b/storage/innobase/buf/buf0buf.cc
@@ -245,7 +245,7 @@ the read requests for the whole area.
#ifndef UNIV_HOTBACKUP
/** Value in microseconds */
-static const int WAIT_FOR_READ = 5000;
+static const int WAIT_FOR_READ = 100;
/** Number of attemtps made to read in a page in the buffer pool */
static const ulint BUF_PAGE_READ_MAX_RETRIES = 100;
@@ -2829,8 +2829,9 @@ wait_until_unfixed:
mutex_exit(&block->mutex);
if (io_fix == BUF_IO_READ) {
-
- os_thread_sleep(WAIT_FOR_READ);
+ /* wait by temporaly s-latch */
+ rw_lock_s_lock(&(block->lock));
+ rw_lock_s_unlock(&(block->lock));
} else {
break;
}
diff --git a/storage/innobase/buf/buf0lru.cc b/storage/innobase/buf/buf0lru.cc
index 1e2c15f969f..c35d84cb985 100644
--- a/storage/innobase/buf/buf0lru.cc
+++ b/storage/innobase/buf/buf0lru.cc
@@ -1805,7 +1805,9 @@ buf_LRU_block_remove_hashed_page(
break;
case FIL_PAGE_INDEX:
#ifdef UNIV_ZIP_DEBUG
- ut_a(page_zip_validate(&bpage->zip, page));
+ ut_a(page_zip_validate(
+ &bpage->zip, page,
+ ((buf_block_t*) bpage)->index));
#endif /* UNIV_ZIP_DEBUG */
break;
default:
diff --git a/storage/innobase/dict/dict0dict.cc b/storage/innobase/dict/dict0dict.cc
index 5871281e1b9..8282dafda0c 100644
--- a/storage/innobase/dict/dict0dict.cc
+++ b/storage/innobase/dict/dict0dict.cc
@@ -2528,7 +2528,6 @@ dict_index_build_internal_clust(
{
dict_index_t* new_index;
dict_field_t* field;
- ulint fixed_size;
ulint trx_id_pos;
ulint i;
ibool* indexed;
@@ -2605,7 +2604,7 @@ dict_index_build_internal_clust(
for (i = 0; i < trx_id_pos; i++) {
- fixed_size = dict_col_get_fixed_size(
+ ulint fixed_size = dict_col_get_fixed_size(
dict_index_get_nth_col(new_index, i),
dict_table_is_comp(table));
@@ -2622,7 +2621,20 @@ dict_index_build_internal_clust(
break;
}
- new_index->trx_id_offset += (unsigned int) fixed_size;
+ /* Add fixed_size to new_index->trx_id_offset.
+ Because the latter is a bit-field, an overflow
+ can theoretically occur. Check for it. */
+ fixed_size += new_index->trx_id_offset;
+
+ new_index->trx_id_offset = fixed_size;
+
+ if (new_index->trx_id_offset != fixed_size) {
+ /* Overflow. Pretend that this is a
+ variable-length PRIMARY KEY. */
+ ut_ad(0);
+ new_index->trx_id_offset = 0;
+ break;
+ }
}
}
diff --git a/storage/innobase/fil/fil0fil.cc b/storage/innobase/fil/fil0fil.cc
index 4c6ed9807f6..2e6835fe0c0 100644
--- a/storage/innobase/fil/fil0fil.cc
+++ b/storage/innobase/fil/fil0fil.cc
@@ -194,16 +194,18 @@ struct fil_space_struct {
.ibd file of tablespace and want to
stop temporarily posting of new i/o
requests on the file */
- ibool stop_ibuf_merges;
+ ibool stop_new_ops;
/*!< we set this TRUE when we start
- deleting a single-table tablespace */
- ibool is_being_deleted;
- /*!< this is set to TRUE when we start
- deleting a single-table tablespace and its
- file; when this flag is set no further i/o
- or flush requests can be placed on this space,
- though there may be such requests still being
- processed on this space */
+ deleting a single-table tablespace.
+ When this is set following new ops
+ are not allowed:
+ * read IO request
+ * ibuf merge
+ * file flush
+ Note that we can still possibly have
+ new write operations because we don't
+ check this flag when doing flush
+ batches. */
ulint purpose;/*!< FIL_TABLESPACE, FIL_LOG, or
FIL_ARCH_LOG */
UT_LIST_BASE_NODE_T(fil_node_t) chain;
@@ -220,12 +222,13 @@ struct fil_space_struct {
ulint n_pending_flushes; /*!< this is positive when flushing
the tablespace to disk; dropping of the
tablespace is forbidden if this is positive */
- ulint n_pending_ibuf_merges;/*!< this is positive
- when merging insert buffer entries to
- a page so that we may need to access
- the ibuf bitmap page in the
- tablespade: dropping of the tablespace
- is forbidden if this is positive */
+ ulint n_pending_ops;/*!< this is positive when we
+ have pending operations against this
+ tablespace. The pending operations can
+ be ibuf merges or lock validation code
+ trying to read a block.
+ Dropping of the tablespace is forbidden
+ if this is positive */
hash_node_t hash; /*!< hash chain node */
hash_node_t name_hash;/*!< hash chain the name_hash table */
#ifndef UNIV_HOTBACKUP
@@ -1928,13 +1931,12 @@ fil_read_first_page(
#ifndef UNIV_HOTBACKUP
/*******************************************************************//**
-Increments the count of pending insert buffer page merges, if space is not
-being deleted.
-@return TRUE if being deleted, and ibuf merges should be skipped */
+Increments the count of pending operation, if space is not being deleted.
+@return TRUE if being deleted, and operation should be skipped */
UNIV_INTERN
ibool
-fil_inc_pending_ibuf_merges(
-/*========================*/
+fil_inc_pending_ops(
+/*================*/
ulint id) /*!< in: space id */
{
fil_space_t* space;
@@ -1945,18 +1947,18 @@ fil_inc_pending_ibuf_merges(
if (space == NULL) {
fprintf(stderr,
- "InnoDB: Error: trying to do ibuf merge to a"
+ "InnoDB: Error: trying to do an operation on a"
" dropped tablespace %lu\n",
(ulong) id);
}
- if (space == NULL || space->stop_ibuf_merges) {
+ if (space == NULL || space->stop_new_ops) {
mutex_exit(&fil_system->mutex);
return(TRUE);
}
- space->n_pending_ibuf_merges++;
+ space->n_pending_ops++;
mutex_exit(&fil_system->mutex);
@@ -1964,11 +1966,11 @@ fil_inc_pending_ibuf_merges(
}
/*******************************************************************//**
-Decrements the count of pending insert buffer page merges. */
+Decrements the count of pending operations. */
UNIV_INTERN
void
-fil_decr_pending_ibuf_merges(
-/*=========================*/
+fil_decr_pending_ops(
+/*=================*/
ulint id) /*!< in: space id */
{
fil_space_t* space;
@@ -1979,13 +1981,13 @@ fil_decr_pending_ibuf_merges(
if (space == NULL) {
fprintf(stderr,
- "InnoDB: Error: decrementing ibuf merge of a"
- " dropped tablespace %lu\n",
+ "InnoDB: Error: decrementing pending operation"
+ " of a dropped tablespace %lu\n",
(ulong) id);
}
if (space != NULL) {
- space->n_pending_ibuf_merges--;
+ space->n_pending_ops--;
}
mutex_exit(&fil_system->mutex);
@@ -2181,7 +2183,6 @@ fil_op_log_parse_or_replay(
}
*/
if (!space_id) {
-
return(ptr);
}
@@ -2276,15 +2277,15 @@ fil_delete_tablespace(
char* path;
ut_a(id != 0);
-stop_ibuf_merges:
+stop_new_ops:
mutex_enter(&fil_system->mutex);
space = fil_space_get_by_id(id);
if (space != NULL) {
- space->stop_ibuf_merges = TRUE;
+ space->stop_new_ops = TRUE;
- if (space->n_pending_ibuf_merges == 0) {
+ if (space->n_pending_ops == 0) {
mutex_exit(&fil_system->mutex);
count = 0;
@@ -2298,9 +2299,10 @@ stop_ibuf_merges:
ut_print_filename(stderr, space->name);
fprintf(stderr, ",\n"
"InnoDB: but there are %lu pending"
- " ibuf merges on it.\n"
+ " operations (most likely ibuf merges)"
+ " on it.\n"
"InnoDB: Loop %lu.\n",
- (ulong) space->n_pending_ibuf_merges,
+ (ulong) space->n_pending_ops,
(ulong) count);
}
@@ -2309,7 +2311,7 @@ stop_ibuf_merges:
os_thread_sleep(20000);
count++;
- goto stop_ibuf_merges;
+ goto stop_new_ops;
}
}
@@ -2334,10 +2336,8 @@ try_again:
return(FALSE);
}
- ut_a(space);
- ut_a(space->n_pending_ibuf_merges == 0);
-
- space->is_being_deleted = TRUE;
+ ut_a(space->stop_new_ops);
+ ut_a(space->n_pending_ops == 0);
/* TODO: The following code must change when InnoDB supports
multiple datafiles per tablespace. */
@@ -2386,12 +2386,26 @@ try_again:
rw_lock_x_lock(&space->latch);
#ifndef UNIV_HOTBACKUP
- /* Invalidate in the buffer pool all pages belonging to the
- tablespace. Since we have set space->is_being_deleted = TRUE, readahead
- or ibuf merge can no longer read more pages of this tablespace to the
- buffer pool. Thus we can clean the tablespace out of the buffer pool
- completely and permanently. The flag is_being_deleted also prevents
- fil_flush() from being applied to this tablespace. */
+ /* IMPORTANT: Because we have set space::stop_new_ops there
+ can't be any new ibuf merges, reads or flushes. We are here
+ because node::n_pending was zero above. However, it is still
+ possible to have pending read and write requests:
+
+ A read request can happen because the reader thread has
+ gone through the ::stop_new_ops check in buf_page_init_for_read()
+ before the flag was set and has not yet incremented ::n_pending
+ when we checked it above.
+
+ A write request can be issued any time because we don't check
+ the ::stop_new_ops flag when queueing a block for write.
+
+ We deal with pending write requests in the following function
+ where we'd minimally evict all dirty pages belonging to this
+ space from the flush_list. Not that if a block is IO-fixed
+ we'll wait for IO to complete.
+
+ To deal with potential read requests by checking the
+ ::stop_new_ops flag in fil_io() */
buf_LRU_invalidate_tablespace(id);
#endif
@@ -2399,6 +2413,15 @@ try_again:
mutex_enter(&fil_system->mutex);
+ /* Double check the sanity of pending ops after reacquiring
+ the fil_system::mutex. */
+ if (fil_space_get_by_id(id)) {
+ ut_a(space->n_pending_ops == 0);
+ ut_a(UT_LIST_GET_LEN(space->chain) == 1);
+ node = UT_LIST_GET_FIRST(space->chain);
+ ut_a(node->n_pending == 0);
+ }
+
success = fil_space_free(id, TRUE);
mutex_exit(&fil_system->mutex);
@@ -2456,7 +2479,7 @@ fil_tablespace_is_being_deleted(
ut_a(space != NULL);
- is_being_deleted = space->is_being_deleted;
+ is_being_deleted = space->stop_new_ops;
mutex_exit(&fil_system->mutex);
@@ -3744,7 +3767,7 @@ fil_tablespace_deleted_or_being_deleted_in_mem(
space = fil_space_get_by_id(id);
- if (space == NULL || space->is_being_deleted) {
+ if (space == NULL || space->stop_new_ops) {
mutex_exit(&fil_system->mutex);
return(TRUE);
@@ -4472,7 +4495,9 @@ fil_io(
space = fil_space_get_by_id(space_id);
- if (!space) {
+ /* If we are deleting a tablespace we don't allow any read
+ operations on that. However, we do allow write operations. */
+ if (!space || (type == OS_FILE_READ && space->stop_new_ops)) {
mutex_exit(&fil_system->mutex);
ut_print_timestamp(stderr);
@@ -4691,7 +4716,7 @@ fil_flush(
space = fil_space_get_by_id(space_id);
- if (!space || space->is_being_deleted) {
+ if (!space || space->stop_new_ops) {
mutex_exit(&fil_system->mutex);
return;
@@ -4823,7 +4848,7 @@ fil_flush_file_spaces(
space;
space = UT_LIST_GET_NEXT(unflushed_spaces, space)) {
- if (space->purpose == purpose && !space->is_being_deleted) {
+ if (space->purpose == purpose && !space->stop_new_ops) {
space_ids[n_space_ids++] = space->id;
}
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index b1215e6bdef..e19fe47e81a 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -607,6 +607,9 @@ innobase_commit_ordered(
bool all); /*!< in: TRUE - commit transaction
FALSE - the current SQL statement
ended */
+static
+void
+innobase_kill_query(handlerton *hton, THD* thd, enum thd_kill_levels level);
/*****************************************************************//**
Commits a transaction in an InnoDB database or marks an SQL statement
@@ -1255,8 +1258,7 @@ convert_error_code_to_mysql(
return(0);
case DB_INTERRUPTED:
- my_error(ER_QUERY_INTERRUPTED, MYF(0));
- /* fall through */
+ return(HA_ERR_ABORTED_BY_USER);
case DB_FOREIGN_EXCEED_MAX_CASCADE:
ut_ad(thd);
@@ -1348,11 +1350,22 @@ convert_error_code_to_mysql(
case DB_TABLE_NOT_FOUND:
return(HA_ERR_NO_SUCH_TABLE);
- case DB_TOO_BIG_RECORD:
- my_error(ER_TOO_BIG_ROWSIZE, MYF(0),
- page_get_free_space_of_empty(flags
- & DICT_TF_COMPACT) / 2);
+ case DB_TOO_BIG_RECORD: {
+ /* If prefix is true then a 768-byte prefix is stored
+ locally for BLOB fields. Refer to dict_table_get_format() */
+ bool prefix = (dict_tf_get_format(flags) == UNIV_FORMAT_A);
+ my_printf_error(ER_TOO_BIG_ROWSIZE,
+ "Row size too large (> %lu). Changing some columns "
+ "to TEXT or BLOB %smay help. In current row "
+ "format, BLOB prefix of %d bytes is stored inline.",
+ MYF(0),
+ page_get_free_space_of_empty(flags &
+ DICT_TF_COMPACT) / 2,
+ prefix ? "or using ROW_FORMAT=DYNAMIC "
+ "or ROW_FORMAT=COMPRESSED ": "",
+ prefix ? DICT_MAX_FIXED_COL_LEN : 0);
return(HA_ERR_TO_BIG_ROW);
+ }
case DB_TOO_BIG_INDEX_COL:
my_error(ER_INDEX_COLUMN_TOO_LONG, MYF(0),
@@ -1869,7 +1882,10 @@ innobase_next_autoinc(
offset = 0;
}
- /* Check for overflow. */
+ /* Check for overflow. Current can be > max_value if the value is
+ in reality a negative value.The visual studio compilers converts
+ large double values automatically into unsigned long long datatype
+ maximum value */
if (block >= max_value
|| offset > max_value
|| current >= max_value
@@ -2523,7 +2539,7 @@ trx_is_interrupted(
/*===============*/
trx_t* trx) /*!< in: transaction */
{
- return(trx && trx->mysql_thd && thd_killed((THD*) trx->mysql_thd));
+ return(trx && trx->mysql_thd && thd_kill_level((THD*) trx->mysql_thd));
}
/**********************************************************************//**
@@ -2673,6 +2689,7 @@ innobase_init(
innobase_release_temporary_latches;
innobase_hton->alter_table_flags = innobase_alter_table_flags;
+ innobase_hton->kill_query = innobase_kill_query;
ut_a(DATA_MYSQL_TRUE_VARCHAR == (ulint)MYSQL_TYPE_VARCHAR);
@@ -3830,6 +3847,30 @@ innobase_close_connection(
DBUG_RETURN(0);
}
+/*****************************************************************//**
+Cancel any pending lock request associated with the current THD. */
+static
+void
+innobase_kill_query(
+/*======================*/
+ handlerton* hton, /*!< in: innobase handlerton */
+ THD* thd, /*!< in: MySQL thread being killed */
+ enum thd_kill_levels level) /*!< in: kill level */
+{
+ trx_t* trx;
+ DBUG_ENTER("innobase_kill_query");
+ DBUG_ASSERT(hton == innodb_hton_ptr);
+
+ trx = thd_to_trx(thd);
+ /* Cancel a pending lock request. */
+ if (trx) {
+ lock_trx_handle_wait(trx);
+ }
+
+ DBUG_VOID_RETURN;
+}
+
+
/*************************************************************************//**
** InnoDB database tables
*****************************************************************************/
@@ -10732,7 +10773,7 @@ ha_innobase::check(
row_mysql_unlock_data_dictionary(prebuilt->trx);
}
- if (thd_killed(user_thd)) {
+ if (thd_kill_level(user_thd)) {
break;
}
@@ -10790,7 +10831,7 @@ ha_innobase::check(
srv_fatal_semaphore_wait_threshold, 7200/*2 hours*/);
prebuilt->trx->op_info = "";
- if (thd_killed(user_thd)) {
+ if (thd_kill_level(user_thd)) {
my_error(ER_QUERY_INTERRUPTED, MYF(0));
}
@@ -15094,8 +15135,8 @@ static MYSQL_SYSVAR_ENUM(stats_method, srv_innodb_stats_method,
#if defined UNIV_DEBUG || defined UNIV_IBUF_DEBUG
static MYSQL_SYSVAR_UINT(change_buffering_debug, ibuf_debug,
PLUGIN_VAR_RQCMDARG,
- "Debug flags for InnoDB change buffering (0=none)",
- NULL, NULL, 0, 0, 1, 0);
+ "Debug flags for InnoDB change buffering (0=none, 2=crash at merge)",
+ NULL, NULL, 0, 0, 2, 0);
#endif /* UNIV_DEBUG || UNIV_IBUF_DEBUG */
static MYSQL_SYSVAR_BOOL(random_read_ahead, srv_random_read_ahead,
diff --git a/storage/innobase/handler/ha_innodb.h b/storage/innobase/handler/ha_innodb.h
index 9039a91d56f..e56a1ec52e3 100644
--- a/storage/innobase/handler/ha_innodb.h
+++ b/storage/innobase/handler/ha_innodb.h
@@ -78,12 +78,13 @@ class ha_innobase: public handler
uchar* upd_buf; /*!< buffer used in updates */
ulint upd_buf_size; /*!< the size of upd_buf in bytes */
- uchar srch_key_val1[REC_VERSION_56_MAX_INDEX_COL_LEN + 2];
- uchar srch_key_val2[REC_VERSION_56_MAX_INDEX_COL_LEN + 2];
+ uchar srch_key_val1[MAX_KEY_LENGTH + MAX_REF_PARTS*2];
+ uchar srch_key_val2[MAX_KEY_LENGTH + MAX_REF_PARTS*2];
/*!< buffers used in converting
search key values from MySQL format
- to InnoDB format. "+ 2" for the two
- bytes where the length is stored */
+ to InnoDB format. For each column
+ 2 bytes are used to store length,
+ hence MAX_REF_PARTS*2. */
Table_flags int_table_flags;
uint primary_key;
ulong start_of_scan; /*!< this is set to 1 when we are
diff --git a/storage/innobase/handler/handler0alter.cc b/storage/innobase/handler/handler0alter.cc
index 9de45527ec7..1468bc79c04 100644
--- a/storage/innobase/handler/handler0alter.cc
+++ b/storage/innobase/handler/handler0alter.cc
@@ -113,13 +113,17 @@ innobase_col_to_mysql(
/* These column types should never be shipped to MySQL. */
ut_ad(0);
- case DATA_CHAR:
case DATA_FIXBINARY:
case DATA_FLOAT:
case DATA_DOUBLE:
case DATA_DECIMAL:
/* Above are the valid column types for MySQL data. */
ut_ad(flen == len);
+ /* fall through */
+ case DATA_CHAR:
+ /* We may have flen > len when there is a shorter
+ prefix on a CHAR column. */
+ ut_ad(flen >= len);
#else /* UNIV_DEBUG */
default:
#endif /* UNIV_DEBUG */
@@ -154,7 +158,7 @@ innobase_rec_to_mysql(
field->reset();
- ipos = dict_index_get_nth_col_pos(index, i);
+ ipos = dict_index_get_nth_col_or_prefix_pos(index, i, TRUE);
if (UNIV_UNLIKELY(ipos == ULINT_UNDEFINED)) {
null_field:
diff --git a/storage/innobase/ibuf/ibuf0ibuf.cc b/storage/innobase/ibuf/ibuf0ibuf.cc
index 1d0abbc2981..cd9de39f3c6 100644
--- a/storage/innobase/ibuf/ibuf0ibuf.cc
+++ b/storage/innobase/ibuf/ibuf0ibuf.cc
@@ -2756,6 +2756,14 @@ ibuf_get_volume_buffered_count_func(
when the database was started up. */
ut_a(len == 1);
+ if (rec_get_deleted_flag(rec, 0)) {
+ /* This record has been merged already,
+ but apparently the system crashed before
+ the change was discarded from the buffer.
+ Pretend that the record does not exist. */
+ return(0);
+ }
+
types = rec_get_nth_field_old(rec, IBUF_REC_FIELD_METADATA, &len);
switch (UNIV_EXPECT(len % DATA_NEW_ORDER_NULL_TYPE_BUF_SIZE,
@@ -4050,11 +4058,11 @@ ibuf_delete(
page, 1);
}
#ifdef UNIV_ZIP_DEBUG
- ut_a(!page_zip || page_zip_validate(page_zip, page));
+ ut_a(!page_zip || page_zip_validate(page_zip, page, index));
#endif /* UNIV_ZIP_DEBUG */
page_cur_delete_rec(&page_cur, index, offsets, mtr);
#ifdef UNIV_ZIP_DEBUG
- ut_a(!page_zip || page_zip_validate(page_zip, page));
+ ut_a(!page_zip || page_zip_validate(page_zip, page, index));
#endif /* UNIV_ZIP_DEBUG */
if (page_zip) {
@@ -4159,6 +4167,22 @@ ibuf_delete_rec(
ut_ad(ibuf_rec_get_page_no(mtr, btr_pcur_get_rec(pcur)) == page_no);
ut_ad(ibuf_rec_get_space(mtr, btr_pcur_get_rec(pcur)) == space);
+#if defined UNIV_DEBUG || defined UNIV_IBUF_DEBUG
+ if (ibuf_debug == 2) {
+ /* Inject a fault (crash). We do this before trying
+ optimistic delete, because a pessimistic delete in the
+ change buffer would require a larger test case. */
+
+ /* Flag the buffered record as processed, to avoid
+ an assertion failure after crash recovery. */
+ btr_cur_set_deleted_flag_for_ibuf(
+ btr_pcur_get_rec(pcur), NULL, TRUE, mtr);
+ ibuf_mtr_commit(mtr);
+ log_write_up_to(IB_ULONGLONG_MAX, LOG_WAIT_ALL_GROUPS, TRUE);
+ DBUG_SUICIDE();
+ }
+#endif /* UNIV_DEBUG || UNIV_IBUF_DEBUG */
+
success = btr_cur_optimistic_delete(btr_pcur_get_btr_cur(pcur), mtr);
if (success) {
@@ -4193,7 +4217,13 @@ ibuf_delete_rec(
ut_ad(ibuf_rec_get_page_no(mtr, btr_pcur_get_rec(pcur)) == page_no);
ut_ad(ibuf_rec_get_space(mtr, btr_pcur_get_rec(pcur)) == space);
- /* We have to resort to a pessimistic delete from ibuf */
+ /* We have to resort to a pessimistic delete from ibuf.
+ Delete-mark the record so that it will not be applied again,
+ in case the server crashes before the pessimistic delete is
+ made persistent. */
+ btr_cur_set_deleted_flag_for_ibuf(
+ btr_pcur_get_rec(pcur), NULL, TRUE, mtr);
+
btr_pcur_store_position(pcur, mtr);
ibuf_btr_pcur_commit_specify_mtr(pcur, mtr);
@@ -4309,7 +4339,7 @@ ibuf_merge_or_delete_for_page(
function. When the counter is > 0, that prevents tablespace
from being dropped. */
- tablespace_being_deleted = fil_inc_pending_ibuf_merges(space);
+ tablespace_being_deleted = fil_inc_pending_ops(space);
if (UNIV_UNLIKELY(tablespace_being_deleted)) {
/* Do not try to read the bitmap page from space;
@@ -4335,7 +4365,7 @@ ibuf_merge_or_delete_for_page(
/* No inserts buffered for this page */
if (!tablespace_being_deleted) {
- fil_decr_pending_ibuf_merges(space);
+ fil_decr_pending_ops(space);
}
return;
@@ -4468,7 +4498,7 @@ loop:
fputs("InnoDB: Discarding record\n ", stderr);
rec_print_old(stderr, rec);
fputs("\nInnoDB: from the insert buffer!\n\n", stderr);
- } else if (block) {
+ } else if (block && !rec_get_deleted_flag(rec, 0)) {
/* Now we have at pcur a record which should be
applied on the index page; NOTE that the call below
copies pointers to fields in rec, and we must
@@ -4628,7 +4658,7 @@ reset_bit:
if (update_ibuf_bitmap && !tablespace_being_deleted) {
- fil_decr_pending_ibuf_merges(space);
+ fil_decr_pending_ops(space);
}
#ifdef UNIV_IBUF_COUNT_DEBUG
diff --git a/storage/innobase/include/btr0cur.h b/storage/innobase/include/btr0cur.h
index 354b6982a13..f437575579e 100644
--- a/storage/innobase/include/btr0cur.h
+++ b/storage/innobase/include/btr0cur.h
@@ -652,7 +652,7 @@ btr_cur_set_deleted_flag_for_ibuf(
when the tablespace is
uncompressed */
ibool val, /*!< in: value to set */
- mtr_t* mtr); /*!< in: mtr */
+ mtr_t* mtr); /*!< in/out: mini-transaction */
/*######################################################################*/
/** In the pessimistic delete, if the page data size drops below this
diff --git a/storage/innobase/include/dict0mem.h b/storage/innobase/include/dict0mem.h
index b770f7e3ca7..ea7e996dfa8 100644
--- a/storage/innobase/include/dict0mem.h
+++ b/storage/innobase/include/dict0mem.h
@@ -456,10 +456,15 @@ struct dict_index_struct{
unsigned type:DICT_IT_BITS;
/*!< index type (DICT_CLUSTERED, DICT_UNIQUE,
DICT_UNIVERSAL, DICT_IBUF, DICT_CORRUPT) */
- unsigned trx_id_offset:10;/*!< position of the trx id column
+#define MAX_KEY_LENGTH_BITS 12
+ unsigned trx_id_offset:MAX_KEY_LENGTH_BITS;
+ /*!< position of the trx id column
in a clustered index record, if the fields
before it are known to be of a fixed size,
0 otherwise */
+#if (1<<MAX_KEY_LENGTH_BITS) < MAX_KEY_LENGTH
+# error (1<<MAX_KEY_LENGTH_BITS) < MAX_KEY_LENGTH
+#endif
unsigned n_user_defined_cols:10;
/*!< number of columns the user defined to
be in the index: in the internal
diff --git a/storage/innobase/include/fil0fil.h b/storage/innobase/include/fil0fil.h
index fa632ea3c6b..1e2b8049860 100644
--- a/storage/innobase/include/fil0fil.h
+++ b/storage/innobase/include/fil0fil.h
@@ -357,20 +357,19 @@ fil_read_first_page(
lsn_t* max_flushed_lsn); /*!< out: max of flushed
lsn values in data files */
/*******************************************************************//**
-Increments the count of pending insert buffer page merges, if space is not
-being deleted.
-@return TRUE if being deleted, and ibuf merges should be skipped */
+Increments the count of pending operation, if space is not being deleted.
+@return TRUE if being deleted, and operation should be skipped */
UNIV_INTERN
ibool
-fil_inc_pending_ibuf_merges(
-/*========================*/
+fil_inc_pending_ops(
+/*================*/
ulint id); /*!< in: space id */
/*******************************************************************//**
-Decrements the count of pending insert buffer page merges. */
+Decrements the count of pending operations. */
UNIV_INTERN
void
-fil_decr_pending_ibuf_merges(
-/*=========================*/
+fil_decr_pending_ops(
+/*=================*/
ulint id); /*!< in: space id */
#endif /* !UNIV_HOTBACKUP */
/*******************************************************************//**
diff --git a/storage/innobase/include/lock0lock.h b/storage/innobase/include/lock0lock.h
index fa1e6d50224..a1ffe87d5bd 100644
--- a/storage/innobase/include/lock0lock.h
+++ b/storage/innobase/include/lock0lock.h
@@ -794,6 +794,31 @@ lock_table_get_n_locks(
/*===================*/
const dict_table_t* table) /*!< in: table */
__attribute__((nonnull));
+#ifdef UNIV_DEBUG
+/*********************************************************************//**
+Checks that a transaction id is sensible, i.e., not in the future.
+@return true if ok */
+UNIV_INTERN
+bool
+lock_check_trx_id_sanity(
+/*=====================*/
+ trx_id_t trx_id, /*!< in: trx id */
+ const rec_t* rec, /*!< in: user record */
+ dict_index_t* index, /*!< in: index */
+ const ulint* offsets) /*!< in: rec_get_offsets(rec, index) */
+ __attribute__((nonnull, warn_unused_result));
+/*******************************************************************//**
+Check if the transaction holds any locks on the sys tables
+or its records.
+@return the strongest lock found on any sys table or 0 for none */
+UNIV_INTERN
+const lock_t*
+lock_trx_has_sys_table_locks(
+/*=========================*/
+ const trx_t* trx) /*!< in: transaction to check */
+ __attribute__((warn_unused_result));
+#endif /* UNIV_DEBUG */
+
/** Lock modes and types */
/* @{ */
#define LOCK_MODE_MASK 0xFUL /*!< mask used to extract mode from the
diff --git a/storage/innobase/include/page0zip.h b/storage/innobase/include/page0zip.h
index f127fad2260..2c84f75b2ab 100644
--- a/storage/innobase/include/page0zip.h
+++ b/storage/innobase/include/page0zip.h
@@ -157,9 +157,10 @@ page_zip_validate_low(
/*==================*/
const page_zip_des_t* page_zip,/*!< in: compressed page */
const page_t* page, /*!< in: uncompressed page */
+ const dict_index_t* index, /*!< in: index of the page, if known */
ibool sloppy) /*!< in: FALSE=strict,
TRUE=ignore the MIN_REC_FLAG */
- __attribute__((nonnull));
+ __attribute__((nonnull(1,2)));
/**********************************************************************//**
Check that the compressed and decompressed pages match. */
UNIV_INTERN
@@ -167,8 +168,9 @@ ibool
page_zip_validate(
/*==============*/
const page_zip_des_t* page_zip,/*!< in: compressed page */
- const page_t* page) /*!< in: uncompressed page */
- __attribute__((nonnull));
+ const page_t* page, /*!< in: uncompressed page */
+ const dict_index_t* index) /*!< in: index of the page, if known */
+ __attribute__((nonnull(1,2)));
#endif /* UNIV_ZIP_DEBUG */
/**********************************************************************//**
diff --git a/storage/innobase/include/row0undo.h b/storage/innobase/include/row0undo.h
index 90a15172ae0..47f9afdc74a 100644
--- a/storage/innobase/include/row0undo.h
+++ b/storage/innobase/include/row0undo.h
@@ -87,10 +87,6 @@ that index record. */
enum undo_exec {
UNDO_NODE_FETCH_NEXT = 1, /*!< we should fetch the next
undo log record */
- UNDO_NODE_PREV_VERS, /*!< the roll ptr to previous
- version of a row is stored in
- node, and undo should be done
- based on it */
UNDO_NODE_INSERT, /*!< undo a fresh insert of a
row to a table */
UNDO_NODE_MODIFY /*!< undo a modify operation
@@ -108,9 +104,6 @@ struct undo_node_struct{
undo_no_t undo_no;/*!< undo number of the record */
ulint rec_type;/*!< undo log record type: TRX_UNDO_INSERT_REC,
... */
- roll_ptr_t new_roll_ptr;
- /*!< roll ptr to restore to clustered index
- record */
trx_id_t new_trx_id; /*!< trx id to restore to clustered index
record */
btr_pcur_t pcur; /*!< persistent cursor used in searching the
diff --git a/storage/innobase/include/row0upd.ic b/storage/innobase/include/row0upd.ic
index 8a2543eaac9..d054662c080 100644
--- a/storage/innobase/include/row0upd.ic
+++ b/storage/innobase/include/row0upd.ic
@@ -28,6 +28,7 @@ Created 12/27/1996 Heikki Tuuri
# include "trx0trx.h"
# include "trx0undo.h"
# include "row0row.h"
+# include "lock0lock.h"
#endif /* !UNIV_HOTBACKUP */
#include "page0zip.h"
@@ -171,6 +172,8 @@ row_upd_rec_sys_fields(
#if DATA_TRX_ID + 1 != DATA_ROLL_PTR
# error "DATA_TRX_ID + 1 != DATA_ROLL_PTR"
#endif
+ ut_ad(lock_check_trx_id_sanity(trx_read_trx_id(rec + offset),
+ rec, index, offsets));
trx_write_trx_id(rec + offset, trx->id);
trx_write_roll_ptr(rec + offset + DATA_TRX_ID_LEN, roll_ptr);
}
diff --git a/storage/innobase/lock/lock0lock.cc b/storage/innobase/lock/lock0lock.cc
index 18fbfbee91b..476b305ca70 100644
--- a/storage/innobase/lock/lock0lock.cc
+++ b/storage/innobase/lock/lock0lock.cc
@@ -488,9 +488,13 @@ lock_report_trx_id_insanity(
/*********************************************************************//**
Checks that a transaction id is sensible, i.e., not in the future.
-@return TRUE if ok */
-static
-ibool
+@return true if ok */
+#ifdef UNIV_DEBUG
+UNIV_INTERN
+#else
+static __attribute__((nonnull, warn_unused_result))
+#endif
+bool
lock_check_trx_id_sanity(
/*=====================*/
trx_id_t trx_id, /*!< in: trx id */
diff --git a/storage/innobase/log/log0recv.cc b/storage/innobase/log/log0recv.cc
index a360d05f056..f914fc2676c 100644
--- a/storage/innobase/log/log0recv.cc
+++ b/storage/innobase/log/log0recv.cc
@@ -1636,9 +1636,8 @@ recv_recover_page_func(
if (fil_page_get_type(page) == FIL_PAGE_INDEX) {
page_zip_des_t* page_zip = buf_block_get_page_zip(block);
- if (page_zip) {
- ut_a(page_zip_validate_low(page_zip, page, FALSE));
- }
+ ut_a(!page_zip
+ || page_zip_validate_low(page_zip, page, NULL, FALSE));
}
#endif /* UNIV_ZIP_DEBUG */
diff --git a/storage/innobase/mysql-test/storage_engine/alter_tablespace.rdiff b/storage/innobase/mysql-test/storage_engine/alter_tablespace.rdiff
new file mode 100644
index 00000000000..0cbe1fa48ae
--- /dev/null
+++ b/storage/innobase/mysql-test/storage_engine/alter_tablespace.rdiff
@@ -0,0 +1,11 @@
+--- suite/storage_engine/alter_tablespace.result 2013-01-13 01:03:49.133994000 +0400
++++ suite/storage_engine/alter_tablespace.reject 2013-01-13 01:04:04.398937286 +0400
+@@ -10,7 +10,7 @@
+ 2
+ ALTER TABLE t1 DISCARD TABLESPACE;
+ SELECT * FROM t1;
+-ERROR HY000: Got error -1 from storage engine
++ERROR HY000: Got error -1 "Internal error < 0 (Not system error)" from storage engine
+ ALTER TABLE t1 IMPORT TABLESPACE;
+ SELECT * FROM t1;
+ a
diff --git a/storage/innobase/mysql-test/storage_engine/tbl_opt_row_format.rdiff b/storage/innobase/mysql-test/storage_engine/tbl_opt_row_format.rdiff
index 4c0e0c375f5..8bf84115a52 100644
--- a/storage/innobase/mysql-test/storage_engine/tbl_opt_row_format.rdiff
+++ b/storage/innobase/mysql-test/storage_engine/tbl_opt_row_format.rdiff
@@ -4,7 +4,7 @@
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> ROW_FORMAT=FIXED;
+Warnings:
-+Warning 1478 InnoDB: assuming ROW_FORMAT=COMPACT.
++Warning 140 InnoDB: assuming ROW_FORMAT=COMPACT.
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
diff --git a/storage/innobase/os/os0file.cc b/storage/innobase/os/os0file.cc
index ec9e234229a..62cde1cf728 100644
--- a/storage/innobase/os/os0file.cc
+++ b/storage/innobase/os/os0file.cc
@@ -1443,6 +1443,13 @@ os_file_create_func(
create_mode &= ~OS_FILE_ON_ERROR_NO_EXIT;
create_mode &= ~OS_FILE_ON_ERROR_SILENT;
+
+ DBUG_EXECUTE_IF(
+ "ib_create_table_fail_disk_full",
+ *success = FALSE;
+ SetLastError(ERROR_DISK_FULL);
+ return((os_file_t) -1);
+ );
try_again:
ut_a(name);
@@ -1560,6 +1567,12 @@ try_again:
create_mode &= ~OS_FILE_ON_ERROR_NO_EXIT;
create_mode &= ~OS_FILE_ON_ERROR_SILENT;
+ DBUG_EXECUTE_IF(
+ "ib_create_table_fail_disk_full",
+ *success = FALSE;
+ errno = ENOSPC;
+ return((os_file_t) -1);
+ );
try_again:
ut_a(name);
diff --git a/storage/innobase/page/page0cur.cc b/storage/innobase/page/page0cur.cc
index 3ae063dedec..9046338f377 100644
--- a/storage/innobase/page/page0cur.cc
+++ b/storage/innobase/page/page0cur.cc
@@ -310,7 +310,7 @@ page_cur_search_with_match(
#endif /* UNIV_DEBUG */
page = buf_block_get_frame(block);
#ifdef UNIV_ZIP_DEBUG
- ut_a(!page_zip || page_zip_validate(page_zip, page));
+ ut_a(!page_zip || page_zip_validate(page_zip, page, index));
#endif /* UNIV_ZIP_DEBUG */
page_check_dir(page);
@@ -1249,7 +1249,7 @@ page_cur_insert_rec_zip(
ut_ad(!page_rec_is_supremum(*current_rec));
#ifdef UNIV_ZIP_DEBUG
- ut_a(page_zip_validate(page_zip, page));
+ ut_a(page_zip_validate(page_zip, page, index));
#endif /* UNIV_ZIP_DEBUG */
/* 1. Get the size of the physical record in the page */
@@ -1973,7 +1973,7 @@ page_cur_delete_rec(
}
#ifdef UNIV_ZIP_DEBUG
- ut_a(!page_zip || page_zip_validate(page_zip, page));
+ ut_a(!page_zip || page_zip_validate(page_zip, page, index));
#endif /* UNIV_ZIP_DEBUG */
}
diff --git a/storage/innobase/page/page0page.cc b/storage/innobase/page/page0page.cc
index fb3e21b8b26..deef6935f08 100644
--- a/storage/innobase/page/page0page.cc
+++ b/storage/innobase/page/page0page.cc
@@ -626,7 +626,7 @@ page_copy_rec_list_end(
Furthermore, btr_compress() may set FIL_PAGE_PREV to
FIL_NULL on new_page while leaving it intact on
new_page_zip. So, we cannot validate new_page_zip. */
- ut_a(page_zip_validate_low(page_zip, page, TRUE));
+ ut_a(page_zip_validate_low(page_zip, page, index, TRUE));
}
#endif /* UNIV_ZIP_DEBUG */
ut_ad(buf_block_get_frame(block) == page);
@@ -943,7 +943,7 @@ page_delete_rec_list_end(
ut_ad(size == ULINT_UNDEFINED || size < UNIV_PAGE_SIZE);
ut_ad(!page_zip || page_rec_is_comp(rec));
#ifdef UNIV_ZIP_DEBUG
- ut_a(!page_zip || page_zip_validate(page_zip, page));
+ ut_a(!page_zip || page_zip_validate(page_zip, page, index));
#endif /* UNIV_ZIP_DEBUG */
if (page_rec_is_infimum(rec)) {
@@ -985,7 +985,7 @@ page_delete_rec_list_end(
ULINT_UNDEFINED, &heap);
rec = rec_get_next_ptr(rec, TRUE);
#ifdef UNIV_ZIP_DEBUG
- ut_a(page_zip_validate(page_zip, page));
+ ut_a(page_zip_validate(page_zip, page, index));
#endif /* UNIV_ZIP_DEBUG */
page_cur_delete_rec(&cur, index, offsets, mtr);
} while (page_offset(rec) != PAGE_NEW_SUPREMUM);
@@ -1123,7 +1123,8 @@ page_delete_rec_list_start(
between btr_attach_half_pages() and insert_page = ...
when btr_page_get_split_rec_to_left() holds
(direction == FSP_DOWN). */
- ut_a(!page_zip || page_zip_validate_low(page_zip, page, TRUE));
+ ut_a(!page_zip
+ || page_zip_validate_low(page_zip, page, index, TRUE));
}
#endif /* UNIV_ZIP_DEBUG */
@@ -1194,9 +1195,10 @@ page_move_rec_list_end(
= buf_block_get_page_zip(block);
ut_a(!new_page_zip == !page_zip);
ut_a(!new_page_zip
- || page_zip_validate(new_page_zip, new_page));
+ || page_zip_validate(new_page_zip, new_page, index));
ut_a(!page_zip
- || page_zip_validate(page_zip, page_align(split_rec)));
+ || page_zip_validate(page_zip, page_align(split_rec),
+ index));
}
#endif /* UNIV_ZIP_DEBUG */
diff --git a/storage/innobase/page/page0zip.cc b/storage/innobase/page/page0zip.cc
index ce75d4e15fc..35a8f458fb2 100644
--- a/storage/innobase/page/page0zip.cc
+++ b/storage/innobase/page/page0zip.cc
@@ -1447,7 +1447,7 @@ err_exit:
page_zip_get_size(page_zip) - PAGE_DATA);
mem_heap_free(heap);
#ifdef UNIV_ZIP_DEBUG
- ut_a(page_zip_validate(page_zip, page));
+ ut_a(page_zip_validate(page_zip, page, index));
#endif /* UNIV_ZIP_DEBUG */
if (mtr) {
@@ -3140,6 +3140,7 @@ page_zip_validate_low(
/*==================*/
const page_zip_des_t* page_zip,/*!< in: compressed page */
const page_t* page, /*!< in: uncompressed page */
+ const dict_index_t* index, /*!< in: index of the page, if known */
ibool sloppy) /*!< in: FALSE=strict,
TRUE=ignore the MIN_REC_FLAG */
{
@@ -3227,39 +3228,102 @@ page_zip_validate_low(
committed. Let us tolerate that difference when we
are performing a sloppy validation. */
- if (sloppy) {
- byte info_bits_diff;
- ulint offset
- = rec_get_next_offs(page + PAGE_NEW_INFIMUM,
- TRUE);
- ut_a(offset >= PAGE_NEW_SUPREMUM);
- offset -= 5 /* REC_NEW_INFO_BITS */;
-
- info_bits_diff = page[offset] ^ temp_page[offset];
-
- if (info_bits_diff == REC_INFO_MIN_REC_FLAG) {
- temp_page[offset] = page[offset];
-
- if (!memcmp(page + PAGE_HEADER,
- temp_page + PAGE_HEADER,
- UNIV_PAGE_SIZE - PAGE_HEADER
- - FIL_PAGE_DATA_END)) {
-
- /* Only the minimum record flag
- differed. Let us ignore it. */
- page_zip_fail(("page_zip_validate: "
- "min_rec_flag "
- "(ignored, "
- "%lu,%lu,0x%02lx)\n",
- page_get_space_id(page),
- page_get_page_no(page),
- (ulong) page[offset]));
- goto func_exit;
- }
+ ulint* offsets;
+ mem_heap_t* heap;
+ const rec_t* rec;
+ const rec_t* trec;
+ byte info_bits_diff;
+ ulint offset
+ = rec_get_next_offs(page + PAGE_NEW_INFIMUM, TRUE);
+ ut_a(offset >= PAGE_NEW_SUPREMUM);
+ offset -= 5/*REC_NEW_INFO_BITS*/;
+
+ info_bits_diff = page[offset] ^ temp_page[offset];
+
+ if (info_bits_diff == REC_INFO_MIN_REC_FLAG) {
+ temp_page[offset] = page[offset];
+
+ if (!memcmp(page + PAGE_HEADER,
+ temp_page + PAGE_HEADER,
+ UNIV_PAGE_SIZE - PAGE_HEADER
+ - FIL_PAGE_DATA_END)) {
+
+ /* Only the minimum record flag
+ differed. Let us ignore it. */
+ page_zip_fail(("page_zip_validate: "
+ "min_rec_flag "
+ "(%s"
+ "%lu,%lu,0x%02lx)\n",
+ sloppy ? "ignored, " : "",
+ page_get_space_id(page),
+ page_get_page_no(page),
+ (ulong) page[offset]));
+ valid = sloppy;
+ goto func_exit;
+ }
+ }
+
+ /* Compare the pointers in the PAGE_FREE list. */
+ rec = page_header_get_ptr(page, PAGE_FREE);
+ trec = page_header_get_ptr(temp_page, PAGE_FREE);
+
+ while (rec || trec) {
+ if (page_offset(rec) != page_offset(trec)) {
+ page_zip_fail(("page_zip_validate: "
+ "PAGE_FREE list: %u!=%u\n",
+ (unsigned) page_offset(rec),
+ (unsigned) page_offset(trec)));
+ valid = FALSE;
+ goto func_exit;
}
+
+ rec = page_rec_get_next_low(rec, TRUE);
+ trec = page_rec_get_next_low(trec, TRUE);
}
- page_zip_fail(("page_zip_validate: content\n"));
+
+ /* Compare the records. */
+ heap = NULL;
+ offsets = NULL;
+ rec = page_rec_get_next_low(
+ page + PAGE_NEW_INFIMUM, TRUE);
+ trec = page_rec_get_next_low(
+ temp_page + PAGE_NEW_INFIMUM, TRUE);
+
+ do {
+ if (page_offset(rec) != page_offset(trec)) {
+ page_zip_fail(("page_zip_validate: "
+ "record list: 0x%02x!=0x%02x\n",
+ (unsigned) page_offset(rec),
+ (unsigned) page_offset(trec)));
valid = FALSE;
+ break;
+ }
+
+ if (index) {
+ /* Compare the data. */
+ offsets = rec_get_offsets(
+ rec, index, offsets,
+ ULINT_UNDEFINED, &heap);
+
+ if (memcmp(rec - rec_offs_extra_size(offsets),
+ trec - rec_offs_extra_size(offsets),
+ rec_offs_size(offsets))) {
+ page_zip_fail(
+ ("page_zip_validate: "
+ "record content: 0x%02x",
+ (unsigned) page_offset(rec)));
+ valid = FALSE;
+ break;
+ }
+ }
+
+ rec = page_rec_get_next_low(rec, TRUE);
+ trec = page_rec_get_next_low(trec, TRUE);
+ } while (rec || trec);
+
+ if (heap) {
+ mem_heap_free(heap);
+ }
}
func_exit:
@@ -3281,9 +3345,10 @@ ibool
page_zip_validate(
/*==============*/
const page_zip_des_t* page_zip,/*!< in: compressed page */
- const page_t* page) /*!< in: uncompressed page */
+ const page_t* page, /*!< in: uncompressed page */
+ const dict_index_t* index) /*!< in: index of the page, if known */
{
- return(page_zip_validate_low(page_zip, page,
+ return(page_zip_validate_low(page_zip, page, index,
recv_recovery_is_on()));
}
#endif /* UNIV_ZIP_DEBUG */
@@ -3614,7 +3679,7 @@ page_zip_write_rec(
page_zip->m_nonempty = TRUE;
#ifdef UNIV_ZIP_DEBUG
- ut_a(page_zip_validate(page_zip, page_align(rec)));
+ ut_a(page_zip_validate(page_zip, page_align(rec), index));
#endif /* UNIV_ZIP_DEBUG */
}
@@ -3661,7 +3726,7 @@ corrupt:
}
#ifdef UNIV_ZIP_DEBUG
- ut_a(page_zip_validate(page_zip, page));
+ ut_a(page_zip_validate(page_zip, page, NULL));
#endif /* UNIV_ZIP_DEBUG */
memcpy(page + offset,
@@ -3670,7 +3735,7 @@ corrupt:
ptr + 4, BTR_EXTERN_FIELD_REF_SIZE);
#ifdef UNIV_ZIP_DEBUG
- ut_a(page_zip_validate(page_zip, page));
+ ut_a(page_zip_validate(page_zip, page, NULL));
#endif /* UNIV_ZIP_DEBUG */
}
@@ -3737,7 +3802,7 @@ page_zip_write_blob_ptr(
memcpy(externs, field, BTR_EXTERN_FIELD_REF_SIZE);
#ifdef UNIV_ZIP_DEBUG
- ut_a(page_zip_validate(page_zip, page));
+ ut_a(page_zip_validate(page_zip, page, index));
#endif /* UNIV_ZIP_DEBUG */
if (mtr) {
@@ -3808,7 +3873,7 @@ corrupt:
}
#ifdef UNIV_ZIP_DEBUG
- ut_a(page_zip_validate(page_zip, page));
+ ut_a(page_zip_validate(page_zip, page, NULL));
#endif /* UNIV_ZIP_DEBUG */
field = page + offset;
@@ -3829,7 +3894,7 @@ corrupt:
memcpy(storage, ptr + 4, REC_NODE_PTR_SIZE);
#ifdef UNIV_ZIP_DEBUG
- ut_a(page_zip_validate(page_zip, page));
+ ut_a(page_zip_validate(page_zip, page, NULL));
#endif /* UNIV_ZIP_DEBUG */
}
@@ -3924,6 +3989,7 @@ page_zip_write_trx_id_and_roll_ptr(
ulint len;
ut_ad(PAGE_ZIP_MATCH(rec, page_zip));
+
ut_ad(page_simple_validate_new(page));
ut_ad(page_zip_simple_validate(page_zip));
ut_ad(page_zip_get_size(page_zip)
@@ -4056,7 +4122,7 @@ page_zip_clear_rec(
}
#ifdef UNIV_ZIP_DEBUG
- ut_a(page_zip_validate(page_zip, page));
+ ut_a(page_zip_validate(page_zip, page, index));
#endif /* UNIV_ZIP_DEBUG */
}
@@ -4080,7 +4146,7 @@ page_zip_rec_set_deleted(
*slot &= ~(PAGE_ZIP_DIR_SLOT_DEL >> 8);
}
#ifdef UNIV_ZIP_DEBUG
- ut_a(page_zip_validate(page_zip, page_align(rec)));
+ ut_a(page_zip_validate(page_zip, page_align(rec), NULL));
#endif /* UNIV_ZIP_DEBUG */
}
@@ -4381,14 +4447,14 @@ corrupt:
goto corrupt;
}
#ifdef UNIV_ZIP_DEBUG
- ut_a(page_zip_validate(page_zip, page));
+ ut_a(page_zip_validate(page_zip, page, NULL));
#endif /* UNIV_ZIP_DEBUG */
memcpy(page + offset, ptr, len);
memcpy(page_zip->data + offset, ptr, len);
#ifdef UNIV_ZIP_DEBUG
- ut_a(page_zip_validate(page_zip, page));
+ ut_a(page_zip_validate(page_zip, page, NULL));
#endif /* UNIV_ZIP_DEBUG */
}
@@ -4466,7 +4532,7 @@ page_zip_reorganize(
ut_ad(mtr_memo_contains(mtr, block, MTR_MEMO_PAGE_X_FIX));
ut_ad(page_is_comp(page));
ut_ad(!dict_index_is_ibuf(index));
- /* Note that page_zip_validate(page_zip, page) may fail here. */
+ /* Note that page_zip_validate(page_zip, page, index) may fail here. */
UNIV_MEM_ASSERT_RW(page, UNIV_PAGE_SIZE);
UNIV_MEM_ASSERT_RW(page_zip->data, page_zip_get_size(page_zip));
@@ -4553,7 +4619,7 @@ page_zip_copy_recs(
FIL_PAGE_PREV or PAGE_LEVEL, causing a temporary min_rec_flag
mismatch. A strict page_zip_validate() will be executed later
during the B-tree operations. */
- ut_a(page_zip_validate_low(src_zip, src, TRUE));
+ ut_a(page_zip_validate_low(src_zip, src, index, TRUE));
#endif /* UNIV_ZIP_DEBUG */
ut_a(page_zip_get_size(page_zip) == page_zip_get_size(src_zip));
if (UNIV_UNLIKELY(src_zip->n_blobs)) {
@@ -4614,7 +4680,7 @@ page_zip_copy_recs(
}
#ifdef UNIV_ZIP_DEBUG
- ut_a(page_zip_validate(page_zip, page));
+ ut_a(page_zip_validate(page_zip, page, index));
#endif /* UNIV_ZIP_DEBUG */
btr_blob_dbg_add(page, index, "page_zip_copy_recs");
diff --git a/storage/innobase/row/row0mysql.cc b/storage/innobase/row/row0mysql.cc
index b4827782be6..f1811a664c2 100644
--- a/storage/innobase/row/row0mysql.cc
+++ b/storage/innobase/row/row0mysql.cc
@@ -2048,7 +2048,8 @@ Creates a table for MySQL. If the name of the table ends in
one of "innodb_monitor", "innodb_lock_monitor", "innodb_tablespace_monitor",
"innodb_table_monitor", then this will also start the printing of monitor
output by the master thread. If the table name ends in "innodb_mem_validate",
-InnoDB will try to invoke mem_validate().
+InnoDB will try to invoke mem_validate(). On failure the transaction will
+be rolled back and the 'table' object will be freed.
@return error code or DB_SUCCESS */
UNIV_INTERN
int
@@ -2193,7 +2194,10 @@ err_exit:
row_drop_table_for_mysql(table->name, trx, FALSE);
trx_commit_for_mysql(trx);
+ } else {
+ dict_mem_table_free(table);
}
+
break;
case DB_TOO_MANY_CONCURRENT_TRXS:
diff --git a/storage/innobase/row/row0sel.cc b/storage/innobase/row/row0sel.cc
index 8f3f5711a61..96884e89511 100644
--- a/storage/innobase/row/row0sel.cc
+++ b/storage/innobase/row/row0sel.cc
@@ -2543,6 +2543,9 @@ row_sel_convert_mysql_key_to_innobase(
dfield++;
}
+ DBUG_EXECUTE_IF("innodb_srch_key_buffer_full",
+ ut_a(buf == (original_buf + buf_len)););
+
ut_a(buf <= original_buf + buf_len);
/* We set the length of tuple to n_fields: we assume that the memory
@@ -4207,6 +4210,11 @@ wait_table_again:
}
rec_loop:
+ if (trx_is_interrupted(trx)) {
+ err = DB_INTERRUPTED;
+ goto normal_return;
+ }
+
/*-------------------------------------------------------------*/
/* PHASE 4: Look for matching records in a loop */
@@ -5211,7 +5219,13 @@ row_search_autoinc_read_column(
rec_offs_init(offsets_);
- offsets = rec_get_offsets(rec, index, offsets, ULINT_UNDEFINED, &heap);
+ offsets = rec_get_offsets(rec, index, offsets, col_no + 1, &heap);
+
+ if (rec_offs_nth_sql_null(offsets, col_no)) {
+ /* There is no non-NULL value in the auto-increment column. */
+ value = 0;
+ goto func_exit;
+ }
data = rec_get_nth_field(rec, offsets, col_no, &len);
@@ -5237,14 +5251,15 @@ row_search_autoinc_read_column(
ut_error;
}
- if (UNIV_LIKELY_NULL(heap)) {
- mem_heap_free(heap);
- }
-
if (!unsigned_type && (ib_int64_t) value < 0) {
value = 0;
}
+func_exit:
+ if (UNIV_LIKELY_NULL(heap)) {
+ mem_heap_free(heap);
+ }
+
return(value);
}
diff --git a/storage/innobase/row/row0umod.cc b/storage/innobase/row/row0umod.cc
index c9b42265553..4869909f5a6 100644
--- a/storage/innobase/row/row0umod.cc
+++ b/storage/innobase/row/row0umod.cc
@@ -69,36 +69,6 @@ If you make a change in this module make sure that no codepath is
introduced where a call to log_free_check() is bypassed. */
/***********************************************************//**
-Checks if also the previous version of the clustered index record was
-modified or inserted by the same transaction, and its undo number is such
-that it should be undone in the same rollback.
-@return TRUE if also previous modify or insert of this row should be undone */
-static
-ibool
-row_undo_mod_undo_also_prev_vers(
-/*=============================*/
- undo_node_t* node, /*!< in: row undo node */
- undo_no_t* undo_no)/*!< out: the undo number */
-{
- trx_undo_rec_t* undo_rec;
- trx_t* trx;
-
- trx = node->trx;
-
- if (node->new_trx_id != trx->id) {
-
- *undo_no = 0;
- return(FALSE);
- }
-
- undo_rec = trx_undo_get_undo_rec_low(node->new_roll_ptr, node->heap);
-
- *undo_no = trx_undo_rec_get_undo_no(undo_rec);
-
- return(trx->roll_limit <= *undo_no);
-}
-
-/***********************************************************//**
Undoes a modify in a clustered index record.
@return DB_SUCCESS, DB_FAIL, or error code: we may run out of file space */
static
@@ -226,18 +196,11 @@ row_undo_mod_clust(
btr_pcur_t* pcur;
mtr_t mtr;
ulint err;
- ibool success;
- ibool more_vers;
- undo_no_t new_undo_no;
ut_ad(node && thr);
log_free_check();
- /* Check if also the previous version of the clustered index record
- should be undone in this same rollback operation */
-
- more_vers = row_undo_mod_undo_also_prev_vers(node, &new_undo_no);
pcur = &(node->pcur);
@@ -286,20 +249,6 @@ row_undo_mod_clust(
trx_undo_rec_release(node->trx, node->undo_no);
- if (more_vers && err == DB_SUCCESS) {
-
- /* Reserve the undo log record to the prior version after
- committing &mtr: this is necessary to comply with the latching
- order, as &mtr may contain the fsp latch which is lower in
- the latch hierarchy than trx->undo_mutex. */
-
- success = trx_undo_rec_reserve(node->trx, new_undo_no);
-
- if (success) {
- node->state = UNDO_NODE_PREV_VERS;
- }
- }
-
return(err);
}
@@ -835,7 +784,6 @@ row_undo_mod_parse_undo_rec(
trx_undo_update_rec_get_update(ptr, clust_index, type, trx_id,
roll_ptr, info_bits, trx,
node->heap, &(node->update));
- node->new_roll_ptr = roll_ptr;
node->new_trx_id = trx_id;
node->cmpl_info = cmpl_info;
diff --git a/storage/innobase/row/row0undo.cc b/storage/innobase/row/row0undo.cc
index 6519e10334d..757d3544ba4 100644
--- a/storage/innobase/row/row0undo.cc
+++ b/storage/innobase/row/row0undo.cc
@@ -283,25 +283,6 @@ row_undo(
} else {
node->state = UNDO_NODE_MODIFY;
}
-
- } else if (node->state == UNDO_NODE_PREV_VERS) {
-
- /* Undo should be done to the same clustered index record
- again in this same rollback, restoring the previous version */
-
- roll_ptr = node->new_roll_ptr;
-
- node->undo_rec = trx_undo_get_undo_rec_low(roll_ptr,
- node->heap);
- node->roll_ptr = roll_ptr;
- node->undo_no = trx_undo_rec_get_undo_no(node->undo_rec);
-
- if (trx_undo_roll_ptr_is_insert(roll_ptr)) {
-
- node->state = UNDO_NODE_INSERT;
- } else {
- node->state = UNDO_NODE_MODIFY;
- }
}
/* Prevent DROP TABLE etc. while we are rolling back this row.
diff --git a/storage/maria/ha_maria.cc b/storage/maria/ha_maria.cc
index 58f4f16d27a..95f37ddb12f 100644
--- a/storage/maria/ha_maria.cc
+++ b/storage/maria/ha_maria.cc
@@ -3056,7 +3056,10 @@ int ha_maria::create(const char *name, register TABLE *table_arg,
ha_create_info->transactional != HA_CHOICE_NO);
if (ha_create_info->options & HA_LEX_CREATE_TMP_TABLE)
+ {
create_flags|= HA_CREATE_TMP_TABLE;
+ create_info.transactional= 0;
+ }
if (ha_create_info->options & HA_CREATE_KEEP_FILES)
create_flags|= HA_CREATE_KEEP_FILES;
if (options & HA_OPTION_PACK_RECORD)
diff --git a/storage/maria/ma_bitmap.c b/storage/maria/ma_bitmap.c
index f5d32d6a191..e3668d3c8d3 100644
--- a/storage/maria/ma_bitmap.c
+++ b/storage/maria/ma_bitmap.c
@@ -239,7 +239,7 @@ my_bool _ma_bitmap_init(MARIA_SHARE *share, File file,
if (((bitmap->map= (uchar*) my_malloc(size, MYF(MY_WME))) == NULL) ||
my_init_dynamic_array(&bitmap->pinned_pages,
- sizeof(MARIA_PINNED_PAGE), 1, 1))
+ sizeof(MARIA_PINNED_PAGE), 1, 1, MYF(0)))
return 1;
bitmap->block_size= share->block_size;
diff --git a/storage/maria/ma_blockrec.c b/storage/maria/ma_blockrec.c
index 71faa11fd2b..55b9a137050 100644
--- a/storage/maria/ma_blockrec.c
+++ b/storage/maria/ma_blockrec.c
@@ -528,7 +528,7 @@ my_bool _ma_init_block_record(MARIA_HA *info)
if (my_init_dynamic_array(&info->bitmap_blocks,
sizeof(MARIA_BITMAP_BLOCK), default_extents,
- 64))
+ 64, MYF(0)))
goto err;
info->cur_row.extents_buffer_length= default_extents * ROW_EXTENT_SIZE;
if (!(info->cur_row.extents= my_malloc(info->cur_row.extents_buffer_length,
diff --git a/storage/maria/ma_check.c b/storage/maria/ma_check.c
index c362a3024ae..ab9080c40fb 100644
--- a/storage/maria/ma_check.c
+++ b/storage/maria/ma_check.c
@@ -3765,7 +3765,8 @@ int maria_repair_by_sort(HA_CHECK *param, register MARIA_HA *info,
param->read_cache.end_of_file= sort_info.filelength;
sort_param.wordlist=NULL;
- init_alloc_root(&sort_param.wordroot, FTPARSER_MEMROOT_ALLOC_SIZE, 0);
+ init_alloc_root(&sort_param.wordroot, FTPARSER_MEMROOT_ALLOC_SIZE, 0,
+ MYF(param->malloc_flags));
sort_param.key_cmp=sort_key_cmp;
sort_param.lock_in_memory=maria_lock_memory;
@@ -4402,7 +4403,8 @@ int maria_repair_parallel(HA_CHECK *param, register MARIA_HA *info,
(FT_MAX_WORD_LEN_FOR_SORT *
sort_param[i].keyinfo->seg->charset->mbmaxlen);
sort_param[i].key_length+=ft_max_word_len_for_sort-HA_FT_MAXBYTELEN;
- init_alloc_root(&sort_param[i].wordroot, FTPARSER_MEMROOT_ALLOC_SIZE, 0);
+ init_alloc_root(&sort_param[i].wordroot, FTPARSER_MEMROOT_ALLOC_SIZE, 0,
+ MYF(param->malloc_flags));
}
}
sort_info.total_keys=i;
diff --git a/storage/maria/ma_ft_boolean_search.c b/storage/maria/ma_ft_boolean_search.c
index 83ae08553ef..c98c4b599fc 100644
--- a/storage/maria/ma_ft_boolean_search.c
+++ b/storage/maria/ma_ft_boolean_search.c
@@ -527,7 +527,7 @@ static void _ftb_init_index_search(FT_INFO *ftb)
/* 4 */
if (!is_tree_inited(& ftb->no_dupes))
init_tree(& ftb->no_dupes,0,0,sizeof(my_off_t),
- _ftb_no_dupes_cmp,0,0,0);
+ _ftb_no_dupes_cmp,0,0,0);
else
reset_tree(& ftb->no_dupes);
}
@@ -561,7 +561,7 @@ FT_INFO * maria_ft_init_boolean_search(MARIA_HA *info, uint keynr,
bzero(& ftb->no_dupes, sizeof(TREE));
ftb->last_word= 0;
- init_alloc_root(&ftb->mem_root, 1024, 1024);
+ init_alloc_root(&ftb->mem_root, 1024, 1024, 0);
ftb->queue.max_elements= 0;
if (!(ftbe=(FTB_EXPR *)alloc_root(&ftb->mem_root, sizeof(FTB_EXPR))))
goto err;
diff --git a/storage/maria/ma_ft_nlq_search.c b/storage/maria/ma_ft_nlq_search.c
index c8b87c4f42c..c6d9c2411c6 100644
--- a/storage/maria/ma_ft_nlq_search.c
+++ b/storage/maria/ma_ft_nlq_search.c
@@ -239,8 +239,8 @@ FT_INFO *maria_ft_init_nlq_search(MARIA_HA *info, uint keynr, uchar *query,
bzero(&wtree,sizeof(wtree));
- init_tree(&aio.dtree,0,0,sizeof(FT_SUPERDOC),(qsort_cmp2)&FT_SUPERDOC_cmp,0,
- NULL, NULL);
+ init_tree(&aio.dtree,0,0,sizeof(FT_SUPERDOC),(qsort_cmp2)&FT_SUPERDOC_cmp,
+ NULL, NULL, MYF(0));
maria_ft_parse_init(&wtree, aio.charset);
ftparser_param->flags= 0;
diff --git a/storage/maria/ma_ft_parser.c b/storage/maria/ma_ft_parser.c
index 3dd6fab5214..81b5ea5119c 100644
--- a/storage/maria/ma_ft_parser.c
+++ b/storage/maria/ma_ft_parser.c
@@ -254,8 +254,8 @@ void maria_ft_parse_init(TREE *wtree, CHARSET_INFO *cs)
{
DBUG_ENTER("maria_ft_parse_init");
if (!is_tree_inited(wtree))
- init_tree(wtree,0,0,sizeof(FT_WORD),(qsort_cmp2)&FT_WORD_cmp,0, NULL,
- (void*) cs);
+ init_tree(wtree,0,0,sizeof(FT_WORD),(qsort_cmp2)&FT_WORD_cmp, NULL,
+ (void*) cs, MYF(0));
DBUG_VOID_RETURN;
}
@@ -348,7 +348,7 @@ MYSQL_FTPARSER_PARAM* maria_ftparser_alloc_param(MARIA_HA *info)
info->ftparser_param= (MYSQL_FTPARSER_PARAM *)
my_malloc(MAX_PARAM_NR * sizeof(MYSQL_FTPARSER_PARAM) *
info->s->ftkeys, MYF(MY_WME | MY_ZEROFILL));
- init_alloc_root(&info->ft_memroot, FTPARSER_MEMROOT_ALLOC_SIZE, 0);
+ init_alloc_root(&info->ft_memroot, FTPARSER_MEMROOT_ALLOC_SIZE, 0, MYF(0));
}
return info->ftparser_param;
}
diff --git a/storage/maria/ma_loghandler.c b/storage/maria/ma_loghandler.c
index 341bbc6088f..56926c048d8 100644
--- a/storage/maria/ma_loghandler.c
+++ b/storage/maria/ma_loghandler.c
@@ -3629,10 +3629,10 @@ my_bool translog_init_with_table(const char *directory,
mysql_rwlock_init(key_TRANSLOG_DESCRIPTOR_open_files_lock,
&log_descriptor.open_files_lock) ||
my_init_dynamic_array(&log_descriptor.open_files,
- sizeof(TRANSLOG_FILE*), 10, 10) ||
+ sizeof(TRANSLOG_FILE*), 10, 10, MYF(0)) ||
my_init_dynamic_array(&log_descriptor.unfinished_files,
sizeof(struct st_file_counter),
- 10, 10))
+ 10, 10, MYF(0)))
goto err;
log_descriptor.min_need_file= 0;
log_descriptor.min_file_number= 0;
@@ -5528,7 +5528,7 @@ translog_write_variable_record_mgroup(LSN *lsn,
if (my_init_dynamic_array(&groups,
sizeof(struct st_translog_group_descriptor),
- 10, 10))
+ 10, 10, MYF(0)))
{
translog_unlock();
DBUG_PRINT("error", ("init array failed"));
diff --git a/storage/maria/ma_open.c b/storage/maria/ma_open.c
index 5f90f61c786..88422e3dc5f 100644
--- a/storage/maria/ma_open.c
+++ b/storage/maria/ma_open.c
@@ -160,7 +160,7 @@ static MARIA_HA *maria_clone_internal(MARIA_SHARE *share, const char *name,
if (my_init_dynamic_array(&info.pinned_pages,
sizeof(MARIA_PINNED_PAGE),
max(share->base.blobs*2 + 4,
- MARIA_MAX_TREE_LEVELS*3), 16))
+ MARIA_MAX_TREE_LEVELS*3), 16, MYF(0)))
goto err;
diff --git a/storage/maria/ma_sort.c b/storage/maria/ma_sort.c
index e1e7b323683..4bc179c3008 100644
--- a/storage/maria/ma_sort.c
+++ b/storage/maria/ma_sort.c
@@ -164,7 +164,7 @@ int _ma_create_index_by_sort(MARIA_SORT_PARAM *info, my_bool no_messages,
HA_FT_MAXBYTELEN, MYF(0))))
{
if (my_init_dynamic_array(&buffpek, sizeof(BUFFPEK), maxbuffer,
- maxbuffer/2))
+ maxbuffer/2, MYF(0)))
{
my_free(sort_keys);
sort_keys= 0;
@@ -397,7 +397,7 @@ pthread_handler_t _ma_thr_find_all_keys(void *arg)
HA_FT_MAXBYTELEN : 0), MYF(0))))
{
if (my_init_dynamic_array(&sort_param->buffpek, sizeof(BUFFPEK),
- maxbuffer, maxbuffer/2))
+ maxbuffer, maxbuffer/2, MYF(0)))
{
my_free(sort_keys);
sort_keys= (uchar **) NULL; /* for err: label */
diff --git a/storage/maria/ma_write.c b/storage/maria/ma_write.c
index 14385328186..5d440a40dc0 100644
--- a/storage/maria/ma_write.c
+++ b/storage/maria/ma_write.c
@@ -880,7 +880,7 @@ ChangeSet@1.2562, 2008-04-09 07:41:40+02:00, serg@janus.mylan +9 -0
/* Yup. converting */
info->ft1_to_ft2=(DYNAMIC_ARRAY *)
my_malloc(sizeof(DYNAMIC_ARRAY), MYF(MY_WME));
- my_init_dynamic_array(info->ft1_to_ft2, ft2len, 300, 50);
+ my_init_dynamic_array(info->ft1_to_ft2, ft2len, 300, 50, MYF(0));
/*
Now, adding all keys from the page to dynarray
@@ -1765,8 +1765,8 @@ int maria_init_bulk_insert(MARIA_HA *info, ulong cache_size, ha_rows rows)
init_tree(&info->bulk_insert[i],
cache_size * key[i].maxlength,
cache_size * key[i].maxlength, 0,
- (qsort_cmp2)keys_compare, 0,
- (tree_element_free) keys_free, (void *)params++);
+ (qsort_cmp2)keys_compare,
+ (tree_element_free) keys_free, (void *)params++, MYF(0));
}
else
info->bulk_insert[i].root=0;
diff --git a/storage/maria/maria_pack.c b/storage/maria/maria_pack.c
index 481b77a2cc6..40686995378 100644
--- a/storage/maria/maria_pack.c
+++ b/storage/maria/maria_pack.c
@@ -798,8 +798,8 @@ static HUFF_COUNTS *init_huff_count(MARIA_HA *info,my_off_t records)
'tree_pos'. It's keys are implemented by pointers into 'tree_buff'.
This is accomplished by '-1' as the element size.
*/
- init_tree(&count[i].int_tree,0,0,-1,(qsort_cmp2) compare_tree,0, NULL,
- NULL);
+ init_tree(&count[i].int_tree,0,0,-1,(qsort_cmp2) compare_tree, NULL,
+ NULL, MYF(0));
if (records && type != FIELD_BLOB && type != FIELD_VARCHAR)
count[i].tree_pos=count[i].tree_buff =
my_malloc(count[i].field_length > 1 ? tree_buff_length : 2,
diff --git a/storage/maria/unittest/sequence_storage.c b/storage/maria/unittest/sequence_storage.c
index d5db20d31ca..4563ea76c64 100644
--- a/storage/maria/unittest/sequence_storage.c
+++ b/storage/maria/unittest/sequence_storage.c
@@ -33,7 +33,7 @@ my_bool seq_storage_reader_init(SEQ_STORAGE *seq, const char *file)
seq->pos= 0;
if ((fd= my_fopen(file, O_RDONLY, MYF(MY_WME))) == NULL)
return 1;
- if (my_init_dynamic_array(&seq->seq, sizeof(ulong), 10, 10))
+ if (my_init_dynamic_array(&seq->seq, sizeof(ulong), 10, 10, MYF(0)))
return 1;
for(;;)
diff --git a/storage/myisam/ft_boolean_search.c b/storage/myisam/ft_boolean_search.c
index 8b61e1dc4f2..70a7037a446 100644
--- a/storage/myisam/ft_boolean_search.c
+++ b/storage/myisam/ft_boolean_search.c
@@ -550,7 +550,7 @@ static void _ftb_init_index_search(FT_INFO *ftb)
/* 4 */
if (!is_tree_inited(& ftb->no_dupes))
init_tree(& ftb->no_dupes,0,0,sizeof(my_off_t),
- _ftb_no_dupes_cmp,0,0,0);
+ _ftb_no_dupes_cmp,0,0,MYF(0));
else
reset_tree(& ftb->no_dupes);
}
@@ -583,7 +583,7 @@ FT_INFO * ft_init_boolean_search(MI_INFO *info, uint keynr, uchar *query,
bzero(& ftb->no_dupes, sizeof(TREE));
ftb->last_word= 0;
- init_alloc_root(&ftb->mem_root, 1024, 1024);
+ init_alloc_root(&ftb->mem_root, 1024, 1024, MYF(0));
ftb->queue.max_elements= 0;
if (!(ftbe=(FTB_EXPR *)alloc_root(&ftb->mem_root, sizeof(FTB_EXPR))))
goto err;
diff --git a/storage/myisam/ft_nlq_search.c b/storage/myisam/ft_nlq_search.c
index bafa7064e28..9524b6f1833 100644
--- a/storage/myisam/ft_nlq_search.c
+++ b/storage/myisam/ft_nlq_search.c
@@ -248,8 +248,8 @@ FT_INFO *ft_init_nlq_search(MI_INFO *info, uint keynr, uchar *query,
bzero(&wtree,sizeof(wtree));
- init_tree(&aio.dtree,0,0,sizeof(FT_SUPERDOC),(qsort_cmp2)&FT_SUPERDOC_cmp,0,
- NULL, NULL);
+ init_tree(&aio.dtree,0,0,sizeof(FT_SUPERDOC),(qsort_cmp2)&FT_SUPERDOC_cmp,
+ NULL, NULL, MYF(0));
ft_parse_init(&wtree, aio.charset);
ftparser_param->flags= 0;
diff --git a/storage/myisam/ft_parser.c b/storage/myisam/ft_parser.c
index c534a9a060b..0e89d7d1b3a 100644
--- a/storage/myisam/ft_parser.c
+++ b/storage/myisam/ft_parser.c
@@ -249,7 +249,8 @@ void ft_parse_init(TREE *wtree, CHARSET_INFO *cs)
{
DBUG_ENTER("ft_parse_init");
if (!is_tree_inited(wtree))
- init_tree(wtree,0,0,sizeof(FT_WORD),(qsort_cmp2)&FT_WORD_cmp,0,0,(void*)cs);
+ init_tree(wtree, 0, 0, sizeof(FT_WORD), (qsort_cmp2)&FT_WORD_cmp, 0,
+ (void*)cs, MYF(0));
DBUG_VOID_RETURN;
}
@@ -341,7 +342,7 @@ MYSQL_FTPARSER_PARAM* ftparser_alloc_param(MI_INFO *info)
info->ftparser_param= (MYSQL_FTPARSER_PARAM *)
my_malloc(MAX_PARAM_NR * sizeof(MYSQL_FTPARSER_PARAM) *
info->s->ftkeys, MYF(MY_WME | MY_ZEROFILL));
- init_alloc_root(&info->ft_memroot, FTPARSER_MEMROOT_ALLOC_SIZE, 0);
+ init_alloc_root(&info->ft_memroot, FTPARSER_MEMROOT_ALLOC_SIZE, 0, MYF(0));
}
return info->ftparser_param;
}
diff --git a/storage/myisam/ft_stopwords.c b/storage/myisam/ft_stopwords.c
index 8f6f9308d3c..45441c17bbb 100644
--- a/storage/myisam/ft_stopwords.c
+++ b/storage/myisam/ft_stopwords.c
@@ -61,9 +61,8 @@ int ft_init_stopwords()
if (!(stopwords3=(TREE *)my_malloc(sizeof(TREE),MYF(0))))
DBUG_RETURN(-1);
init_tree(stopwords3,0,0,sizeof(FT_STOPWORD),(qsort_cmp2)&FT_STOPWORD_cmp,
- 0,
(ft_stopword_file ? (tree_element_free)&FT_STOPWORD_free : 0),
- NULL);
+ NULL, MYF(0));
/*
Stopword engine currently does not support tricky
character sets UCS2, UTF16, UTF32.
diff --git a/storage/myisam/mi_check.c b/storage/myisam/mi_check.c
index ef3a6bc2864..056aff5a72b 100644
--- a/storage/myisam/mi_check.c
+++ b/storage/myisam/mi_check.c
@@ -2299,7 +2299,8 @@ int mi_repair_by_sort(HA_CHECK *param, register MI_INFO *info,
mysql_file_seek(param->read_cache.file, 0L, MY_SEEK_END, MYF(0));
sort_param.wordlist=NULL;
- init_alloc_root(&sort_param.wordroot, FTPARSER_MEMROOT_ALLOC_SIZE, 0);
+ init_alloc_root(&sort_param.wordroot, FTPARSER_MEMROOT_ALLOC_SIZE, 0,
+ MYF(param->malloc_flags));
if (share->data_file_type == DYNAMIC_RECORD)
length=max(share->base.min_pack_length+1,share->base.min_block_length);
@@ -2869,7 +2870,8 @@ int mi_repair_parallel(HA_CHECK *param, register MI_INFO *info,
uint ft_max_word_len_for_sort=FT_MAX_WORD_LEN_FOR_SORT*
sort_param[i].keyinfo->seg->charset->mbmaxlen;
sort_param[i].key_length+=ft_max_word_len_for_sort-HA_FT_MAXBYTELEN;
- init_alloc_root(&sort_param[i].wordroot, FTPARSER_MEMROOT_ALLOC_SIZE, 0);
+ init_alloc_root(&sort_param[i].wordroot, FTPARSER_MEMROOT_ALLOC_SIZE, 0,
+ MYF(param->malloc_flags));
}
}
sort_info.total_keys=i;
diff --git a/storage/myisam/mi_open.c b/storage/myisam/mi_open.c
index 305984ee94d..438057e22df 100644
--- a/storage/myisam/mi_open.c
+++ b/storage/myisam/mi_open.c
@@ -237,7 +237,8 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags)
}
/* sanity check */
- if (share->base.keystart > 65535 || share->base.rec_reflength > 8)
+ if (share->base.keystart > 65535 ||
+ share->base.rec_reflength > 8 || share->base.key_reflength > 7)
{
my_errno=HA_ERR_CRASHED;
goto err;
diff --git a/storage/myisam/mi_write.c b/storage/myisam/mi_write.c
index 70cc96d0cba..60ea7757827 100644
--- a/storage/myisam/mi_write.c
+++ b/storage/myisam/mi_write.c
@@ -544,7 +544,7 @@ int _mi_insert(register MI_INFO *info, register MI_KEYDEF *keyinfo,
/* yup. converting */
info->ft1_to_ft2=(DYNAMIC_ARRAY *)
my_malloc(sizeof(DYNAMIC_ARRAY), MYF(MY_WME));
- my_init_dynamic_array(info->ft1_to_ft2, ft2len, 300, 50);
+ my_init_dynamic_array(info->ft1_to_ft2, ft2len, 300, 50, MYF(0));
/*
now, adding all keys from the page to dynarray
@@ -1013,8 +1013,8 @@ int mi_init_bulk_insert(MI_INFO *info, ulong cache_size, ha_rows rows)
init_tree(&info->bulk_insert[i],
cache_size * key[i].maxlength,
cache_size * key[i].maxlength, 0,
- (qsort_cmp2)keys_compare, 0,
- (tree_element_free) keys_free, (void *)params++);
+ (qsort_cmp2)keys_compare,
+ (tree_element_free) keys_free, (void *)params++, MYF(0));
}
else
info->bulk_insert[i].root=0;
diff --git a/storage/myisam/myisamchk.c b/storage/myisam/myisamchk.c
index 7d8b577e8b0..c8546ee56f5 100644
--- a/storage/myisam/myisamchk.c
+++ b/storage/myisam/myisamchk.c
@@ -291,7 +291,14 @@ static struct my_option my_long_options[] =
&check_param.write_buffer_length, 0, GET_ULONG, REQUIRED_ARG,
(long) READ_BUFFER_INIT, (long) MALLOC_OVERHEAD,
INT_MAX32, (long) MALLOC_OVERHEAD, (long) 1L, 0},
- { "sort_buffer_size", OPT_SORT_BUFFER_SIZE, "",
+ { "sort_buffer_size", OPT_SORT_BUFFER_SIZE,
+ "Deprecated. myisam_sort_buffer_size alias is being used",
+ &check_param.sort_buffer_length,
+ &check_param.sort_buffer_length, 0, GET_ULL, REQUIRED_ARG,
+ (long) SORT_BUFFER_INIT, (long) (MIN_SORT_BUFFER + MALLOC_OVERHEAD),
+ SIZE_T_MAX, (long) MALLOC_OVERHEAD, (long) 1L, 0},
+ { "myisam_sort_buffer_size", OPT_SORT_BUFFER_SIZE,
+ "Alias of sort_buffer_size parameter",
&check_param.sort_buffer_length,
&check_param.sort_buffer_length, 0, GET_ULL, REQUIRED_ARG,
(long) SORT_BUFFER_INIT, (long) (MIN_SORT_BUFFER + MALLOC_OVERHEAD),
diff --git a/storage/myisam/myisamlog.c b/storage/myisam/myisamlog.c
index 3314f1b94ac..1624213851b 100644
--- a/storage/myisam/myisamlog.c
+++ b/storage/myisam/myisamlog.c
@@ -329,8 +329,9 @@ static int examine_log(char * file_name, char **table_names)
init_io_cache(&cache,file,0,READ_CACHE,start_offset,0,MYF(0));
bzero((uchar*) com_count,sizeof(com_count));
- init_tree(&tree,0,0,sizeof(file_info),(qsort_cmp2) file_info_compare,1,
- (tree_element_free) file_info_free, NULL);
+ init_tree(&tree,0,0,sizeof(file_info),(qsort_cmp2) file_info_compare,
+ (tree_element_free) file_info_free, NULL,
+ MYF(MY_TREE_WITH_DELETE));
(void) init_key_cache(dflt_key_cache,KEY_CACHE_BLOCK_SIZE,KEY_CACHE_SIZE,
0, 0, 0);
diff --git a/storage/myisam/myisampack.c b/storage/myisam/myisampack.c
index 5d6b03ff4b8..6ce88db87f5 100644
--- a/storage/myisam/myisampack.c
+++ b/storage/myisam/myisampack.c
@@ -816,8 +816,8 @@ static HUFF_COUNTS *init_huff_count(MI_INFO *info,my_off_t records)
'tree_pos'. It's keys are implemented by pointers into 'tree_buff'.
This is accomplished by '-1' as the element size.
*/
- init_tree(&count[i].int_tree,0,0,-1,(qsort_cmp2) compare_tree,0, NULL,
- NULL);
+ init_tree(&count[i].int_tree,0,0,-1,(qsort_cmp2) compare_tree, NULL,
+ NULL, MYF(0));
if (records && type != FIELD_BLOB && type != FIELD_VARCHAR)
count[i].tree_pos=count[i].tree_buff =
my_malloc(count[i].field_length > 1 ? tree_buff_length : 2,
diff --git a/storage/myisam/sort.c b/storage/myisam/sort.c
index 2c4639b3143..4af45ea02e9 100644
--- a/storage/myisam/sort.c
+++ b/storage/myisam/sort.c
@@ -165,7 +165,7 @@ int _create_index_by_sort(MI_SORT_PARAM *info,my_bool no_messages,
HA_FT_MAXBYTELEN, MYF(0))))
{
if (my_init_dynamic_array(&buffpek, sizeof(BUFFPEK), maxbuffer,
- maxbuffer/2))
+ maxbuffer/2, MYF(0)))
{
my_free(sort_keys);
sort_keys= 0;
@@ -389,7 +389,7 @@ pthread_handler_t thr_find_all_keys(void *arg)
HA_FT_MAXBYTELEN : 0), MYF(0))))
{
if (my_init_dynamic_array(&sort_param->buffpek, sizeof(BUFFPEK),
- maxbuffer, maxbuffer/2))
+ maxbuffer, maxbuffer/2, MYF(0)))
{
my_free(sort_keys);
sort_keys= (uchar **) NULL; /* for err: label */
diff --git a/storage/myisammrg/ha_myisammrg.cc b/storage/myisammrg/ha_myisammrg.cc
index 1b0eea13418..7bb7990d9a3 100644
--- a/storage/myisammrg/ha_myisammrg.cc
+++ b/storage/myisammrg/ha_myisammrg.cc
@@ -120,7 +120,7 @@ ha_myisammrg::ha_myisammrg(handlerton *hton, TABLE_SHARE *table_arg)
:handler(hton, table_arg), file(0), is_cloned(0)
{
init_sql_alloc(&children_mem_root,
- FN_REFLEN + ALLOC_ROOT_MIN_BLOCK_SIZE, 0);
+ FN_REFLEN + ALLOC_ROOT_MIN_BLOCK_SIZE, 0, MYF(0));
}
diff --git a/storage/myisammrg/mysql-test/storage_engine/vcol.rdiff b/storage/myisammrg/mysql-test/storage_engine/vcol.rdiff
index 20431a9c713..094b26668c1 100644
--- a/storage/myisammrg/mysql-test/storage_engine/vcol.rdiff
+++ b/storage/myisammrg/mysql-test/storage_engine/vcol.rdiff
@@ -67,7 +67,7 @@
< 4 5
< DROP TABLE t1;
---
-> ERROR HY000: MRG_MYISAM storage engine does not support computed columns
+> ERROR HY000: MRG_MyISAM storage engine does not support computed columns
> # ERROR: Statement ended with errno 1910, errname ER_UNSUPPORTED_ENGINE_FOR_VIRTUAL_COLUMNS (expected to succeed)
> # ------------ UNEXPECTED RESULT ------------
> # [ CREATE TABLE t1 (a INT(11) /*!*/ /*Custom column options*/, b INT(11) /*!*/ /*Custom column options*/ GENERATED ALWAYS AS (a+1)) ENGINE=MRG_MYISAM /*!*/ /*Custom table options*/ UNION(mrg.t1) INSERT_METHOD=LAST ]
diff --git a/storage/perfschema/pfs.cc b/storage/perfschema/pfs.cc
index ccb8c77d573..d3de38d025c 100644
--- a/storage/perfschema/pfs.cc
+++ b/storage/perfschema/pfs.cc
@@ -130,7 +130,7 @@
mode when a server is installed.
The implementation of the database creation script is located in
- @verbatim ./scripts/mysql_system_tables.sql @endverbatim
+ @verbatim ./scripts/mysql_performance_tables.sql @endverbatim
@subsection INT_CONFIG Runtime configuration interface
diff --git a/storage/perfschema/pfs_check.cc b/storage/perfschema/pfs_check.cc
index c52be6f0da2..2ab54ab1a4a 100644
--- a/storage/perfschema/pfs_check.cc
+++ b/storage/perfschema/pfs_check.cc
@@ -56,6 +56,8 @@ void check_performance_schema()
PFS_engine_table_share::check_all_tables(thd);
delete thd;
+ /* Remember that we don't have a THD */
+ set_current_thd(0);
DBUG_VOID_RETURN;
}
diff --git a/storage/perfschema/pfs_instr.cc b/storage/perfschema/pfs_instr.cc
index 44d424e9df6..39caabaf030 100644
--- a/storage/perfschema/pfs_instr.cc
+++ b/storage/perfschema/pfs_instr.cc
@@ -998,8 +998,6 @@ PFS_socket *sanitize_socket(PFS_socket *unsafe)
*/
void destroy_thread(PFS_thread *pfs)
{
- DBUG_ENTER("destroy_thread");
-
DBUG_ASSERT(pfs != NULL);
if (pfs->m_account != NULL)
{
@@ -1062,7 +1060,6 @@ void destroy_thread(PFS_thread *pfs)
pfs->m_digest_hash_pins= NULL;
}
pfs->m_lock.allocated_to_free();
- DBUG_VOID_RETURN;
}
/**
diff --git a/storage/perfschema/pfs_server.cc b/storage/perfschema/pfs_server.cc
index daf842d1248..3df0f27f652 100644
--- a/storage/perfschema/pfs_server.cc
+++ b/storage/perfschema/pfs_server.cc
@@ -209,7 +209,8 @@ void shutdown_performance_schema(void)
*/
void init_pfs_instrument_array()
{
- my_init_dynamic_array(&pfs_instr_config_array, sizeof(PFS_instr_config*), 10, 10);
+ my_init_dynamic_array(&pfs_instr_config_array, sizeof(PFS_instr_config*),
+ 10, 10, MYF(0));
pfs_instr_config_state= PFS_INSTR_CONFIG_ALLOCATED;
}
diff --git a/storage/sphinx/ha_sphinx.cc b/storage/sphinx/ha_sphinx.cc
index 97e83cd9221..3305875c124 100644
--- a/storage/sphinx/ha_sphinx.cc
+++ b/storage/sphinx/ha_sphinx.cc
@@ -3591,12 +3591,12 @@ struct st_mysql_storage_engine sphinx_storage_engine =
struct st_mysql_show_var sphinx_status_vars[] =
{
- {"sphinx_total", (char *)sphinx_showfunc_total, SHOW_SIMPLE_FUNC},
- {"sphinx_total_found", (char *)sphinx_showfunc_total_found, SHOW_SIMPLE_FUNC},
- {"sphinx_time", (char *)sphinx_showfunc_time, SHOW_SIMPLE_FUNC},
- {"sphinx_word_count", (char *)sphinx_showfunc_word_count, SHOW_SIMPLE_FUNC},
- {"sphinx_words", (char *)sphinx_showfunc_words, SHOW_SIMPLE_FUNC},
- {"sphinx_error", (char *)sphinx_showfunc_error, SHOW_SIMPLE_FUNC},
+ {"Sphinx_total", (char *)sphinx_showfunc_total, SHOW_SIMPLE_FUNC},
+ {"Sphinx_total_found", (char *)sphinx_showfunc_total_found, SHOW_SIMPLE_FUNC},
+ {"Sphinx_time", (char *)sphinx_showfunc_time, SHOW_SIMPLE_FUNC},
+ {"Sphinx_word_count", (char *)sphinx_showfunc_word_count, SHOW_SIMPLE_FUNC},
+ {"Sphinx_words", (char *)sphinx_showfunc_words, SHOW_SIMPLE_FUNC},
+ {"Sphinx_error", (char *)sphinx_showfunc_error, SHOW_SIMPLE_FUNC},
{0, 0, (enum_mysql_show_type)0}
};
diff --git a/storage/xtradb/btr/btr0cur.c b/storage/xtradb/btr/btr0cur.c
index 61c07ac792e..687853a422e 100644
--- a/storage/xtradb/btr/btr0cur.c
+++ b/storage/xtradb/btr/btr0cur.c
@@ -239,6 +239,7 @@ btr_cur_latch_leaves(
mtr_t* mtr) /*!< in: mtr */
{
ulint mode;
+ ulint sibling_mode;
ulint left_page_no;
ulint right_page_no;
buf_block_t* get_block;
@@ -261,14 +262,21 @@ btr_cur_latch_leaves(
#endif /* UNIV_BTR_DEBUG */
get_block->check_index_page_at_flush = TRUE;
return;
+ case BTR_SEARCH_TREE:
case BTR_MODIFY_TREE:
- /* x-latch also brothers from left to right */
+ if (UNIV_UNLIKELY(latch_mode == BTR_SEARCH_TREE)) {
+ mode = RW_S_LATCH;
+ sibling_mode = RW_NO_LATCH;
+ } else {
+ mode = sibling_mode = RW_X_LATCH;
+ }
+ /* Fetch and possibly latch also brothers from left to right */
left_page_no = btr_page_get_prev(page, mtr);
if (left_page_no != FIL_NULL) {
get_block = btr_block_get(
space, zip_size, left_page_no,
- RW_X_LATCH, cursor->index, mtr);
+ sibling_mode, cursor->index, mtr);
if (srv_pass_corrupt_table && !get_block) {
return;
@@ -280,12 +288,21 @@ btr_cur_latch_leaves(
ut_a(btr_page_get_next(get_block->frame, mtr)
== page_get_page_no(page));
#endif /* UNIV_BTR_DEBUG */
- get_block->check_index_page_at_flush = TRUE;
+ if (sibling_mode == RW_NO_LATCH) {
+ /* btr_block_get() called with RW_NO_LATCH will
+ fix the read block in the buffer. This serves
+ no purpose for the fake changes prefetching,
+ thus we unfix the sibling blocks immediately.*/
+ mtr_memo_release(mtr, get_block,
+ MTR_MEMO_BUF_FIX);
+ } else {
+ get_block->check_index_page_at_flush = TRUE;
+ }
}
get_block = btr_block_get(
space, zip_size, page_no,
- RW_X_LATCH, cursor->index, mtr);
+ mode, cursor->index, mtr);
if (srv_pass_corrupt_table && !get_block) {
return;
@@ -301,7 +318,7 @@ btr_cur_latch_leaves(
if (right_page_no != FIL_NULL) {
get_block = btr_block_get(
space, zip_size, right_page_no,
- RW_X_LATCH, cursor->index, mtr);
+ sibling_mode, cursor->index, mtr);
if (srv_pass_corrupt_table && !get_block) {
return;
@@ -313,7 +330,12 @@ btr_cur_latch_leaves(
ut_a(btr_page_get_prev(get_block->frame, mtr)
== page_get_page_no(page));
#endif /* UNIV_BTR_DEBUG */
- get_block->check_index_page_at_flush = TRUE;
+ if (sibling_mode == RW_NO_LATCH) {
+ mtr_memo_release(mtr, get_block,
+ MTR_MEMO_BUF_FIX);
+ } else {
+ get_block->check_index_page_at_flush = TRUE;
+ }
}
return;
@@ -1566,6 +1588,9 @@ btr_cur_pessimistic_insert(
}
if (!(flags & BTR_NO_UNDO_LOG_FLAG)) {
+
+ ut_a(cursor->tree_height != ULINT_UNDEFINED);
+
/* First reserve enough free space for the file segments
of the index tree, so that the insert will not fail because
of lack of space */
@@ -1860,7 +1885,8 @@ btr_cur_update_alloc_zip(
ulint length, /*!< in: size needed */
ibool create, /*!< in: TRUE=delete-and-insert,
FALSE=update-in-place */
- mtr_t* mtr) /*!< in: mini-transaction */
+ mtr_t* mtr, /*!< in: mini-transaction */
+ trx_t* trx) /*!< in: NULL or transaction */
{
ut_a(page_zip == buf_block_get_page_zip(block));
ut_ad(page_zip);
@@ -1877,6 +1903,14 @@ btr_cur_update_alloc_zip(
return(FALSE);
}
+ if (trx && trx->fake_changes) {
+ /* Don't call page_zip_compress_write_log_no_data as that has
+ assert which would fail. Assume there won't be a compression
+ failure. */
+
+ return TRUE;
+ }
+
if (!page_zip_compress(page_zip, buf_block_get_frame(block),
index, mtr)) {
/* Unable to compress the page */
@@ -1960,7 +1994,8 @@ btr_cur_update_in_place(
/* Check that enough space is available on the compressed page. */
if (page_zip
&& !btr_cur_update_alloc_zip(page_zip, block, index,
- rec_offs_size(offsets), FALSE, mtr)) {
+ rec_offs_size(offsets), FALSE, mtr,
+ trx)) {
return(DB_ZIP_OVERFLOW);
}
@@ -2159,7 +2194,8 @@ any_extern:
if (page_zip
&& !btr_cur_update_alloc_zip(page_zip, block, index,
- new_rec_size, TRUE, mtr)) {
+ new_rec_size, TRUE, mtr,
+ thr_get_trx(thr))) {
err = DB_ZIP_OVERFLOW;
goto err_exit;
}
@@ -2402,7 +2438,15 @@ btr_cur_pessimistic_update(
of the index tree, so that the update will not fail because
of lack of space */
- n_extents = cursor->tree_height / 16 + 3;
+ if (UNIV_UNLIKELY(cursor->tree_height == ULINT_UNDEFINED)) {
+ /* When the tree height is uninitialized due to fake
+ changes, reserve some hardcoded number of extents. */
+ ut_a(thr && thr_get_trx(thr)->fake_changes);
+ n_extents = 3;
+ }
+ else {
+ n_extents = cursor->tree_height / 16 + 3;
+ }
if (flags & BTR_NO_UNDO_LOG_FLAG) {
reserve_flag = FSP_CLEANING;
@@ -2439,7 +2483,7 @@ btr_cur_pessimistic_update(
itself. Thus the following call is safe. */
row_upd_index_replace_new_col_vals_index_pos(new_entry, index, update,
FALSE, *heap);
- if (!(flags & BTR_KEEP_SYS_FLAG)) {
+ if (!(flags & BTR_KEEP_SYS_FLAG) && !trx->fake_changes) {
row_upd_index_entry_sys_field(new_entry, index, DATA_ROLL_PTR,
roll_ptr);
row_upd_index_entry_sys_field(new_entry, index, DATA_TRX_ID,
@@ -3210,6 +3254,8 @@ btr_cur_pessimistic_delete(
of the index tree, so that the node pointer updates will
not fail because of lack of space */
+ ut_a(cursor->tree_height != ULINT_UNDEFINED);
+
n_extents = cursor->tree_height / 32 + 1;
success = fsp_reserve_free_extents(&n_reserved,
diff --git a/storage/xtradb/btr/btr0pcur.c b/storage/xtradb/btr/btr0pcur.c
index b335e2c8aee..a1b7affdeb7 100644
--- a/storage/xtradb/btr/btr0pcur.c
+++ b/storage/xtradb/btr/btr0pcur.c
@@ -47,6 +47,7 @@ btr_pcur_create_for_mysql(void)
pcur->btr_cur.index = NULL;
btr_pcur_init(pcur);
+ pcur->btr_cur.tree_height = ULINT_UNDEFINED;
return(pcur);
}
diff --git a/storage/xtradb/buf/buf0lru.c b/storage/xtradb/buf/buf0lru.c
index a6a1f8dcf9c..14b5c65132c 100644
--- a/storage/xtradb/buf/buf0lru.c
+++ b/storage/xtradb/buf/buf0lru.c
@@ -239,9 +239,11 @@ buf_LRU_drop_page_hash_batch(
When doing a DROP TABLE/DISCARD TABLESPACE we have to drop all page
hash index entries belonging to that table. This function tries to
do that in batch. Note that this is a 'best effort' attempt and does
-not guarantee that ALL hash entries will be removed. */
+not guarantee that ALL hash entries will be removed.
+
+@return number of hashed pages found*/
static
-void
+ulint
buf_LRU_drop_page_hash_for_tablespace(
/*==================================*/
buf_pool_t* buf_pool, /*!< in: buffer pool instance */
@@ -251,13 +253,14 @@ buf_LRU_drop_page_hash_for_tablespace(
ulint* page_arr;
ulint num_entries;
ulint zip_size;
+ ulint num_found = 0;
zip_size = fil_space_get_zip_size(id);
if (UNIV_UNLIKELY(zip_size == ULINT_UNDEFINED)) {
/* Somehow, the tablespace does not exist. Nothing to drop. */
ut_ad(0);
- return;
+ return num_found;
}
page_arr = ut_malloc(
@@ -315,6 +318,7 @@ next_page:
ut_a(num_entries < BUF_LRU_DROP_SEARCH_SIZE);
++num_entries;
+ ++num_found;
if (num_entries < BUF_LRU_DROP_SEARCH_SIZE) {
goto next_page;
@@ -370,6 +374,8 @@ next_page:
/* Drop any remaining batch of search hashed pages. */
buf_LRU_drop_page_hash_batch(id, zip_size, page_arr, num_entries);
ut_free(page_arr);
+
+ return num_found;
}
/******************************************************************//**
@@ -814,8 +820,6 @@ buf_LRU_mark_space_was_deleted(
for (i = 0; i < srv_buf_pool_instances; i++) {
buf_pool_t* buf_pool;
buf_page_t* bpage;
- buf_chunk_t* chunk;
- ulint j, k;
buf_pool = buf_pool_from_array(i);
@@ -832,28 +836,10 @@ buf_LRU_mark_space_was_deleted(
mutex_exit(&buf_pool->LRU_list_mutex);
- btr_search_s_lock_all();
- chunk = buf_pool->chunks;
- for (j = buf_pool->n_chunks; j--; chunk++) {
- buf_block_t* block = chunk->blocks;
- for (k = chunk->size; k--; block++) {
- if (buf_block_get_state(block)
- != BUF_BLOCK_FILE_PAGE
- || !block->index
- || buf_page_get_space(&block->page) != id) {
- continue;
- }
-
- btr_search_s_unlock_all();
-
- rw_lock_x_lock(&block->lock);
- btr_search_drop_page_hash_index(block);
- rw_lock_x_unlock(&block->lock);
-
- btr_search_s_lock_all();
- }
- }
- btr_search_s_unlock_all();
+ /* The AHI entries for the tablespace being deleted should be
+ removed by now. */
+ ut_ad(buf_LRU_drop_page_hash_for_tablespace(buf_pool, id)
+ == 0);
}
}
diff --git a/storage/xtradb/buf/buf0rea.c b/storage/xtradb/buf/buf0rea.c
index 67379d614a0..6d76a488af7 100644
--- a/storage/xtradb/buf/buf0rea.c
+++ b/storage/xtradb/buf/buf0rea.c
@@ -235,6 +235,9 @@ not_to_recover:
sync, space, 0, offset, 0, UNIV_PAGE_SIZE,
((buf_block_t*) bpage)->frame, bpage, trx);
}
+ if(sync) {
+ thd_wait_end(NULL);
+ }
if (*err == DB_TABLESPACE_DELETED) {
buf_read_page_handle_error(bpage);
@@ -250,7 +253,6 @@ not_to_recover:
}
if (sync) {
- thd_wait_end(NULL);
/* The i/o is already completed when we arrive from
fil_read */
if (!buf_page_io_complete(bpage)) {
diff --git a/storage/xtradb/fsp/fsp0fsp.c b/storage/xtradb/fsp/fsp0fsp.c
index d4a2745b90b..5cbc74b0862 100644
--- a/storage/xtradb/fsp/fsp0fsp.c
+++ b/storage/xtradb/fsp/fsp0fsp.c
@@ -3031,7 +3031,11 @@ try_again:
some of them will contain extent descriptor pages, and therefore
will not be free extents */
- n_free_up = (size - free_limit) / FSP_EXTENT_SIZE;
+ if (size <= free_limit) {
+ n_free_up = 0;
+ } else {
+ n_free_up = (size - free_limit) / FSP_EXTENT_SIZE;
+ }
if (n_free_up > 0) {
n_free_up--;
diff --git a/storage/xtradb/handler/ha_innodb.cc b/storage/xtradb/handler/ha_innodb.cc
index ec976bfeb45..12f6f5134d2 100644
--- a/storage/xtradb/handler/ha_innodb.cc
+++ b/storage/xtradb/handler/ha_innodb.cc
@@ -381,6 +381,7 @@ static PSI_file_info all_innodb_files[] = {
static INNOBASE_SHARE *get_share(const char *table_name);
static void free_share(INNOBASE_SHARE *share);
static int innobase_close_connection(handlerton *hton, THD* thd);
+static void innobase_kill_query(handlerton *hton, THD* thd, enum thd_kill_levels level);
static void innobase_commit_ordered(handlerton *hton, THD* thd, bool all);
static int innobase_commit(handlerton *hton, THD* thd, bool all);
static int innobase_rollback(handlerton *hton, THD* thd, bool all);
@@ -1053,6 +1054,13 @@ thd_to_trx(
return(*(trx_t**) thd_ha_data(thd, innodb_hton_ptr));
}
+my_bool
+ha_innobase::is_fake_change_enabled(THD* thd)
+{
+ trx_t* trx = thd_to_trx(thd);
+ return(trx && trx->fake_changes);
+}
+
/********************************************************************//**
Call this function when mysqld passes control to the client. That is to
avoid deadlocks on the adaptive hash S-latch possibly held by thd. For more
@@ -1117,8 +1125,7 @@ convert_error_code_to_mysql(
return(0);
case DB_INTERRUPTED:
- my_error(ER_QUERY_INTERRUPTED, MYF(0));
- /* fall through */
+ return(HA_ERR_ABORTED_BY_USER);
case DB_FOREIGN_EXCEED_MAX_CASCADE:
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
@@ -2382,7 +2389,7 @@ trx_is_interrupted(
/*===============*/
trx_t* trx) /*!< in: transaction */
{
- return(trx && trx->mysql_thd && thd_killed((THD*) trx->mysql_thd));
+ return(trx && trx->mysql_thd && thd_kill_level((THD*) trx->mysql_thd));
}
/**********************************************************************//**
@@ -2639,6 +2646,7 @@ innobase_init(
innobase_hton->flags=HTON_NO_FLAGS;
innobase_hton->release_temporary_latches=innobase_release_temporary_latches;
innobase_hton->alter_table_flags = innobase_alter_table_flags;
+ innobase_hton->kill_query = innobase_kill_query;
ut_a(DATA_MYSQL_TRUE_VARCHAR == (ulint)MYSQL_TYPE_VARCHAR);
@@ -3052,6 +3060,14 @@ innobase_change_buffering_inited_ok:
srv_use_checksums = (ibool) innobase_use_checksums;
srv_fast_checksum = (ibool) innobase_fast_checksum;
+ if (innobase_fast_checksum) {
+ fprintf(stderr,
+ "InnoDB: Warning: innodb_fast_checksum is DEPRECATED "
+ "and *WILL* be removed in Percona Server 5.6. Please "
+ "consult the Percona Server 5.6 documentation for "
+ "help in upgrading.\n");
+ }
+
srv_blocking_lru_restore = (ibool) innobase_blocking_lru_restore;
#ifdef HAVE_LARGE_PAGES
@@ -3938,6 +3954,33 @@ innobase_close_connection(
DBUG_RETURN(0);
}
+/*****************************************************************//**
+Cancel any pending lock request associated with the current THD. */
+static
+void
+innobase_kill_query(
+/*======================*/
+ handlerton* hton, /*!< in: innobase handlerton */
+ THD* thd, /*!< in: MySQL thread being killed */
+ enum thd_kill_levels level) /*!< in: kill level */
+{
+ trx_t* trx;
+ DBUG_ENTER("innobase_kill_query");
+ DBUG_ASSERT(hton == innodb_hton_ptr);
+
+ mutex_enter(&kernel_mutex);
+
+ trx = thd_to_trx(thd);
+
+ /* Cancel a pending lock request. */
+ if (trx && trx->wait_lock) {
+ lock_cancel_waiting_and_release(trx->wait_lock);
+ }
+
+ mutex_exit(&kernel_mutex);
+
+ DBUG_VOID_RETURN;
+}
/*************************************************************************//**
** InnoDB database tables
@@ -6278,7 +6321,9 @@ no_commit:
error = row_insert_for_mysql((byte*) record, prebuilt);
#ifdef EXTENDED_FOR_USERSTAT
- if (error == DB_SUCCESS) rows_changed++;
+ if (UNIV_LIKELY(error == DB_SUCCESS && !trx->fake_changes)) {
+ rows_changed++;
+ }
#endif
/* Handle duplicate key errors */
@@ -6641,7 +6686,9 @@ ha_innobase::update_row(
}
#ifdef EXTENDED_FOR_USERSTAT
- if (error == DB_SUCCESS) rows_changed++;
+ if (UNIV_LIKELY(error == DB_SUCCESS && !trx->fake_changes)) {
+ rows_changed++;
+ }
#endif
innodb_srv_conc_exit_innodb(trx);
@@ -6704,7 +6751,9 @@ ha_innobase::delete_row(
error = row_update_for_mysql((byte*) record, prebuilt);
#ifdef EXTENDED_FOR_USERSTAT
- if (error == DB_SUCCESS) rows_changed++;
+ if (UNIV_LIKELY(error == DB_SUCCESS && !trx->fake_changes)) {
+ rows_changed++;
+ }
#endif
innodb_srv_conc_exit_innodb(trx);
@@ -9825,7 +9874,7 @@ ha_innobase::check(
row_mysql_unlock_data_dictionary(prebuilt->trx);
}
- if (thd_killed(user_thd)) {
+ if (thd_kill_level(user_thd)) {
break;
}
@@ -9882,7 +9931,7 @@ ha_innobase::check(
mutex_exit(&kernel_mutex);
prebuilt->trx->op_info = "";
- if (thd_killed(user_thd)) {
+ if (thd_kill_level(user_thd)) {
my_error(ER_QUERY_INTERRUPTED, MYF(0));
}
@@ -12674,6 +12723,8 @@ static MYSQL_SYSVAR_BOOL(checksums, innobase_use_checksums,
static MYSQL_SYSVAR_BOOL(fast_checksum, innobase_fast_checksum,
PLUGIN_VAR_NOCMDARG | PLUGIN_VAR_READONLY,
+ "DEPRECATED. #### WARNING #### : This feature is DEPRECATED and WILL "
+ "be removed in Percona Server 5.6. "
"Change the algorithm of checksum for the whole of datapage to 4-bytes word based. "
"The original checksum is checked after the new one. It may be slow for reading page"
" which has orginal checksum. Overwrite the page or recreate the InnoDB database, "
@@ -13107,6 +13158,11 @@ static MYSQL_SYSVAR_BOOL(track_changed_pages, srv_track_changed_pages,
"Track the redo log for changed pages and output a changed page bitmap",
NULL, NULL, FALSE);
+static MYSQL_SYSVAR_ULONGLONG(max_bitmap_file_size, srv_max_bitmap_file_size,
+ PLUGIN_VAR_RQCMDARG,
+ "The maximum size of changed page bitmap files",
+ NULL, NULL, 100*1024*1024ULL, 4096ULL, ULONGLONG_MAX, 0);
+
static MYSQL_SYSVAR_ULONGLONG(changed_pages_limit, srv_changed_pages_limit,
PLUGIN_VAR_RQCMDARG,
"The maximum number of rows for "
@@ -13309,6 +13365,13 @@ static MYSQL_SYSVAR_ULINT(lazy_drop_table, srv_lazy_drop_table,
"e.g. for http://bugs.mysql.com/51325",
NULL, NULL, 0, 0, 1, 0);
+static MYSQL_SYSVAR_BOOL(locking_fake_changes, srv_fake_changes_locks,
+ PLUGIN_VAR_NOCMDARG,
+ "###EXPERIMENTAL### if enabled, transactions will get S row locks instead "
+ "of X locks for fake changes. If disabled, fake change transactions will "
+ "not take any locks at all.",
+ NULL, NULL, TRUE);
+
static struct st_mysql_sys_var* innobase_system_variables[]= {
MYSQL_SYSVAR(page_size),
MYSQL_SYSVAR(log_block_size),
@@ -13400,6 +13463,7 @@ static struct st_mysql_sys_var* innobase_system_variables[]= {
MYSQL_SYSVAR(use_native_aio),
MYSQL_SYSVAR(change_buffering),
MYSQL_SYSVAR(track_changed_pages),
+ MYSQL_SYSVAR(max_bitmap_file_size),
MYSQL_SYSVAR(changed_pages_limit),
#if defined UNIV_DEBUG || defined UNIV_IBUF_DEBUG
MYSQL_SYSVAR(change_buffering_debug),
@@ -13418,6 +13482,7 @@ static struct st_mysql_sys_var* innobase_system_variables[]= {
MYSQL_SYSVAR(corrupt_table_action),
MYSQL_SYSVAR(lazy_drop_table),
MYSQL_SYSVAR(fake_changes),
+ MYSQL_SYSVAR(locking_fake_changes),
MYSQL_SYSVAR(merge_sort_block_size),
NULL
};
@@ -13666,7 +13731,7 @@ int ha_innobase::multi_range_read_explain_info(uint mrr_mode, char *str, size_t
bool ha_innobase::is_thd_killed()
{
- return thd_killed(user_thd);
+ return thd_kill_level(user_thd);
}
/**
diff --git a/storage/xtradb/handler/ha_innodb.h b/storage/xtradb/handler/ha_innodb.h
index 4d9c0a1ab35..359d0b95367 100644
--- a/storage/xtradb/handler/ha_innodb.h
+++ b/storage/xtradb/handler/ha_innodb.h
@@ -137,6 +137,7 @@ class ha_innobase: public handler
int close(void);
double scan_time();
double read_time(uint index, uint ranges, ha_rows rows);
+ my_bool is_fake_change_enabled(THD *thd);
bool is_corrupt() const;
int write_row(uchar * buf);
diff --git a/storage/xtradb/handler/i_s.cc b/storage/xtradb/handler/i_s.cc
index 29a80594344..4b33d6a780c 100644
--- a/storage/xtradb/handler/i_s.cc
+++ b/storage/xtradb/handler/i_s.cc
@@ -7147,29 +7147,38 @@ static ST_FIELD_INFO i_s_innodb_changed_pages_info[] =
};
/***********************************************************************
- This function parses condition and gets upper bounds for start and end LSN's
- if condition corresponds to certain pattern.
+ This function implements ICP for I_S.INNODB_CHANGED_PAGES by parsing a
+ condition and getting lower and upper bounds for start and end LSNs if the
+ condition corresponds to a certain pattern.
- We can't know right position to avoid scanning bitmap files from the beginning
- to the lower bound. But we can stop scanning bitmap files if we reach upper bound.
+ In the most general form, we understand queries like
- It's expected the most used queries will be like the following:
-
- SELECT * FROM INNODB_CHANGED_PAGES WHERE START_LSN > num1 AND start_lsn < num2;
+ SELECT * FROM INNODB_CHANGED_PAGES
+ WHERE START_LSN > num1 AND START_LSN < num2
+ AND END_LSN > num3 AND END_LSN < num4;
- That's why the pattern is:
+ That's why the pattern syntax is:
pattern: comp | and_comp;
comp: lsn < int_num | lsn <= int_num | int_num > lsn | int_num >= lsn;
lsn: start_lsn | end_lsn;
- and_comp: some_expression AND some_expression | some_expression AND and_comp;
- some_expression: comp | any_other_expression;
+ and_comp: expression AND expression | expression AND and_comp;
+ expression: comp | any_other_expression;
+
+ The two bounds are handled differently: the lower bound is used to find the
+ correct starting _file_, the upper bound the last _block_ that needs reading.
+
+ Lower bound conditions are handled in the following way: start_lsn >= X
+ specifies that the reading must start from the file that has the highest
+ starting LSN less than or equal to X. start_lsn > X is equivalent to
+ start_lsn >= X + 1. For end_lsn, end_lsn >= X is treated as
+ start_lsn >= X - 1 and end_lsn > X as start_lsn >= X.
- Suppose the condition is start_lsn < 100, this means we have to read all
- blocks with start_lsn < 100. Which is equivalent to reading all the blocks
- with end_lsn <= 99, or just end_lsn < 100. That's why it's enough to find
- maximum lsn value, doesn't matter if this is start or end lsn and compare
- it with "start_lsn" field.
+ For the upper bound, suppose the condition is start_lsn < 100, this means we
+ have to read all blocks with start_lsn < 100. Which is equivalent to reading
+ all the blocks with end_lsn <= 99, or just end_lsn < 100. That's why it's
+ enough to find maximum lsn value, doesn't matter if this is start or end lsn
+ and compare it with "start_lsn" field. LSN <= 100 is treated as LSN < 101.
Example:
@@ -7180,92 +7189,130 @@ static ST_FIELD_INFO i_s_innodb_changed_pages_info[] =
555 > end_lsn AND
page_id = 100;
- max_lsn will be set to 555.
+ end_lsn will be set to 555, start_lsn will be set 11.
+
+ Support for other functions (equal, NULL-safe equal, BETWEEN, IN, etc.) will
+ be added on demand.
+
*/
static
void
limit_lsn_range_from_condition(
/*===========================*/
- TABLE* table, /*!<in: table */
- COND* cond, /*!<in: condition */
- ib_uint64_t* max_lsn) /*!<in/out: maximum LSN
- (must be initialized with maximum
- available value) */
+ TABLE* table, /*!<in: table */
+ COND* cond, /*!<in: condition */
+ ib_uint64_t* start_lsn, /*!<in/out: minumum LSN */
+ ib_uint64_t* end_lsn) /*!<in/out: maximum LSN */
{
+ enum Item_func::Functype func_type;
+
if (cond->type() != Item::COND_ITEM &&
cond->type() != Item::FUNC_ITEM)
return;
- switch (((Item_func*) cond)->functype())
+ func_type = ((Item_func*) cond)->functype();
+
+ switch (func_type)
{
- case Item_func::COND_AND_FUNC:
- {
- List_iterator<Item> li(*((Item_cond*) cond)->
- argument_list());
- Item *item;
- while ((item= li++))
- limit_lsn_range_from_condition(table,
- item,
- max_lsn);
- break;
+ case Item_func::COND_AND_FUNC:
+ {
+ List_iterator<Item> li(*((Item_cond*) cond)
+ ->argument_list());
+ Item *item;
+
+ while ((item= li++)) {
+ limit_lsn_range_from_condition(table, item, start_lsn,
+ end_lsn);
+ }
+ break;
+ }
+ case Item_func::LT_FUNC:
+ case Item_func::LE_FUNC:
+ case Item_func::GT_FUNC:
+ case Item_func::GE_FUNC:
+ {
+ Item *left;
+ Item *right;
+ Item_field *item_field;
+ ib_uint64_t tmp_result;
+ ibool is_end_lsn;
+
+ /* a <= b equals to b >= a that's why we just exchange "left"
+ and "right" in the case of ">" or ">=" function. We don't
+ touch the operation itself. */
+ if (((Item_func*) cond)->functype() == Item_func::LT_FUNC
+ || ((Item_func*) cond)->functype() == Item_func::LE_FUNC) {
+ left = ((Item_func*) cond)->arguments()[0];
+ right = ((Item_func*) cond)->arguments()[1];
+ } else {
+ left = ((Item_func*) cond)->arguments()[1];
+ right = ((Item_func*) cond)->arguments()[0];
}
- case Item_func::LT_FUNC:
- case Item_func::LE_FUNC:
- case Item_func::GT_FUNC:
- case Item_func::GE_FUNC:
- {
- Item *left;
- Item *right;
- Item_field *item_field;
- ib_uint64_t tmp_result;
-
- /*
- a <= b equals to b >= a that's why we just exchange
- "left" and "right" in the case of ">" or ">="
- function
- */
- if (((Item_func*) cond)->functype() ==
- Item_func::LT_FUNC ||
- ((Item_func*) cond)->functype() ==
- Item_func::LE_FUNC)
- {
- left = ((Item_func*) cond)->arguments()[0];
- right = ((Item_func*) cond)->arguments()[1];
- } else {
- left = ((Item_func*) cond)->arguments()[1];
- right = ((Item_func*) cond)->arguments()[0];
- }
- if (!left || !right)
- return;
- if (left->type() != Item::FIELD_ITEM)
- return;
- if (right->type() != Item::INT_ITEM)
- return;
+ if (left->type() == Item::FIELD_ITEM) {
+ item_field = (Item_field *)left;
+ } else if (right->type() == Item::FIELD_ITEM) {
+ item_field = (Item_field *)right;
+ } else {
+ return;
+ }
- item_field = (Item_field*)left;
+ /* Check if the current field belongs to our table */
+ if (table != item_field->field->table) {
+ return;
+ }
- if (/* START_LSN */
- table->field[2] != item_field->field &&
- /* END_LSN */
- table->field[3] != item_field->field)
- {
- return;
- }
+ /* Check if the field is START_LSN or END_LSN */
+ /* END_LSN */
+ is_end_lsn = table->field[3]->eq(item_field->field);
+
+ if (/* START_LSN */ !table->field[2]->eq(item_field->field)
+ && !is_end_lsn) {
+ return;
+ }
+
+ if (left->type() == Item::FIELD_ITEM
+ && right->type() == Item::INT_ITEM) {
- /* Check if the current field belongs to our table */
- if (table != item_field->field->table)
- return;
+ /* The case of start_lsn|end_lsn <|<= const, i.e. the
+ upper bound. */
tmp_result = right->val_int();
- if (tmp_result < *max_lsn)
- *max_lsn = tmp_result;
+ if (((func_type == Item_func::LE_FUNC)
+ || (func_type == Item_func::GE_FUNC))
+ && (tmp_result != IB_ULONGLONG_MAX)) {
- break;
+ tmp_result++;
+ }
+ if (tmp_result < *end_lsn) {
+ *end_lsn = tmp_result;
+ }
+
+ } else if (left->type() == Item::INT_ITEM
+ && right->type() == Item::FIELD_ITEM) {
+
+ /* The case of const <|<= start_lsn|end_lsn, i.e. the
+ lower bound */
+
+ tmp_result = left->val_int();
+ if (is_end_lsn && tmp_result != 0) {
+ tmp_result--;
+ }
+ if (((func_type == Item_func::LT_FUNC)
+ || (func_type == Item_func::GT_FUNC))
+ && (tmp_result != IB_ULONGLONG_MAX)) {
+
+ tmp_result++;
+ }
+ if (tmp_result > *start_lsn) {
+ *start_lsn = tmp_result;
+ }
}
- default:;
- }
+ break;
+ }
+ default:;
+ }
}
/***********************************************************************
@@ -7282,40 +7329,55 @@ i_s_innodb_changed_pages_fill(
TABLE* table = (TABLE *) tables->table;
log_bitmap_iterator_t i;
ib_uint64_t output_rows_num = 0UL;
- ib_uint64_t max_lsn = ~0ULL;
+ ib_uint64_t max_lsn = IB_ULONGLONG_MAX;
+ ib_uint64_t min_lsn = 0ULL;
+
+ DBUG_ENTER("i_s_innodb_changed_pages_fill");
- if (!srv_track_changed_pages)
- return 0;
+ /* deny access to non-superusers */
+ if (check_global_access(thd, PROCESS_ACL)) {
+
+ DBUG_RETURN(0);
+ }
- if (!log_online_bitmap_iterator_init(&i))
- return 1;
+ RETURN_IF_INNODB_NOT_STARTED(tables->schema_table_name);
- if (cond)
- limit_lsn_range_from_condition(table, cond, &max_lsn);
+ if (!srv_track_changed_pages) {
+ DBUG_RETURN(0);
+ }
+
+ if (cond) {
+ limit_lsn_range_from_condition(table, cond, &min_lsn,
+ &max_lsn);
+ }
+
+ if (!log_online_bitmap_iterator_init(&i, min_lsn, max_lsn)) {
+ DBUG_RETURN(1);
+ }
while(log_online_bitmap_iterator_next(&i) &&
(!srv_changed_pages_limit ||
output_rows_num < srv_changed_pages_limit) &&
/*
- There is no need to compare both start LSN and end LSN fields
- with maximum value. It's enough to compare only start LSN.
- Example:
-
- max_lsn = 100
- \\\\\\\\\\\\\\\\\\\\\\\\\|\\\\\\\\ - Query 1
- I------I I-------I I-------------I I----I
- ////////////////// | - Query 2
- 1 2 3 4
-
- Query 1:
- SELECT * FROM INNODB_CHANGED_PAGES WHERE start_lsn < 100
- will select 1,2,3 bitmaps
- Query 2:
- SELECT * FROM INNODB_CHANGED_PAGES WHERE end_lsn < 100
- will select 1,2 bitmaps
-
- The condition start_lsn <= 100 will be false after reading
- 1,2,3 bitmaps which suits for both cases.
+ There is no need to compare both start LSN and end LSN fields
+ with maximum value. It's enough to compare only start LSN.
+ Example:
+
+ max_lsn = 100
+ \\\\\\\\\\\\\\\\\\\\\\\\\|\\\\\\\\ - Query 1
+ I------I I-------I I-------------I I----I
+ ////////////////// | - Query 2
+ 1 2 3 4
+
+ Query 1:
+ SELECT * FROM INNODB_CHANGED_PAGES WHERE start_lsn < 100
+ will select 1,2,3 bitmaps
+ Query 2:
+ SELECT * FROM INNODB_CHANGED_PAGES WHERE end_lsn < 100
+ will select 1,2 bitmaps
+
+ The condition start_lsn <= 100 will be false after reading
+ 1,2,3 bitmaps which suits for both cases.
*/
LOG_BITMAP_ITERATOR_START_LSN(i) <= max_lsn)
{
@@ -7330,10 +7392,10 @@ i_s_innodb_changed_pages_fill(
LOG_BITMAP_ITERATOR_PAGE_NUM(i));
/* START_LSN */
table->field[2]->store(
- LOG_BITMAP_ITERATOR_START_LSN(i));
+ LOG_BITMAP_ITERATOR_START_LSN(i), true);
/* END_LSN */
table->field[3]->store(
- LOG_BITMAP_ITERATOR_END_LSN(i));
+ LOG_BITMAP_ITERATOR_END_LSN(i), true);
/*
I_S tables are in-memory tables. If bitmap file is big enough
@@ -7353,14 +7415,14 @@ i_s_innodb_changed_pages_fill(
if (schema_table_store_record(thd, table))
{
log_online_bitmap_iterator_release(&i);
- return 1;
+ DBUG_RETURN(1);
}
++output_rows_num;
}
log_online_bitmap_iterator_release(&i);
- return 0;
+ DBUG_RETURN(0);
}
static
diff --git a/storage/xtradb/ibuf/ibuf0ibuf.c b/storage/xtradb/ibuf/ibuf0ibuf.c
index 78cb6e20176..77305e42fb1 100644
--- a/storage/xtradb/ibuf/ibuf0ibuf.c
+++ b/storage/xtradb/ibuf/ibuf0ibuf.c
@@ -4044,7 +4044,7 @@ updated_in_place:
update)
&& (!page_zip || btr_cur_update_alloc_zip(
page_zip, block, index,
- rec_offs_size(offsets), FALSE, mtr))) {
+ rec_offs_size(offsets), FALSE, mtr, NULL))) {
/* This is the easy case. Do something similar
to btr_cur_update_in_place(). */
row_upd_rec_in_place(rec, index, offsets,
diff --git a/storage/xtradb/include/btr0btr.h b/storage/xtradb/include/btr0btr.h
index 03e89ae3f7d..fb06a774b82 100644
--- a/storage/xtradb/include/btr0btr.h
+++ b/storage/xtradb/include/btr0btr.h
@@ -65,7 +65,10 @@ enum btr_latch_mode {
/** Search the previous record. */
BTR_SEARCH_PREV = 35,
/** Modify the previous record. */
- BTR_MODIFY_PREV = 36
+ BTR_MODIFY_PREV = 36,
+ /** Weaker BTR_MODIFY_TREE that does not lock the leaf page siblings,
+ used for fake changes. */
+ BTR_SEARCH_TREE = 37 /* BTR_MODIFY_TREE | 4 */
};
/* BTR_INSERT, BTR_DELETE and BTR_DELETE_MARK are mutually exclusive. */
diff --git a/storage/xtradb/include/btr0cur.h b/storage/xtradb/include/btr0cur.h
index cbc6103c2ee..cb44129aeb5 100644
--- a/storage/xtradb/include/btr0cur.h
+++ b/storage/xtradb/include/btr0cur.h
@@ -259,8 +259,9 @@ btr_cur_update_alloc_zip(
ulint length, /*!< in: size needed */
ibool create, /*!< in: TRUE=delete-and-insert,
FALSE=update-in-place */
- mtr_t* mtr) /*!< in: mini-transaction */
- __attribute__((nonnull, warn_unused_result));
+ mtr_t* mtr, /*!< in: mini-transaction */
+ trx_t* trx) /*!< in: NULL or transaction */
+ __attribute__((nonnull (1, 2, 3, 6), warn_unused_result));
/*************************************************************//**
Updates a record when the update causes no size changes in its fields.
@return DB_SUCCESS or error number */
diff --git a/storage/xtradb/include/log0online.h b/storage/xtradb/include/log0online.h
index 0e0ca169f6f..e7c3f301e45 100644
--- a/storage/xtradb/include/log0online.h
+++ b/storage/xtradb/include/log0online.h
@@ -27,6 +27,16 @@ Online database log parsing for changed page tracking
#include "univ.i"
#include "os0file.h"
+/** Single bitmap file information */
+typedef struct log_online_bitmap_file_struct log_online_bitmap_file_t;
+
+/** A set of bitmap files containing some LSN range */
+typedef struct log_online_bitmap_file_range_struct
+log_online_bitmap_file_range_t;
+
+/** An iterator over changed page info */
+typedef struct log_bitmap_iterator_struct log_bitmap_iterator_t;
+
/*********************************************************************//**
Initializes the online log following subsytem. */
UNIV_INTERN
@@ -49,45 +59,32 @@ void
log_online_follow_redo_log();
/*=========================*/
-/** The iterator through all bits of changed pages bitmap blocks */
-struct log_bitmap_iterator_struct
-{
- char in_name[FN_REFLEN]; /*!< the file name for bitmap
- input */
- os_file_t in; /*!< the bitmap input file */
- ib_uint64_t in_offset; /*!< the next write position in the
- bitmap output file */
- ib_uint32_t bit_offset; /*!< bit offset inside of bitmap
- block*/
- ib_uint64_t start_lsn; /*!< Start lsn of the block */
- ib_uint64_t end_lsn; /*!< End lsn of the block */
- ib_uint32_t space_id; /*!< Block space id */
- ib_uint32_t first_page_id; /*!< First block page id */
- ibool changed; /*!< true if current page was changed */
- byte* page; /*!< Bitmap block */
-};
-
-typedef struct log_bitmap_iterator_struct log_bitmap_iterator_t;
-
#define LOG_BITMAP_ITERATOR_START_LSN(i) \
- ((i).start_lsn)
+ ((i).start_lsn)
#define LOG_BITMAP_ITERATOR_END_LSN(i) \
- ((i).end_lsn)
+ ((i).end_lsn)
#define LOG_BITMAP_ITERATOR_SPACE_ID(i) \
- ((i).space_id)
+ ((i).space_id)
#define LOG_BITMAP_ITERATOR_PAGE_NUM(i) \
- ((i).first_page_id + (i).bit_offset)
+ ((i).first_page_id + (i).bit_offset)
#define LOG_BITMAP_ITERATOR_PAGE_CHANGED(i) \
- ((i).changed)
+ ((i).changed)
/*********************************************************************//**
-Initializes log bitmap iterator.
+Initializes log bitmap iterator. The minimum LSN is used for finding the
+correct starting file with records and it there may be records returned by
+the iterator that have LSN less than start_lsn.
+
@return TRUE if the iterator is initialized OK, FALSE otherwise. */
UNIV_INTERN
ibool
log_online_bitmap_iterator_init(
/*============================*/
- log_bitmap_iterator_t *i); /*!<in/out: iterator */
+ log_bitmap_iterator_t *i, /*!<in/out: iterator */
+ ib_uint64_t min_lsn, /*!<in: start LSN for the
+ iterator */
+ ib_uint64_t max_lsn); /*!<in: end LSN for the
+ iterator */
/*********************************************************************//**
Releases log bitmap iterator. */
@@ -108,4 +105,57 @@ log_online_bitmap_iterator_next(
/*============================*/
log_bitmap_iterator_t *i); /*!<in/out: iterator */
+/** Struct for single bitmap file information */
+struct log_online_bitmap_file_struct {
+ char name[FN_REFLEN]; /*!< Name with full path */
+ os_file_t file; /*!< Handle to opened file */
+ ib_uint64_t size; /*!< Size of the file */
+ ib_uint64_t offset; /*!< Offset of the next read,
+ or count of already-read bytes
+ */
+};
+
+/** Struct for a set of bitmap files containing some LSN range */
+struct log_online_bitmap_file_range_struct {
+ size_t count; /*!< Number of files */
+ /*!< Dynamically-allocated array of info about individual files */
+ struct {
+ char name[FN_REFLEN]; /*!< Name of a file */
+ ib_uint64_t start_lsn; /*!< Starting LSN of
+ data in this file */
+ ulong seq_num; /*!< Sequence number of
+ this file */
+ } *files;
+};
+
+/** Struct for an iterator through all bits of changed pages bitmap blocks */
+struct log_bitmap_iterator_struct
+{
+ log_online_bitmap_file_range_t in_files; /*!< The bitmap files
+ for this iterator */
+ size_t in_i; /*!< Currently read
+ file index in in_files
+ */
+ log_online_bitmap_file_t in; /*!< Currently read
+ file */
+ ib_uint32_t bit_offset; /*!< bit offset inside
+ the current bitmap
+ block */
+ ib_uint64_t start_lsn; /*!< Start LSN of the
+ current bitmap block */
+ ib_uint64_t end_lsn; /*!< End LSN of the
+ current bitmap block */
+ ib_uint32_t space_id; /*!< Current block
+ space id */
+ ib_uint32_t first_page_id; /*!< Id of the first
+ page in the current
+ block */
+ ibool last_page_in_run;/*!< "Last page in
+ run" flag value for the
+ current block */
+ ibool changed; /*!< true if current
+ page was changed */
+ byte* page; /*!< Bitmap block */
+};
+
#endif
diff --git a/storage/xtradb/include/srv0srv.h b/storage/xtradb/include/srv0srv.h
index a95eb8a1d58..6c5b61487f2 100644
--- a/storage/xtradb/include/srv0srv.h
+++ b/storage/xtradb/include/srv0srv.h
@@ -144,7 +144,8 @@ extern char* srv_doublewrite_file;
extern ibool srv_recovery_stats;
-extern my_bool srv_track_changed_pages;
+extern my_bool srv_track_changed_pages;
+extern ib_uint64_t srv_max_bitmap_file_size;
extern
ulonglong srv_changed_pages_limit;
@@ -395,6 +396,10 @@ extern uint srv_auto_lru_dump;
/** Whether startup should be blocked until buffer pool is fully restored */
extern ibool srv_blocking_lru_restore;
+/** When TRUE, fake change transcations take S rather than X row locks.
+When FALSE, row locks are not taken at all. */
+extern my_bool srv_fake_changes_locks;
+
/** Status variables to be passed to MySQL */
typedef struct export_var_struct export_struc;
diff --git a/storage/xtradb/include/univ.i b/storage/xtradb/include/univ.i
index 5d2cd2d0313..77acf54d8dc 100644
--- a/storage/xtradb/include/univ.i
+++ b/storage/xtradb/include/univ.i
@@ -54,7 +54,7 @@ Created 1/20/1994 Heikki Tuuri
#define INNODB_VERSION_BUGFIX 8
#ifndef PERCONA_INNODB_VERSION
-#define PERCONA_INNODB_VERSION 29.1
+#define PERCONA_INNODB_VERSION 29.3
#endif
/* The following is the InnoDB version as shown in
diff --git a/storage/xtradb/include/ut0ut.h b/storage/xtradb/include/ut0ut.h
index 47ab6eb9b74..48f30b33e65 100644
--- a/storage/xtradb/include/ut0ut.h
+++ b/storage/xtradb/include/ut0ut.h
@@ -122,6 +122,15 @@ ut_max(
/*===*/
ulint n1, /*!< in: first number */
ulint n2); /*!< in: second number */
+/******************************************************//**
+Calculates the maximum of two ib_uint64_t values.
+@return the maximum */
+UNIV_INLINE
+ib_uint64_t
+ut_max_uint64(
+/*==========*/
+ ib_uint64_t n1, /*!< in: first number */
+ ib_uint64_t n2); /*!< in: second number */
/****************************************************************//**
Calculates minimum of two ulint-pairs. */
UNIV_INLINE
diff --git a/storage/xtradb/include/ut0ut.ic b/storage/xtradb/include/ut0ut.ic
index 6f55c7e410e..d56deb6266f 100644
--- a/storage/xtradb/include/ut0ut.ic
+++ b/storage/xtradb/include/ut0ut.ic
@@ -49,6 +49,19 @@ ut_max(
return((n1 <= n2) ? n2 : n1);
}
+/******************************************************//**
+Calculates the maximum of two ib_uint64_t values.
+@return the maximum */
+UNIV_INLINE
+ib_uint64_t
+ut_max_uint64(
+/*==========*/
+ ib_uint64_t n1, /*!< in: first number */
+ ib_uint64_t n2) /*!< in: second number */
+{
+ return((n1 <= n2) ? n2 : n1);
+}
+
/****************************************************************//**
Calculates minimum of two ulint-pairs. */
UNIV_INLINE
diff --git a/storage/xtradb/lock/lock0lock.c b/storage/xtradb/lock/lock0lock.c
index 414d3ae2c49..f172ad6695b 100644
--- a/storage/xtradb/lock/lock0lock.c
+++ b/storage/xtradb/lock/lock0lock.c
@@ -5481,8 +5481,13 @@ lock_sec_rec_read_check_and_lock(
return(DB_SUCCESS);
}
- if (thr && thr_get_trx(thr)->fake_changes && mode == LOCK_X) {
- mode = LOCK_S;
+ if (UNIV_UNLIKELY((thr && thr_get_trx(thr)->fake_changes))) {
+ if (!srv_fake_changes_locks) {
+ return(DB_SUCCESS);
+ }
+ if (mode == LOCK_X) {
+ mode = LOCK_S;
+ }
}
heap_no = page_rec_get_heap_no(rec);
@@ -5561,8 +5566,13 @@ lock_clust_rec_read_check_and_lock(
return(DB_SUCCESS);
}
- if (thr && thr_get_trx(thr)->fake_changes && mode == LOCK_X) {
- mode = LOCK_S;
+ if (UNIV_UNLIKELY((thr && thr_get_trx(thr)->fake_changes))) {
+ if (!srv_fake_changes_locks) {
+ return(DB_SUCCESS);
+ }
+ if (mode == LOCK_X) {
+ mode = LOCK_S;
+ }
}
heap_no = page_rec_get_heap_no(rec);
diff --git a/storage/xtradb/log/log0log.c b/storage/xtradb/log/log0log.c
index f2066b49662..e7c7a165b9c 100644
--- a/storage/xtradb/log/log0log.c
+++ b/storage/xtradb/log/log0log.c
@@ -248,7 +248,7 @@ log_check_tracking_margin(
checked for the already-written log. */
{
ib_uint64_t tracked_lsn;
- ulint tracked_lsn_age;
+ ib_uint64_t tracked_lsn_age;
if (!srv_track_changed_pages) {
return FALSE;
@@ -460,7 +460,7 @@ log_close(void)
ib_uint64_t oldest_lsn;
ib_uint64_t lsn;
ib_uint64_t tracked_lsn;
- ulint tracked_lsn_age;
+ ib_uint64_t tracked_lsn_age;
log_t* log = log_sys;
ib_uint64_t checkpoint_age;
diff --git a/storage/xtradb/log/log0online.c b/storage/xtradb/log/log0online.c
index 1d478c467e6..55eb9d17c46 100644
--- a/storage/xtradb/log/log0online.c
+++ b/storage/xtradb/log/log0online.c
@@ -48,10 +48,8 @@ struct log_bitmap_struct {
parsed, it points to the start,
otherwise points immediatelly past the
end of the incomplete log record. */
- char* out_name; /*!< the file name for bitmap output */
- os_file_t out; /*!< the bitmap output file */
- ib_uint64_t out_offset; /*!< the next write position in the
- bitmap output file */
+ log_online_bitmap_file_t out; /*!< The current bitmap file */
+ ulint out_seq_num; /*!< the bitmap file sequence number */
ib_uint64_t start_lsn; /*!< the LSN of the next unparsed
record and the start of the next LSN
interval to be parsed. */
@@ -76,8 +74,13 @@ struct log_bitmap_struct {
/* The log parsing and bitmap output struct instance */
static struct log_bitmap_struct* log_bmp_sys;
-/* File name stem for modified page bitmaps */
-static const char* modified_page_stem = "ib_modified_log.";
+/** File name stem for bitmap files. */
+static const char* bmp_file_name_stem = "ib_modified_log_";
+
+/** File name template for bitmap files. The 1st format tag is a directory
+name, the 2nd tag is the stem, the 3rd tag is a file sequence number, the 4th
+tag is the start LSN for the file. */
+static const char* bmp_file_name_template = "%s%s%lu_%llu.xdb";
/* On server startup with empty database srv_start_lsn == 0, in
which case the first LSN of actual log records will be this. */
@@ -85,7 +88,7 @@ which case the first LSN of actual log records will be this. */
/* Tests if num bit of bitmap is set */
#define IS_BIT_SET(bitmap, num) \
- (*((bitmap) + ((num) >> 3)) & (1UL << ((num) & 7UL)))
+ (*((bitmap) + ((num) >> 3)) & (1UL << ((num) & 7UL)))
/** The bitmap file block size in bytes. All writes will be multiples of this.
*/
@@ -243,10 +246,69 @@ log_online_calc_checksum(
}
/****************************************************************//**
+Read one bitmap data page and check it for corruption.
+
+@return TRUE if page read OK, FALSE if I/O error */
+static
+ibool
+log_online_read_bitmap_page(
+/*========================*/
+ log_online_bitmap_file_t *bitmap_file, /*!<in/out: bitmap
+ file */
+ byte *page, /*!<out: read page.
+ Must be at least
+ MODIFIED_PAGE_BLOCK_SIZE
+ bytes long */
+ ibool *checksum_ok) /*!<out: TRUE if page
+ checksum OK */
+{
+ ulint offset_low = (ulint)(bitmap_file->offset & 0xFFFFFFFF);
+ ulint offset_high = (ulint)(bitmap_file->offset >> 32);
+ ulint checksum;
+ ulint actual_checksum;
+ ibool success;
+
+ ut_a(bitmap_file->size >= MODIFIED_PAGE_BLOCK_SIZE);
+ ut_a(bitmap_file->offset
+ <= bitmap_file->size - MODIFIED_PAGE_BLOCK_SIZE);
+ ut_a(bitmap_file->offset % MODIFIED_PAGE_BLOCK_SIZE == 0);
+
+ success = os_file_read(bitmap_file->file, page, offset_low,
+ offset_high, MODIFIED_PAGE_BLOCK_SIZE);
+
+ if (UNIV_UNLIKELY(!success)) {
+
+ /* The following call prints an error message */
+ os_file_get_last_error(TRUE);
+ fprintf(stderr,
+ "InnoDB: Warning: failed reading changed page bitmap "
+ "file \'%s\'\n", bitmap_file->name);
+ return FALSE;
+ }
+
+ bitmap_file->offset += MODIFIED_PAGE_BLOCK_SIZE;
+ ut_ad(bitmap_file->offset <= bitmap_file->size);
+
+ checksum = mach_read_from_4(page + MODIFIED_PAGE_BLOCK_CHECKSUM);
+ actual_checksum = log_online_calc_checksum(page);
+ *checksum_ok = (checksum == actual_checksum);
+
+ return TRUE;
+}
+
+/****************************************************************//**
Get the last tracked fully LSN from the bitmap file by reading
backwards untile a correct end page is found. Detects incomplete
writes and corrupted data. Sets the start output position for the
written bitmap data.
+
+Multiple bitmap files are handled using the following assumptions:
+1) Only the last file might be corrupted. In case where no good data was found
+in the last file, assume that the next to last file is OK. This assumption
+does not limit crash recovery capability in any way.
+2) If the whole of the last file was corrupted, assume that the start LSN in
+its name is correct and use it for (re-)tracking start.
+
@return the last fully tracked LSN */
static
ib_uint64_t
@@ -254,73 +316,46 @@ log_online_read_last_tracked_lsn()
/*==============================*/
{
byte page[MODIFIED_PAGE_BLOCK_SIZE];
- ib_uint64_t read_offset = log_bmp_sys->out_offset;
- /* Initialize these to nonequal values so that file size == 0 case with
- zero loop repetitions is handled correctly */
- ulint checksum = 0;
- ulint actual_checksum = !checksum;
ibool is_last_page = FALSE;
+ ibool checksum_ok = FALSE;
ib_uint64_t result;
+ ib_uint64_t read_offset = log_bmp_sys->out.offset;
- ut_ad(log_bmp_sys->out_offset % MODIFIED_PAGE_BLOCK_SIZE == 0);
-
- while (checksum != actual_checksum && read_offset > 0 && !is_last_page)
+ while (!checksum_ok && read_offset > 0 && !is_last_page)
{
-
- ulint offset_low, offset_high;
- ibool success;
-
read_offset -= MODIFIED_PAGE_BLOCK_SIZE;
- offset_high = (ulint)(read_offset >> 32);
- offset_low = (ulint)(read_offset & 0xFFFFFFFF);
-
- success = os_file_read(log_bmp_sys->out, page, offset_low,
- offset_high, MODIFIED_PAGE_BLOCK_SIZE);
- if (!success) {
+ log_bmp_sys->out.offset = read_offset;
- /* The following call prints an error message */
- os_file_get_last_error(TRUE);
- /* Here and below assume that bitmap file names do not
- contain apostrophes, thus no need for
- ut_print_filename(). */
- fprintf(stderr, "InnoDB: Warning: failed reading "
- "changed page bitmap file \'%s\'\n",
- log_bmp_sys->out_name);
- return MIN_TRACKED_LSN;
+ if (!log_online_read_bitmap_page(&log_bmp_sys->out, page,
+ &checksum_ok)) {
+ checksum_ok = FALSE;
+ result = 0;
+ break;
}
- is_last_page
- = mach_read_from_4(page + MODIFIED_PAGE_IS_LAST_BLOCK);
- checksum = mach_read_from_4(page
- + MODIFIED_PAGE_BLOCK_CHECKSUM);
- actual_checksum = log_online_calc_checksum(page);
- if (checksum != actual_checksum) {
+ if (checksum_ok) {
+ is_last_page
+ = mach_read_from_4
+ (page + MODIFIED_PAGE_IS_LAST_BLOCK);
+ } else {
- fprintf(stderr, "InnoDB: Warning: corruption "
- "detected in \'%s\' at offset %llu\n",
- log_bmp_sys->out_name, read_offset);
+ fprintf(stderr,
+ "InnoDB: Warning: corruption detected in "
+ "\'%s\' at offset %llu\n",
+ log_bmp_sys->out.name, read_offset);
}
-
};
- if (UNIV_LIKELY(checksum == actual_checksum && is_last_page)) {
-
- log_bmp_sys->out_offset = read_offset
- + MODIFIED_PAGE_BLOCK_SIZE;
- result = mach_read_from_8(page + MODIFIED_PAGE_END_LSN);
- }
- else {
- log_bmp_sys->out_offset = read_offset;
- result = 0;
- }
+ result = (checksum_ok && is_last_page)
+ ? mach_read_from_8(page + MODIFIED_PAGE_END_LSN) : 0;
/* Truncate the output file to discard the corrupted bitmap data, if
any */
- if (!os_file_set_eof_at(log_bmp_sys->out,
- log_bmp_sys->out_offset)) {
+ if (!os_file_set_eof_at(log_bmp_sys->out.file,
+ log_bmp_sys->out.offset)) {
fprintf(stderr, "InnoDB: Warning: failed truncating "
"changed page bitmap file \'%s\' to %llu bytes\n",
- log_bmp_sys->out_name, log_bmp_sys->out_offset);
+ log_bmp_sys->out.name, log_bmp_sys->out.offset);
result = 0;
}
return result;
@@ -350,6 +385,37 @@ log_set_tracked_lsn(
#endif
}
+/*********************************************************************//**
+Check if missing, if any, LSN interval can be read and tracked using the
+current LSN value, the LSN value where the tracking stopped, and the log group
+capacity.
+
+@return TRUE if the missing interval can be tracked or if there's no missing
+data. */
+static
+ibool
+log_online_can_track_missing(
+/*=========================*/
+ ib_uint64_t last_tracked_lsn, /*!<in: last tracked LSN */
+ ib_uint64_t tracking_start_lsn) /*!<in: current LSN */
+{
+ /* last_tracked_lsn might be < MIN_TRACKED_LSN in the case of empty
+ bitmap file, handle this too. */
+ last_tracked_lsn = ut_max_uint64(last_tracked_lsn, MIN_TRACKED_LSN);
+
+ if (last_tracked_lsn > tracking_start_lsn) {
+ fprintf(stderr,
+ "InnoDB: Error: last tracked LSN is in future. This "
+ "can be caused by mismatched bitmap files.\n");
+ exit(1);
+ }
+
+ return (last_tracked_lsn == tracking_start_lsn)
+ || (log_sys->lsn - last_tracked_lsn
+ <= log_sys->log_group_capacity);
+}
+
+
/****************************************************************//**
Diagnose a gap in tracked LSN range on server startup due to crash or
very fast shutdown and try to close it by tracking the data
@@ -365,22 +431,20 @@ log_online_track_missing_on_startup(
{
ut_ad(last_tracked_lsn != tracking_start_lsn);
- fprintf(stderr, "InnoDB: last tracked LSN in \'%s\' is %llu, but "
- "last checkpoint LSN is %llu. This might be due to a server "
- "crash or a very fast shutdown. ", log_bmp_sys->out_name,
- last_tracked_lsn, tracking_start_lsn);
-
- /* last_tracked_lsn might be < MIN_TRACKED_LSN in the case of empty
- bitmap file, handle this too. */
- last_tracked_lsn = ut_max(last_tracked_lsn, MIN_TRACKED_LSN);
+ fprintf(stderr, "InnoDB: last tracked LSN is %llu, but the last "
+ "checkpoint LSN is %llu. This might be due to a server "
+ "crash or a very fast shutdown. ", last_tracked_lsn,
+ tracking_start_lsn);
/* See if we can fully recover the missing interval */
- if (log_sys->lsn - last_tracked_lsn < log_sys->log_group_capacity) {
+ if (log_online_can_track_missing(last_tracked_lsn,
+ tracking_start_lsn)) {
fprintf(stderr,
"Reading the log to advance the last tracked LSN.\n");
- log_bmp_sys->start_lsn = last_tracked_lsn;
+ log_bmp_sys->start_lsn = ut_max_uint64(last_tracked_lsn,
+ MIN_TRACKED_LSN);
log_set_tracked_lsn(log_bmp_sys->start_lsn);
log_online_follow_redo_log();
ut_ad(log_bmp_sys->end_lsn >= tracking_start_lsn);
@@ -406,16 +470,101 @@ log_online_track_missing_on_startup(
}
/*********************************************************************//**
+Format a bitmap output file name to log_bmp_sys->out.name. */
+static
+void
+log_online_make_bitmap_name(
+/*=========================*/
+ ib_uint64_t start_lsn) /*!< in: the start LSN name part */
+{
+ ut_snprintf(log_bmp_sys->out.name, FN_REFLEN, bmp_file_name_template,
+ srv_data_home, bmp_file_name_stem,
+ log_bmp_sys->out_seq_num, start_lsn);
+
+}
+
+/*********************************************************************//**
+Create a new empty bitmap output file. */
+static
+void
+log_online_start_bitmap_file()
+/*==========================*/
+{
+ ibool success;
+
+ log_bmp_sys->out.file
+ = os_file_create(innodb_file_bmp_key, log_bmp_sys->out.name,
+ OS_FILE_OVERWRITE, OS_FILE_NORMAL,
+ OS_DATA_FILE, &success);
+ if (UNIV_UNLIKELY(!success)) {
+
+ /* The following call prints an error message */
+ os_file_get_last_error(TRUE);
+ fprintf(stderr,
+ "InnoDB: Error: Cannot create \'%s\'\n",
+ log_bmp_sys->out.name);
+ exit(1);
+ }
+
+ log_bmp_sys->out.offset = 0;
+}
+
+/*********************************************************************//**
+Close the current bitmap output file and create the next one. */
+static
+void
+log_online_rotate_bitmap_file(
+/*===========================*/
+ ib_uint64_t next_file_start_lsn) /*!<in: the start LSN name
+ part */
+{
+ os_file_close(log_bmp_sys->out.file);
+ log_bmp_sys->out_seq_num++;
+ log_online_make_bitmap_name(next_file_start_lsn);
+ log_online_start_bitmap_file();
+}
+
+/*********************************************************************//**
+Check the name of a given file if it's a changed page bitmap file and
+return file sequence and start LSN name components if it is. If is not,
+the values of output parameters are undefined.
+
+@return TRUE if a given file is a changed page bitmap file. */
+static
+ibool
+log_online_is_bitmap_file(
+/*======================*/
+ const os_file_stat_t* file_info, /*!<in: file to
+ check */
+ ulong* bitmap_file_seq_num, /*!<out: bitmap file
+ sequence number */
+ ib_uint64_t* bitmap_file_start_lsn) /*!<out: bitmap file
+ start LSN */
+{
+ char stem[FN_REFLEN];
+
+ ut_ad (strlen(file_info->name) < OS_FILE_MAX_PATH);
+
+ return ((file_info->type == OS_FILE_TYPE_FILE
+ || file_info->type == OS_FILE_TYPE_LINK)
+ && (sscanf(file_info->name, "%[a-z_]%lu_%llu.xdb", stem,
+ bitmap_file_seq_num, bitmap_file_start_lsn) == 3)
+ && (!strcmp(stem, bmp_file_name_stem)));
+}
+
+/*********************************************************************//**
Initialize the online log following subsytem. */
UNIV_INTERN
void
log_online_read_init()
/*==================*/
{
- char buf[FN_REFLEN];
ibool success;
ib_uint64_t tracking_start_lsn
- = ut_max(log_sys->last_checkpoint_lsn, MIN_TRACKED_LSN);
+ = ut_max_uint64(log_sys->last_checkpoint_lsn, MIN_TRACKED_LSN);
+ os_file_dir_t bitmap_dir;
+ os_file_stat_t bitmap_dir_file_info;
+ ib_uint64_t last_file_start_lsn = MIN_TRACKED_LSN;
/* Assert (could be compile-time assert) that bitmap data start and end
in a bitmap block is 8-byte aligned */
@@ -424,82 +573,120 @@ log_online_read_init()
log_bmp_sys = ut_malloc(sizeof(*log_bmp_sys));
- ut_snprintf(buf, FN_REFLEN, "%s%s%d", srv_data_home,
- modified_page_stem, 1);
- log_bmp_sys->out_name = ut_malloc(strlen(buf) + 1);
- ut_strcpy(log_bmp_sys->out_name, buf);
+ /* Enumerate existing bitmap files to either open the last one to get
+ the last tracked LSN either to find that there are none and start
+ tracking from scratch. */
+ log_bmp_sys->out.name[0] = '\0';
+ log_bmp_sys->out_seq_num = 0;
+
+ bitmap_dir = os_file_opendir(srv_data_home, TRUE);
+ ut_a(bitmap_dir);
+ while (!os_file_readdir_next_file(srv_data_home, bitmap_dir,
+ &bitmap_dir_file_info)) {
+
+ ulong file_seq_num;
+ ib_uint64_t file_start_lsn;
+
+ if (!log_online_is_bitmap_file(&bitmap_dir_file_info,
+ &file_seq_num,
+ &file_start_lsn)) {
+ continue;
+ }
+
+ if (file_seq_num > log_bmp_sys->out_seq_num
+ && bitmap_dir_file_info.size > 0) {
+ log_bmp_sys->out_seq_num = file_seq_num;
+ last_file_start_lsn = file_start_lsn;
+ /* No dir component (srv_data_home) here, because
+ that's the cwd */
+ strncpy(log_bmp_sys->out.name,
+ bitmap_dir_file_info.name, FN_REFLEN - 1);
+ log_bmp_sys->out.name[FN_REFLEN - 1] = '\0';
+ }
+ }
+
+ if (os_file_closedir(bitmap_dir)) {
+ os_file_get_last_error(TRUE);
+ fprintf(stderr, "InnoDB: Error: cannot close \'%s\'\n",
+ srv_data_home);
+ exit(1);
+ }
+
+ if (!log_bmp_sys->out_seq_num) {
+ log_bmp_sys->out_seq_num = 1;
+ log_online_make_bitmap_name(0);
+ }
log_bmp_sys->modified_pages = rbt_create(MODIFIED_PAGE_BLOCK_SIZE,
log_online_compare_bmp_keys);
log_bmp_sys->page_free_list = NULL;
- log_bmp_sys->out
+ log_bmp_sys->out.file
= os_file_create_simple_no_error_handling
- (innodb_file_bmp_key, log_bmp_sys->out_name, OS_FILE_OPEN,
+ (innodb_file_bmp_key, log_bmp_sys->out.name, OS_FILE_OPEN,
OS_FILE_READ_WRITE, &success);
if (!success) {
/* New file, tracking from scratch */
- log_bmp_sys->out
- = os_file_create_simple_no_error_handling
- (innodb_file_bmp_key, log_bmp_sys->out_name,
- OS_FILE_CREATE, OS_FILE_READ_WRITE, &success);
- if (!success) {
-
- /* The following call prints an error message */
- os_file_get_last_error(TRUE);
- fprintf(stderr,
- "InnoDB: Error: Cannot create \'%s\'\n",
- log_bmp_sys->out_name);
- exit(1);
- }
-
- log_bmp_sys->out_offset = 0;
+ log_online_start_bitmap_file();
}
else {
- /* Old file, read last tracked LSN and continue from there */
+ /* Read the last tracked LSN from the last file */
ulint size_low;
ulint size_high;
ib_uint64_t last_tracked_lsn;
- success = os_file_get_size(log_bmp_sys->out, &size_low,
+ success = os_file_get_size(log_bmp_sys->out.file, &size_low,
&size_high);
ut_a(success);
- log_bmp_sys->out_offset
+ log_bmp_sys->out.size
= ((ib_uint64_t)size_high << 32) | size_low;
+ log_bmp_sys->out.offset = log_bmp_sys->out.size;
- if (log_bmp_sys->out_offset % MODIFIED_PAGE_BLOCK_SIZE != 0) {
+ if (log_bmp_sys->out.offset % MODIFIED_PAGE_BLOCK_SIZE != 0) {
fprintf(stderr,
"InnoDB: Warning: truncated block detected "
"in \'%s\' at offset %llu\n",
- log_bmp_sys->out_name,
- log_bmp_sys->out_offset);
- log_bmp_sys->out_offset -=
- log_bmp_sys->out_offset
+ log_bmp_sys->out.name,
+ log_bmp_sys->out.offset);
+ log_bmp_sys->out.offset -=
+ log_bmp_sys->out.offset
% MODIFIED_PAGE_BLOCK_SIZE;
}
last_tracked_lsn = log_online_read_last_tracked_lsn();
+ if (!last_tracked_lsn) {
+ last_tracked_lsn = last_file_start_lsn;
+ }
+
+ /* Start a new file. Choose the LSN value in its name based on
+ if we can retrack any missing data. */
+ if (log_online_can_track_missing(last_tracked_lsn,
+ tracking_start_lsn)) {
+ log_online_rotate_bitmap_file(last_tracked_lsn);
+ }
+ else {
+ log_online_rotate_bitmap_file(tracking_start_lsn);
+ }
if (last_tracked_lsn < tracking_start_lsn) {
- log_online_track_missing_on_startup(last_tracked_lsn,
- tracking_start_lsn);
+ log_online_track_missing_on_startup
+ (last_tracked_lsn, tracking_start_lsn);
return;
}
if (last_tracked_lsn > tracking_start_lsn) {
- fprintf(stderr, "InnoDB: last tracked LSN in \'%s\' "
- "is %llu, but last checkpoint LSN is %llu. "
+ fprintf(stderr, "InnoDB: last tracked LSN is %llu, "
+ "but last the checkpoint LSN is %llu. "
"The tracking-based incremental backups will "
"work only from the latter LSN!\n",
- log_bmp_sys->out_name, last_tracked_lsn,
- tracking_start_lsn);
+ last_tracked_lsn, tracking_start_lsn);
}
}
@@ -519,7 +706,7 @@ log_online_read_shutdown()
{
ib_rbt_node_t *free_list_node = log_bmp_sys->page_free_list;
- os_file_close(log_bmp_sys->out);
+ os_file_close(log_bmp_sys->out.file);
rbt_free(log_bmp_sys->modified_pages);
@@ -529,7 +716,6 @@ log_online_read_shutdown()
free_list_node = next;
}
- ut_free(log_bmp_sys->out_name);
ut_free(log_bmp_sys);
}
@@ -746,8 +932,8 @@ log_online_follow_log_seg(
/* The next parse LSN is inside the current block, skip
data preceding it. */
skip_already_parsed_len
- = log_bmp_sys->next_parse_lsn
- - block_start_lsn;
+ = (ulint)(log_bmp_sys->next_parse_lsn
+ - block_start_lsn);
}
else {
@@ -819,32 +1005,32 @@ log_online_write_bitmap_page(
{
ibool success;
- success = os_file_write(log_bmp_sys->out_name,log_bmp_sys->out,
+ success = os_file_write(log_bmp_sys->out.name, log_bmp_sys->out.file,
block,
- (ulint)(log_bmp_sys->out_offset & 0xFFFFFFFF),
- (ulint)(log_bmp_sys->out_offset << 32),
+ (ulint)(log_bmp_sys->out.offset & 0xFFFFFFFF),
+ (ulint)(log_bmp_sys->out.offset << 32),
MODIFIED_PAGE_BLOCK_SIZE);
if (UNIV_UNLIKELY(!success)) {
/* The following call prints an error message */
os_file_get_last_error(TRUE);
fprintf(stderr, "InnoDB: Error: failed writing changed page "
- "bitmap file \'%s\'\n", log_bmp_sys->out_name);
+ "bitmap file \'%s\'\n", log_bmp_sys->out.name);
return;
}
- success = os_file_flush(log_bmp_sys->out, FALSE);
+ success = os_file_flush(log_bmp_sys->out.file, FALSE);
if (UNIV_UNLIKELY(!success)) {
/* The following call prints an error message */
os_file_get_last_error(TRUE);
fprintf(stderr, "InnoDB: Error: failed flushing "
"changed page bitmap file \'%s\'\n",
- log_bmp_sys->out_name);
+ log_bmp_sys->out.name);
return;
}
- log_bmp_sys->out_offset += MODIFIED_PAGE_BLOCK_SIZE;
+ log_bmp_sys->out.offset += MODIFIED_PAGE_BLOCK_SIZE;
}
/*********************************************************************//**
@@ -858,6 +1044,10 @@ log_online_write_bitmap()
ib_rbt_node_t *bmp_tree_node;
const ib_rbt_node_t *last_bmp_tree_node;
+ if (log_bmp_sys->out.offset >= srv_max_bitmap_file_size) {
+ log_online_rotate_bitmap_file(log_bmp_sys->start_lsn);
+ }
+
bmp_tree_node = (ib_rbt_node_t *)
rbt_first(log_bmp_sys->modified_pages);
last_bmp_tree_node = rbt_last(log_bmp_sys->modified_pages);
@@ -930,47 +1120,306 @@ log_online_follow_redo_log()
}
/*********************************************************************//**
-Initializes log bitmap iterator.
+List the bitmap files in srv_data_home and setup their range that contains the
+specified LSN interval. This range, if non-empty, will start with a file that
+has the greatest LSN equal to or less than the start LSN and will include all
+the files up to the one with the greatest LSN less than the end LSN. Caller
+must free bitmap_files->files when done if bitmap_files set to non-NULL and
+this function returned TRUE. Field bitmap_files->count might be set to a
+larger value than the actual count of the files, and space for the unused array
+slots will be allocated but cleared to zeroes.
+
+@return TRUE if succeeded
+*/
+static
+ibool
+log_online_setup_bitmap_file_range(
+/*===============================*/
+ log_online_bitmap_file_range_t *bitmap_files, /*!<in/out: bitmap file
+ range */
+ ib_uint64_t range_start, /*!<in: start LSN */
+ ib_uint64_t range_end) /*!<in: end LSN */
+{
+ os_file_dir_t bitmap_dir;
+ os_file_stat_t bitmap_dir_file_info;
+ ulong first_file_seq_num = ULONG_MAX;
+ ib_uint64_t first_file_start_lsn = IB_ULONGLONG_MAX;
+
+ bitmap_files->count = 0;
+ bitmap_files->files = NULL;
+
+ /* 1st pass: size the info array */
+
+ bitmap_dir = os_file_opendir(srv_data_home, FALSE);
+ if (!bitmap_dir) {
+ fprintf(stderr,
+ "InnoDB: Error: "
+ "failed to open bitmap directory \'%s\'\n",
+ srv_data_home);
+ return FALSE;
+ }
+
+ while (!os_file_readdir_next_file(srv_data_home, bitmap_dir,
+ &bitmap_dir_file_info)) {
+
+ ulong file_seq_num;
+ ib_uint64_t file_start_lsn;
+
+ if (!log_online_is_bitmap_file(&bitmap_dir_file_info,
+ &file_seq_num,
+ &file_start_lsn)
+ || file_start_lsn >= range_end) {
+
+ continue;
+ }
+
+ if (file_start_lsn >= range_start
+ || file_start_lsn == first_file_start_lsn
+ || first_file_start_lsn > range_start) {
+
+ /* A file that falls into the range */
+ bitmap_files->count++;
+ if (file_start_lsn < first_file_start_lsn) {
+
+ first_file_start_lsn = file_start_lsn;
+ }
+ if (file_seq_num < first_file_seq_num) {
+
+ first_file_seq_num = file_seq_num;
+ }
+ } else if (file_start_lsn > first_file_start_lsn) {
+
+ /* A file that has LSN closer to the range start
+ but smaller than it, replacing another such file */
+ first_file_start_lsn = file_start_lsn;
+ first_file_seq_num = file_seq_num;
+ }
+ }
+
+ ut_a(first_file_seq_num != ULONG_MAX || bitmap_files->count == 0);
+
+ if (os_file_closedir(bitmap_dir)) {
+ os_file_get_last_error(TRUE);
+ fprintf(stderr, "InnoDB: Error: cannot close \'%s\'\n",
+ srv_data_home);
+ return FALSE;
+ }
+
+ if (!bitmap_files->count) {
+ return TRUE;
+ }
+
+ /* 2nd pass: get the file names in the file_seq_num order */
+
+ bitmap_dir = os_file_opendir(srv_data_home, FALSE);
+ if (!bitmap_dir) {
+ fprintf(stderr, "InnoDB: Error: "
+ "failed to open bitmap directory \'%s\'\n",
+ srv_data_home);
+ return FALSE;
+ }
+
+ bitmap_files->files = ut_malloc(bitmap_files->count
+ * sizeof(bitmap_files->files[0]));
+ memset(bitmap_files->files, 0,
+ bitmap_files->count * sizeof(bitmap_files->files[0]));
+
+ while (!os_file_readdir_next_file(srv_data_home, bitmap_dir,
+ &bitmap_dir_file_info)) {
+
+ ulong file_seq_num;
+ ib_uint64_t file_start_lsn;
+ size_t array_pos;
+
+ if (!log_online_is_bitmap_file(&bitmap_dir_file_info,
+ &file_seq_num,
+ &file_start_lsn)
+ || file_start_lsn >= range_end
+ || file_start_lsn < first_file_start_lsn) {
+ continue;
+ }
+
+ array_pos = file_seq_num - first_file_seq_num;
+ if (file_seq_num > bitmap_files->files[array_pos].seq_num) {
+ bitmap_files->files[array_pos].seq_num = file_seq_num;
+ strncpy(bitmap_files->files[array_pos].name,
+ bitmap_dir_file_info.name, FN_REFLEN);
+ bitmap_files->files[array_pos].name[FN_REFLEN - 1]
+ = '\0';
+ bitmap_files->files[array_pos].start_lsn
+ = file_start_lsn;
+ }
+ }
+
+ if (os_file_closedir(bitmap_dir)) {
+ os_file_get_last_error(TRUE);
+ fprintf(stderr, "InnoDB: Error: cannot close \'%s\'\n",
+ srv_data_home);
+ free(bitmap_files->files);
+ return FALSE;
+ }
+
+#ifdef UNIV_DEBUG
+ ut_ad(bitmap_files->files[0].seq_num == first_file_seq_num);
+ ut_ad(bitmap_files->files[0].start_lsn == first_file_start_lsn);
+ {
+ size_t i;
+ for (i = 1; i < bitmap_files->count; i++) {
+ if (!bitmap_files->files[i].seq_num) {
+ break;
+ }
+ ut_ad(bitmap_files->files[i].seq_num
+ > bitmap_files->files[i - 1].seq_num);
+ ut_ad(bitmap_files->files[i].start_lsn
+ >= bitmap_files->files[i - 1].start_lsn);
+ }
+ }
+#endif
+
+ return TRUE;
+}
+
+/****************************************************************//**
+Open a bitmap file for reading.
+
+@return TRUE if opened successfully */
+static
+ibool
+log_online_open_bitmap_file_read_only(
+/*==================================*/
+ const char* name, /*!<in: bitmap file
+ name without directory,
+ which is assumed to be
+ srv_data_home */
+ log_online_bitmap_file_t* bitmap_file) /*!<out: opened bitmap
+ file */
+{
+ ibool success = FALSE;
+ ulint size_low;
+ ulint size_high;
+
+ ut_snprintf(bitmap_file->name, FN_REFLEN, "%s%s", srv_data_home, name);
+ bitmap_file->file
+ = os_file_create_simple_no_error_handling(innodb_file_bmp_key,
+ bitmap_file->name,
+ OS_FILE_OPEN,
+ OS_FILE_READ_ONLY,
+ &success);
+ if (!success) {
+ /* Here and below assume that bitmap file names do not
+ contain apostrophes, thus no need for ut_print_filename(). */
+ fprintf(stderr,
+ "InnoDB: Warning: error opening the changed page "
+ "bitmap \'%s\'\n", bitmap_file->name);
+ return FALSE;
+ }
+
+ success = os_file_get_size(bitmap_file->file, &size_low, &size_high);
+ bitmap_file->size = (((ib_uint64_t)size_high) << 32) | size_low;
+ bitmap_file->offset = 0;
+
+#ifdef UNIV_LINUX
+ posix_fadvise(bitmap_file->file, 0, 0, POSIX_FADV_SEQUENTIAL);
+ posix_fadvise(bitmap_file->file, 0, 0, POSIX_FADV_NOREUSE);
+#endif
+
+ return TRUE;
+}
+
+/****************************************************************//**
+Diagnose one or both of the following situations if we read close to
+the end of bitmap file:
+1) Warn if the remainder of the file is less than one page.
+2) Error if we cannot read any more full pages but the last read page
+did not have the last-in-run flag set.
+
+@return FALSE for the error */
+static
+ibool
+log_online_diagnose_bitmap_eof(
+/*===========================*/
+ const log_online_bitmap_file_t* bitmap_file, /*!< in: bitmap file */
+ ibool last_page_in_run)/*!< in: "last page in
+ run" flag value in the
+ last read page */
+{
+ /* Check if we are too close to EOF to read a full page */
+ if ((bitmap_file->size < MODIFIED_PAGE_BLOCK_SIZE)
+ || (bitmap_file->offset
+ > bitmap_file->size - MODIFIED_PAGE_BLOCK_SIZE)) {
+
+ if (bitmap_file->offset != bitmap_file->size) {
+ /* If we are not at EOF and we have less than one page
+ to read, it's junk. This error is not fatal in
+ itself. */
+
+ fprintf(stderr,
+ "InnoDB: Warning: junk at the end of changed "
+ "page bitmap file \'%s\'.\n",
+ bitmap_file->name);
+ }
+
+ if (!last_page_in_run) {
+ /* We are at EOF but the last read page did not finish
+ a run */
+ /* It's a "Warning" here because it's not a fatal error
+ for the whole server */
+ fprintf(stderr,
+ "InnoDB: Warning: changed page bitmap "
+ "file \'%s\' does not contain a complete run "
+ "at the end.\n", bitmap_file->name);
+ return FALSE;
+ }
+ }
+ return TRUE;
+}
+
+/*********************************************************************//**
+Initialize the log bitmap iterator for a given range. The records are
+processed at a bitmap block granularity, i.e. all the records in the same block
+share the same start and end LSN values, the exact LSN of each record is
+unavailable (nor is it defined for blocks that are touched more than once in
+the LSN interval contained in the block). Thus min_lsn and max_lsn should be
+set at block boundaries or bigger, otherwise the records at the 1st and the
+last blocks will not be returned. Also note that there might be returned
+records with LSN < min_lsn, as min_lsn is used to select the correct starting
+file but not block.
+
@return TRUE if the iterator is initialized OK, FALSE otherwise. */
UNIV_INTERN
ibool
log_online_bitmap_iterator_init(
/*============================*/
- log_bitmap_iterator_t *i) /*!<in/out: iterator */
+ log_bitmap_iterator_t *i, /*!<in/out: iterator */
+ ib_uint64_t min_lsn,/*!< in: start LSN */
+ ib_uint64_t max_lsn)/*!< in: end LSN */
{
- ibool success;
-
ut_a(i);
- ut_snprintf(i->in_name, FN_REFLEN, "%s%s%d", srv_data_home,
- modified_page_stem, 1);
- i->in_offset = 0;
- /*
- Set up bit offset out of the reasonable limit
- to intiate reading block from file in
- log_online_bitmap_iterator_next()
- */
- i->bit_offset = MODIFIED_PAGE_BLOCK_BITMAP_LEN;
- i->in =
- os_file_create_simple_no_error_handling(innodb_file_bmp_key,
- i->in_name,
- OS_FILE_OPEN,
- OS_FILE_READ_ONLY,
- &success);
- if (!success) {
- /* The following call prints an error message */
- os_file_get_last_error(TRUE);
- fprintf(stderr,
- "InnoDB: Error: Cannot open \'%s\'\n",
- i->in_name);
+ if (!log_online_setup_bitmap_file_range(&i->in_files, min_lsn,
+ max_lsn)) {
+
return FALSE;
}
- i->page = ut_malloc(MODIFIED_PAGE_BLOCK_SIZE);
+ ut_a(i->in_files.count > 0);
+
+ /* Open the 1st bitmap file */
+ i->in_i = 0;
+ if (!log_online_open_bitmap_file_read_only(i->in_files.files[i->in_i].
+ name,
+ &i->in)) {
+ i->in_i = i->in_files.count;
+ free(i->in_files.files);
+ return FALSE;
+ }
+ i->page = ut_malloc(MODIFIED_PAGE_BLOCK_SIZE);
+ i->bit_offset = MODIFIED_PAGE_BLOCK_BITMAP_LEN;
i->start_lsn = i->end_lsn = 0;
i->space_id = 0;
i->first_page_id = 0;
+ i->last_page_in_run = TRUE;
i->changed = FALSE;
return TRUE;
@@ -985,7 +1434,11 @@ log_online_bitmap_iterator_release(
log_bitmap_iterator_t *i) /*!<in/out: iterator */
{
ut_a(i);
- os_file_close(i->in);
+
+ if (i->in_i < i->in_files.count) {
+ os_file_close(i->in.file);
+ }
+ ut_free(i->in_files.files);
ut_free(i->page);
}
@@ -1000,14 +1453,7 @@ log_online_bitmap_iterator_next(
/*============================*/
log_bitmap_iterator_t *i) /*!<in/out: iterator */
{
- ulint offset_low;
- ulint offset_high;
- ulint size_low;
- ulint size_high;
- ulint checksum = 0;
- ulint actual_checksum = !checksum;
-
- ibool success;
+ ibool checksum_ok = FALSE;
ut_a(i);
@@ -1020,66 +1466,51 @@ log_online_bitmap_iterator_next(
return TRUE;
}
- while (checksum != actual_checksum)
+ while (!checksum_ok)
{
- success = os_file_get_size(i->in,
- &size_low,
- &size_high);
- if (!success) {
- os_file_get_last_error(TRUE);
- fprintf(stderr,
- "InnoDB: Warning: can't get size of "
- "page bitmap file \'%s\'\n",
- i->in_name);
- return FALSE;
- }
-
- if (i->in_offset >=
- (ib_uint64_t)(size_low) +
- ((ib_uint64_t)(size_high) << 32))
- return FALSE;
-
- offset_high = (ulint)(i->in_offset >> 32);
- offset_low = (ulint)(i->in_offset & 0xFFFFFFFF);
+ while (i->in.size < MODIFIED_PAGE_BLOCK_SIZE
+ || (i->in.offset
+ > i->in.size - MODIFIED_PAGE_BLOCK_SIZE)) {
+
+ /* Advance file */
+ i->in_i++;
+ os_file_close(i->in.file);
+ log_online_diagnose_bitmap_eof(&i->in,
+ i->last_page_in_run);
+ if (i->in_i == i->in_files.count
+ || i->in_files.files[i->in_i].seq_num == 0) {
+
+ return FALSE;
+ }
- success = os_file_read(
- i->in,
- i->page,
- offset_low,
- offset_high,
- MODIFIED_PAGE_BLOCK_SIZE);
+ if (!log_online_open_bitmap_file_read_only(
+ i->in_files.files[i->in_i].name,
+ &i->in)) {
+ return FALSE;
+ }
+ }
- if (!success) {
+ if (!log_online_read_bitmap_page(&i->in, i->page,
+ &checksum_ok)) {
os_file_get_last_error(TRUE);
fprintf(stderr,
"InnoDB: Warning: failed reading "
"changed page bitmap file \'%s\'\n",
- i->in_name);
+ i->in_files.files[i->in_i].name);
return FALSE;
}
-
- checksum = mach_read_from_4(
- i->page + MODIFIED_PAGE_BLOCK_CHECKSUM);
-
- actual_checksum = log_online_calc_checksum(i->page);
-
- i->in_offset += MODIFIED_PAGE_BLOCK_SIZE;
}
- i->start_lsn =
- mach_read_from_8(i->page + MODIFIED_PAGE_START_LSN);
- i->end_lsn =
- mach_read_from_8(i->page + MODIFIED_PAGE_END_LSN);
- i->space_id =
- mach_read_from_4(i->page + MODIFIED_PAGE_SPACE_ID);
- i->first_page_id =
- mach_read_from_4(i->page + MODIFIED_PAGE_1ST_PAGE_ID);
- i->bit_offset =
- 0;
- i->changed =
- IS_BIT_SET(i->page + MODIFIED_PAGE_BLOCK_BITMAP,
- i->bit_offset);
+ i->start_lsn = mach_read_from_8(i->page + MODIFIED_PAGE_START_LSN);
+ i->end_lsn = mach_read_from_8(i->page + MODIFIED_PAGE_END_LSN);
+ i->space_id = mach_read_from_4(i->page + MODIFIED_PAGE_SPACE_ID);
+ i->first_page_id = mach_read_from_4(i->page
+ + MODIFIED_PAGE_1ST_PAGE_ID);
+ i->last_page_in_run = mach_read_from_4(i->page
+ + MODIFIED_PAGE_IS_LAST_BLOCK);
+ i->bit_offset = 0;
+ i->changed = IS_BIT_SET(i->page + MODIFIED_PAGE_BLOCK_BITMAP,
+ i->bit_offset);
return TRUE;
}
-
diff --git a/storage/xtradb/os/os0file.c b/storage/xtradb/os/os0file.c
index 2555c010027..8e0516a84a9 100644
--- a/storage/xtradb/os/os0file.c
+++ b/storage/xtradb/os/os0file.c
@@ -2158,8 +2158,10 @@ os_file_set_eof_at(
ib_uint64_t new_len)/*!< in: new file length */
{
#ifdef __WIN__
- /* TODO: untested! */
- return(!_chsize_s(file, new_len));
+ LARGE_INTEGER li, li2;
+ li.QuadPart = new_len;
+ return(SetFilePointerEx(file, li, &li2,FILE_BEGIN)
+ && SetEndOfFile(file));
#else
/* TODO: works only with -D_FILE_OFFSET_BITS=64 ? */
return(!ftruncate(file, new_len));
diff --git a/storage/xtradb/row/row0ins.c b/storage/xtradb/row/row0ins.c
index 3ae4c227ddc..61c3720fa2e 100644
--- a/storage/xtradb/row/row0ins.c
+++ b/storage/xtradb/row/row0ins.c
@@ -2012,7 +2012,10 @@ row_ins_index_entry_low(
the function will return in both low_match and up_match of the
cursor sensible values */
- if (dict_index_is_clust(index)) {
+ if (UNIV_UNLIKELY(thr_get_trx(thr)->fake_changes)) {
+ search_mode = (mode & BTR_MODIFY_TREE)
+ ? BTR_SEARCH_TREE : BTR_SEARCH_LEAF;
+ } else if (dict_index_is_clust(index)) {
search_mode = mode;
} else if (!(thr_get_trx(thr)->check_unique_secondary)) {
search_mode = mode | BTR_INSERT | BTR_IGNORE_SEC_UNIQUE;
@@ -2021,7 +2024,7 @@ row_ins_index_entry_low(
}
btr_cur_search_to_nth_level(index, 0, entry, PAGE_CUR_LE,
- thr_get_trx(thr)->fake_changes ? BTR_SEARCH_LEAF : search_mode,
+ search_mode,
&cursor, 0, __FILE__, __LINE__, &mtr);
if (cursor.flag == BTR_CUR_INSERT_TO_IBUF) {
diff --git a/storage/xtradb/row/row0mysql.c b/storage/xtradb/row/row0mysql.c
index 575160501c3..9ab85940760 100644
--- a/storage/xtradb/row/row0mysql.c
+++ b/storage/xtradb/row/row0mysql.c
@@ -1277,17 +1277,19 @@ run_again:
que_thr_stop_for_mysql_no_error(thr, trx);
- prebuilt->table->stat_n_rows++;
+ if (UNIV_LIKELY(!(trx->fake_changes))) {
- srv_n_rows_inserted++;
+ prebuilt->table->stat_n_rows++;
- if (prebuilt->table->stat_n_rows == 0) {
- /* Avoid wrap-over */
- prebuilt->table->stat_n_rows--;
+ if (prebuilt->table->stat_n_rows == 0) {
+ /* Avoid wrap-over */
+ prebuilt->table->stat_n_rows--;
+ }
+
+ srv_n_rows_inserted++;
+ row_update_statistics_if_needed(prebuilt->table);
}
- if (!(trx->fake_changes))
- row_update_statistics_if_needed(prebuilt->table);
trx->op_info = "";
return((int) err);
@@ -1534,6 +1536,11 @@ run_again:
que_thr_stop_for_mysql_no_error(thr, trx);
+ if (UNIV_UNLIKELY(trx->fake_changes)) {
+ trx->op_info = "";
+ return((int) err);
+ }
+
if (node->is_delete) {
if (prebuilt->table->stat_n_rows > 0) {
prebuilt->table->stat_n_rows--;
@@ -1548,7 +1555,6 @@ run_again:
that changes indexed columns, UPDATEs that change only non-indexed
columns would not affect statistics. */
if (node->is_delete || !(node->cmpl_info & UPD_NODE_NO_ORD_CHANGE)) {
- if (!(trx->fake_changes))
row_update_statistics_if_needed(prebuilt->table);
}
@@ -1756,6 +1762,11 @@ run_again:
return(err);
}
+ if (UNIV_UNLIKELY((trx->fake_changes))) {
+
+ return(err);
+ }
+
if (node->is_delete) {
if (table->stat_n_rows > 0) {
table->stat_n_rows--;
@@ -1766,7 +1777,6 @@ run_again:
srv_n_rows_updated++;
}
- if (!(trx->fake_changes))
row_update_statistics_if_needed(table);
return(err);
diff --git a/storage/xtradb/row/row0upd.c b/storage/xtradb/row/row0upd.c
index 859b3d415ab..b2a0eb57669 100644
--- a/storage/xtradb/row/row0upd.c
+++ b/storage/xtradb/row/row0upd.c
@@ -2018,7 +2018,8 @@ row_upd_clust_rec(
the same transaction do not modify the record in the meantime.
Therefore we can assert that the restoration of the cursor succeeds. */
- ut_a(btr_pcur_restore_position(thr_get_trx(thr)->fake_changes ? BTR_SEARCH_LEAF : BTR_MODIFY_TREE,
+ ut_a(btr_pcur_restore_position(thr_get_trx(thr)->fake_changes
+ ? BTR_SEARCH_TREE : BTR_MODIFY_TREE,
pcur, mtr));
ut_ad(!rec_get_deleted_flag(btr_pcur_get_rec(pcur),
diff --git a/storage/xtradb/srv/srv0srv.c b/storage/xtradb/srv/srv0srv.c
index 9d479ac6c87..6e210071746 100644
--- a/storage/xtradb/srv/srv0srv.c
+++ b/storage/xtradb/srv/srv0srv.c
@@ -179,8 +179,14 @@ UNIV_INTERN ibool srv_recovery_stats = FALSE;
UNIV_INTERN my_bool srv_track_changed_pages = TRUE;
+UNIV_INTERN ib_uint64_t srv_max_bitmap_file_size = 100 * 1024 * 1024;
+
UNIV_INTERN ulonglong srv_changed_pages_limit = 0;
+/** When TRUE, fake change transcations take S rather than X row locks.
+ When FALSE, row locks are not taken at all. */
+UNIV_INTERN my_bool srv_fake_changes_locks = TRUE;
+
/* if TRUE, then we auto-extend the last data file */
UNIV_INTERN ibool srv_auto_extend_last_data_file = FALSE;
/* if != 0, this tells the max size auto-extending may increase the
diff --git a/storage/xtradb/srv/srv0start.c b/storage/xtradb/srv/srv0start.c
index 65a775b56da..2faa68cb87c 100644
--- a/storage/xtradb/srv/srv0start.c
+++ b/storage/xtradb/srv/srv0start.c
@@ -1148,6 +1148,24 @@ skip_size_check:
return(DB_SUCCESS);
}
+/*********************************************************************//**
+Initializes the log tracking subsystem and starts its thread. */
+static
+void
+init_log_online(void)
+/*=================*/
+{
+ if (srv_track_changed_pages) {
+
+ log_online_read_init();
+
+ /* Create the thread that follows the redo log to output the
+ changed page bitmap */
+ os_thread_create(&srv_redo_log_follow_thread, NULL,
+ thread_ids + 5 + SRV_MAX_N_IO_THREADS);
+ }
+}
+
/********************************************************************
Starts InnoDB and creates a new database if database files
are not found and the user wants.
@@ -1794,6 +1812,8 @@ innobase_start_or_create_for_mysql(void)
trx_sys_file_format_init();
if (create_new_db) {
+ init_log_online();
+
mtr_start(&mtr);
fsp_header_init(0, sum_of_new_sizes, &mtr);
@@ -1893,6 +1913,8 @@ innobase_start_or_create_for_mysql(void)
return(DB_ERROR);
}
+ init_log_online();
+
/* Since the insert buffer init is in dict_boot, and the
insert buffer is needed in any disk i/o, first we call
dict_boot(). Note that trx_sys_init_at_db_start() only needs
@@ -2040,19 +2062,6 @@ innobase_start_or_create_for_mysql(void)
if (srv_auto_lru_dump && srv_blocking_lru_restore)
buf_LRU_file_restore();
- if (srv_track_changed_pages) {
-
- /* Initialize the log tracking subsystem here to block
- server startup until it's completed due to the potential
- need to re-read previous server run's log. */
- log_online_read_init();
-
- /* Create the thread that follows the redo log to output the
- changed page bitmap */
- os_thread_create(&srv_redo_log_follow_thread, NULL,
- thread_ids + 6 + SRV_MAX_N_IO_THREADS);
- }
-
srv_is_being_started = FALSE;
err = dict_create_or_check_foreign_constraint_tables();
diff --git a/strings/ctype-ucs2.c b/strings/ctype-ucs2.c
index 52eaece5528..6ebbae8fb5a 100644
--- a/strings/ctype-ucs2.c
+++ b/strings/ctype-ucs2.c
@@ -46,9 +46,10 @@
#define LFACTOR1 ULL(10000000000)
#define LFACTOR2 ULL(100000000000)
+#if defined(HAVE_CHARSET_utf32) || defined(HAVE_CHARSET_mb2)
static unsigned long lfactor[9]=
{ 1L, 10L, 100L, 1000L, 10000L, 100000L, 1000000L, 10000000L, 100000000L };
-
+#endif
#ifdef HAVE_CHARSET_mb2_or_mb4
diff --git a/strings/my_vsnprintf.c b/strings/my_vsnprintf.c
index 408931ee930..2073d5a93d9 100644
--- a/strings/my_vsnprintf.c
+++ b/strings/my_vsnprintf.c
@@ -685,7 +685,7 @@ size_t my_vsnprintf_ex(CHARSET_INFO *cs, char *to, size_t n,
}
/* We come here on '%%', unknown code or too long parameter */
- if (to == end)
+ if (to >= end)
break;
*to++='%'; /* % used as % or unknown code */
}
diff --git a/support-files/compiler_warnings.supp b/support-files/compiler_warnings.supp
index 110c1f08263..34f368c4373 100644
--- a/support-files/compiler_warnings.supp
+++ b/support-files/compiler_warnings.supp
@@ -138,6 +138,11 @@ lock_xt\.cc : uninitialized local variable .* used
restart_xt\.cc : dereferencing pointer .* does break strict-aliasing
#
+# oqgraph errors that are hard to fix
+#
+oqgraph/graphcore\.cc : may be used uninitialized in this function
+
+#
# I think these are due to mix of C and C++.
#
storage/pbxt/ : typedef.*was ignored in this declaration
@@ -153,6 +158,7 @@ include/runtime.hpp: .*pure_error.*
.*/extra/yassl/taocrypt/src/file\.cpp: ignoring return value
.*/extra/yassl/taocrypt/src/integer\.cpp: control reaches end of non-void function
mySTL/algorithm\.hpp: is used uninitialized in this function
+include/pwdbased\.hpp: comparison of unsigned expression
#
# OpenSSL
@@ -184,6 +190,7 @@ net_serv.cc : .*conversion from 'SOCKET' to 'int'.*
# Ignorable warnings from header files
#
backward_warning\.h : This file includes at least one
+/usr/include/i386-linux-gnu/bits/string3\.h: memset used with constant zero length parameter
# allow a little moving space for the warning below
mi_packrec\.c : .*result of 32-bit shift implicitly converted to 64 bits.* : 560-600
@@ -195,15 +202,15 @@ ma_packrec\.c : .*result of 32-bit shift implicitly converted to 64 bits.* : 550
.* : .*no matching operator delete found; memory will not be freed if initialization throws an exception.*
ctype-simple\.c : .*unary minus operator applied to unsigned type, result still unsigned.*
sql/sys_vars\.cc : invalid access to non-static data member
-sql/sys_vars\.cc : perhaps the 'offsetof' macro was used incorrectly
+string3\.h : memset used with constant zero length parameter
+
# Wrong warning due to GCC bug: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29478
regexec\.c : passing argument 3 of.*matcher.* discards qualifiers from pointer target type
libmysql\.c: passing argument 2 of .*memcpy.* discards qualifiers from pointer target type : 3000-4000
-storage/xtradb/dict/dict0dict\.c : passing argument 1 of .*strcpy.* discards qualifiers from pointer target type : 2500-3500
-storage/xtradb/sync/sync0rw\.c : passing argument 1 of .*memset.* discards qualifiers from pointer target type : 200-300
-storage/innobase/dict/dict0dict\.c : passing argument 1 of .*strcpy.* discards qualifiers from pointer target type : 2500-3500
-storage/innobase/sync/sync0rw\.c : passing argument 1 of .*memset.* discards qualifiers from pointer target type : 200-300
+storage/.*/dict/dict0dict\.c : passing argument 1 of .*strcpy.* discards qualifiers from pointer target type : 2500-3500
+storage/.*/sync/sync0rw\.c : passing argument 1 of .*memset.* discards qualifiers from pointer target type : 200-300
+storage/.*/btr/btr0sea\.c : passing argument 2 of .*btr_cur_position.* discards qualifiers from pointer
#
# Strange things from autoconf that is probably safe to ignore
@@ -211,3 +218,4 @@ storage/innobase/sync/sync0rw\.c : passing argument 1 of .*memset.* discards qua
configure.in : warning: AC_LANG_CONFTEST: no AC_LANG_SOURCE call detected in body
configure.in : config/ac-macros/character_sets.m4.*prefer named diversions
+warning: File listed twice
diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh
index 0d673e5b339..2d629c766e8 100644
--- a/support-files/mysql.spec.sh
+++ b/support-files/mysql.spec.sh
@@ -1,4 +1,4 @@
-# Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -286,8 +286,9 @@ documentation and the manual for more information.
Summary: MySQL: a very fast and reliable SQL database server
Group: Applications/Databases
Requires: %{distro_requires}
-Provides: msqlormysql mysql MySQL mysql-server MySQL-server
-Obsoletes: mysql MySQL mysql-server MySQL-server
+Provides: msqlormysql MySQL MySQL-server
+Conflicts: mysql mysql-server mysql-advanced mysql-server-advanced
+Obsoletes: MySQL MySQL-server
Obsoletes: MySQL-server-classic MySQL-server-community MySQL-server-enterprise
Obsoletes: MySQL-server-advanced MySQL-server-advanced-gpl MySQL-server-enterprise-gpl
@@ -319,8 +320,9 @@ package "MySQL-client%{product_suffix}" as well!
%package -n MySQL-client%{product_suffix}
Summary: MySQL - Client
Group: Applications/Databases
-Provides: mysql-client MySQL-client
-Obsoletes: mysql-client MySQL-client
+Provides: MySQL-client
+Conflicts: mysql mysql-advanced
+Obsoletes: MySQL-client
Obsoletes: MySQL-client-classic MySQL-client-community MySQL-client-enterprise
Obsoletes: MySQL-client-advanced MySQL-client-advanced-gpl MySQL-client-enterprise-gpl
@@ -334,8 +336,9 @@ For a description of MySQL see the base MySQL RPM or http://www.mysql.com/
Summary: MySQL - Test suite
Group: Applications/Databases
Requires: MySQL-client perl
-Provides: mysql-test MySQL-test
-Obsoletes: mysql-test MySQL-test
+Provides: MySQL-test
+Conflicts: mysql-test mysql-test-advanced
+Obsoletes: MySQL-test
Obsoletes: mysql-bench MySQL-bench
Obsoletes: MySQL-test-classic MySQL-test-community MySQL-test-enterprise
Obsoletes: MySQL-test-advanced MySQL-test-advanced-gpl MySQL-test-enterprise-gpl
@@ -350,8 +353,9 @@ For a description of MySQL see the base MySQL RPM or http://www.mysql.com/
%package -n MySQL-devel%{product_suffix}
Summary: MySQL - Development header files and libraries
Group: Applications/Databases
-Provides: mysql-devel MySQL-devel
-Obsoletes: mysql-devel MySQL-devel
+Provides: MySQL-devel
+Conflicts: mysql-devel mysql-embedded-devel mysql-devel-advanced mysql-embedded-devel-advanced
+Obsoletes: MySQL-devel
Obsoletes: MySQL-devel-classic MySQL-devel-community MySQL-devel-enterprise
Obsoletes: MySQL-devel-advanced MySQL-devel-advanced-gpl MySQL-devel-enterprise-gpl
@@ -365,8 +369,9 @@ For a description of MySQL see the base MySQL RPM or http://www.mysql.com/
%package -n MySQL-shared%{product_suffix}
Summary: MySQL - Shared libraries
Group: Applications/Databases
-Provides: mysql-shared MySQL-shared
-Obsoletes: mysql-shared MySQL-shared-standard MySQL-shared-pro
+Provides: MySQL-shared
+Conflicts: mysql-libs mysql-libs-advanced
+Obsoletes: MySQL-shared-standard MySQL-shared-pro
Obsoletes: MySQL-shared-pro-cert MySQL-shared-pro-gpl
Obsoletes: MySQL-shared-pro-gpl-cert MySQL-shared
Obsoletes: MySQL-shared-classic MySQL-shared-community MySQL-shared-enterprise
@@ -381,8 +386,9 @@ and applications need to dynamically load and use MySQL.
Summary: MySQL - Embedded library
Group: Applications/Databases
Requires: MySQL-devel
-Provides: mysql-embedded MySQL-embedded
-Obsoletes: mysql-embedded MySQL-embedded
+Provides: MySQL-embedded
+Conflicts: mysql-embedded mysql-embedded-advanced
+Obsoletes: MySQL-embedded
Obsoletes: MySQL-embedded-pro
Obsoletes: MySQL-embedded-classic MySQL-embedded-community MySQL-embedded-enterprise
Obsoletes: MySQL-embedded-advanced MySQL-embedded-advanced-gpl MySQL-embedded-enterprise-gpl
@@ -601,8 +607,13 @@ fi
# Check if we can safely upgrade. An upgrade is only safe if it's from one
# of our RPMs in the same version family.
+# Handle both ways of spelling the capability.
installed=`rpm -q --whatprovides mysql-server 2> /dev/null`
+if [ $? -ne 0 -o -z "$installed" ]; then
+ installed=`rpm -q --whatprovides MySQL-server 2> /dev/null`
+fi
if [ $? -eq 0 -a -n "$installed" ]; then
+ installed=`echo $installed | sed 's/\([^ ]*\) .*/\1/'` # Tests have shown duplicated package names
vendor=`rpm -q --queryformat='%{VENDOR}' "$installed" 2>&1`
version=`rpm -q --queryformat='%{VERSION}' "$installed" 2>&1`
myoldvendor='%{mysql_old_vendor}'
@@ -1173,6 +1184,10 @@ echo "=====" >> $STATUS_HISTORY
this can be oveeridden via the command line by adding
--define "runselftest 0"
Failures of the test suite will NOT make the RPM build fail!
+
+* Mon Jun 11 2012 Joerg Bruehe <joerg.bruehe@oracle.com>
+
+- Make sure newly added "SPECIFIC-ULN/" directory does not disturb packaging.
* Wed Sep 28 2011 Joerg Bruehe <joerg.bruehe@oracle.com>
diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c
index eecd06907a5..93ed18ed565 100644
--- a/tests/mysql_client_test.c
+++ b/tests/mysql_client_test.c
@@ -16040,6 +16040,7 @@ static void test_change_user()
const char *pw= "password";
const char *db= "mysqltest_user_test_database";
int rc;
+ MYSQL* conn;
DBUG_ENTER("test_change_user");
myheader("test_change_user");
@@ -16083,149 +16084,173 @@ static void test_change_user()
rc= mysql_query(mysql, buff);
myquery(rc);
+ conn= client_connect(0, MYSQL_PROTOCOL_TCP, 0);
/* Try some combinations */
- rc= mysql_change_user(mysql, NULL, NULL, NULL);
+ rc= mysql_change_user(conn, NULL, NULL, NULL);
DIE_UNLESS(rc);
if (! opt_silent)
- printf("Got error (as expected): %s\n", mysql_error(mysql));
+ printf("Got error (as expected): %s\n", mysql_error(conn));
- rc= mysql_change_user(mysql, "", NULL, NULL);
+ rc= mysql_change_user(conn, "", NULL, NULL);
DIE_UNLESS(rc);
if (! opt_silent)
- printf("Got error (as expected): %s\n", mysql_error(mysql));
+ printf("Got error (as expected): %s\n", mysql_error(conn));
- rc= mysql_change_user(mysql, "", "", NULL);
+ rc= mysql_change_user(conn, "", "", NULL);
DIE_UNLESS(rc);
if (! opt_silent)
- printf("Got error (as expected): %s\n", mysql_error(mysql));
+ printf("Got error (as expected): %s\n", mysql_error(conn));
- rc= mysql_change_user(mysql, "", "", "");
+ mysql_close(conn);
+ conn= client_connect(0, MYSQL_PROTOCOL_TCP, 0);
+
+ rc= mysql_change_user(conn, "", "", "");
DIE_UNLESS(rc);
if (! opt_silent)
- printf("Got error (as expected): %s\n", mysql_error(mysql));
+ printf("Got error (as expected): %s\n", mysql_error(conn));
- rc= mysql_change_user(mysql, NULL, "", "");
+ rc= mysql_change_user(conn, NULL, "", "");
DIE_UNLESS(rc);
if (! opt_silent)
- printf("Got error (as expected): %s\n", mysql_error(mysql));
+ printf("Got error (as expected): %s\n", mysql_error(conn));
- rc= mysql_change_user(mysql, NULL, NULL, "");
+ rc= mysql_change_user(conn, NULL, NULL, "");
DIE_UNLESS(rc);
if (! opt_silent)
- printf("Got error (as expected): %s\n", mysql_error(mysql));
+ printf("Got error (as expected): %s\n", mysql_error(conn));
+
+ mysql_close(conn);
+ conn= client_connect(0, MYSQL_PROTOCOL_TCP, 0);
- rc= mysql_change_user(mysql, "", NULL, "");
+ rc= mysql_change_user(conn, "", NULL, "");
DIE_UNLESS(rc);
if (! opt_silent)
- printf("Got error (as expected): %s\n", mysql_error(mysql));
+ printf("Got error (as expected): %s\n", mysql_error(conn));
- rc= mysql_change_user(mysql, user_pw, NULL, "");
+ rc= mysql_change_user(conn, user_pw, NULL, "");
DIE_UNLESS(rc);
if (! opt_silent)
- printf("Got error (as expected): %s\n", mysql_error(mysql));
+ printf("Got error (as expected): %s\n", mysql_error(conn));
- rc= mysql_change_user(mysql, user_pw, "", "");
+ rc= mysql_change_user(conn, user_pw, "", "");
DIE_UNLESS(rc);
if (! opt_silent)
- printf("Got error (as expected): %s\n", mysql_error(mysql));
+ printf("Got error (as expected): %s\n", mysql_error(conn));
- rc= mysql_change_user(mysql, user_pw, "", NULL);
+ mysql_close(conn);
+ conn= client_connect(0, MYSQL_PROTOCOL_TCP, 0);
+
+ rc= mysql_change_user(conn, user_pw, "", NULL);
DIE_UNLESS(rc);
if (! opt_silent)
- printf("Got error (as expected): %s\n", mysql_error(mysql));
+ printf("Got error (as expected): %s\n", mysql_error(conn));
- rc= mysql_change_user(mysql, user_pw, NULL, NULL);
+ rc= mysql_change_user(conn, user_pw, NULL, NULL);
DIE_UNLESS(rc);
if (! opt_silent)
- printf("Got error (as expected): %s\n", mysql_error(mysql));
+ printf("Got error (as expected): %s\n", mysql_error(conn));
- rc= mysql_change_user(mysql, user_pw, "", db);
+ rc= mysql_change_user(conn, user_pw, "", db);
DIE_UNLESS(rc);
if (! opt_silent)
- printf("Got error (as expected): %s\n", mysql_error(mysql));
+ printf("Got error (as expected): %s\n", mysql_error(conn));
+
+ mysql_close(conn);
+ conn= client_connect(0, MYSQL_PROTOCOL_TCP, 0);
- rc= mysql_change_user(mysql, user_pw, NULL, db);
+ rc= mysql_change_user(conn, user_pw, NULL, db);
DIE_UNLESS(rc);
if (! opt_silent)
- printf("Got error (as expected): %s\n", mysql_error(mysql));
+ printf("Got error (as expected): %s\n", mysql_error(conn));
- rc= mysql_change_user(mysql, user_pw, pw, db);
+ rc= mysql_change_user(conn, user_pw, pw, db);
myquery(rc);
- rc= mysql_change_user(mysql, user_pw, pw, NULL);
+ rc= mysql_change_user(conn, user_pw, pw, NULL);
myquery(rc);
- rc= mysql_change_user(mysql, user_pw, pw, "");
+ rc= mysql_change_user(conn, user_pw, pw, "");
myquery(rc);
- rc= mysql_change_user(mysql, user_no_pw, pw, db);
+ rc= mysql_change_user(conn, user_no_pw, pw, db);
DIE_UNLESS(rc);
if (! opt_silent)
- printf("Got error (as expected): %s\n", mysql_error(mysql));
+ printf("Got error (as expected): %s\n", mysql_error(conn));
- rc= mysql_change_user(mysql, user_no_pw, pw, "");
+ rc= mysql_change_user(conn, user_no_pw, pw, "");
DIE_UNLESS(rc);
if (! opt_silent)
- printf("Got error (as expected): %s\n", mysql_error(mysql));
+ printf("Got error (as expected): %s\n", mysql_error(conn));
- rc= mysql_change_user(mysql, user_no_pw, pw, NULL);
+ mysql_close(conn);
+ conn= client_connect(0, MYSQL_PROTOCOL_TCP, 0);
+
+ rc= mysql_change_user(conn, user_no_pw, pw, NULL);
DIE_UNLESS(rc);
if (! opt_silent)
- printf("Got error (as expected): %s\n", mysql_error(mysql));
+ printf("Got error (as expected): %s\n", mysql_error(conn));
- rc= mysql_change_user(mysql, user_no_pw, "", NULL);
+ rc= mysql_change_user(conn, user_no_pw, "", NULL);
myquery(rc);
- rc= mysql_change_user(mysql, user_no_pw, "", "");
+ rc= mysql_change_user(conn, user_no_pw, "", "");
myquery(rc);
- rc= mysql_change_user(mysql, user_no_pw, "", db);
+ rc= mysql_change_user(conn, user_no_pw, "", db);
myquery(rc);
- rc= mysql_change_user(mysql, user_no_pw, NULL, db);
+ rc= mysql_change_user(conn, user_no_pw, NULL, db);
myquery(rc);
- rc= mysql_change_user(mysql, "", pw, db);
+ rc= mysql_change_user(conn, "", pw, db);
DIE_UNLESS(rc);
if (! opt_silent)
- printf("Got error (as expected): %s\n", mysql_error(mysql));
+ printf("Got error (as expected): %s\n", mysql_error(conn));
- rc= mysql_change_user(mysql, "", pw, "");
+ rc= mysql_change_user(conn, "", pw, "");
DIE_UNLESS(rc);
if (! opt_silent)
- printf("Got error (as expected): %s\n", mysql_error(mysql));
+ printf("Got error (as expected): %s\n", mysql_error(conn));
+
+ mysql_close(conn);
+ conn= client_connect(0, MYSQL_PROTOCOL_TCP, 0);
- rc= mysql_change_user(mysql, "", pw, NULL);
+ rc= mysql_change_user(conn, "", pw, NULL);
DIE_UNLESS(rc);
if (! opt_silent)
- printf("Got error (as expected): %s\n", mysql_error(mysql));
+ printf("Got error (as expected): %s\n", mysql_error(conn));
- rc= mysql_change_user(mysql, NULL, pw, NULL);
+ rc= mysql_change_user(conn, NULL, pw, NULL);
DIE_UNLESS(rc);
if (! opt_silent)
- printf("Got error (as expected): %s\n", mysql_error(mysql));
+ printf("Got error (as expected): %s\n", mysql_error(conn));
- rc= mysql_change_user(mysql, NULL, NULL, db);
+ rc= mysql_change_user(conn, NULL, NULL, db);
DIE_UNLESS(rc);
if (! opt_silent)
- printf("Got error (as expected): %s\n", mysql_error(mysql));
+ printf("Got error (as expected): %s\n", mysql_error(conn));
- rc= mysql_change_user(mysql, NULL, "", db);
+ mysql_close(conn);
+ conn= client_connect(0, MYSQL_PROTOCOL_TCP, 0);
+
+ rc= mysql_change_user(conn, NULL, "", db);
DIE_UNLESS(rc);
if (! opt_silent)
- printf("Got error (as expected): %s\n", mysql_error(mysql));
+ printf("Got error (as expected): %s\n", mysql_error(conn));
- rc= mysql_change_user(mysql, "", "", db);
+ rc= mysql_change_user(conn, "", "", db);
DIE_UNLESS(rc);
if (! opt_silent)
- printf("Got error (as expected): %s\n", mysql_error(mysql));
+ printf("Got error (as expected): %s\n", mysql_error(conn));
/* Cleanup the environment */
- mysql_change_user(mysql, opt_user, opt_password, current_db);
+ mysql_change_user(conn, opt_user, opt_password, current_db);
+
+ mysql_close(conn);
sprintf(buff, "drop database %s", db);
rc= mysql_query(mysql, buff);
@@ -16888,29 +16913,35 @@ static void test_bug31669()
static char db[NAME_CHAR_LEN+1];
static char query[LARGE_BUFFER_SIZE*2];
#endif
+ MYSQL* conn;
DBUG_ENTER("test_bug31669");
myheader("test_bug31669");
- rc= mysql_change_user(mysql, NULL, NULL, NULL);
+ conn= client_connect(0, MYSQL_PROTOCOL_TCP, 0);
+
+ rc= mysql_change_user(conn, NULL, NULL, NULL);
DIE_UNLESS(rc);
- rc= mysql_change_user(mysql, "", "", "");
+ rc= mysql_change_user(conn, "", "", "");
DIE_UNLESS(rc);
memset(buff, 'a', sizeof(buff));
- rc= mysql_change_user(mysql, buff, buff, buff);
+ mysql_close(conn);
+ conn= client_connect(0, MYSQL_PROTOCOL_TCP, 0);
+
+ rc= mysql_change_user(conn, buff, buff, buff);
DIE_UNLESS(rc);
- rc = mysql_change_user(mysql, opt_user, opt_password, current_db);
+ rc = mysql_change_user(conn, opt_user, opt_password, current_db);
DIE_UNLESS(!rc);
#ifndef EMBEDDED_LIBRARY
memset(db, 'a', sizeof(db));
db[NAME_CHAR_LEN]= 0;
strxmov(query, "CREATE DATABASE IF NOT EXISTS ", db, NullS);
- rc= mysql_query(mysql, query);
+ rc= mysql_query(conn, query);
myquery(rc);
memset(user, 'b', sizeof(user));
@@ -16919,54 +16950,59 @@ static void test_bug31669()
buff[LARGE_BUFFER_SIZE]= 0;
strxmov(query, "GRANT ALL PRIVILEGES ON *.* TO '", user, "'@'%' IDENTIFIED BY "
"'", buff, "' WITH GRANT OPTION", NullS);
- rc= mysql_query(mysql, query);
+ rc= mysql_query(conn, query);
myquery(rc);
strxmov(query, "GRANT ALL PRIVILEGES ON *.* TO '", user, "'@'localhost' IDENTIFIED BY "
"'", buff, "' WITH GRANT OPTION", NullS);
- rc= mysql_query(mysql, query);
+ rc= mysql_query(conn, query);
myquery(rc);
- rc= mysql_query(mysql, "FLUSH PRIVILEGES");
+ rc= mysql_query(conn, "FLUSH PRIVILEGES");
myquery(rc);
- rc= mysql_change_user(mysql, user, buff, db);
+ rc= mysql_change_user(conn, user, buff, db);
DIE_UNLESS(!rc);
user[USERNAME_CHAR_LENGTH-1]= 'a';
- rc= mysql_change_user(mysql, user, buff, db);
+ rc= mysql_change_user(conn, user, buff, db);
DIE_UNLESS(rc);
user[USERNAME_CHAR_LENGTH-1]= 'b';
buff[LARGE_BUFFER_SIZE-1]= 'd';
- rc= mysql_change_user(mysql, user, buff, db);
+ rc= mysql_change_user(conn, user, buff, db);
DIE_UNLESS(rc);
buff[LARGE_BUFFER_SIZE-1]= 'c';
db[NAME_CHAR_LEN-1]= 'e';
- rc= mysql_change_user(mysql, user, buff, db);
+ rc= mysql_change_user(conn, user, buff, db);
DIE_UNLESS(rc);
+ mysql_close(conn);
+ conn= client_connect(0, MYSQL_PROTOCOL_TCP, 0);
+
db[NAME_CHAR_LEN-1]= 'a';
- rc= mysql_change_user(mysql, user, buff, db);
+ rc= mysql_change_user(conn, user, buff, db);
DIE_UNLESS(!rc);
- rc= mysql_change_user(mysql, user + 1, buff + 1, db + 1);
+ rc= mysql_change_user(conn, user + 1, buff + 1, db + 1);
DIE_UNLESS(rc);
- rc = mysql_change_user(mysql, opt_user, opt_password, current_db);
+ rc = mysql_change_user(conn, opt_user, opt_password, current_db);
DIE_UNLESS(!rc);
strxmov(query, "DROP DATABASE ", db, NullS);
- rc= mysql_query(mysql, query);
+ rc= mysql_query(conn, query);
myquery(rc);
strxmov(query, "DELETE FROM mysql.user WHERE User='", user, "'", NullS);
- rc= mysql_query(mysql, query);
+ rc= mysql_query(conn, query);
myquery(rc);
- DIE_UNLESS(mysql_affected_rows(mysql) == 2);
+ DIE_UNLESS(mysql_affected_rows(conn) == 2);
#endif
+ mysql_close(conn);
+
DBUG_VOID_RETURN;
}
diff --git a/win/create_def_file.js b/win/create_def_file.js
index 812d68ce85e..5fb28ef0bee 100644
--- a/win/create_def_file.js
+++ b/win/create_def_file.js
@@ -169,6 +169,7 @@ function ScrubSymbol(symbol)
function IsCompilerDefinedSymbol(symbol)
{
return ((symbol.indexOf("__real@") != -1) ||
+ (symbol.indexOf("_xmm@") != -1) ||
(symbol.indexOf("_RTC_") != -1) ||
(symbol.indexOf("??_C@_") != -1) ||
(symbol.indexOf("??_R") != -1) ||