diff --git a/bin/pt-mysql-summary b/bin/pt-mysql-summary index 3c794eb8..e708dccb 100755 --- a/bin/pt-mysql-summary +++ b/bin/pt-mysql-summary @@ -1994,6 +1994,19 @@ section_mysql_files () { done } +section_percona_xtradb_cluster () { + local mysql_var="$1" + local mysql_status="$2" + + name_val "Cluster" "$(get_var "wsrep_cluster_name" "$mysql_var")" + name_val "Node" "$(get_var "wsrep_node_name" "$mysql_var")" + name_val "Node status" "$(get_var "wsrep_cluster_status" "$mysql_status")" + name_val "Cluster address" "$(get_var "wsrep_cluster_address" "$mysql_var")" + name_val "SST method" "$(get_var "wsrep_sst_method" "$mysql_var")" + name_val "Cluster size" "$(get_var "wsrep_cluster_size" "$mysql_status")" + name_val "Cluster nodes" "$(get_var "wsrep_incoming_addresses" "$mysql_status")" +} + report_mysql_summary () { local dir="$1" @@ -2060,6 +2073,17 @@ report_mysql_summary () { section "Key Percona Server features" section_percona_server_features "$dir/mysql-variables" + section "Percona XtraDB Cluster" + local has_wsrep="$(get_var "wsrep_on" "$dir/mysql-variables")" + if [ -n "${has_wsrep:-""}" ]; then + local wsrep_on="$(feat_on "$dir/mysql-variables" "wsrep_on")" + if [ "${wsrep_on:-""}" = "Enabled" ]; then + section_percona_xtradb_cluster "$dir/mysql-variables" "$dir/mysql-status" + else + name_val "wsrep_on" "OFF" + fi + fi + section "Plugins" name_val "InnoDB compression" "$(get_plugin_status "$dir/mysql-plugins" "INNODB_CMP")" diff --git a/lib/bash/report_mysql_info.sh b/lib/bash/report_mysql_info.sh index d0909ce2..f73c3282 100644 --- a/lib/bash/report_mysql_info.sh +++ b/lib/bash/report_mysql_info.sh @@ -1091,6 +1091,19 @@ section_mysql_files () { done } +section_percona_xtradb_cluster () { + local mysql_var="$1" + local mysql_status="$2" + + name_val "Cluster" "$(get_var "wsrep_cluster_name" "$mysql_var")" + name_val "Node" "$(get_var "wsrep_node_name" "$mysql_var")" + name_val "Node status" "$(get_var "wsrep_cluster_status" "$mysql_status")" + name_val "Cluster address" "$(get_var "wsrep_cluster_address" "$mysql_var")" + name_val "SST method" "$(get_var "wsrep_sst_method" "$mysql_var")" + name_val "Cluster size" "$(get_var "wsrep_cluster_size" "$mysql_status")" + name_val "Cluster nodes" "$(get_var "wsrep_incoming_addresses" "$mysql_status")" +} + report_mysql_summary () { local dir="$1" @@ -1180,6 +1193,20 @@ report_mysql_summary () { section "Key Percona Server features" section_percona_server_features "$dir/mysql-variables" + # ######################################################################## + # Percona XtraDB Cluster data + # ######################################################################## + section "Percona XtraDB Cluster" + local has_wsrep="$(get_var "wsrep_on" "$dir/mysql-variables")" + if [ -n "${has_wsrep:-""}" ]; then + local wsrep_on="$(feat_on "$dir/mysql-variables" "wsrep_on")" + if [ "${wsrep_on:-""}" = "Enabled" ]; then + section_percona_xtradb_cluster "$dir/mysql-variables" "$dir/mysql-status" + else + name_val "wsrep_on" "OFF" + fi + fi + # ######################################################################## # Plugins # ######################################################################## diff --git a/t/lib/bash/report_mysql_info.sh b/t/lib/bash/report_mysql_info.sh index 0920e1fd..81c702fb 100644 --- a/t/lib/bash/report_mysql_info.sh +++ b/t/lib/bash/report_mysql_info.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -plan 34 +plan 36 . "$LIB_DIR/alt_cmds.sh" . "$LIB_DIR/log_warn_die.sh" @@ -739,6 +739,19 @@ no_diff \ "$samples/expected_output_temp004.txt" \ "report_mysql_summary, dir: temp004" +report_mysql_summary "$samples/temp006" 2>/dev/null | tail -n+3 > "$PT_TMPDIR/got" +no_diff \ + "$PT_TMPDIR/got" \ + "$samples/expected_output_temp006.txt" \ + "report_mysql_summary, dir: temp006 (PXC, cluster node)" + +report_mysql_summary "$samples/temp007" 2>/dev/null | tail -n+3 > "$PT_TMPDIR/got" +no_diff \ + "$PT_TMPDIR/got" \ + "$samples/expected_output_temp007.txt" \ + "report_mysql_summary, dir: temp007 (PXC, traditional master)" + + # ########################################################################### # Done # ########################################################################### diff --git a/t/pt-mysql-summary/pt-mysql-summary.t b/t/pt-mysql-summary/pt-mysql-summary.t index 6633e383..5dcd5395 100644 --- a/t/pt-mysql-summary/pt-mysql-summary.t +++ b/t/pt-mysql-summary/pt-mysql-summary.t @@ -56,7 +56,7 @@ like( ); # --read-samples -for my $i (2..5) { +for my $i (2..7) { ok( no_diff( sub { diff --git a/t/pt-mysql-summary/samples/expected_output_temp002.txt b/t/pt-mysql-summary/samples/expected_output_temp002.txt index 26ff2d2c..fa2a4646 100644 --- a/t/pt-mysql-summary/samples/expected_output_temp002.txt +++ b/t/pt-mysql-summary/samples/expected_output_temp002.txt @@ -123,6 +123,7 @@ Uptime 90000 1 1 Smooth Flushing | Not Supported HandlerSocket NoSQL | Not Supported Fast Hash UDFs | Unknown +# Percona XtraDB Cluster ##################################### # Plugins #################################################### InnoDB compression | ACTIVE # Query cache ################################################ diff --git a/t/pt-mysql-summary/samples/expected_output_temp003.txt b/t/pt-mysql-summary/samples/expected_output_temp003.txt index fad40466..dd297a63 100644 --- a/t/pt-mysql-summary/samples/expected_output_temp003.txt +++ b/t/pt-mysql-summary/samples/expected_output_temp003.txt @@ -99,6 +99,7 @@ Uptime 90000 1 1 Smooth Flushing | Not Supported HandlerSocket NoSQL | Not Supported Fast Hash UDFs | Unknown +# Percona XtraDB Cluster ##################################### # Plugins #################################################### InnoDB compression | Not found # Query cache ################################################ diff --git a/t/pt-mysql-summary/samples/expected_output_temp004.txt b/t/pt-mysql-summary/samples/expected_output_temp004.txt index f5de6c54..da18e588 100644 --- a/t/pt-mysql-summary/samples/expected_output_temp004.txt +++ b/t/pt-mysql-summary/samples/expected_output_temp004.txt @@ -98,6 +98,7 @@ Uptime 90000 1 1 Smooth Flushing | Not Supported HandlerSocket NoSQL | Not Supported Fast Hash UDFs | Unknown +# Percona XtraDB Cluster ##################################### # Plugins #################################################### InnoDB compression | Not found # Query cache ################################################ diff --git a/t/pt-mysql-summary/samples/expected_output_temp005.txt b/t/pt-mysql-summary/samples/expected_output_temp005.txt index 98c6d2de..15f5afd5 100644 --- a/t/pt-mysql-summary/samples/expected_output_temp005.txt +++ b/t/pt-mysql-summary/samples/expected_output_temp005.txt @@ -141,6 +141,7 @@ Uptime 90000 1 1 Smooth Flushing | Enabled HandlerSocket NoSQL | Not Supported Fast Hash UDFs | Unknown +# Percona XtraDB Cluster ##################################### # Plugins #################################################### InnoDB compression | ACTIVE # Query cache ################################################ diff --git a/t/pt-mysql-summary/samples/expected_output_temp006.txt b/t/pt-mysql-summary/samples/expected_output_temp006.txt new file mode 100644 index 00000000..6006847c --- /dev/null +++ b/t/pt-mysql-summary/samples/expected_output_temp006.txt @@ -0,0 +1,335 @@ +# Instances ################################################## + Port Data Directory Nice OOM Socket + ===== ========================== ==== === ====== + 12345 /tmp/12345/data 0 0 /tmp/12345/mysql_sandbox12345.sock + 12346 /tmp/12346/data 0 0 /tmp/12346/mysql_sandbox12346.sock + 12347 /tmp/12347/data 0 0 /tmp/12347/mysql_sandbox12347.sock +# MySQL Executable ########################################### +# Report On Port 12345 ####################################### + User | msandbox@% + Time | 2012-11-27 17:38:42 (ART) + Hostname | hugmeir + Version | 5.5.28-23.7-log Percona XtraDB Cluster (GPL) 5.5.28-23.7, Revision 373, wsrep_23.7.r3821 + Built On | Linux i686 + Started | 2012-11-27 16:56 (up 0+00:41:51) + Databases | 5 + Datadir | /tmp/12345/data/ + Processes | 4 connected, 1 running + Replication | Is not a slave, has 0 slaves connected + Pidfile | /tmp/12345/data/mysql_sandbox12345.pid (exists) +# Processlist ################################################ + + Command COUNT(*) Working SUM(Time) MAX(Time) + ------------------------------ -------- ------- --------- --------- + Query 1 1 0 0 + Sleep 3 0 8000 2500 + + User COUNT(*) Working SUM(Time) MAX(Time) + ------------------------------ -------- ------- --------- --------- + msandbox 1 1 0 0 + system user 3 0 0 0 + + Host COUNT(*) Working SUM(Time) MAX(Time) + ------------------------------ -------- ------- --------- --------- + 3 0 0 0 + localhost 1 1 0 0 + + db COUNT(*) Working SUM(Time) MAX(Time) + ------------------------------ -------- ------- --------- --------- + NULL 4 1 0 0 + + State COUNT(*) Working SUM(Time) MAX(Time) + ------------------------------ -------- ------- --------- --------- + NULL 2 0 0 0 + sleeping 1 1 0 0 + wsrep aborter idle 1 0 0 0 + +# Status Counters (Wait 10 Seconds) ########################## +Variable Per day Per second 10 secs +Binlog_cache_disk_use 35 +Binlog_cache_use 150 +Binlog_stmt_cache_use 35 +Bytes_received 125000000 1250 225 +Bytes_sent 25000000 300 2500 +Com_admin_commands 35 +Com_alter_table 70 +Com_begin 35 +Com_change_db 2000 +Com_checksum 35 +Com_commit 70 +Com_create_db 70 +Com_create_function 100 +Com_create_procedure 100 +Com_create_table 700 +Com_create_trigger 200 +Com_create_view 250 +Com_drop_db 35 +Com_drop_table 35 +Com_flush 70 +Com_insert 35000 +Com_load 35 +Com_rollback 35 +Com_select 10000 1 +Com_set_option 12500 +Com_show_binlogs 400 +Com_show_create_db 100 +Com_show_create_func 100 +Com_show_create_proc 100 +Com_show_create_table 3500 +Com_show_create_trigger 200 +Com_show_databases 450 +Com_show_engine_status 400 +Com_show_fields 1750 +Com_show_function_status 100 +Com_show_master_status 400 +Com_show_plugins 400 +Com_show_procedure_status 100 +Com_show_processlist 400 +Com_show_slave_status 400 +Com_show_status 600 +Com_show_table_status 1750 +Com_show_tables 250 +Com_show_triggers 1750 +Com_show_variables 400 +Com_update 35 +Connections 7000 1 +Created_tmp_disk_tables 8000 1 +Created_tmp_files 250 +Created_tmp_tables 35000 6 +Flush_commands 100 +Handler_commit 8000 +Handler_prepare 6000 +Handler_read_first 900 +Handler_read_key 800 +Handler_read_next 1250 +Handler_read_rnd_next 2250000 25 45 +Handler_rollback 1000 +Handler_update 200 +Handler_write 2000000 25 45 +Innodb_adaptive_hash_cells 5000000 60 +Innodb_adaptive_hash_heap_buffers 200 +Innodb_adaptive_hash_hash_searches 4500000 50 +Innodb_adaptive_hash_non_hash_searches 1750000 20 +Innodb_background_log_sync 1500 +Innodb_buffer_pool_pages_flushed 30000 +Innodb_buffer_pool_pages_old 8000 +Innodb_buffer_pool_read_requests 15000000 175 +Innodb_buffer_pool_write_requests 8000000 90 +Innodb_checkpoint_max_age 250000000 3000 +Innodb_checkpoint_target_age 250000000 3000 +Innodb_data_fsyncs 4500 +Innodb_data_writes 35000 +Innodb_data_written 1250000000 15000 +Innodb_dblwr_pages_written 25000 +Innodb_dblwr_writes 600 +Innodb_dict_tables 900 +Innodb_history_list_length 35 +Innodb_ibuf_segment_size 70 +Innodb_ibuf_size 35 +Innodb_log_write_requests 600000 7 +Innodb_log_writes 2500 +Innodb_lsn_current 300000000 3500 +Innodb_lsn_flushed 300000000 3500 +Innodb_lsn_last_checkpoint 300000000 3500 +Innodb_master_thread_1_second_loops 1500 +Innodb_master_thread_10_second_loops 150 +Innodb_master_thread_background_loops 100 +Innodb_master_thread_main_flush_loops 100 +Innodb_master_thread_sleeps 1500 +Innodb_max_trx_id 30000 +Innodb_mem_adaptive_hash 22500000 250 +Innodb_mem_dictionary 8000000 90 +Innodb_mem_total 1250000000 12500 +Innodb_mutex_os_waits 200 +Innodb_mutex_spin_rounds 9000 +Innodb_mutex_spin_waits 400 +Innodb_oldest_view_low_limit_trx_id 30000 +Innodb_os_log_fsyncs 3000 +Innodb_os_log_written 300000000 3500 +Innodb_pages_created 25000 +Innodb_pages_written 30000 +Innodb_purge_trx_id 30000 +Innodb_rows_inserted 1750000 20 +Innodb_rows_read 1750000 20 +Innodb_s_lock_os_waits 800 +Innodb_s_lock_spin_rounds 25000 +Innodb_s_lock_spin_waits 800 +Innodb_x_lock_os_waits 300 +Innodb_x_lock_spin_rounds 9000 +Key_read_requests 1500 +Key_reads 35 +Key_write_requests 400 +Key_writes 400 +Open_table_definitions 1750 +Opened_files 45000 4 +Opened_table_definitions 3500 +Opened_tables 4000 +Queries 80000 4 +Questions 50000 4 +Select_scan 8000 +Sort_scan 70 +Table_locks_immediate 7000 +Threads_created 7000 1 +Uptime 90000 1 1 +binlog_commits 175 +binlog_group_commits 175 +wsrep_protocol_version 150 +wsrep_last_committed 1750 +wsrep_replicated 1750 +wsrep_replicated_bytes 125000000 1250 +wsrep_received 400 +wsrep_received_bytes 22500 +wsrep_local_commits 150 +wsrep_local_state 150 +wsrep_cert_index_size 2500000 30 +wsrep_cluster_conf_id 100 +wsrep_cluster_size 100 +# Table cache ################################################ + Size | 400 + Usage | 10% +# Key Percona Server features ################################ + Table & Index Stats | Not Supported + Multiple I/O Threads | Enabled + Corruption Resilient | Not Supported + Durable Replication | Not Supported + Import InnoDB Tables | Not Supported + Fast Server Restarts | Not Supported + Enhanced Logging | Not Supported + Replica Perf Logging | Disabled + Response Time Hist. | Not Supported + Smooth Flushing | Not Supported + HandlerSocket NoSQL | Not Supported + Fast Hash UDFs | Unknown +# Percona XtraDB Cluster ##################################### + Cluster | pt_sandbox_cluster + Node | 12345 + Node status | Primary + Cluster address | gcomm:// + SST method | rsync + Cluster size | 3 + Cluster nodes | 192.168.0.100,192.168.0.100,192.168.0.100 +# Plugins #################################################### + InnoDB compression | ACTIVE +# Query cache ################################################ + query_cache_type | ON + Size | 0.0 + Usage | 0% + HitToInsertRatio | 0% +# Schema ##################################################### + + Database Tables Views SPs Trigs Funcs FKs Partn + mysql 22 + percona_test 3 + sakila 16 7 3 6 3 22 + + Database MyISAM InnoDB + mysql 22 + percona_test 3 + sakila 7 16 + + Database BTREE + mysql 31 + percona_test 2 + sakila 63 + + c t s e l d i t s t b v b y d m + h i e n o a n i m e i a l e e e + a m t u n t t n a x g r o a c d + r e m g e y l t i c b r i i + s b t i l n h m u + t l i n i t a a m + a o m t n r l i + m b e t n + p t + Database === === === === === === === === === === === === === === === === + mysql 61 8 6 78 5 4 19 3 3 4 8 3 4 + percona_test 3 2 + sakila 1 15 1 3 4 2 19 26 7 42 1 1 7 2 + +# Noteworthy Technologies #################################### + Full Text Indexing | No + Geospatial Types | No + Foreign Keys | Yes + Partitioning | No + InnoDB Compression | No + SSL | No + Explicit LOCK TABLES | No + Delayed Insert | No + XA Transactions | No + NDB Cluster | No + Prepared Statements | No + Prepared statement count | 0 +# InnoDB ##################################################### + Version | 1.1.8-rel29.1 + Buffer Pool Size | 32.0M + Buffer Pool Fill | 35% + Buffer Pool Dirty | 0% + File Per Table | OFF + Page Size | 16k + Log File Size | 2 * 5.0M = 10.0M + Log Buffer Size | 8M + Flush Method | + Flush Log At Commit | 1 + XA Support | ON + Checksums | ON + Doublewrite | ON + R/W I/O Threads | 4 4 + I/O Capacity | 200 + Thread Concurrency | 0 + Concurrency Tickets | 500 + Commit Concurrency | 0 + Txn Isolation Level | REPEATABLE-READ + Adaptive Flushing | ON + Adaptive Checkpoint | + Checkpoint Age | 0 + InnoDB Queue | 0 queries inside InnoDB, 0 queries in queue + Oldest Transaction | 0 Seconds + History List Len | 1 + Read Views | 1 + Undo Log Entries | 0 transactions, 0 total undo, 0 max undo + Pending I/O Reads | 0 buf pool reads, 0 normal AIO, 0 ibuf AIO, 0 preads + Pending I/O Writes | 0 buf pool (0 LRU, 0 flush list, 0 page); 0 AIO, 0 sync, 0 log IO (0 log, 0 chkp); 0 pwrites + Pending I/O Flushes | 0 buf pool, 0 log + Transaction States | 1xnot started +# MyISAM ##################################################### + Key Cache | 16.0M + Pct Used | 10% + Unflushed | 0% +# Security ################################################### + Users | 2 users, 0 anon, 0 w/o pw, 0 old pw + Old Passwords | OFF +# Binary Logging ############################################# + Binlogs | 1 + Zero-Sized | 0 + Total Size | 1.4M + binlog_format | ROW + expire_logs_days | 0 + sync_binlog | 0 + server_id | 12345 + binlog_do_db | + binlog_ignore_db | +# Noteworthy Variables ####################################### + Auto-Inc Incr/Offset | 3/1 + default_storage_engine | InnoDB + flush_time | 0 + init_connect | + init_file | + sql_mode | + join_buffer_size | 128k + sort_buffer_size | 2M + read_buffer_size | 128k + read_rnd_buffer_size | 256k + bulk_insert_buffer | 0.00 + max_heap_table_size | 16M + tmp_table_size | 16M + max_allowed_packet | 1M + thread_stack | 192k + log | ON + log_error | /tmp/12345/data/mysqld.log + log_warnings | 1 + log_slow_queries | OFF +log_queries_not_using_indexes | OFF + log_slave_updates | ON +# Configuration File ######################################### + Config File | Cannot autodetect or find, giving up +# The End #################################################### diff --git a/t/pt-mysql-summary/samples/expected_output_temp007.txt b/t/pt-mysql-summary/samples/expected_output_temp007.txt new file mode 100644 index 00000000..65ac0cb5 --- /dev/null +++ b/t/pt-mysql-summary/samples/expected_output_temp007.txt @@ -0,0 +1,295 @@ +# Instances ################################################## + Port Data Directory Nice OOM Socket + ===== ========================== ==== === ====== + 12345 /tmp/12345/data 0 0 /tmp/12345/mysql_sandbox12345.sock + 12346 /tmp/12346/data 0 0 /tmp/12346/mysql_sandbox12346.sock + 12347 /tmp/12347/data 0 0 /tmp/12347/mysql_sandbox12347.sock +# MySQL Executable ########################################### + Path to executable | /home/hugmeir/mysql5/mysqlbrew/mysqls/Percona-XtraDB-Cluster-5.5.28-23.7.373.Linux.i686/bin/mysqld + Has symbols | Yes +# Report On Port 12345 ####################################### + User | msandbox@% + Time | 2012-11-27 18:59:59 (ART) + Hostname | hugmeir + Version | 5.5.28-23.7-log Percona XtraDB Cluster (GPL) 5.5.28-23.7, Revision 373, wsrep_23.7.r3821 + Built On | Linux i686 + Started | 2012-11-27 18:58 (up 0+00:01:36) + Databases | 5 + Datadir | /tmp/12345/data/ + Processes | 2 connected, 2 running + Replication | Is not a slave, has 1 slaves connected + Pidfile | /tmp/12345/data/mysql_sandbox12345.pid (exists) +# Processlist ################################################ + + Command COUNT(*) Working SUM(Time) MAX(Time) + ------------------------------ -------- ------- --------- --------- + Binlog Dump 1 1 90 90 + Query 1 1 0 0 + + User COUNT(*) Working SUM(Time) MAX(Time) + ------------------------------ -------- ------- --------- --------- + msandbox 2 2 90 90 + + Host COUNT(*) Working SUM(Time) MAX(Time) + ------------------------------ -------- ------- --------- --------- + localhost 2 2 90 90 + + db COUNT(*) Working SUM(Time) MAX(Time) + ------------------------------ -------- ------- --------- --------- + NULL 2 2 90 90 + + State COUNT(*) Working SUM(Time) MAX(Time) + ------------------------------ -------- ------- --------- --------- + Master has sent all binlog to 1 1 90 90 + NULL 1 1 0 0 + +# Status Counters (Wait 10 Seconds) ########################## +Variable Per day Per second 11 secs +Binlog_cache_disk_use 900 +Binlog_cache_use 3500 +Binlog_stmt_cache_use 900 +Bytes_received 3000000000 35000 200 +Bytes_sent 3000000000 35000 2250 +Com_admin_commands 1750 +Com_begin 900 +Com_change_db 1750 +Com_checksum 900 +Com_commit 1750 +Com_create_db 1750 +Com_create_function 2500 +Com_create_procedure 2500 +Com_create_table 17500 +Com_create_trigger 5000 +Com_create_view 6000 +Com_drop_db 900 +Com_drop_table 900 +Com_insert 1000000 10 +Com_load 900 +Com_rollback 900 +Com_select 15000 1 +Com_set_option 10000 +Com_show_engine_status 900 +Com_show_status 900 +Com_show_tables 900 +Com_show_variables 1750 +Com_update 900 +Connections 12500 1 +Created_tmp_files 6000 +Created_tmp_tables 3500 6 +Flush_commands 900 +Handler_commit 125000 1 +Handler_prepare 100000 1 +Handler_read_first 17500 +Handler_read_key 15000 +Handler_read_rnd_next 45000000 500 40 +Handler_rollback 12500 +Handler_update 5000 +Handler_write 45000000 500 40 +Innodb_adaptive_hash_cells 125000000 1500 +Innodb_adaptive_hash_heap_buffers 5000 +Innodb_adaptive_hash_hash_searches 125000000 1250 +Innodb_adaptive_hash_non_hash_searches 50000000 500 +Innodb_background_log_sync 30000 +Innodb_buffer_pool_pages_flushed 700000 8 +Innodb_buffer_pool_pages_old 200000 2 +Innodb_buffer_pool_read_requests 400000000 4500 +Innodb_buffer_pool_write_requests 200000000 2500 +Innodb_checkpoint_max_age 7000000000 80000 +Innodb_checkpoint_target_age 7000000000 80000 +Innodb_data_fsyncs 100000 1 +Innodb_data_writes 900000 9 +Innodb_data_written 30000000000 350000 +Innodb_dblwr_pages_written 600000 6 +Innodb_dblwr_writes 15000 +Innodb_dict_tables 22500 +Innodb_ibuf_segment_size 1750 +Innodb_ibuf_size 900 +Innodb_log_write_requests 15000000 175 +Innodb_log_writes 60000 +Innodb_lsn_current 8000000000 90000 +Innodb_lsn_flushed 8000000000 90000 +Innodb_lsn_last_checkpoint 8000000000 90000 +Innodb_master_thread_1_second_loops 30000 +Innodb_master_thread_10_second_loops 2500 +Innodb_master_thread_background_loops 3500 +Innodb_master_thread_main_flush_loops 3500 +Innodb_master_thread_sleeps 30000 +Innodb_max_trx_id 800000 8 +Innodb_mem_adaptive_hash 600000000 7000 +Innodb_mem_dictionary 200000000 2250 +Innodb_mem_total 30000000000 350000 +Innodb_mutex_os_waits 3500 +Innodb_mutex_spin_rounds 200000 2 +Innodb_mutex_spin_waits 12500 +Innodb_oldest_view_low_limit_trx_id 700000 8 +Innodb_os_log_fsyncs 80000 +Innodb_os_log_written 8000000000 90000 +Innodb_pages_created 600000 7 +Innodb_pages_written 700000 8 +Innodb_rows_inserted 40000000 500 +Innodb_rows_read 40000000 500 +Innodb_s_lock_os_waits 22500 +Innodb_s_lock_spin_rounds 600000 7 +Innodb_s_lock_spin_waits 22500 +Innodb_x_lock_os_waits 7000 +Innodb_x_lock_spin_rounds 225000 2 +Key_read_requests 25000000 300 +Key_reads 900 +Key_write_requests 10000000 125 +Key_writes 200000 2 +Open_table_definitions 50000 +Opened_files 200000 2 4 +Opened_table_definitions 80000 +Opened_tables 80000 +Queries 1000000 10 3 +Questions 150000 1 3 +Select_scan 4500 +Table_locks_immediate 175000 1 +Threads_created 12500 1 +Uptime 90000 1 1 +binlog_commits 4500 +binlog_group_commits 4500 +wsrep_local_index 4000000000000 45000000 +# Table cache ################################################ + Size | 400 + Usage | 15% +# Key Percona Server features ################################ + Table & Index Stats | Not Supported + Multiple I/O Threads | Enabled + Corruption Resilient | Not Supported + Durable Replication | Not Supported + Import InnoDB Tables | Not Supported + Fast Server Restarts | Not Supported + Enhanced Logging | Not Supported + Replica Perf Logging | Disabled + Response Time Hist. | Not Supported + Smooth Flushing | Not Supported + HandlerSocket NoSQL | Not Supported + Fast Hash UDFs | Unknown +# Percona XtraDB Cluster ##################################### + wsrep_on | OFF +# Plugins #################################################### + InnoDB compression | ACTIVE +# Query cache ################################################ + query_cache_type | ON + Size | 0.0 + Usage | 0% + HitToInsertRatio | 0% +# Schema ##################################################### + + Database Tables Views SPs Trigs Funcs FKs Partn + mysql 22 + percona_test 3 + sakila 16 7 3 6 3 22 + + Database MyISAM InnoDB + mysql 22 + percona_test 3 + sakila 8 15 + + Database BTREE FULLTEXT + mysql 31 + percona_test 2 + sakila 63 1 + + c t s e l d i t s t b v b y d m + h i e n o a n i m e i a l e e e + a m t u n t t n a x g r o a c d + r e m g e y l t i c b r i i + s b t i l n h m u + t l i n i t a a m + a o m t n r l i + m b e t n + p t + Database === === === === === === === === === === === === === === === === + mysql 61 8 6 78 5 4 19 3 3 4 8 3 4 + percona_test 3 2 + sakila 1 15 1 3 4 2 19 26 7 42 1 1 7 2 + +# Noteworthy Technologies #################################### + Full Text Indexing | Yes + Geospatial Types | No + Foreign Keys | Yes + Partitioning | No + InnoDB Compression | No + SSL | No + Explicit LOCK TABLES | No + Delayed Insert | No + XA Transactions | No + NDB Cluster | No + Prepared Statements | No + Prepared statement count | 0 +# InnoDB ##################################################### + Version | 1.1.8-rel29.1 + Buffer Pool Size | 32.0M + Buffer Pool Fill | 35% + Buffer Pool Dirty | 0% + File Per Table | OFF + Page Size | 16k + Log File Size | 2 * 5.0M = 10.0M + Log Buffer Size | 8M + Flush Method | + Flush Log At Commit | 1 + XA Support | ON + Checksums | ON + Doublewrite | ON + R/W I/O Threads | 4 4 + I/O Capacity | 200 + Thread Concurrency | 0 + Concurrency Tickets | 500 + Commit Concurrency | 0 + Txn Isolation Level | REPEATABLE-READ + Adaptive Flushing | ON + Adaptive Checkpoint | + Checkpoint Age | 0 + InnoDB Queue | 0 queries inside InnoDB, 0 queries in queue + Oldest Transaction | 0 Seconds + History List Len | 0 + Read Views | 1 + Undo Log Entries | 0 transactions, 0 total undo, 0 max undo + Pending I/O Reads | 0 buf pool reads, 0 normal AIO, 0 ibuf AIO, 0 preads + Pending I/O Writes | 0 buf pool (0 LRU, 0 flush list, 0 page); 0 AIO, 0 sync, 0 log IO (0 log, 0 chkp); 0 pwrites + Pending I/O Flushes | 0 buf pool, 0 log + Transaction States | 1xnot started +# MyISAM ##################################################### + Key Cache | 16.0M + Pct Used | 10% + Unflushed | 0% +# Security ################################################### + Users | 2 users, 0 anon, 0 w/o pw, 0 old pw + Old Passwords | OFF +# Binary Logging ############################################# + Binlogs | 1 + Zero-Sized | 0 + Total Size | 3.1M + binlog_format | STATEMENT + expire_logs_days | 0 + sync_binlog | 0 + server_id | 12345 + binlog_do_db | + binlog_ignore_db | +# Noteworthy Variables ####################################### + Auto-Inc Incr/Offset | 1/1 + default_storage_engine | InnoDB + flush_time | 0 + init_connect | + init_file | + sql_mode | + join_buffer_size | 128k + sort_buffer_size | 2M + read_buffer_size | 128k + read_rnd_buffer_size | 256k + bulk_insert_buffer | 0.00 + max_heap_table_size | 16M + tmp_table_size | 16M + max_allowed_packet | 1M + thread_stack | 192k + log | ON + log_error | /tmp/12345/data/mysqld.log + log_warnings | 1 + log_slow_queries | OFF +log_queries_not_using_indexes | OFF + log_slave_updates | ON +# Configuration File ######################################### + Config File | Cannot autodetect or find, giving up +# The End #################################################### diff --git a/t/pt-mysql-summary/samples/expected_result_report_summary.txt b/t/pt-mysql-summary/samples/expected_result_report_summary.txt index 0a3cf207..07b59a5d 100644 --- a/t/pt-mysql-summary/samples/expected_result_report_summary.txt +++ b/t/pt-mysql-summary/samples/expected_result_report_summary.txt @@ -107,6 +107,7 @@ Uptime 90000 1 1 Smooth Flushing | Not Supported HandlerSocket NoSQL | Not Supported Fast Hash UDFs | Unknown +# Percona XtraDB Cluster ##################################### # Plugins #################################################### InnoDB compression | Not found # Query cache ################################################ diff --git a/t/pt-mysql-summary/samples/ps-mysqld-006.txt b/t/pt-mysql-summary/samples/ps-mysqld-006.txt new file mode 100644 index 00000000..492e9b91 --- /dev/null +++ b/t/pt-mysql-summary/samples/ps-mysqld-006.txt @@ -0,0 +1,4 @@ + PID TTY STAT TIME COMMAND +32324 pts/6 Sl 0:25 /home/hugmeir/mysql5/mysqlbrew/mysqls/Percona-XtraDB-Cluster-5.5.28-23.7.373.Linux.i686/bin/mysqld --defaults-file=/tmp/12345/my.sandbox.cnf +32419 pts/6 Sl 0:18 /home/hugmeir/mysql5/mysqlbrew/mysqls/Percona-XtraDB-Cluster-5.5.28-23.7.373.Linux.i686/bin/mysqld --defaults-file=/tmp/12346/my.sandbox.cnf +32578 pts/6 Sl 0:18 /home/hugmeir/mysql5/mysqlbrew/mysqls/Percona-XtraDB-Cluster-5.5.28-23.7.373.Linux.i686/bin/mysqld --defaults-file=/tmp/12347/my.sandbox.cnf diff --git a/t/pt-mysql-summary/samples/temp006/collect.err b/t/pt-mysql-summary/samples/temp006/collect.err new file mode 100644 index 00000000..e69de29b diff --git a/t/pt-mysql-summary/samples/temp006/innodb-status b/t/pt-mysql-summary/samples/temp006/innodb-status new file mode 100644 index 00000000..d0267bb3 --- /dev/null +++ b/t/pt-mysql-summary/samples/temp006/innodb-status @@ -0,0 +1,119 @@ +*************************** 1. row *************************** + Type: InnoDB + Name: +Status: +===================================== +121127 17:38:42 INNODB MONITOR OUTPUT +===================================== +Per second averages calculated from the last 53 seconds +----------------- +BACKGROUND THREAD +----------------- +srv_master_thread loops: 42 1_second, 42 sleeps, 4 10_second, 3 background, 3 flush +srv_master_thread log flush and writes: 45 +---------- +SEMAPHORES +---------- +OS WAIT ARRAY INFO: reservation count 39, signal count 39 +Mutex spin waits 11, rounds 271, OS waits 6 +RW-shared spins 24, rounds 720, OS waits 24 +RW-excl spins 0, rounds 270, OS waits 9 +Spin rounds per wait: 24.64 mutex, 30.00 RW-shared, 270.00 RW-excl +-------- +FILE I/O +-------- +I/O thread 0 state: waiting for completed aio requests (insert buffer thread) +I/O thread 1 state: waiting for completed aio requests (log thread) +I/O thread 2 state: waiting for completed aio requests (read thread) +I/O thread 3 state: waiting for completed aio requests (read thread) +I/O thread 4 state: waiting for completed aio requests (read thread) +I/O thread 5 state: waiting for completed aio requests (read thread) +I/O thread 6 state: waiting for completed aio requests (write thread) +I/O thread 7 state: waiting for completed aio requests (write thread) +I/O thread 8 state: waiting for completed aio requests (write thread) +I/O thread 9 state: waiting for completed aio requests (write thread) +Pending normal aio reads: 0 [0, 0, 0, 0] , aio writes: 0 [0, 0, 0, 0] , + ibuf aio reads: 0, log i/o's: 0, sync i/o's: 0 +Pending flushes (fsync) log: 0; buffer pool: 0 +0 OS file reads, 1067 OS file writes, 131 OS fsyncs +0.00 reads/s, 0 avg bytes/read, 0.00 writes/s, 0.00 fsyncs/s +------------------------------------- +INSERT BUFFER AND ADAPTIVE HASH INDEX +------------------------------------- +Ibuf: size 1, free list len 0, seg size 2, 0 merges +merged operations: + insert 0, delete mark 0, delete 0 +discarded operations: + insert 0, delete mark 0, delete 0 +Hash table size 138337, node heap has 7 buffer(s) +0.00 hash searches/s, 0.00 non-hash searches/s +--- +LOG +--- +Log sequence number 8809964 +Log flushed up to 8809964 +Last checkpoint at 8809964 +Max checkpoint age 7782360 +Checkpoint age target 7539162 +Modified age 0 +Checkpoint age 0 +0 pending log writes, 0 pending chkp writes +93 log i/o's done, 0.00 log i/o's/second +---------------------- +BUFFER POOL AND MEMORY +---------------------- +Total memory allocated 34062336; in additional pool allocated 0 +Internal hash tables (constant factor + variable factor) + Adaptive hash index 672196 (553348 + 118848) + Page hash 17692 (buffer pool 0 only) + Dictionary cache 221035 (139064 + 81971) + File system 41792 (41336 + 456) + Lock system 42228 (41908 + 320) + Recovery system 0 (0 + 0) +Dictionary memory allocated 81971 +Buffer pool size 2047 +Buffer pool size, bytes 33538048 +Free buffers 1332 +Database pages 708 +Old database pages 241 +Modified db pages 0 +Pending reads 0 +Pending writes: LRU 0, flush list 0, single page 0 +Pages made young 0, not young 0 +0.00 youngs/s, 0.00 non-youngs/s +Pages read 0, created 708, written 916 +0.00 reads/s, 0.00 creates/s, 0.00 writes/s +No buffer pool page gets since the last printout +Pages read ahead 0.00/s, evicted without access 0.00/s, Random read ahead 0.00/s +LRU len: 708, unzip_LRU len: 0 +I/O sum[0]:cur[0], unzip sum[0]:cur[0] +-------------- +ROW OPERATIONS +-------------- +0 queries inside InnoDB, 0 queries in queue +1 read views open inside InnoDB +---OLDEST VIEW--- +Normal read view +Read view low limit trx n:o 338 +Read view up limit trx id 337 +Read view low limit trx id 339 +Read view individually stored trx ids: +Read view trx id 337 +----------------- +Main thread process no. 32324, id 2710072128, state: waiting for server activity +Number of rows inserted 47315, updated 0, deleted 0, read 47274 +0.00 inserts/s, 0.00 updates/s, 0.00 deletes/s, 0.00 reads/s +------------ +TRANSACTIONS +------------ +Trx id counter 34E +Purge done for trx's n:o < 338 undo n:o < 0 +History list length 1 +LIST OF TRANSACTIONS FOR EACH SESSION: +---TRANSACTION 0, not started +MySQL thread id 205, OS thread handle 0xa0822b40, query id 2462 localhost msandbox sleeping +SHOW /*!50000 ENGINE*/ INNODB STATUS +---------------------------- +END OF INNODB MONITOR OUTPUT +============================ + diff --git a/t/pt-mysql-summary/samples/temp006/mysql-databases b/t/pt-mysql-summary/samples/temp006/mysql-databases new file mode 100644 index 00000000..ff1205b2 --- /dev/null +++ b/t/pt-mysql-summary/samples/temp006/mysql-databases @@ -0,0 +1,5 @@ +information_schema +mysql +percona_test +performance_schema +sakila diff --git a/t/pt-mysql-summary/samples/temp006/mysql-master-logs b/t/pt-mysql-summary/samples/temp006/mysql-master-logs new file mode 100644 index 00000000..59d2be4d --- /dev/null +++ b/t/pt-mysql-summary/samples/temp006/mysql-master-logs @@ -0,0 +1 @@ +mysql-bin.000001 1518742 diff --git a/t/pt-mysql-summary/samples/temp006/mysql-master-status b/t/pt-mysql-summary/samples/temp006/mysql-master-status new file mode 100644 index 00000000..04927c45 --- /dev/null +++ b/t/pt-mysql-summary/samples/temp006/mysql-master-status @@ -0,0 +1 @@ +mysql-bin.000001 1518742 diff --git a/t/pt-mysql-summary/samples/temp006/mysql-plugins b/t/pt-mysql-summary/samples/temp006/mysql-plugins new file mode 100644 index 00000000..95fb6b17 --- /dev/null +++ b/t/pt-mysql-summary/samples/temp006/mysql-plugins @@ -0,0 +1,41 @@ +binlog ACTIVE STORAGE ENGINE NULL GPL +wsrep ACTIVE STORAGE ENGINE NULL GPL +mysql_native_password ACTIVE AUTHENTICATION NULL GPL +mysql_old_password ACTIVE AUTHENTICATION NULL GPL +MRG_MYISAM ACTIVE STORAGE ENGINE NULL GPL +MyISAM ACTIVE STORAGE ENGINE NULL GPL +MEMORY ACTIVE STORAGE ENGINE NULL GPL +CSV ACTIVE STORAGE ENGINE NULL GPL +PERFORMANCE_SCHEMA ACTIVE STORAGE ENGINE NULL GPL +InnoDB ACTIVE STORAGE ENGINE NULL GPL +INNODB_RSEG ACTIVE INFORMATION SCHEMA NULL GPL +INNODB_UNDO_LOGS ACTIVE INFORMATION SCHEMA NULL GPL +INNODB_TRX ACTIVE INFORMATION SCHEMA NULL GPL +INNODB_LOCKS ACTIVE INFORMATION SCHEMA NULL GPL +INNODB_LOCK_WAITS ACTIVE INFORMATION SCHEMA NULL GPL +INNODB_CMP ACTIVE INFORMATION SCHEMA NULL GPL +INNODB_CMP_RESET ACTIVE INFORMATION SCHEMA NULL GPL +INNODB_CMPMEM ACTIVE INFORMATION SCHEMA NULL GPL +INNODB_CMPMEM_RESET ACTIVE INFORMATION SCHEMA NULL GPL +INNODB_SYS_TABLES ACTIVE INFORMATION SCHEMA NULL GPL +INNODB_SYS_TABLESTATS ACTIVE INFORMATION SCHEMA NULL GPL +INNODB_SYS_INDEXES ACTIVE INFORMATION SCHEMA NULL GPL +INNODB_SYS_COLUMNS ACTIVE INFORMATION SCHEMA NULL GPL +INNODB_SYS_FIELDS ACTIVE INFORMATION SCHEMA NULL GPL +INNODB_SYS_FOREIGN ACTIVE INFORMATION SCHEMA NULL GPL +INNODB_SYS_FOREIGN_COLS ACTIVE INFORMATION SCHEMA NULL GPL +INNODB_SYS_STATS ACTIVE INFORMATION SCHEMA NULL GPL +INNODB_TABLE_STATS ACTIVE INFORMATION SCHEMA NULL GPL +INNODB_INDEX_STATS ACTIVE INFORMATION SCHEMA NULL GPL +INNODB_BUFFER_POOL_PAGES ACTIVE INFORMATION SCHEMA NULL GPL +INNODB_BUFFER_POOL_PAGES_INDEX ACTIVE INFORMATION SCHEMA NULL GPL +INNODB_BUFFER_POOL_PAGES_BLOB ACTIVE INFORMATION SCHEMA NULL GPL +XTRADB_ADMIN_COMMAND ACTIVE INFORMATION SCHEMA NULL GPL +INNODB_CHANGED_PAGES ACTIVE INFORMATION SCHEMA NULL GPL +INNODB_BUFFER_PAGE ACTIVE INFORMATION SCHEMA NULL GPL +INNODB_BUFFER_PAGE_LRU ACTIVE INFORMATION SCHEMA NULL GPL +INNODB_BUFFER_POOL_STATS ACTIVE INFORMATION SCHEMA NULL GPL +BLACKHOLE ACTIVE STORAGE ENGINE NULL GPL +ARCHIVE ACTIVE STORAGE ENGINE NULL GPL +FEDERATED DISABLED STORAGE ENGINE NULL GPL +partition ACTIVE STORAGE ENGINE NULL GPL diff --git a/t/pt-mysql-summary/samples/temp006/mysql-processlist b/t/pt-mysql-summary/samples/temp006/mysql-processlist new file mode 100644 index 00000000..bb3d0112 --- /dev/null +++ b/t/pt-mysql-summary/samples/temp006/mysql-processlist @@ -0,0 +1,48 @@ +*************************** 1. row *************************** + Id: 1 + User: system user + Host: + db: NULL + Command: Sleep + Time: 2510 + State: NULL + Info: NULL + Rows_sent: 0 +Rows_examined: 0 + Rows_read: 1 +*************************** 2. row *************************** + Id: 2 + User: system user + Host: + db: NULL + Command: Sleep + Time: 2510 + State: wsrep aborter idle + Info: NULL + Rows_sent: 0 +Rows_examined: 0 + Rows_read: 1 +*************************** 3. row *************************** + Id: 3 + User: system user + Host: + db: NULL + Command: Sleep + Time: 2507 + State: NULL + Info: NULL + Rows_sent: 0 +Rows_examined: 0 + Rows_read: 1 +*************************** 4. row *************************** + Id: 206 + User: msandbox + Host: localhost + db: NULL + Command: Query + Time: 0 + State: sleeping + Info: SHOW FULL PROCESSLIST + Rows_sent: 0 +Rows_examined: 0 + Rows_read: 1 diff --git a/t/pt-mysql-summary/samples/temp006/mysql-slave b/t/pt-mysql-summary/samples/temp006/mysql-slave new file mode 100644 index 00000000..e69de29b diff --git a/t/pt-mysql-summary/samples/temp006/mysql-status b/t/pt-mysql-summary/samples/temp006/mysql-status new file mode 100644 index 00000000..adf1e5c1 --- /dev/null +++ b/t/pt-mysql-summary/samples/temp006/mysql-status @@ -0,0 +1,410 @@ +Aborted_clients 0 +Aborted_connects 0 +Binlog_cache_disk_use 1 +Binlog_cache_use 4 +Binlog_stmt_cache_disk_use 0 +Binlog_stmt_cache_use 1 +Bytes_received 3315595 +Bytes_sent 796598 +Com_admin_commands 1 +Com_assign_to_keycache 0 +Com_alter_db 0 +Com_alter_db_upgrade 0 +Com_alter_event 0 +Com_alter_function 0 +Com_alter_procedure 0 +Com_alter_server 0 +Com_alter_table 2 +Com_alter_tablespace 0 +Com_analyze 0 +Com_begin 1 +Com_binlog 0 +Com_call_procedure 0 +Com_change_db 59 +Com_change_master 0 +Com_check 0 +Com_checksum 1 +Com_commit 2 +Com_create_db 2 +Com_create_event 0 +Com_create_function 3 +Com_create_index 0 +Com_create_procedure 3 +Com_create_server 0 +Com_create_table 19 +Com_create_trigger 6 +Com_create_udf 0 +Com_create_user 0 +Com_create_view 7 +Com_dealloc_sql 0 +Com_delete 0 +Com_delete_multi 0 +Com_do 0 +Com_drop_db 1 +Com_drop_event 0 +Com_drop_function 0 +Com_drop_index 0 +Com_drop_procedure 0 +Com_drop_server 0 +Com_drop_table 1 +Com_drop_trigger 0 +Com_drop_user 0 +Com_drop_view 0 +Com_empty_query 0 +Com_execute_sql 0 +Com_flush 2 +Com_grant 0 +Com_ha_close 0 +Com_ha_open 0 +Com_ha_read 0 +Com_help 0 +Com_insert 1059 +Com_insert_select 0 +Com_install_plugin 0 +Com_kill 0 +Com_load 1 +Com_lock_tables 0 +Com_optimize 0 +Com_preload_keys 0 +Com_prepare_sql 0 +Com_purge 0 +Com_purge_before_date 0 +Com_release_savepoint 0 +Com_rename_table 0 +Com_rename_user 0 +Com_repair 0 +Com_replace 0 +Com_replace_select 0 +Com_reset 0 +Com_resignal 0 +Com_revoke 0 +Com_revoke_all 0 +Com_rollback 1 +Com_rollback_to_savepoint 0 +Com_savepoint 0 +Com_select 326 +Com_set_option 373 +Com_signal 0 +Com_show_authors 0 +Com_show_binlog_events 0 +Com_show_binlogs 11 +Com_show_charsets 0 +Com_show_client_statistics 0 +Com_show_collations 0 +Com_show_contributors 0 +Com_show_create_db 3 +Com_show_create_event 0 +Com_show_create_func 3 +Com_show_create_proc 3 +Com_show_create_table 96 +Com_show_create_trigger 6 +Com_show_databases 13 +Com_show_engine_logs 0 +Com_show_engine_mutex 0 +Com_show_engine_status 12 +Com_show_events 0 +Com_show_errors 0 +Com_show_fields 48 +Com_show_function_status 3 +Com_show_grants 0 +Com_show_index_statistics 0 +Com_show_keys 0 +Com_show_master_status 11 +Com_show_open_tables 0 +Com_show_plugins 11 +Com_show_privileges 0 +Com_show_procedure_status 3 +Com_show_processlist 11 +Com_show_profile 0 +Com_show_profiles 0 +Com_show_relaylog_events 0 +Com_show_slave_hosts 0 +Com_show_slave_status 11 +Com_show_slave_status_nolock 0 +Com_show_status 18 +Com_show_storage_engines 0 +Com_show_table_statistics 0 +Com_show_table_status 48 +Com_show_tables 7 +Com_show_temporary_tables 0 +Com_show_thread_statistics 0 +Com_show_triggers 48 +Com_show_user_statistics 0 +Com_show_variables 12 +Com_show_warnings 0 +Com_slave_start 0 +Com_slave_stop 0 +Com_stmt_close 0 +Com_stmt_execute 0 +Com_stmt_fetch 0 +Com_stmt_prepare 0 +Com_stmt_reprepare 0 +Com_stmt_reset 0 +Com_stmt_send_long_data 0 +Com_truncate 0 +Com_uninstall_plugin 0 +Com_unlock_tables 0 +Com_update 1 +Com_update_multi 0 +Com_xa_commit 0 +Com_xa_end 0 +Com_xa_prepare 0 +Com_xa_recover 0 +Com_xa_rollback 0 +Com_xa_start 0 +Compression OFF +Connections 202 +Created_tmp_disk_tables 242 +Created_tmp_files 7 +Created_tmp_tables 976 +Delayed_errors 0 +Delayed_insert_threads 0 +Delayed_writes 0 +Flashcache_enabled OFF +Flush_commands 3 +Handler_commit 220 +Handler_delete 0 +Handler_discover 0 +Handler_prepare 183 +Handler_read_first 26 +Handler_read_key 23 +Handler_read_last 0 +Handler_read_next 36 +Handler_read_prev 0 +Handler_read_rnd 0 +Handler_read_rnd_next 61902 +Handler_rollback 32 +Handler_savepoint 0 +Handler_savepoint_rollback 0 +Handler_update 6 +Handler_write 59905 +Innodb_adaptive_hash_cells 138337 +Innodb_adaptive_hash_heap_buffers 6 +Innodb_adaptive_hash_hash_searches 129190 +Innodb_adaptive_hash_non_hash_searches 53308 +Innodb_background_log_sync 45 +Innodb_buffer_pool_pages_data 708 +Innodb_buffer_pool_pages_dirty 0 +Innodb_buffer_pool_pages_flushed 916 +Innodb_buffer_pool_pages_LRU_flushed 0 +Innodb_buffer_pool_pages_free 1332 +Innodb_buffer_pool_pages_made_not_young 0 +Innodb_buffer_pool_pages_made_young 0 +Innodb_buffer_pool_pages_misc 7 +Innodb_buffer_pool_pages_old 241 +Innodb_buffer_pool_pages_total 2047 +Innodb_buffer_pool_read_ahead_rnd 0 +Innodb_buffer_pool_read_ahead 0 +Innodb_buffer_pool_read_ahead_evicted 0 +Innodb_buffer_pool_read_requests 447048 +Innodb_buffer_pool_reads 0 +Innodb_buffer_pool_wait_free 0 +Innodb_buffer_pool_write_requests 236593 +Innodb_checkpoint_age 0 +Innodb_checkpoint_max_age 7782360 +Innodb_checkpoint_target_age 7539162 +Innodb_data_fsyncs 131 +Innodb_data_pending_fsyncs 0 +Innodb_data_pending_reads 0 +Innodb_data_pending_writes 0 +Innodb_data_read 0 +Innodb_data_reads 0 +Innodb_data_writes 1067 +Innodb_data_written 36013056 +Innodb_dblwr_pages_written 742 +Innodb_dblwr_writes 17 +Innodb_deadlocks 0 +Innodb_dict_tables 27 +Innodb_have_atomic_builtins ON +Innodb_history_list_length 1 +Innodb_ibuf_discarded_delete_marks 0 +Innodb_ibuf_discarded_deletes 0 +Innodb_ibuf_discarded_inserts 0 +Innodb_ibuf_free_list 0 +Innodb_ibuf_merged_delete_marks 0 +Innodb_ibuf_merged_deletes 0 +Innodb_ibuf_merged_inserts 0 +Innodb_ibuf_merges 0 +Innodb_ibuf_segment_size 2 +Innodb_ibuf_size 1 +Innodb_log_waits 0 +Innodb_log_write_requests 18226 +Innodb_log_writes 70 +Innodb_lsn_current 8809964 +Innodb_lsn_flushed 8809964 +Innodb_lsn_last_checkpoint 8809964 +Innodb_master_thread_1_second_loops 42 +Innodb_master_thread_10_second_loops 4 +Innodb_master_thread_background_loops 3 +Innodb_master_thread_main_flush_loops 3 +Innodb_master_thread_sleeps 42 +Innodb_max_trx_id 846 +Innodb_mem_adaptive_hash 672196 +Innodb_mem_dictionary 221035 +Innodb_mem_total 34062336 +Innodb_mutex_os_waits 6 +Innodb_mutex_spin_rounds 271 +Innodb_mutex_spin_waits 11 +Innodb_oldest_view_low_limit_trx_id 825 +Innodb_os_log_fsyncs 93 +Innodb_os_log_pending_fsyncs 0 +Innodb_os_log_pending_writes 0 +Innodb_os_log_written 8836608 +Innodb_page_size 16384 +Innodb_pages_created 708 +Innodb_pages_read 0 +Innodb_pages_written 916 +Innodb_purge_trx_id 824 +Innodb_purge_undo_no 0 +Innodb_row_lock_current_waits 0 +Innodb_current_row_locks 0 +Innodb_row_lock_time 0 +Innodb_row_lock_time_avg 0 +Innodb_row_lock_time_max 0 +Innodb_row_lock_waits 0 +Innodb_rows_deleted 0 +Innodb_rows_inserted 47315 +Innodb_rows_read 47274 +Innodb_rows_updated 0 +Innodb_s_lock_os_waits 24 +Innodb_s_lock_spin_rounds 720 +Innodb_s_lock_spin_waits 24 +Innodb_truncated_status_writes 0 +Innodb_x_lock_os_waits 9 +Innodb_x_lock_spin_rounds 270 +Innodb_x_lock_spin_waits 0 +Key_blocks_not_flushed 0 +Key_blocks_unused 14495 +Key_blocks_used 2 +Key_read_requests 47 +Key_reads 1 +Key_write_requests 12 +Key_writes 12 +Last_query_cost 0.000000 +Max_used_connections 4 +Not_flushed_delayed_rows 0 +Open_files 51 +Open_streams 0 +Open_table_definitions 50 +Open_tables 45 +Opened_files 1349 +Opened_table_definitions 107 +Opened_tables 109 +Performance_schema_cond_classes_lost 0 +Performance_schema_cond_instances_lost 0 +Performance_schema_file_classes_lost 0 +Performance_schema_file_handles_lost 0 +Performance_schema_file_instances_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_table_handles_lost 0 +Performance_schema_table_instances_lost 0 +Performance_schema_thread_classes_lost 0 +Performance_schema_thread_instances_lost 0 +Prepared_stmt_count 0 +Qcache_free_blocks 0 +Qcache_free_memory 0 +Qcache_hits 0 +Qcache_inserts 0 +Qcache_lowmem_prunes 0 +Qcache_not_cached 0 +Qcache_queries_in_cache 0 +Qcache_total_blocks 0 +Queries 2450 +Questions 1450 +Rpl_status AUTH_MASTER +Select_full_join 0 +Select_full_range_join 0 +Select_range 0 +Select_range_check 0 +Select_scan 243 +Slave_heartbeat_period 0.000 +Slave_open_temp_tables 0 +Slave_received_heartbeats 0 +Slave_retried_transactions 0 +Slave_running OFF +Slow_launch_threads 0 +Slow_queries 0 +Sort_merge_passes 0 +Sort_range 0 +Sort_rows 0 +Sort_scan 2 +Ssl_accept_renegotiates 0 +Ssl_accepts 0 +Ssl_callback_cache_hits 0 +Ssl_cipher +Ssl_cipher_list +Ssl_client_connects 0 +Ssl_connect_renegotiates 0 +Ssl_ctx_verify_depth 0 +Ssl_ctx_verify_mode 0 +Ssl_default_timeout 0 +Ssl_finished_accepts 0 +Ssl_finished_connects 0 +Ssl_session_cache_hits 0 +Ssl_session_cache_misses 0 +Ssl_session_cache_mode NONE +Ssl_session_cache_overflows 0 +Ssl_session_cache_size 0 +Ssl_session_cache_timeouts 0 +Ssl_sessions_reused 0 +Ssl_used_session_cache_entries 0 +Ssl_verify_depth 0 +Ssl_verify_mode 0 +Ssl_version +Table_locks_immediate 214 +Table_locks_waited 0 +Tc_log_max_pages_used 0 +Tc_log_page_size 0 +Tc_log_page_waits 0 +Threads_cached 0 +Threads_connected 4 +Threads_created 201 +Threads_running 1 +Uptime 2511 +Uptime_since_flush_status 2511 +binlog_commits 5 +binlog_group_commits 5 +wsrep_local_state_uuid 968bdd7e-38cc-11e2-0800-a86d39553d83 +wsrep_protocol_version 4 +wsrep_last_committed 49 +wsrep_replicated 49 +wsrep_replicated_bytes 3372882 +wsrep_received 11 +wsrep_received_bytes 658 +wsrep_local_commits 4 +wsrep_local_cert_failures 0 +wsrep_local_bf_aborts 0 +wsrep_local_replays 0 +wsrep_local_send_queue 0 +wsrep_local_send_queue_avg 0.000000 +wsrep_local_recv_queue 0 +wsrep_local_recv_queue_avg 0.000000 +wsrep_flow_control_paused 0.000000 +wsrep_flow_control_sent 0 +wsrep_flow_control_recv 0 +wsrep_cert_deps_distance 1.000000 +wsrep_apply_oooe 0.000000 +wsrep_apply_oool 0.000000 +wsrep_apply_window 0.000000 +wsrep_commit_oooe 0.000000 +wsrep_commit_oool 0.000000 +wsrep_commit_window 0.000000 +wsrep_local_state 4 +wsrep_local_state_comment Synced +wsrep_cert_index_size 73966 +wsrep_causal_reads 0 +wsrep_incoming_addresses 192.168.0.100,192.168.0.100,192.168.0.100 +wsrep_cluster_conf_id 3 +wsrep_cluster_size 3 +wsrep_cluster_state_uuid 968bdd7e-38cc-11e2-0800-a86d39553d83 +wsrep_cluster_status Primary +wsrep_connected ON +wsrep_local_index 0 +wsrep_provider_name Galera +wsrep_provider_vendor Codership Oy +wsrep_provider_version 2.2(r137) +wsrep_ready ON diff --git a/t/pt-mysql-summary/samples/temp006/mysql-status-defer b/t/pt-mysql-summary/samples/temp006/mysql-status-defer new file mode 100644 index 00000000..cb6cb4c4 --- /dev/null +++ b/t/pt-mysql-summary/samples/temp006/mysql-status-defer @@ -0,0 +1,410 @@ +Aborted_clients 0 0 +Aborted_connects 0 0 +Binlog_cache_disk_use 1 1 +Binlog_cache_use 4 4 +Binlog_stmt_cache_disk_use 0 0 +Binlog_stmt_cache_use 1 1 +Bytes_received 3315595 3317884 +Bytes_sent 796598 821862 +Com_admin_commands 1 1 +Com_assign_to_keycache 0 0 +Com_alter_db 0 0 +Com_alter_db_upgrade 0 0 +Com_alter_event 0 0 +Com_alter_function 0 0 +Com_alter_procedure 0 0 +Com_alter_server 0 0 +Com_alter_table 2 2 +Com_alter_tablespace 0 0 +Com_analyze 0 0 +Com_begin 1 1 +Com_binlog 0 0 +Com_call_procedure 0 0 +Com_change_db 59 59 +Com_change_master 0 0 +Com_check 0 0 +Com_checksum 1 1 +Com_commit 2 2 +Com_create_db 2 2 +Com_create_event 0 0 +Com_create_function 3 3 +Com_create_index 0 0 +Com_create_procedure 3 3 +Com_create_server 0 0 +Com_create_table 19 19 +Com_create_trigger 6 6 +Com_create_udf 0 0 +Com_create_user 0 0 +Com_create_view 7 7 +Com_dealloc_sql 0 0 +Com_delete 0 0 +Com_delete_multi 0 0 +Com_do 0 0 +Com_drop_db 1 1 +Com_drop_event 0 0 +Com_drop_function 0 0 +Com_drop_index 0 0 +Com_drop_procedure 0 0 +Com_drop_server 0 0 +Com_drop_table 1 1 +Com_drop_trigger 0 0 +Com_drop_user 0 0 +Com_drop_view 0 0 +Com_empty_query 0 0 +Com_execute_sql 0 0 +Com_flush 2 2 +Com_grant 0 0 +Com_ha_close 0 0 +Com_ha_open 0 0 +Com_ha_read 0 0 +Com_help 0 0 +Com_insert 1059 1059 +Com_insert_select 0 0 +Com_install_plugin 0 0 +Com_kill 0 0 +Com_load 1 1 +Com_lock_tables 0 0 +Com_optimize 0 0 +Com_preload_keys 0 0 +Com_prepare_sql 0 0 +Com_purge 0 0 +Com_purge_before_date 0 0 +Com_release_savepoint 0 0 +Com_rename_table 0 0 +Com_rename_user 0 0 +Com_repair 0 0 +Com_replace 0 0 +Com_replace_select 0 0 +Com_reset 0 0 +Com_resignal 0 0 +Com_revoke 0 0 +Com_revoke_all 0 0 +Com_rollback 1 1 +Com_rollback_to_savepoint 0 0 +Com_savepoint 0 0 +Com_select 326 345 +Com_set_option 373 373 +Com_signal 0 0 +Com_show_authors 0 0 +Com_show_binlog_events 0 0 +Com_show_binlogs 11 12 +Com_show_charsets 0 0 +Com_show_client_statistics 0 0 +Com_show_collations 0 0 +Com_show_contributors 0 0 +Com_show_create_db 3 3 +Com_show_create_event 0 0 +Com_show_create_func 3 3 +Com_show_create_proc 3 3 +Com_show_create_table 96 96 +Com_show_create_trigger 6 6 +Com_show_databases 13 14 +Com_show_engine_logs 0 0 +Com_show_engine_mutex 0 0 +Com_show_engine_status 12 13 +Com_show_events 0 0 +Com_show_errors 0 0 +Com_show_fields 48 48 +Com_show_function_status 3 3 +Com_show_grants 0 0 +Com_show_index_statistics 0 0 +Com_show_keys 0 0 +Com_show_master_status 11 12 +Com_show_open_tables 0 0 +Com_show_plugins 11 12 +Com_show_privileges 0 0 +Com_show_procedure_status 3 3 +Com_show_processlist 11 12 +Com_show_profile 0 0 +Com_show_profiles 0 0 +Com_show_relaylog_events 0 0 +Com_show_slave_hosts 0 0 +Com_show_slave_status 11 12 +Com_show_slave_status_nolock 0 0 +Com_show_status 18 19 +Com_show_storage_engines 0 0 +Com_show_table_statistics 0 0 +Com_show_table_status 48 48 +Com_show_tables 7 7 +Com_show_temporary_tables 0 0 +Com_show_thread_statistics 0 0 +Com_show_triggers 48 48 +Com_show_user_statistics 0 0 +Com_show_variables 12 12 +Com_show_warnings 0 0 +Com_slave_start 0 0 +Com_slave_stop 0 0 +Com_stmt_close 0 0 +Com_stmt_execute 0 0 +Com_stmt_fetch 0 0 +Com_stmt_prepare 0 0 +Com_stmt_reprepare 0 0 +Com_stmt_reset 0 0 +Com_stmt_send_long_data 0 0 +Com_truncate 0 0 +Com_uninstall_plugin 0 0 +Com_unlock_tables 0 0 +Com_update 1 1 +Com_update_multi 0 0 +Com_xa_commit 0 0 +Com_xa_end 0 0 +Com_xa_prepare 0 0 +Com_xa_recover 0 0 +Com_xa_rollback 0 0 +Com_xa_start 0 0 +Compression OFF OFF +Connections 202 216 +Created_tmp_disk_tables 242 253 +Created_tmp_files 7 7 +Created_tmp_tables 976 1045 +Delayed_errors 0 0 +Delayed_insert_threads 0 0 +Delayed_writes 0 0 +Flashcache_enabled OFF OFF +Flush_commands 3 3 +Handler_commit 220 220 +Handler_delete 0 0 +Handler_discover 0 0 +Handler_prepare 183 183 +Handler_read_first 26 26 +Handler_read_key 23 23 +Handler_read_last 0 0 +Handler_read_next 36 36 +Handler_read_prev 0 0 +Handler_read_rnd 0 0 +Handler_read_rnd_next 61902 62371 +Handler_rollback 32 32 +Handler_savepoint 0 0 +Handler_savepoint_rollback 0 0 +Handler_update 6 6 +Handler_write 59905 60367 +Innodb_adaptive_hash_cells 138337 138337 +Innodb_adaptive_hash_heap_buffers 6 6 +Innodb_adaptive_hash_hash_searches 129190 129190 +Innodb_adaptive_hash_non_hash_searches 53308 53308 +Innodb_background_log_sync 45 45 +Innodb_buffer_pool_pages_data 708 708 +Innodb_buffer_pool_pages_dirty 0 0 +Innodb_buffer_pool_pages_flushed 916 916 +Innodb_buffer_pool_pages_LRU_flushed 0 0 +Innodb_buffer_pool_pages_free 1332 1332 +Innodb_buffer_pool_pages_made_not_young 0 0 +Innodb_buffer_pool_pages_made_young 0 0 +Innodb_buffer_pool_pages_misc 7 7 +Innodb_buffer_pool_pages_old 241 241 +Innodb_buffer_pool_pages_total 2047 2047 +Innodb_buffer_pool_read_ahead_rnd 0 0 +Innodb_buffer_pool_read_ahead 0 0 +Innodb_buffer_pool_read_ahead_evicted 0 0 +Innodb_buffer_pool_read_requests 447048 447048 +Innodb_buffer_pool_reads 0 0 +Innodb_buffer_pool_wait_free 0 0 +Innodb_buffer_pool_write_requests 236593 236593 +Innodb_checkpoint_age 0 0 +Innodb_checkpoint_max_age 7782360 7782360 +Innodb_checkpoint_target_age 7539162 7539162 +Innodb_data_fsyncs 131 131 +Innodb_data_pending_fsyncs 0 0 +Innodb_data_pending_reads 0 0 +Innodb_data_pending_writes 0 0 +Innodb_data_read 0 0 +Innodb_data_reads 0 0 +Innodb_data_writes 1067 1067 +Innodb_data_written 36013056 36013056 +Innodb_dblwr_pages_written 742 742 +Innodb_dblwr_writes 17 17 +Innodb_deadlocks 0 0 +Innodb_dict_tables 27 27 +Innodb_have_atomic_builtins ON ON +Innodb_history_list_length 1 1 +Innodb_ibuf_discarded_delete_marks 0 0 +Innodb_ibuf_discarded_deletes 0 0 +Innodb_ibuf_discarded_inserts 0 0 +Innodb_ibuf_free_list 0 0 +Innodb_ibuf_merged_delete_marks 0 0 +Innodb_ibuf_merged_deletes 0 0 +Innodb_ibuf_merged_inserts 0 0 +Innodb_ibuf_merges 0 0 +Innodb_ibuf_segment_size 2 2 +Innodb_ibuf_size 1 1 +Innodb_log_waits 0 0 +Innodb_log_write_requests 18226 18226 +Innodb_log_writes 70 70 +Innodb_lsn_current 8809964 8809964 +Innodb_lsn_flushed 8809964 8809964 +Innodb_lsn_last_checkpoint 8809964 8809964 +Innodb_master_thread_1_second_loops 42 42 +Innodb_master_thread_10_second_loops 4 4 +Innodb_master_thread_background_loops 3 3 +Innodb_master_thread_main_flush_loops 3 3 +Innodb_master_thread_sleeps 42 42 +Innodb_max_trx_id 846 846 +Innodb_mem_adaptive_hash 672196 672196 +Innodb_mem_dictionary 221035 221035 +Innodb_mem_total 34062336 34062336 +Innodb_mutex_os_waits 6 6 +Innodb_mutex_spin_rounds 271 271 +Innodb_mutex_spin_waits 11 11 +Innodb_oldest_view_low_limit_trx_id 825 825 +Innodb_os_log_fsyncs 93 93 +Innodb_os_log_pending_fsyncs 0 0 +Innodb_os_log_pending_writes 0 0 +Innodb_os_log_written 8836608 8836608 +Innodb_page_size 16384 16384 +Innodb_pages_created 708 708 +Innodb_pages_read 0 0 +Innodb_pages_written 916 916 +Innodb_purge_trx_id 824 824 +Innodb_purge_undo_no 0 0 +Innodb_row_lock_current_waits 0 0 +Innodb_current_row_locks 0 0 +Innodb_row_lock_time 0 0 +Innodb_row_lock_time_avg 0 0 +Innodb_row_lock_time_max 0 0 +Innodb_row_lock_waits 0 0 +Innodb_rows_deleted 0 0 +Innodb_rows_inserted 47315 47315 +Innodb_rows_read 47274 47274 +Innodb_rows_updated 0 0 +Innodb_s_lock_os_waits 24 24 +Innodb_s_lock_spin_rounds 720 720 +Innodb_s_lock_spin_waits 24 24 +Innodb_truncated_status_writes 0 0 +Innodb_x_lock_os_waits 9 9 +Innodb_x_lock_spin_rounds 270 270 +Innodb_x_lock_spin_waits 0 0 +Key_blocks_not_flushed 0 0 +Key_blocks_unused 14495 14495 +Key_blocks_used 2 2 +Key_read_requests 47 47 +Key_reads 1 1 +Key_write_requests 12 12 +Key_writes 12 12 +Last_query_cost 0.000000 0.000000 +Max_used_connections 4 4 +Not_flushed_delayed_rows 0 0 +Open_files 51 51 +Open_streams 0 0 +Open_table_definitions 50 50 +Open_tables 45 45 +Opened_files 1349 1397 +Opened_table_definitions 107 107 +Opened_tables 109 109 +Performance_schema_cond_classes_lost 0 0 +Performance_schema_cond_instances_lost 0 0 +Performance_schema_file_classes_lost 0 0 +Performance_schema_file_handles_lost 0 0 +Performance_schema_file_instances_lost 0 0 +Performance_schema_locker_lost 0 0 +Performance_schema_mutex_classes_lost 0 0 +Performance_schema_mutex_instances_lost 0 0 +Performance_schema_rwlock_classes_lost 0 0 +Performance_schema_rwlock_instances_lost 0 0 +Performance_schema_table_handles_lost 0 0 +Performance_schema_table_instances_lost 0 0 +Performance_schema_thread_classes_lost 0 0 +Performance_schema_thread_instances_lost 0 0 +Prepared_stmt_count 0 0 +Qcache_free_blocks 0 0 +Qcache_free_memory 0 0 +Qcache_hits 0 0 +Qcache_inserts 0 0 +Qcache_lowmem_prunes 0 0 +Qcache_not_cached 0 0 +Qcache_queries_in_cache 0 0 +Qcache_total_blocks 0 0 +Queries 2450 2492 +Questions 1450 1492 +Rpl_status AUTH_MASTER AUTH_MASTER +Select_full_join 0 0 +Select_full_range_join 0 0 +Select_range 0 0 +Select_range_check 0 0 +Select_scan 243 248 +Slave_heartbeat_period 0.000 0.000 +Slave_open_temp_tables 0 0 +Slave_received_heartbeats 0 0 +Slave_retried_transactions 0 0 +Slave_running OFF OFF +Slow_launch_threads 0 0 +Slow_queries 0 0 +Sort_merge_passes 0 0 +Sort_range 0 0 +Sort_rows 0 0 +Sort_scan 2 2 +Ssl_accept_renegotiates 0 0 +Ssl_accepts 0 0 +Ssl_callback_cache_hits 0 0 +Ssl_cipher +Ssl_cipher_list +Ssl_client_connects 0 0 +Ssl_connect_renegotiates 0 0 +Ssl_ctx_verify_depth 0 0 +Ssl_ctx_verify_mode 0 0 +Ssl_default_timeout 0 0 +Ssl_finished_accepts 0 0 +Ssl_finished_connects 0 0 +Ssl_session_cache_hits 0 0 +Ssl_session_cache_misses 0 0 +Ssl_session_cache_mode NONE NONE +Ssl_session_cache_overflows 0 0 +Ssl_session_cache_size 0 0 +Ssl_session_cache_timeouts 0 0 +Ssl_sessions_reused 0 0 +Ssl_used_session_cache_entries 0 0 +Ssl_verify_depth 0 0 +Ssl_verify_mode 0 0 +Ssl_version +Table_locks_immediate 214 215 +Table_locks_waited 0 0 +Tc_log_max_pages_used 0 0 +Tc_log_page_size 0 0 +Tc_log_page_waits 0 0 +Threads_cached 0 0 +Threads_connected 4 4 +Threads_created 201 215 +Threads_running 1 1 +Uptime 2511 2521 +Uptime_since_flush_status 2511 2521 +binlog_commits 5 5 +binlog_group_commits 5 5 +wsrep_local_state_uuid 968bdd7e-38cc-11e2-0800-a86d39553d83 968bdd7e-38cc-11e2-0800-a86d39553d83 +wsrep_protocol_version 4 4 +wsrep_last_committed 49 49 +wsrep_replicated 49 49 +wsrep_replicated_bytes 3372882 3372882 +wsrep_received 11 11 +wsrep_received_bytes 658 658 +wsrep_local_commits 4 4 +wsrep_local_cert_failures 0 0 +wsrep_local_bf_aborts 0 0 +wsrep_local_replays 0 0 +wsrep_local_send_queue 0 0 +wsrep_local_send_queue_avg 0.000000 0.000000 +wsrep_local_recv_queue 0 0 +wsrep_local_recv_queue_avg 0.000000 0.000000 +wsrep_flow_control_paused 0.000000 0.000000 +wsrep_flow_control_sent 0 0 +wsrep_flow_control_recv 0 0 +wsrep_cert_deps_distance 1.000000 1.000000 +wsrep_apply_oooe 0.000000 0.000000 +wsrep_apply_oool 0.000000 0.000000 +wsrep_apply_window 0.000000 0.000000 +wsrep_commit_oooe 0.000000 0.000000 +wsrep_commit_oool 0.000000 0.000000 +wsrep_commit_window 0.000000 0.000000 +wsrep_local_state 4 4 +wsrep_local_state_comment Synced Synced +wsrep_cert_index_size 73966 73966 +wsrep_causal_reads 0 0 +wsrep_incoming_addresses 192.168.0.100,192.168.0.100,192.168.0.100 192.168.0.100,192.168.0.100,192.168.0.100 +wsrep_cluster_conf_id 3 3 +wsrep_cluster_size 3 3 +wsrep_cluster_state_uuid 968bdd7e-38cc-11e2-0800-a86d39553d83 968bdd7e-38cc-11e2-0800-a86d39553d83 +wsrep_cluster_status Primary Primary +wsrep_connected ON ON +wsrep_local_index 0 0 +wsrep_provider_name Galera Galera +wsrep_provider_vendor Codership Oy Codership Oy +wsrep_provider_version 2.2(r137) 2.2(r137) +wsrep_ready ON ON diff --git a/t/pt-mysql-summary/samples/temp006/mysql-users b/t/pt-mysql-summary/samples/temp006/mysql-users new file mode 100644 index 00000000..6679bb64 --- /dev/null +++ b/t/pt-mysql-summary/samples/temp006/mysql-users @@ -0,0 +1 @@ +2 0 0 0 diff --git a/t/pt-mysql-summary/samples/temp006/mysql-variables b/t/pt-mysql-summary/samples/temp006/mysql-variables new file mode 100644 index 00000000..82c189d9 --- /dev/null +++ b/t/pt-mysql-summary/samples/temp006/mysql-variables @@ -0,0 +1,422 @@ +auto_increment_increment 3 +auto_increment_offset 1 +autocommit ON +automatic_sp_privileges ON +back_log 50 +basedir /home/hugmeir/mysql5/mysqlbrew/mysqls/Percona-XtraDB-Cluster-5.5.28-23.7.373.Linux.i686 +big_tables OFF +binlog_cache_size 32768 +binlog_direct_non_transactional_updates OFF +binlog_format ROW +binlog_stmt_cache_size 32768 +bulk_insert_buffer_size 8388608 +character_set_client latin1 +character_set_connection latin1 +character_set_database latin1 +character_set_filesystem binary +character_set_results latin1 +character_set_server latin1 +character_set_system utf8 +character_sets_dir /home/hugmeir/mysql5/mysqlbrew/mysqls/Percona-XtraDB-Cluster-5.5.28-23.7.373.Linux.i686/share/charsets/ +collation_connection latin1_swedish_ci +collation_database latin1_swedish_ci +collation_server latin1_swedish_ci +completion_type NO_CHAIN +concurrent_insert AUTO +connect_timeout 10 +datadir /tmp/12345/data/ +date_format %Y-%m-%d +datetime_format %Y-%m-%d %H:%i:%s +default_storage_engine InnoDB +default_week_format 0 +delay_key_write ON +delayed_insert_limit 100 +delayed_insert_timeout 300 +delayed_queue_size 1000 +div_precision_increment 4 +enforce_storage_engine +engine_condition_pushdown ON +event_scheduler OFF +expand_fast_index_creation OFF +expire_logs_days 0 +fast_index_creation ON +flush OFF +flush_time 0 +foreign_key_checks ON +ft_boolean_syntax + -><()~*:""&| +ft_max_word_len 84 +ft_min_word_len 4 +ft_query_expansion_limit 20 +ft_stopword_file (built-in) +general_log ON +general_log_file genlog +group_concat_max_len 1024 +have_compress YES +have_crypt YES +have_csv YES +have_dynamic_loading YES +have_flashcache YES +have_geometry YES +have_innodb YES +have_ndbcluster NO +have_openssl DISABLED +have_partitioning YES +have_profiling YES +have_query_cache YES +have_response_time_distribution YES +have_rtree_keys YES +have_ssl DISABLED +have_symlink YES +hostname hugmeir +ignore_builtin_innodb OFF +init_connect +init_file +init_slave +innodb_adaptive_flushing ON +innodb_adaptive_flushing_method estimate +innodb_adaptive_hash_index ON +innodb_adaptive_hash_index_partitions 1 +innodb_additional_mem_pool_size 8388608 +innodb_autoextend_increment 8 +innodb_autoinc_lock_mode 2 +innodb_blocking_buffer_pool_restore OFF +innodb_buffer_pool_instances 1 +innodb_buffer_pool_populate OFF +innodb_buffer_pool_restore_at_startup 0 +innodb_buffer_pool_shm_checksum ON +innodb_buffer_pool_shm_key 0 +innodb_buffer_pool_size 33554432 +innodb_change_buffering all +innodb_changed_pages_limit 1000000 +innodb_checkpoint_age_target 0 +innodb_checksums ON +innodb_commit_concurrency 0 +innodb_concurrency_tickets 500 +innodb_corrupt_table_action assert +innodb_data_file_path ibdata1:10M:autoextend +innodb_data_home_dir /tmp/12345/data +innodb_dict_size_limit 0 +innodb_disallow_writes OFF +innodb_doublewrite ON +innodb_doublewrite_file +innodb_fake_changes OFF +innodb_fast_checksum OFF +innodb_fast_shutdown 1 +innodb_file_format Antelope +innodb_file_format_check ON +innodb_file_format_max Antelope +innodb_file_per_table OFF +innodb_flush_log_at_trx_commit 1 +innodb_flush_method +innodb_flush_neighbor_pages area +innodb_force_load_corrupted OFF +innodb_force_recovery 0 +innodb_ibuf_accel_rate 100 +innodb_ibuf_active_contract 1 +innodb_ibuf_max_size 16760832 +innodb_import_table_from_xtrabackup 0 +innodb_io_capacity 200 +innodb_kill_idle_transaction 0 +innodb_large_prefix OFF +innodb_lazy_drop_table 0 +innodb_lock_wait_timeout 3 +innodb_locks_unsafe_for_binlog ON +innodb_log_block_size 512 +innodb_log_buffer_size 8388608 +innodb_log_file_size 5242880 +innodb_log_files_in_group 2 +innodb_log_group_home_dir /tmp/12345/data +innodb_max_dirty_pages_pct 75 +innodb_max_purge_lag 0 +innodb_merge_sort_block_size 1048576 +innodb_mirrored_log_groups 1 +innodb_old_blocks_pct 37 +innodb_old_blocks_time 0 +innodb_open_files 300 +innodb_page_size 16384 +innodb_purge_batch_size 20 +innodb_purge_threads 1 +innodb_random_read_ahead OFF +innodb_read_ahead linear +innodb_read_ahead_threshold 56 +innodb_read_io_threads 4 +innodb_recovery_stats OFF +innodb_recovery_update_relay_log OFF +innodb_replication_delay 0 +innodb_rollback_on_timeout OFF +innodb_rollback_segments 128 +innodb_show_locks_held 10 +innodb_show_verbose_locks 0 +innodb_spin_wait_delay 6 +innodb_stats_auto_update 1 +innodb_stats_method nulls_equal +innodb_stats_on_metadata ON +innodb_stats_sample_pages 8 +innodb_stats_update_need_lock 1 +innodb_strict_mode OFF +innodb_support_xa ON +innodb_sync_spin_loops 30 +innodb_table_locks ON +innodb_thread_concurrency 0 +innodb_thread_concurrency_timer_based OFF +innodb_thread_sleep_delay 10000 +innodb_track_changed_pages OFF +innodb_use_global_flush_log_at_trx_commit ON +innodb_use_native_aio ON +innodb_use_sys_malloc ON +innodb_use_sys_stats_table OFF +innodb_version 1.1.8-rel29.1 +innodb_write_io_threads 4 +interactive_timeout 28800 +join_buffer_size 131072 +keep_files_on_create OFF +key_buffer_size 16777216 +key_cache_age_threshold 300 +key_cache_block_size 1024 +key_cache_division_limit 100 +large_files_support ON +large_page_size 0 +large_pages OFF +lc_messages en_US +lc_messages_dir /home/hugmeir/mysql5/mysqlbrew/mysqls/Percona-XtraDB-Cluster-5.5.28-23.7.373.Linux.i686/share/ +lc_time_names en_US +license GPL +local_infile ON +lock_wait_timeout 31536000 +locked_in_memory OFF +log ON +log_bin ON +log_bin_trust_function_creators OFF +log_error /tmp/12345/data/mysqld.log +log_output FILE +log_queries_not_using_indexes OFF +log_slave_updates ON +log_slow_admin_statements OFF +log_slow_filter +log_slow_queries OFF +log_slow_rate_limit 1 +log_slow_rate_type session +log_slow_slave_statements OFF +log_slow_sp_statements ON +log_slow_verbosity +log_warnings 1 +log_warnings_suppress +long_query_time 10.000000 +low_priority_updates OFF +lower_case_file_system OFF +lower_case_table_names 0 +max_allowed_packet 1048576 +max_binlog_cache_size 18446744073709547520 +max_binlog_files 0 +max_binlog_size 1073741824 +max_binlog_stmt_cache_size 18446744073709547520 +max_connect_errors 10 +max_connections 151 +max_delayed_threads 20 +max_error_count 64 +max_heap_table_size 16777216 +max_insert_delayed_threads 20 +max_join_size 18446744073709551615 +max_length_for_sort_data 1024 +max_long_data_size 1048576 +max_prepared_stmt_count 16382 +max_relay_log_size 0 +max_seeks_for_key 4294967295 +max_sort_length 1024 +max_sp_recursion_depth 0 +max_tmp_tables 32 +max_user_connections 0 +max_write_lock_count 4294967295 +metadata_locks_cache_size 1024 +min_examined_row_limit 0 +multi_range_count 256 +myisam_data_pointer_size 6 +myisam_max_sort_file_size 2146435072 +myisam_mmap_size 4294967295 +myisam_recover_options OFF +myisam_repair_threads 1 +myisam_sort_buffer_size 8388608 +myisam_stats_method nulls_unequal +myisam_use_mmap OFF +net_buffer_length 16384 +net_read_timeout 30 +net_retry_count 10 +net_write_timeout 60 +new OFF +old OFF +old_alter_table OFF +old_passwords OFF +open_files_limit 1024 +optimizer_fix ON +optimizer_prune_level 1 +optimizer_search_depth 62 +optimizer_switch index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on +performance_schema OFF +performance_schema_events_waits_history_long_size 10000 +performance_schema_events_waits_history_size 10 +performance_schema_max_cond_classes 80 +performance_schema_max_cond_instances 1000 +performance_schema_max_file_classes 50 +performance_schema_max_file_handles 32768 +performance_schema_max_file_instances 10000 +performance_schema_max_mutex_classes 200 +performance_schema_max_mutex_instances 1000000 +performance_schema_max_rwlock_classes 30 +performance_schema_max_rwlock_instances 1000000 +performance_schema_max_table_handles 100000 +performance_schema_max_table_instances 50000 +performance_schema_max_thread_classes 50 +performance_schema_max_thread_instances 1000 +pid_file /tmp/12345/data/mysql_sandbox12345.pid +plugin_dir /home/hugmeir/mysql5/mysqlbrew/mysqls/Percona-XtraDB-Cluster-5.5.28-23.7.373.Linux.i686/lib/mysql/plugin/ +port 12345 +preload_buffer_size 32768 +profiling OFF +profiling_history_size 15 +protocol_version 10 +query_alloc_block_size 8192 +query_cache_limit 1048576 +query_cache_min_res_unit 4096 +query_cache_size 0 +query_cache_strip_comments OFF +query_cache_type ON +query_cache_wlock_invalidate OFF +query_prealloc_size 8192 +query_response_time_range_base 10 +query_response_time_stats OFF +range_alloc_block_size 4096 +read_buffer_size 131072 +read_only OFF +read_rnd_buffer_size 262144 +relay_log mysql-relay-bin +relay_log_index +relay_log_info_file relay-log.info +relay_log_purge ON +relay_log_recovery OFF +relay_log_space_limit 0 +report_host 127.0.0.1 +report_password +report_port 12345 +report_user +rpl_recovery_rank 0 +secure_auth OFF +secure_file_priv +server_id 12345 +skip_external_locking ON +skip_name_resolve OFF +skip_networking OFF +skip_show_database OFF +slave_compressed_protocol OFF +slave_exec_mode STRICT +slave_load_tmpdir /tmp +slave_max_allowed_packet 1073741824 +slave_net_timeout 3600 +slave_skip_errors OFF +slave_transaction_retries 10 +slave_type_conversions +slow_launch_time 2 +slow_query_log OFF +slow_query_log_file /tmp/12345/data/hugmeir-slow.log +slow_query_log_timestamp_always OFF +slow_query_log_timestamp_precision second +slow_query_log_use_global_control +socket /tmp/12345/mysql_sandbox12345.sock +sort_buffer_size 2097152 +sql_auto_is_null OFF +sql_big_selects ON +sql_big_tables OFF +sql_buffer_result OFF +sql_log_bin ON +sql_log_off OFF +sql_low_priority_updates OFF +sql_max_join_size 18446744073709551615 +sql_mode +sql_notes ON +sql_quote_show_create ON +sql_safe_updates OFF +sql_select_limit 18446744073709551615 +sql_slave_skip_counter 0 +sql_warnings OFF +ssl_ca +ssl_capath +ssl_cert +ssl_cipher +ssl_key +storage_engine InnoDB +stored_program_cache 256 +sync_binlog 0 +sync_frm ON +sync_master_info 0 +sync_relay_log 0 +sync_relay_log_info 0 +system_time_zone ART +table_definition_cache 400 +table_open_cache 400 +thread_cache_size 0 +thread_concurrency 10 +thread_handling one-thread-per-connection +thread_stack 196608 +thread_statistics OFF +time_format %H:%i:%s +time_zone SYSTEM +timed_mutexes OFF +tmp_table_size 16777216 +tmpdir /tmp +transaction_alloc_block_size 8192 +transaction_prealloc_size 4096 +tx_isolation REPEATABLE-READ +unique_checks ON +updatable_views_with_limit YES +userstat OFF +version 5.5.28-23.7-log +version_comment Percona XtraDB Cluster (GPL) 5.5.28-23.7, Revision 373, wsrep_23.7.r3821 +version_compile_machine i686 +version_compile_os Linux +wait_timeout 28800 +wsrep_OSU_method TOI +wsrep_auto_increment_control ON +wsrep_causal_reads OFF +wsrep_certify_nonPK ON +wsrep_cluster_address gcomm:// +wsrep_cluster_name pt_sandbox_cluster +wsrep_convert_LOCK_to_trx OFF +wsrep_data_home_dir /tmp/12345/data/ +wsrep_dbug_option +wsrep_debug OFF +wsrep_drupal_282555_workaround OFF +wsrep_forced_binlog_format NONE +wsrep_log_conflicts OFF +wsrep_max_ws_rows 131072 +wsrep_max_ws_size 1073741824 +wsrep_mysql_replication_bundle 0 +wsrep_node_address +wsrep_node_incoming_address 192.168.0.100 +wsrep_node_name 12345 +wsrep_notify_cmd +wsrep_on ON +wsrep_provider /home/hugmeir/mysql5/mysqlbrew/mysqls/Percona-XtraDB-Cluster-5.5.28-23.7.373.Linux.i686/lib/libgalera_smm.so +wsrep_provider_options base_host = 192.168.122.1; base_port = 12355; cert.log_conflicts = no; evs.causal_keepalive_period = PT1S; evs.debug_log_mask = 0x1; evs.inactive_check_period = PT0.5S; evs.inactive_timeout = PT15S; evs.info_log_mask = 0; evs.install_timeout = PT15S; evs.join_retrans_period = PT1S; evs.keepalive_period = PT1S; evs.max_install_timeouts = 1; evs.send_window = 4; evs.stats_report_period = PT1M; evs.suspect_timeout = PT5S; evs.use_aggregate = true; evs.user_send_window = 2; evs.version = 0; evs.view_forget_timeout = PT5M; gcache.dir = /tmp/12345/data/; gcache.keep_pages_size = 0; gcache.mem_size = 0; gcache.name = /tmp/12345/data//galera.cache; gcache.page_size = 128M; gcache.size = 128M; gcs.fc_debug = 0; gcs.fc_factor = 1; gcs.fc_limit = 16; gcs.fc_master_slave = NO; gcs.max_packet_size = 64500; gcs.max_throttle = 0.25; gcs.recv_q_hard_limit = 2147483647; gcs.recv_q_soft_limit = 0.25; gcs.sync_donor = NO; gmcast.listen_addr = tcp://192.168.0.100:12355; gmcast.mcast_addr = ; gmcast.mcast_ttl = 1; gmcast.peer_timeout = PT3S; gmcast.time_wait = PT5S; gmcast.version = 0; ist.recv_addr = 192.168.122.1; pc.checksum = true; pc.ignore_quorum = false; pc.ignore_sb = false; pc.linger = PT2S; pc.npvo = false; pc.version = 0; protonet.backend = asio; protonet.version = 0; replicator.causal_read_timeout = PT30S; replicator.commit_order = 3 +wsrep_recover OFF +wsrep_replicate_myisam ON +wsrep_retry_autocommit 1 +wsrep_slave_threads 2 +wsrep_sst_auth +wsrep_sst_donor +wsrep_sst_donor_rejects_queries OFF +wsrep_sst_method rsync +wsrep_sst_receive_address 192.168.0.100:12365 +wsrep_start_position 00000000-0000-0000-0000-000000000000:-1 +internal::nice_of_32578 0 +internal::oom_of_32578 0 +internal::nice_of_32419 0 +internal::oom_of_32419 0 +internal::nice_of_32324 0 +internal::oom_of_32324 0 +pt-summary-internal-pid_file_exists 1 +pt-summary-internal-current_time 2012-11-27 16:56 +pt-summary-internal-Config_File_path +pt-summary-internal-mysql_executable /usr/bin/mysql +pt-summary-internal-now 2012-11-27 17:38:42 +pt-summary-internal-user msandbox@% +pt-summary-internal-FNV_64 Unknown +pt-summary-internal-trigger_count 6 diff --git a/t/pt-mysql-summary/samples/temp006/mysqld-executables b/t/pt-mysql-summary/samples/temp006/mysqld-executables new file mode 100644 index 00000000..e69de29b diff --git a/t/pt-mysql-summary/samples/temp006/mysqld-instances b/t/pt-mysql-summary/samples/temp006/mysqld-instances new file mode 100644 index 00000000..492e9b91 --- /dev/null +++ b/t/pt-mysql-summary/samples/temp006/mysqld-instances @@ -0,0 +1,4 @@ + PID TTY STAT TIME COMMAND +32324 pts/6 Sl 0:25 /home/hugmeir/mysql5/mysqlbrew/mysqls/Percona-XtraDB-Cluster-5.5.28-23.7.373.Linux.i686/bin/mysqld --defaults-file=/tmp/12345/my.sandbox.cnf +32419 pts/6 Sl 0:18 /home/hugmeir/mysql5/mysqlbrew/mysqls/Percona-XtraDB-Cluster-5.5.28-23.7.373.Linux.i686/bin/mysqld --defaults-file=/tmp/12346/my.sandbox.cnf +32578 pts/6 Sl 0:18 /home/hugmeir/mysql5/mysqlbrew/mysqls/Percona-XtraDB-Cluster-5.5.28-23.7.373.Linux.i686/bin/mysqld --defaults-file=/tmp/12347/my.sandbox.cnf diff --git a/t/pt-mysql-summary/samples/temp006/mysqldump b/t/pt-mysql-summary/samples/temp006/mysqldump new file mode 100644 index 00000000..3f6d4f9a --- /dev/null +++ b/t/pt-mysql-summary/samples/temp006/mysqldump @@ -0,0 +1,1128 @@ + +CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysql` /*!40100 DEFAULT CHARACTER SET latin1 */; + +USE `mysql`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `columns_priv` ( + `Host` char(60) COLLATE utf8_bin NOT NULL DEFAULT '', + `Db` char(64) COLLATE utf8_bin NOT NULL DEFAULT '', + `User` char(16) COLLATE utf8_bin NOT NULL DEFAULT '', + `Table_name` char(64) COLLATE utf8_bin NOT NULL DEFAULT '', + `Column_name` char(64) COLLATE utf8_bin NOT NULL DEFAULT '', + `Timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `Column_priv` set('Select','Insert','Update','References') CHARACTER SET utf8 NOT NULL DEFAULT '', + PRIMARY KEY (`Host`,`Db`,`User`,`Table_name`,`Column_name`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Column privileges'; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `db` ( + `Host` char(60) COLLATE utf8_bin NOT NULL DEFAULT '', + `Db` char(64) COLLATE utf8_bin NOT NULL DEFAULT '', + `User` char(16) COLLATE utf8_bin NOT NULL DEFAULT '', + `Select_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Insert_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Update_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Delete_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Create_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Drop_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Grant_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `References_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Index_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Alter_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Create_tmp_table_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Lock_tables_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Create_view_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Show_view_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Create_routine_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Alter_routine_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Execute_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Event_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Trigger_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + PRIMARY KEY (`Host`,`Db`,`User`), + KEY `User` (`User`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Database privileges'; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `event` ( + `db` char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '', + `name` char(64) NOT NULL DEFAULT '', + `body` longblob NOT NULL, + `definer` char(77) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '', + `execute_at` datetime DEFAULT NULL, + `interval_value` int(11) DEFAULT NULL, + `interval_field` enum('YEAR','QUARTER','MONTH','DAY','HOUR','MINUTE','WEEK','SECOND','MICROSECOND','YEAR_MONTH','DAY_HOUR','DAY_MINUTE','DAY_SECOND','HOUR_MINUTE','HOUR_SECOND','MINUTE_SECOND','DAY_MICROSECOND','HOUR_MICROSECOND','MINUTE_MICROSECOND','SECOND_MICROSECOND') DEFAULT NULL, + `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', + `last_executed` datetime DEFAULT NULL, + `starts` datetime DEFAULT NULL, + `ends` datetime DEFAULT NULL, + `status` enum('ENABLED','DISABLED','SLAVESIDE_DISABLED') NOT NULL DEFAULT 'ENABLED', + `on_completion` enum('DROP','PRESERVE') NOT NULL DEFAULT 'DROP', + `sql_mode` set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','NOT_USED','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE','NO_ENGINE_SUBSTITUTION','PAD_CHAR_TO_FULL_LENGTH') NOT NULL DEFAULT '', + `comment` char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '', + `originator` int(10) unsigned NOT NULL, + `time_zone` char(64) CHARACTER SET latin1 NOT NULL DEFAULT 'SYSTEM', + `character_set_client` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, + `collation_connection` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, + `db_collation` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, + `body_utf8` longblob, + PRIMARY KEY (`db`,`name`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Events'; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `func` ( + `name` char(64) COLLATE utf8_bin NOT NULL DEFAULT '', + `ret` tinyint(1) NOT NULL DEFAULT '0', + `dl` char(128) COLLATE utf8_bin NOT NULL DEFAULT '', + `type` enum('function','aggregate') CHARACTER SET utf8 NOT NULL, + PRIMARY KEY (`name`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='User defined functions'; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `help_category` ( + `help_category_id` smallint(5) unsigned NOT NULL, + `name` char(64) NOT NULL, + `parent_category_id` smallint(5) unsigned DEFAULT NULL, + `url` char(128) NOT NULL, + PRIMARY KEY (`help_category_id`), + UNIQUE KEY `name` (`name`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='help categories'; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `help_keyword` ( + `help_keyword_id` int(10) unsigned NOT NULL, + `name` char(64) NOT NULL, + PRIMARY KEY (`help_keyword_id`), + UNIQUE KEY `name` (`name`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='help keywords'; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `help_relation` ( + `help_topic_id` int(10) unsigned NOT NULL, + `help_keyword_id` int(10) unsigned NOT NULL, + PRIMARY KEY (`help_keyword_id`,`help_topic_id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='keyword-topic relation'; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `help_topic` ( + `help_topic_id` int(10) unsigned NOT NULL, + `name` char(64) NOT NULL, + `help_category_id` smallint(5) unsigned NOT NULL, + `description` text NOT NULL, + `example` text NOT NULL, + `url` char(128) NOT NULL, + PRIMARY KEY (`help_topic_id`), + UNIQUE KEY `name` (`name`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='help topics'; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `host` ( + `Host` char(60) COLLATE utf8_bin NOT NULL DEFAULT '', + `Db` char(64) COLLATE utf8_bin NOT NULL DEFAULT '', + `Select_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Insert_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Update_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Delete_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Create_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Drop_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Grant_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `References_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Index_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Alter_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Create_tmp_table_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Lock_tables_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Create_view_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Show_view_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Create_routine_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Alter_routine_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Execute_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Trigger_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + PRIMARY KEY (`Host`,`Db`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Host privileges; Merged with database privileges'; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ndb_binlog_index` ( + `Position` bigint(20) unsigned NOT NULL, + `File` varchar(255) NOT NULL, + `epoch` bigint(20) unsigned NOT NULL, + `inserts` bigint(20) unsigned NOT NULL, + `updates` bigint(20) unsigned NOT NULL, + `deletes` bigint(20) unsigned NOT NULL, + `schemaops` bigint(20) unsigned NOT NULL, + PRIMARY KEY (`epoch`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `plugin` ( + `name` varchar(64) NOT NULL DEFAULT '', + `dl` varchar(128) NOT NULL DEFAULT '', + PRIMARY KEY (`name`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='MySQL plugins'; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `proc` ( + `db` char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '', + `name` char(64) NOT NULL DEFAULT '', + `type` enum('FUNCTION','PROCEDURE') NOT NULL, + `specific_name` char(64) NOT NULL DEFAULT '', + `language` enum('SQL') NOT NULL DEFAULT 'SQL', + `sql_data_access` enum('CONTAINS_SQL','NO_SQL','READS_SQL_DATA','MODIFIES_SQL_DATA') NOT NULL DEFAULT 'CONTAINS_SQL', + `is_deterministic` enum('YES','NO') NOT NULL DEFAULT 'NO', + `security_type` enum('INVOKER','DEFINER') NOT NULL DEFAULT 'DEFINER', + `param_list` blob NOT NULL, + `returns` longblob NOT NULL, + `body` longblob NOT NULL, + `definer` char(77) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '', + `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', + `sql_mode` set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','NOT_USED','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE','NO_ENGINE_SUBSTITUTION','PAD_CHAR_TO_FULL_LENGTH') NOT NULL DEFAULT '', + `comment` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `character_set_client` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, + `collation_connection` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, + `db_collation` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, + `body_utf8` longblob, + PRIMARY KEY (`db`,`name`,`type`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Stored Procedures'; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `procs_priv` ( + `Host` char(60) COLLATE utf8_bin NOT NULL DEFAULT '', + `Db` char(64) COLLATE utf8_bin NOT NULL DEFAULT '', + `User` char(16) COLLATE utf8_bin NOT NULL DEFAULT '', + `Routine_name` char(64) CHARACTER SET utf8 NOT NULL DEFAULT '', + `Routine_type` enum('FUNCTION','PROCEDURE') COLLATE utf8_bin NOT NULL, + `Grantor` char(77) COLLATE utf8_bin NOT NULL DEFAULT '', + `Proc_priv` set('Execute','Alter Routine','Grant') CHARACTER SET utf8 NOT NULL DEFAULT '', + `Timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`Host`,`Db`,`User`,`Routine_name`,`Routine_type`), + KEY `Grantor` (`Grantor`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Procedure privileges'; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `proxies_priv` ( + `Host` char(60) COLLATE utf8_bin NOT NULL DEFAULT '', + `User` char(16) COLLATE utf8_bin NOT NULL DEFAULT '', + `Proxied_host` char(60) COLLATE utf8_bin NOT NULL DEFAULT '', + `Proxied_user` char(16) COLLATE utf8_bin NOT NULL DEFAULT '', + `With_grant` tinyint(1) NOT NULL DEFAULT '0', + `Grantor` char(77) COLLATE utf8_bin NOT NULL DEFAULT '', + `Timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`Host`,`User`,`Proxied_host`,`Proxied_user`), + KEY `Grantor` (`Grantor`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='User proxy privileges'; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `servers` ( + `Server_name` char(64) NOT NULL DEFAULT '', + `Host` char(64) NOT NULL DEFAULT '', + `Db` char(64) NOT NULL DEFAULT '', + `Username` char(64) NOT NULL DEFAULT '', + `Password` char(64) NOT NULL DEFAULT '', + `Port` int(4) NOT NULL DEFAULT '0', + `Socket` char(64) NOT NULL DEFAULT '', + `Wrapper` char(64) NOT NULL DEFAULT '', + `Owner` char(64) NOT NULL DEFAULT '', + PRIMARY KEY (`Server_name`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='MySQL Foreign Servers table'; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `tables_priv` ( + `Host` char(60) COLLATE utf8_bin NOT NULL DEFAULT '', + `Db` char(64) COLLATE utf8_bin NOT NULL DEFAULT '', + `User` char(16) COLLATE utf8_bin NOT NULL DEFAULT '', + `Table_name` char(64) COLLATE utf8_bin NOT NULL DEFAULT '', + `Grantor` char(77) COLLATE utf8_bin NOT NULL DEFAULT '', + `Timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `Table_priv` set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view','Trigger') CHARACTER SET utf8 NOT NULL DEFAULT '', + `Column_priv` set('Select','Insert','Update','References') CHARACTER SET utf8 NOT NULL DEFAULT '', + PRIMARY KEY (`Host`,`Db`,`User`,`Table_name`), + KEY `Grantor` (`Grantor`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Table privileges'; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `time_zone` ( + `Time_zone_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `Use_leap_seconds` enum('Y','N') NOT NULL DEFAULT 'N', + PRIMARY KEY (`Time_zone_id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Time zones'; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `time_zone_leap_second` ( + `Transition_time` bigint(20) NOT NULL, + `Correction` int(11) NOT NULL, + PRIMARY KEY (`Transition_time`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Leap seconds information for time zones'; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `time_zone_name` ( + `Name` char(64) NOT NULL, + `Time_zone_id` int(10) unsigned NOT NULL, + PRIMARY KEY (`Name`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Time zone names'; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `time_zone_transition` ( + `Time_zone_id` int(10) unsigned NOT NULL, + `Transition_time` bigint(20) NOT NULL, + `Transition_type_id` int(10) unsigned NOT NULL, + PRIMARY KEY (`Time_zone_id`,`Transition_time`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Time zone transitions'; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `time_zone_transition_type` ( + `Time_zone_id` int(10) unsigned NOT NULL, + `Transition_type_id` int(10) unsigned NOT NULL, + `Offset` int(11) NOT NULL DEFAULT '0', + `Is_DST` tinyint(3) unsigned NOT NULL DEFAULT '0', + `Abbreviation` char(8) NOT NULL DEFAULT '', + PRIMARY KEY (`Time_zone_id`,`Transition_type_id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Time zone transition types'; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `user` ( + `Host` char(60) COLLATE utf8_bin NOT NULL DEFAULT '', + `User` char(16) COLLATE utf8_bin NOT NULL DEFAULT '', + `Password` char(41) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + `Select_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Insert_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Update_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Delete_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Create_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Drop_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Reload_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Shutdown_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Process_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `File_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Grant_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `References_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Index_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Alter_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Show_db_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Super_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Create_tmp_table_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Lock_tables_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Execute_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Repl_slave_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Repl_client_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Create_view_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Show_view_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Create_routine_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Alter_routine_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Create_user_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Event_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Trigger_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Create_tablespace_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `ssl_type` enum('','ANY','X509','SPECIFIED') CHARACTER SET utf8 NOT NULL DEFAULT '', + `ssl_cipher` blob NOT NULL, + `x509_issuer` blob NOT NULL, + `x509_subject` blob NOT NULL, + `max_questions` int(11) unsigned NOT NULL DEFAULT '0', + `max_updates` int(11) unsigned NOT NULL DEFAULT '0', + `max_connections` int(11) unsigned NOT NULL DEFAULT '0', + `max_user_connections` int(11) unsigned NOT NULL DEFAULT '0', + `plugin` char(60) COLLATE utf8_bin NOT NULL DEFAULT '', + `authentication_string` text COLLATE utf8_bin NOT NULL, + PRIMARY KEY (`Host`,`User`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Users and global privileges'; +/*!40101 SET character_set_client = @saved_cs_client */; + +CREATE DATABASE /*!32312 IF NOT EXISTS*/ `percona_test` /*!40100 DEFAULT CHARACTER SET latin1 */; + +USE `percona_test`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `checksums` ( + `db_tbl` varchar(128) NOT NULL, + `checksum` int(10) unsigned NOT NULL, + PRIMARY KEY (`db_tbl`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `load_data` ( + `i` int(11) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `sentinel` ( + `id` int(11) NOT NULL, + `ping` varchar(64) NOT NULL DEFAULT '', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + +CREATE DATABASE /*!32312 IF NOT EXISTS*/ `sakila` /*!40100 DEFAULT CHARACTER SET latin1 */; + +USE `sakila`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `actor` ( + `actor_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT, + `first_name` varchar(45) NOT NULL, + `last_name` varchar(45) NOT NULL, + `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`actor_id`), + KEY `idx_actor_last_name` (`last_name`) +) ENGINE=InnoDB AUTO_INCREMENT=201 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +/*!50001 CREATE TABLE `actor_info` ( + `actor_id` smallint(5) unsigned, + `first_name` varchar(45), + `last_name` varchar(45), + `film_info` text +) ENGINE=MyISAM */; +SET character_set_client = @saved_cs_client; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `address` ( + `address_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT, + `address` varchar(50) NOT NULL, + `address2` varchar(50) DEFAULT NULL, + `district` varchar(20) NOT NULL, + `city_id` smallint(5) unsigned NOT NULL, + `postal_code` varchar(10) DEFAULT NULL, + `phone` varchar(20) NOT NULL, + `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`address_id`), + KEY `idx_fk_city_id` (`city_id`), + CONSTRAINT `fk_address_city` FOREIGN KEY (`city_id`) REFERENCES `city` (`city_id`) ON UPDATE CASCADE +) ENGINE=InnoDB AUTO_INCREMENT=606 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `category` ( + `category_id` tinyint(3) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(25) NOT NULL, + `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`category_id`) +) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `city` ( + `city_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT, + `city` varchar(50) NOT NULL, + `country_id` smallint(5) unsigned NOT NULL, + `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`city_id`), + KEY `idx_fk_country_id` (`country_id`), + CONSTRAINT `fk_city_country` FOREIGN KEY (`country_id`) REFERENCES `country` (`country_id`) ON UPDATE CASCADE +) ENGINE=InnoDB AUTO_INCREMENT=601 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `country` ( + `country_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT, + `country` varchar(50) NOT NULL, + `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`country_id`) +) ENGINE=InnoDB AUTO_INCREMENT=110 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `customer` ( + `customer_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT, + `store_id` tinyint(3) unsigned NOT NULL, + `first_name` varchar(45) NOT NULL, + `last_name` varchar(45) NOT NULL, + `email` varchar(50) DEFAULT NULL, + `address_id` smallint(5) unsigned NOT NULL, + `active` tinyint(1) NOT NULL DEFAULT '1', + `create_date` datetime NOT NULL, + `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`customer_id`), + KEY `idx_fk_store_id` (`store_id`), + KEY `idx_fk_address_id` (`address_id`), + KEY `idx_last_name` (`last_name`), + CONSTRAINT `fk_customer_address` FOREIGN KEY (`address_id`) REFERENCES `address` (`address_id`) ON UPDATE CASCADE, + CONSTRAINT `fk_customer_store` FOREIGN KEY (`store_id`) REFERENCES `store` (`store_id`) ON UPDATE CASCADE +) ENGINE=InnoDB AUTO_INCREMENT=600 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = utf8 */ ; +/*!50003 SET character_set_results = utf8 */ ; +/*!50003 SET collation_connection = utf8_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = '' */ ; +DELIMITER ;; +/*!50003 CREATE*/ /*!50017 DEFINER=`msandbox`@`%`*/ /*!50003 TRIGGER customer_create_date BEFORE INSERT ON customer + FOR EACH ROW SET NEW.create_date = NOW() */;; +DELIMITER ; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +/*!50001 CREATE TABLE `customer_list` ( + `ID` smallint(5) unsigned, + `name` varchar(91), + `address` varchar(50), + `zip code` varchar(10), + `phone` varchar(20), + `city` varchar(50), + `country` varchar(50), + `notes` varchar(6), + `SID` tinyint(3) unsigned +) ENGINE=MyISAM */; +SET character_set_client = @saved_cs_client; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `film` ( + `film_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT, + `title` varchar(255) NOT NULL, + `description` text, + `release_year` year(4) DEFAULT NULL, + `language_id` tinyint(3) unsigned NOT NULL, + `original_language_id` tinyint(3) unsigned DEFAULT NULL, + `rental_duration` tinyint(3) unsigned NOT NULL DEFAULT '3', + `rental_rate` decimal(4,2) NOT NULL DEFAULT '4.99', + `length` smallint(5) unsigned DEFAULT NULL, + `replacement_cost` decimal(5,2) NOT NULL DEFAULT '19.99', + `rating` enum('G','PG','PG-13','R','NC-17') DEFAULT 'G', + `special_features` set('Trailers','Commentaries','Deleted Scenes','Behind the Scenes') DEFAULT NULL, + `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`film_id`), + KEY `idx_title` (`title`), + KEY `idx_fk_language_id` (`language_id`), + KEY `idx_fk_original_language_id` (`original_language_id`), + CONSTRAINT `fk_film_language` FOREIGN KEY (`language_id`) REFERENCES `language` (`language_id`) ON UPDATE CASCADE, + CONSTRAINT `fk_film_language_original` FOREIGN KEY (`original_language_id`) REFERENCES `language` (`language_id`) ON UPDATE CASCADE +) ENGINE=InnoDB AUTO_INCREMENT=1001 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = utf8 */ ; +/*!50003 SET character_set_results = utf8 */ ; +/*!50003 SET collation_connection = utf8_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */ ; +DELIMITER ;; +/*!50003 CREATE*/ /*!50017 DEFINER=`msandbox`@`%`*/ /*!50003 TRIGGER `ins_film` AFTER INSERT ON `film` FOR EACH ROW BEGIN + INSERT INTO film_text (film_id, title, description) + VALUES (new.film_id, new.title, new.description); + END */;; +DELIMITER ; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = utf8 */ ; +/*!50003 SET character_set_results = utf8 */ ; +/*!50003 SET collation_connection = utf8_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */ ; +DELIMITER ;; +/*!50003 CREATE*/ /*!50017 DEFINER=`msandbox`@`%`*/ /*!50003 TRIGGER `upd_film` AFTER UPDATE ON `film` FOR EACH ROW BEGIN + IF (old.title != new.title) or (old.description != new.description) + THEN + UPDATE film_text + SET title=new.title, + description=new.description, + film_id=new.film_id + WHERE film_id=old.film_id; + END IF; + END */;; +DELIMITER ; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = utf8 */ ; +/*!50003 SET character_set_results = utf8 */ ; +/*!50003 SET collation_connection = utf8_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */ ; +DELIMITER ;; +/*!50003 CREATE*/ /*!50017 DEFINER=`msandbox`@`%`*/ /*!50003 TRIGGER `del_film` AFTER DELETE ON `film` FOR EACH ROW BEGIN + DELETE FROM film_text WHERE film_id = old.film_id; + END */;; +DELIMITER ; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `film_actor` ( + `actor_id` smallint(5) unsigned NOT NULL, + `film_id` smallint(5) unsigned NOT NULL, + `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`actor_id`,`film_id`), + KEY `idx_fk_film_id` (`film_id`), + CONSTRAINT `fk_film_actor_actor` FOREIGN KEY (`actor_id`) REFERENCES `actor` (`actor_id`) ON UPDATE CASCADE, + CONSTRAINT `fk_film_actor_film` FOREIGN KEY (`film_id`) REFERENCES `film` (`film_id`) ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `film_category` ( + `film_id` smallint(5) unsigned NOT NULL, + `category_id` tinyint(3) unsigned NOT NULL, + `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`film_id`,`category_id`), + KEY `fk_film_category_category` (`category_id`), + CONSTRAINT `fk_film_category_film` FOREIGN KEY (`film_id`) REFERENCES `film` (`film_id`) ON UPDATE CASCADE, + CONSTRAINT `fk_film_category_category` FOREIGN KEY (`category_id`) REFERENCES `category` (`category_id`) ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +/*!50001 CREATE TABLE `film_list` ( + `FID` smallint(5) unsigned, + `title` varchar(255), + `description` text, + `category` varchar(25), + `price` decimal(4,2), + `length` smallint(5) unsigned, + `rating` enum('G','PG','PG-13','R','NC-17'), + `actors` text +) ENGINE=MyISAM */; +SET character_set_client = @saved_cs_client; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `film_text` ( + `film_id` smallint(6) NOT NULL, + `title` varchar(255) NOT NULL, + `description` text, + PRIMARY KEY (`film_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `inventory` ( + `inventory_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `film_id` smallint(5) unsigned NOT NULL, + `store_id` tinyint(3) unsigned NOT NULL, + `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`inventory_id`), + KEY `idx_fk_film_id` (`film_id`), + KEY `idx_store_id_film_id` (`store_id`,`film_id`), + CONSTRAINT `fk_inventory_store` FOREIGN KEY (`store_id`) REFERENCES `store` (`store_id`) ON UPDATE CASCADE, + CONSTRAINT `fk_inventory_film` FOREIGN KEY (`film_id`) REFERENCES `film` (`film_id`) ON UPDATE CASCADE +) ENGINE=InnoDB AUTO_INCREMENT=4582 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `language` ( + `language_id` tinyint(3) unsigned NOT NULL AUTO_INCREMENT, + `name` char(20) NOT NULL, + `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`language_id`) +) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +/*!50001 CREATE TABLE `nicer_but_slower_film_list` ( + `FID` smallint(5) unsigned, + `title` varchar(255), + `description` text, + `category` varchar(25), + `price` decimal(4,2), + `length` smallint(5) unsigned, + `rating` enum('G','PG','PG-13','R','NC-17'), + `actors` text +) ENGINE=MyISAM */; +SET character_set_client = @saved_cs_client; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `payment` ( + `payment_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT, + `customer_id` smallint(5) unsigned NOT NULL, + `staff_id` tinyint(3) unsigned NOT NULL, + `rental_id` int(11) DEFAULT NULL, + `amount` decimal(5,2) NOT NULL, + `payment_date` datetime NOT NULL, + `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`payment_id`), + KEY `idx_fk_staff_id` (`staff_id`), + KEY `idx_fk_customer_id` (`customer_id`), + KEY `fk_payment_rental` (`rental_id`), + CONSTRAINT `fk_payment_rental` FOREIGN KEY (`rental_id`) REFERENCES `rental` (`rental_id`) ON DELETE SET NULL ON UPDATE CASCADE, + CONSTRAINT `fk_payment_customer` FOREIGN KEY (`customer_id`) REFERENCES `customer` (`customer_id`) ON UPDATE CASCADE, + CONSTRAINT `fk_payment_staff` FOREIGN KEY (`staff_id`) REFERENCES `staff` (`staff_id`) ON UPDATE CASCADE +) ENGINE=InnoDB AUTO_INCREMENT=16050 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = utf8 */ ; +/*!50003 SET character_set_results = utf8 */ ; +/*!50003 SET collation_connection = utf8_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = '' */ ; +DELIMITER ;; +/*!50003 CREATE*/ /*!50017 DEFINER=`msandbox`@`%`*/ /*!50003 TRIGGER payment_date BEFORE INSERT ON payment + FOR EACH ROW SET NEW.payment_date = NOW() */;; +DELIMITER ; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `rental` ( + `rental_id` int(11) NOT NULL AUTO_INCREMENT, + `rental_date` datetime NOT NULL, + `inventory_id` mediumint(8) unsigned NOT NULL, + `customer_id` smallint(5) unsigned NOT NULL, + `return_date` datetime DEFAULT NULL, + `staff_id` tinyint(3) unsigned NOT NULL, + `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`rental_id`), + UNIQUE KEY `rental_date` (`rental_date`,`inventory_id`,`customer_id`), + KEY `idx_fk_inventory_id` (`inventory_id`), + KEY `idx_fk_customer_id` (`customer_id`), + KEY `idx_fk_staff_id` (`staff_id`), + CONSTRAINT `fk_rental_staff` FOREIGN KEY (`staff_id`) REFERENCES `staff` (`staff_id`) ON UPDATE CASCADE, + CONSTRAINT `fk_rental_inventory` FOREIGN KEY (`inventory_id`) REFERENCES `inventory` (`inventory_id`) ON UPDATE CASCADE, + CONSTRAINT `fk_rental_customer` FOREIGN KEY (`customer_id`) REFERENCES `customer` (`customer_id`) ON UPDATE CASCADE +) ENGINE=InnoDB AUTO_INCREMENT=16050 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = utf8 */ ; +/*!50003 SET character_set_results = utf8 */ ; +/*!50003 SET collation_connection = utf8_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = '' */ ; +DELIMITER ;; +/*!50003 CREATE*/ /*!50017 DEFINER=`msandbox`@`%`*/ /*!50003 TRIGGER rental_date BEFORE INSERT ON rental + FOR EACH ROW SET NEW.rental_date = NOW() */;; +DELIMITER ; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +/*!50001 CREATE TABLE `sales_by_film_category` ( + `category` varchar(25), + `total_sales` decimal(27,2) +) ENGINE=MyISAM */; +SET character_set_client = @saved_cs_client; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +/*!50001 CREATE TABLE `sales_by_store` ( + `store` varchar(101), + `manager` varchar(91), + `total_sales` decimal(27,2) +) ENGINE=MyISAM */; +SET character_set_client = @saved_cs_client; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `staff` ( + `staff_id` tinyint(3) unsigned NOT NULL AUTO_INCREMENT, + `first_name` varchar(45) NOT NULL, + `last_name` varchar(45) NOT NULL, + `address_id` smallint(5) unsigned NOT NULL, + `picture` blob, + `email` varchar(50) DEFAULT NULL, + `store_id` tinyint(3) unsigned NOT NULL, + `active` tinyint(1) NOT NULL DEFAULT '1', + `username` varchar(16) NOT NULL, + `password` varchar(40) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, + `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`staff_id`), + KEY `idx_fk_store_id` (`store_id`), + KEY `idx_fk_address_id` (`address_id`), + CONSTRAINT `fk_staff_store` FOREIGN KEY (`store_id`) REFERENCES `store` (`store_id`) ON UPDATE CASCADE, + CONSTRAINT `fk_staff_address` FOREIGN KEY (`address_id`) REFERENCES `address` (`address_id`) ON UPDATE CASCADE +) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +/*!50001 CREATE TABLE `staff_list` ( + `ID` tinyint(3) unsigned, + `name` varchar(91), + `address` varchar(50), + `zip code` varchar(10), + `phone` varchar(20), + `city` varchar(50), + `country` varchar(50), + `SID` tinyint(3) unsigned +) ENGINE=MyISAM */; +SET character_set_client = @saved_cs_client; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `store` ( + `store_id` tinyint(3) unsigned NOT NULL AUTO_INCREMENT, + `manager_staff_id` tinyint(3) unsigned NOT NULL, + `address_id` smallint(5) unsigned NOT NULL, + `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`store_id`), + UNIQUE KEY `idx_unique_manager` (`manager_staff_id`), + KEY `idx_fk_address_id` (`address_id`), + CONSTRAINT `fk_store_staff` FOREIGN KEY (`manager_staff_id`) REFERENCES `staff` (`staff_id`) ON UPDATE CASCADE, + CONSTRAINT `fk_store_address` FOREIGN KEY (`address_id`) REFERENCES `address` (`address_id`) ON UPDATE CASCADE +) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = utf8 */ ; +/*!50003 SET character_set_results = utf8 */ ; +/*!50003 SET collation_connection = utf8_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */ ; +DELIMITER ;; +/*!50003 CREATE*/ /*!50020 DEFINER=`msandbox`@`%`*/ /*!50003 FUNCTION `get_customer_balance`(p_customer_id INT, p_effective_date DATETIME) RETURNS decimal(5,2) + READS SQL DATA + DETERMINISTIC +BEGIN + + + + + + + + + DECLARE v_rentfees DECIMAL(5,2); + DECLARE v_overfees INTEGER; + DECLARE v_payments DECIMAL(5,2); + + SELECT IFNULL(SUM(film.rental_rate),0) INTO v_rentfees + FROM film, inventory, rental + WHERE film.film_id = inventory.film_id + AND inventory.inventory_id = rental.inventory_id + AND rental.rental_date <= p_effective_date + AND rental.customer_id = p_customer_id; + + SELECT IFNULL(SUM(IF((TO_DAYS(rental.return_date) - TO_DAYS(rental.rental_date)) > film.rental_duration, + ((TO_DAYS(rental.return_date) - TO_DAYS(rental.rental_date)) - film.rental_duration),0)),0) INTO v_overfees + FROM rental, inventory, film + WHERE film.film_id = inventory.film_id + AND inventory.inventory_id = rental.inventory_id + AND rental.rental_date <= p_effective_date + AND rental.customer_id = p_customer_id; + + + SELECT IFNULL(SUM(payment.amount),0) INTO v_payments + FROM payment + + WHERE payment.payment_date <= p_effective_date + AND payment.customer_id = p_customer_id; + + RETURN v_rentfees + v_overfees - v_payments; +END */;; +DELIMITER ; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = utf8 */ ; +/*!50003 SET character_set_results = utf8 */ ; +/*!50003 SET collation_connection = utf8_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */ ; +DELIMITER ;; +/*!50003 CREATE*/ /*!50020 DEFINER=`msandbox`@`%`*/ /*!50003 FUNCTION `inventory_held_by_customer`(p_inventory_id INT) RETURNS int(11) + READS SQL DATA +BEGIN + DECLARE v_customer_id INT; + DECLARE EXIT HANDLER FOR NOT FOUND RETURN NULL; + + SELECT customer_id INTO v_customer_id + FROM rental + WHERE return_date IS NULL + AND inventory_id = p_inventory_id; + + RETURN v_customer_id; +END */;; +DELIMITER ; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = utf8 */ ; +/*!50003 SET character_set_results = utf8 */ ; +/*!50003 SET collation_connection = utf8_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */ ; +DELIMITER ;; +/*!50003 CREATE*/ /*!50020 DEFINER=`msandbox`@`%`*/ /*!50003 FUNCTION `inventory_in_stock`(p_inventory_id INT) RETURNS tinyint(1) + READS SQL DATA +BEGIN + DECLARE v_rentals INT; + DECLARE v_out INT; + + + + + SELECT COUNT(*) INTO v_rentals + FROM rental + WHERE inventory_id = p_inventory_id; + + IF v_rentals = 0 THEN + RETURN TRUE; + END IF; + + SELECT COUNT(rental_id) INTO v_out + FROM inventory LEFT JOIN rental USING(inventory_id) + WHERE inventory.inventory_id = p_inventory_id + AND rental.return_date IS NULL; + + IF v_out > 0 THEN + RETURN FALSE; + ELSE + RETURN TRUE; + END IF; +END */;; +DELIMITER ; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = utf8 */ ; +/*!50003 SET character_set_results = utf8 */ ; +/*!50003 SET collation_connection = utf8_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */ ; +DELIMITER ;; +/*!50003 CREATE*/ /*!50020 DEFINER=`msandbox`@`%`*/ /*!50003 PROCEDURE `film_in_stock`(IN p_film_id INT, IN p_store_id INT, OUT p_film_count INT) + READS SQL DATA +BEGIN + SELECT inventory_id + FROM inventory + WHERE film_id = p_film_id + AND store_id = p_store_id + AND inventory_in_stock(inventory_id); + + SELECT FOUND_ROWS() INTO p_film_count; +END */;; +DELIMITER ; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = utf8 */ ; +/*!50003 SET character_set_results = utf8 */ ; +/*!50003 SET collation_connection = utf8_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */ ; +DELIMITER ;; +/*!50003 CREATE*/ /*!50020 DEFINER=`msandbox`@`%`*/ /*!50003 PROCEDURE `film_not_in_stock`(IN p_film_id INT, IN p_store_id INT, OUT p_film_count INT) + READS SQL DATA +BEGIN + SELECT inventory_id + FROM inventory + WHERE film_id = p_film_id + AND store_id = p_store_id + AND NOT inventory_in_stock(inventory_id); + + SELECT FOUND_ROWS() INTO p_film_count; +END */;; +DELIMITER ; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = utf8 */ ; +/*!50003 SET character_set_results = utf8 */ ; +/*!50003 SET collation_connection = utf8_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */ ; +DELIMITER ;; +/*!50003 CREATE*/ /*!50020 DEFINER=`msandbox`@`%`*/ /*!50003 PROCEDURE `rewards_report`( + IN min_monthly_purchases TINYINT UNSIGNED + , IN min_dollar_amount_purchased DECIMAL(10,2) UNSIGNED + , OUT count_rewardees INT +) + READS SQL DATA + COMMENT 'Provides a customizable report on best customers' +proc: BEGIN + + DECLARE last_month_start DATE; + DECLARE last_month_end DATE; + + + IF min_monthly_purchases = 0 THEN + SELECT 'Minimum monthly purchases parameter must be > 0'; + LEAVE proc; + END IF; + IF min_dollar_amount_purchased = 0.00 THEN + SELECT 'Minimum monthly dollar amount purchased parameter must be > $0.00'; + LEAVE proc; + END IF; + + + SET last_month_start = DATE_SUB(CURRENT_DATE(), INTERVAL 1 MONTH); + SET last_month_start = STR_TO_DATE(CONCAT(YEAR(last_month_start),'-',MONTH(last_month_start),'-01'),'%Y-%m-%d'); + SET last_month_end = LAST_DAY(last_month_start); + + + CREATE TEMPORARY TABLE tmpCustomer (customer_id SMALLINT UNSIGNED NOT NULL PRIMARY KEY); + + + INSERT INTO tmpCustomer (customer_id) + SELECT p.customer_id + FROM payment AS p + WHERE DATE(p.payment_date) BETWEEN last_month_start AND last_month_end + GROUP BY customer_id + HAVING SUM(p.amount) > min_dollar_amount_purchased + AND COUNT(customer_id) > min_monthly_purchases; + + + SELECT COUNT(*) FROM tmpCustomer INTO count_rewardees; + + + SELECT c.* + FROM tmpCustomer AS t + INNER JOIN customer AS c ON t.customer_id = c.customer_id; + + + DROP TABLE tmpCustomer; +END */;; +DELIMITER ; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; + +USE `mysql`; + +USE `percona_test`; + +USE `sakila`; +/*!50001 DROP TABLE IF EXISTS `actor_info`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = utf8 */; +/*!50001 SET character_set_results = utf8 */; +/*!50001 SET collation_connection = utf8_general_ci */; +/*!50001 CREATE ALGORITHM=UNDEFINED */ +/*!50013 DEFINER=`msandbox`@`%` SQL SECURITY INVOKER */ +/*!50001 VIEW `actor_info` AS select `a`.`actor_id` AS `actor_id`,`a`.`first_name` AS `first_name`,`a`.`last_name` AS `last_name`,group_concat(distinct concat(`c`.`name`,': ',(select group_concat(`f`.`title` order by `f`.`title` ASC separator ', ') from ((`film` `f` join `film_category` `fc` on((`f`.`film_id` = `fc`.`film_id`))) join `film_actor` `fa` on((`f`.`film_id` = `fa`.`film_id`))) where ((`fc`.`category_id` = `c`.`category_id`) and (`fa`.`actor_id` = `a`.`actor_id`)))) order by `c`.`name` ASC separator '; ') AS `film_info` from (((`actor` `a` left join `film_actor` `fa` on((`a`.`actor_id` = `fa`.`actor_id`))) left join `film_category` `fc` on((`fa`.`film_id` = `fc`.`film_id`))) left join `category` `c` on((`fc`.`category_id` = `c`.`category_id`))) group by `a`.`actor_id`,`a`.`first_name`,`a`.`last_name` */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; +/*!50001 DROP TABLE IF EXISTS `customer_list`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = utf8 */; +/*!50001 SET character_set_results = utf8 */; +/*!50001 SET collation_connection = utf8_general_ci */; +/*!50001 CREATE ALGORITHM=UNDEFINED */ +/*!50013 DEFINER=`msandbox`@`%` SQL SECURITY DEFINER */ +/*!50001 VIEW `customer_list` AS select `cu`.`customer_id` AS `ID`,concat(`cu`.`first_name`,_utf8' ',`cu`.`last_name`) AS `name`,`a`.`address` AS `address`,`a`.`postal_code` AS `zip code`,`a`.`phone` AS `phone`,`city`.`city` AS `city`,`country`.`country` AS `country`,if(`cu`.`active`,_utf8'active',_utf8'') AS `notes`,`cu`.`store_id` AS `SID` from (((`customer` `cu` join `address` `a` on((`cu`.`address_id` = `a`.`address_id`))) join `city` on((`a`.`city_id` = `city`.`city_id`))) join `country` on((`city`.`country_id` = `country`.`country_id`))) */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; +/*!50001 DROP TABLE IF EXISTS `film_list`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = utf8 */; +/*!50001 SET character_set_results = utf8 */; +/*!50001 SET collation_connection = utf8_general_ci */; +/*!50001 CREATE ALGORITHM=UNDEFINED */ +/*!50013 DEFINER=`msandbox`@`%` SQL SECURITY DEFINER */ +/*!50001 VIEW `film_list` AS select `film`.`film_id` AS `FID`,`film`.`title` AS `title`,`film`.`description` AS `description`,`category`.`name` AS `category`,`film`.`rental_rate` AS `price`,`film`.`length` AS `length`,`film`.`rating` AS `rating`,group_concat(concat(`actor`.`first_name`,_utf8' ',`actor`.`last_name`) separator ', ') AS `actors` from ((((`category` left join `film_category` on((`category`.`category_id` = `film_category`.`category_id`))) left join `film` on((`film_category`.`film_id` = `film`.`film_id`))) join `film_actor` on((`film`.`film_id` = `film_actor`.`film_id`))) join `actor` on((`film_actor`.`actor_id` = `actor`.`actor_id`))) group by `film`.`film_id` */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; +/*!50001 DROP TABLE IF EXISTS `nicer_but_slower_film_list`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = utf8 */; +/*!50001 SET character_set_results = utf8 */; +/*!50001 SET collation_connection = utf8_general_ci */; +/*!50001 CREATE ALGORITHM=UNDEFINED */ +/*!50013 DEFINER=`msandbox`@`%` SQL SECURITY DEFINER */ +/*!50001 VIEW `nicer_but_slower_film_list` AS select `film`.`film_id` AS `FID`,`film`.`title` AS `title`,`film`.`description` AS `description`,`category`.`name` AS `category`,`film`.`rental_rate` AS `price`,`film`.`length` AS `length`,`film`.`rating` AS `rating`,group_concat(concat(concat(ucase(substr(`actor`.`first_name`,1,1)),lcase(substr(`actor`.`first_name`,2,length(`actor`.`first_name`))),_utf8' ',concat(ucase(substr(`actor`.`last_name`,1,1)),lcase(substr(`actor`.`last_name`,2,length(`actor`.`last_name`)))))) separator ', ') AS `actors` from ((((`category` left join `film_category` on((`category`.`category_id` = `film_category`.`category_id`))) left join `film` on((`film_category`.`film_id` = `film`.`film_id`))) join `film_actor` on((`film`.`film_id` = `film_actor`.`film_id`))) join `actor` on((`film_actor`.`actor_id` = `actor`.`actor_id`))) group by `film`.`film_id` */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; +/*!50001 DROP TABLE IF EXISTS `sales_by_film_category`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = utf8 */; +/*!50001 SET character_set_results = utf8 */; +/*!50001 SET collation_connection = utf8_general_ci */; +/*!50001 CREATE ALGORITHM=UNDEFINED */ +/*!50013 DEFINER=`msandbox`@`%` SQL SECURITY DEFINER */ +/*!50001 VIEW `sales_by_film_category` AS select `c`.`name` AS `category`,sum(`p`.`amount`) AS `total_sales` from (((((`payment` `p` join `rental` `r` on((`p`.`rental_id` = `r`.`rental_id`))) join `inventory` `i` on((`r`.`inventory_id` = `i`.`inventory_id`))) join `film` `f` on((`i`.`film_id` = `f`.`film_id`))) join `film_category` `fc` on((`f`.`film_id` = `fc`.`film_id`))) join `category` `c` on((`fc`.`category_id` = `c`.`category_id`))) group by `c`.`name` order by sum(`p`.`amount`) desc */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; +/*!50001 DROP TABLE IF EXISTS `sales_by_store`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = utf8 */; +/*!50001 SET character_set_results = utf8 */; +/*!50001 SET collation_connection = utf8_general_ci */; +/*!50001 CREATE ALGORITHM=UNDEFINED */ +/*!50013 DEFINER=`msandbox`@`%` SQL SECURITY DEFINER */ +/*!50001 VIEW `sales_by_store` AS select concat(`c`.`city`,_utf8',',`cy`.`country`) AS `store`,concat(`m`.`first_name`,_utf8' ',`m`.`last_name`) AS `manager`,sum(`p`.`amount`) AS `total_sales` from (((((((`payment` `p` join `rental` `r` on((`p`.`rental_id` = `r`.`rental_id`))) join `inventory` `i` on((`r`.`inventory_id` = `i`.`inventory_id`))) join `store` `s` on((`i`.`store_id` = `s`.`store_id`))) join `address` `a` on((`s`.`address_id` = `a`.`address_id`))) join `city` `c` on((`a`.`city_id` = `c`.`city_id`))) join `country` `cy` on((`c`.`country_id` = `cy`.`country_id`))) join `staff` `m` on((`s`.`manager_staff_id` = `m`.`staff_id`))) group by `s`.`store_id` order by `cy`.`country`,`c`.`city` */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; +/*!50001 DROP TABLE IF EXISTS `staff_list`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = utf8 */; +/*!50001 SET character_set_results = utf8 */; +/*!50001 SET collation_connection = utf8_general_ci */; +/*!50001 CREATE ALGORITHM=UNDEFINED */ +/*!50013 DEFINER=`msandbox`@`%` SQL SECURITY DEFINER */ +/*!50001 VIEW `staff_list` AS select `s`.`staff_id` AS `ID`,concat(`s`.`first_name`,_utf8' ',`s`.`last_name`) AS `name`,`a`.`address` AS `address`,`a`.`postal_code` AS `zip code`,`a`.`phone` AS `phone`,`city`.`city` AS `city`,`country`.`country` AS `country`,`s`.`store_id` AS `SID` from (((`staff` `s` join `address` `a` on((`s`.`address_id` = `a`.`address_id`))) join `city` on((`a`.`city_id` = `city`.`city_id`))) join `country` on((`city`.`country_id` = `country`.`country_id`))) */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; diff --git a/t/pt-mysql-summary/samples/temp007/collect.err b/t/pt-mysql-summary/samples/temp007/collect.err new file mode 100644 index 00000000..e69de29b diff --git a/t/pt-mysql-summary/samples/temp007/innodb-status b/t/pt-mysql-summary/samples/temp007/innodb-status new file mode 100644 index 00000000..6870f4aa --- /dev/null +++ b/t/pt-mysql-summary/samples/temp007/innodb-status @@ -0,0 +1,118 @@ +*************************** 1. row *************************** + Type: InnoDB + Name: +Status: +===================================== +121127 18:59:59 INNODB MONITOR OUTPUT +===================================== +Per second averages calculated from the last 32 seconds +----------------- +BACKGROUND THREAD +----------------- +srv_master_thread loops: 32 1_second, 32 sleeps, 3 10_second, 4 background, 4 flush +srv_master_thread log flush and writes: 35 +---------- +SEMAPHORES +---------- +OS WAIT ARRAY INFO: reservation count 36, signal count 36 +Mutex spin waits 14, rounds 222, OS waits 4 +RW-shared spins 25, rounds 722, OS waits 24 +RW-excl spins 0, rounds 240, OS waits 8 +Spin rounds per wait: 15.86 mutex, 28.88 RW-shared, 240.00 RW-excl +-------- +FILE I/O +-------- +I/O thread 0 state: waiting for completed aio requests (insert buffer thread) +I/O thread 1 state: waiting for completed aio requests (log thread) +I/O thread 2 state: waiting for completed aio requests (read thread) +I/O thread 3 state: waiting for completed aio requests (read thread) +I/O thread 4 state: waiting for completed aio requests (read thread) +I/O thread 5 state: waiting for completed aio requests (read thread) +I/O thread 6 state: waiting for completed aio requests (write thread) +I/O thread 7 state: waiting for completed aio requests (write thread) +I/O thread 8 state: waiting for completed aio requests (write thread) +I/O thread 9 state: waiting for completed aio requests (write thread) +Pending normal aio reads: 0 [0, 0, 0, 0] , aio writes: 0 [0, 0, 0, 0] , + ibuf aio reads: 0, log i/o's: 0, sync i/o's: 0 +Pending flushes (fsync) log: 0; buffer pool: 0 +0 OS file reads, 955 OS file writes, 125 OS fsyncs +0.00 reads/s, 0 avg bytes/read, 0.00 writes/s, 0.00 fsyncs/s +------------------------------------- +INSERT BUFFER AND ADAPTIVE HASH INDEX +------------------------------------- +Ibuf: size 1, free list len 0, seg size 2, 0 merges +merged operations: + insert 0, delete mark 0, delete 0 +discarded operations: + insert 0, delete mark 0, delete 0 +Hash table size 138337, node heap has 7 buffer(s) +0.00 hash searches/s, 0.00 non-hash searches/s +--- +LOG +--- +Log sequence number 8603780 +Log flushed up to 8603780 +Last checkpoint at 8603780 +Max checkpoint age 7782360 +Checkpoint age target 7539162 +Modified age 0 +Checkpoint age 0 +0 pending log writes, 0 pending chkp writes +89 log i/o's done, 0.00 log i/o's/second +---------------------- +BUFFER POOL AND MEMORY +---------------------- +Total memory allocated 34062336; in additional pool allocated 0 +Internal hash tables (constant factor + variable factor) + Adaptive hash index 672196 (553348 + 118848) + Page hash 17692 (buffer pool 0 only) + Dictionary cache 219018 (139064 + 79954) + File system 41792 (41336 + 456) + Lock system 42228 (41908 + 320) + Recovery system 0 (0 + 0) +Dictionary memory allocated 79954 +Buffer pool size 2047 +Buffer pool size, bytes 33538048 +Free buffers 1347 +Database pages 693 +Old database pages 235 +Modified db pages 0 +Pending reads 0 +Pending writes: LRU 0, flush list 0, single page 0 +Pages made young 0, not young 0 +0.00 youngs/s, 0.00 non-youngs/s +Pages read 0, created 693, written 811 +0.00 reads/s, 0.00 creates/s, 0.00 writes/s +No buffer pool page gets since the last printout +Pages read ahead 0.00/s, evicted without access 0.00/s, Random read ahead 0.00/s +LRU len: 693, unzip_LRU len: 0 +I/O sum[0]:cur[0], unzip sum[0]:cur[0] +-------------- +ROW OPERATIONS +-------------- +0 queries inside InnoDB, 0 queries in queue +1 read views open inside InnoDB +---OLDEST VIEW--- +Normal read view +Read view low limit trx n:o 300 +Read view up limit trx id 300 +Read view low limit trx id 300 +Read view individually stored trx ids: +----------------- +Main thread process no. 30877, id 2895674176, state: waiting for server activity +Number of rows inserted 46315, updated 0, deleted 0, read 46274 +0.00 inserts/s, 0.00 updates/s, 0.00 deletes/s, 0.00 reads/s +------------ +TRANSACTIONS +------------ +Trx id counter 348 +Purge done for trx's n:o < 0 undo n:o < 0 +History list length 0 +LIST OF TRANSACTIONS FOR EACH SESSION: +---TRANSACTION 0, not started +MySQL thread id 18, OS thread handle 0xb6f31b40, query id 1170 localhost msandbox +SHOW /*!50000 ENGINE*/ INNODB STATUS +---------------------------- +END OF INNODB MONITOR OUTPUT +============================ + diff --git a/t/pt-mysql-summary/samples/temp007/mysql-databases b/t/pt-mysql-summary/samples/temp007/mysql-databases new file mode 100644 index 00000000..ff1205b2 --- /dev/null +++ b/t/pt-mysql-summary/samples/temp007/mysql-databases @@ -0,0 +1,5 @@ +information_schema +mysql +percona_test +performance_schema +sakila diff --git a/t/pt-mysql-summary/samples/temp007/mysql-master-logs b/t/pt-mysql-summary/samples/temp007/mysql-master-logs new file mode 100644 index 00000000..051f73cf --- /dev/null +++ b/t/pt-mysql-summary/samples/temp007/mysql-master-logs @@ -0,0 +1 @@ +mysql-bin.000001 3259054 diff --git a/t/pt-mysql-summary/samples/temp007/mysql-master-status b/t/pt-mysql-summary/samples/temp007/mysql-master-status new file mode 100644 index 00000000..84294174 --- /dev/null +++ b/t/pt-mysql-summary/samples/temp007/mysql-master-status @@ -0,0 +1 @@ +mysql-bin.000001 3259054 diff --git a/t/pt-mysql-summary/samples/temp007/mysql-plugins b/t/pt-mysql-summary/samples/temp007/mysql-plugins new file mode 100644 index 00000000..95fb6b17 --- /dev/null +++ b/t/pt-mysql-summary/samples/temp007/mysql-plugins @@ -0,0 +1,41 @@ +binlog ACTIVE STORAGE ENGINE NULL GPL +wsrep ACTIVE STORAGE ENGINE NULL GPL +mysql_native_password ACTIVE AUTHENTICATION NULL GPL +mysql_old_password ACTIVE AUTHENTICATION NULL GPL +MRG_MYISAM ACTIVE STORAGE ENGINE NULL GPL +MyISAM ACTIVE STORAGE ENGINE NULL GPL +MEMORY ACTIVE STORAGE ENGINE NULL GPL +CSV ACTIVE STORAGE ENGINE NULL GPL +PERFORMANCE_SCHEMA ACTIVE STORAGE ENGINE NULL GPL +InnoDB ACTIVE STORAGE ENGINE NULL GPL +INNODB_RSEG ACTIVE INFORMATION SCHEMA NULL GPL +INNODB_UNDO_LOGS ACTIVE INFORMATION SCHEMA NULL GPL +INNODB_TRX ACTIVE INFORMATION SCHEMA NULL GPL +INNODB_LOCKS ACTIVE INFORMATION SCHEMA NULL GPL +INNODB_LOCK_WAITS ACTIVE INFORMATION SCHEMA NULL GPL +INNODB_CMP ACTIVE INFORMATION SCHEMA NULL GPL +INNODB_CMP_RESET ACTIVE INFORMATION SCHEMA NULL GPL +INNODB_CMPMEM ACTIVE INFORMATION SCHEMA NULL GPL +INNODB_CMPMEM_RESET ACTIVE INFORMATION SCHEMA NULL GPL +INNODB_SYS_TABLES ACTIVE INFORMATION SCHEMA NULL GPL +INNODB_SYS_TABLESTATS ACTIVE INFORMATION SCHEMA NULL GPL +INNODB_SYS_INDEXES ACTIVE INFORMATION SCHEMA NULL GPL +INNODB_SYS_COLUMNS ACTIVE INFORMATION SCHEMA NULL GPL +INNODB_SYS_FIELDS ACTIVE INFORMATION SCHEMA NULL GPL +INNODB_SYS_FOREIGN ACTIVE INFORMATION SCHEMA NULL GPL +INNODB_SYS_FOREIGN_COLS ACTIVE INFORMATION SCHEMA NULL GPL +INNODB_SYS_STATS ACTIVE INFORMATION SCHEMA NULL GPL +INNODB_TABLE_STATS ACTIVE INFORMATION SCHEMA NULL GPL +INNODB_INDEX_STATS ACTIVE INFORMATION SCHEMA NULL GPL +INNODB_BUFFER_POOL_PAGES ACTIVE INFORMATION SCHEMA NULL GPL +INNODB_BUFFER_POOL_PAGES_INDEX ACTIVE INFORMATION SCHEMA NULL GPL +INNODB_BUFFER_POOL_PAGES_BLOB ACTIVE INFORMATION SCHEMA NULL GPL +XTRADB_ADMIN_COMMAND ACTIVE INFORMATION SCHEMA NULL GPL +INNODB_CHANGED_PAGES ACTIVE INFORMATION SCHEMA NULL GPL +INNODB_BUFFER_PAGE ACTIVE INFORMATION SCHEMA NULL GPL +INNODB_BUFFER_PAGE_LRU ACTIVE INFORMATION SCHEMA NULL GPL +INNODB_BUFFER_POOL_STATS ACTIVE INFORMATION SCHEMA NULL GPL +BLACKHOLE ACTIVE STORAGE ENGINE NULL GPL +ARCHIVE ACTIVE STORAGE ENGINE NULL GPL +FEDERATED DISABLED STORAGE ENGINE NULL GPL +partition ACTIVE STORAGE ENGINE NULL GPL diff --git a/t/pt-mysql-summary/samples/temp007/mysql-processlist b/t/pt-mysql-summary/samples/temp007/mysql-processlist new file mode 100644 index 00000000..53ecb70d --- /dev/null +++ b/t/pt-mysql-summary/samples/temp007/mysql-processlist @@ -0,0 +1,24 @@ +*************************** 1. row *************************** + Id: 4 + User: msandbox + Host: localhost:49789 + db: NULL + Command: Binlog Dump + Time: 88 + State: Master has sent all binlog to slave; waiting for binlog to be updated + Info: NULL + Rows_sent: 0 +Rows_examined: 0 + Rows_read: 2 +*************************** 2. row *************************** + Id: 19 + User: msandbox + Host: localhost + db: NULL + Command: Query + Time: 0 + State: NULL + Info: SHOW FULL PROCESSLIST + Rows_sent: 0 +Rows_examined: 0 + Rows_read: 1 diff --git a/t/pt-mysql-summary/samples/temp007/mysql-slave b/t/pt-mysql-summary/samples/temp007/mysql-slave new file mode 100644 index 00000000..e69de29b diff --git a/t/pt-mysql-summary/samples/temp007/mysql-status b/t/pt-mysql-summary/samples/temp007/mysql-status new file mode 100644 index 00000000..5cf3f159 --- /dev/null +++ b/t/pt-mysql-summary/samples/temp007/mysql-status @@ -0,0 +1,380 @@ +Aborted_clients 0 +Aborted_connects 0 +Binlog_cache_disk_use 1 +Binlog_cache_use 4 +Binlog_stmt_cache_disk_use 0 +Binlog_stmt_cache_use 1 +Bytes_received 3254928 +Bytes_sent 3284914 +Com_admin_commands 2 +Com_assign_to_keycache 0 +Com_alter_db 0 +Com_alter_db_upgrade 0 +Com_alter_event 0 +Com_alter_function 0 +Com_alter_procedure 0 +Com_alter_server 0 +Com_alter_table 0 +Com_alter_tablespace 0 +Com_analyze 0 +Com_begin 1 +Com_binlog 0 +Com_call_procedure 0 +Com_change_db 2 +Com_change_master 0 +Com_check 0 +Com_checksum 1 +Com_commit 2 +Com_create_db 2 +Com_create_event 0 +Com_create_function 3 +Com_create_index 0 +Com_create_procedure 3 +Com_create_server 0 +Com_create_table 19 +Com_create_trigger 6 +Com_create_udf 0 +Com_create_user 0 +Com_create_view 7 +Com_dealloc_sql 0 +Com_delete 0 +Com_delete_multi 0 +Com_do 0 +Com_drop_db 1 +Com_drop_event 0 +Com_drop_function 0 +Com_drop_index 0 +Com_drop_procedure 0 +Com_drop_server 0 +Com_drop_table 1 +Com_drop_trigger 0 +Com_drop_user 0 +Com_drop_view 0 +Com_empty_query 0 +Com_execute_sql 0 +Com_flush 0 +Com_grant 0 +Com_ha_close 0 +Com_ha_open 0 +Com_ha_read 0 +Com_help 0 +Com_insert 1059 +Com_insert_select 0 +Com_install_plugin 0 +Com_kill 0 +Com_load 1 +Com_lock_tables 0 +Com_optimize 0 +Com_preload_keys 0 +Com_prepare_sql 0 +Com_purge 0 +Com_purge_before_date 0 +Com_release_savepoint 0 +Com_rename_table 0 +Com_rename_user 0 +Com_repair 0 +Com_replace 0 +Com_replace_select 0 +Com_reset 0 +Com_resignal 0 +Com_revoke 0 +Com_revoke_all 0 +Com_rollback 1 +Com_rollback_to_savepoint 0 +Com_savepoint 0 +Com_select 17 +Com_set_option 12 +Com_signal 0 +Com_show_authors 0 +Com_show_binlog_events 0 +Com_show_binlogs 0 +Com_show_charsets 0 +Com_show_client_statistics 0 +Com_show_collations 0 +Com_show_contributors 0 +Com_show_create_db 0 +Com_show_create_event 0 +Com_show_create_func 0 +Com_show_create_proc 0 +Com_show_create_table 0 +Com_show_create_trigger 0 +Com_show_databases 0 +Com_show_engine_logs 0 +Com_show_engine_mutex 0 +Com_show_engine_status 1 +Com_show_events 0 +Com_show_errors 0 +Com_show_fields 0 +Com_show_function_status 0 +Com_show_grants 0 +Com_show_index_statistics 0 +Com_show_keys 0 +Com_show_master_status 0 +Com_show_open_tables 0 +Com_show_plugins 0 +Com_show_privileges 0 +Com_show_procedure_status 0 +Com_show_processlist 0 +Com_show_profile 0 +Com_show_profiles 0 +Com_show_relaylog_events 0 +Com_show_slave_hosts 0 +Com_show_slave_status 0 +Com_show_slave_status_nolock 0 +Com_show_status 1 +Com_show_storage_engines 0 +Com_show_table_statistics 0 +Com_show_table_status 0 +Com_show_tables 1 +Com_show_temporary_tables 0 +Com_show_thread_statistics 0 +Com_show_triggers 0 +Com_show_user_statistics 0 +Com_show_variables 2 +Com_show_warnings 0 +Com_slave_start 0 +Com_slave_stop 0 +Com_stmt_close 0 +Com_stmt_execute 0 +Com_stmt_fetch 0 +Com_stmt_prepare 0 +Com_stmt_reprepare 0 +Com_stmt_reset 0 +Com_stmt_send_long_data 0 +Com_truncate 0 +Com_uninstall_plugin 0 +Com_unlock_tables 0 +Com_update 1 +Com_update_multi 0 +Com_xa_commit 0 +Com_xa_end 0 +Com_xa_prepare 0 +Com_xa_recover 0 +Com_xa_rollback 0 +Com_xa_start 0 +Compression OFF +Connections 15 +Created_tmp_disk_tables 0 +Created_tmp_files 7 +Created_tmp_tables 4 +Delayed_errors 0 +Delayed_insert_threads 0 +Delayed_writes 0 +Flashcache_enabled OFF +Flush_commands 1 +Handler_commit 141 +Handler_delete 0 +Handler_discover 0 +Handler_prepare 122 +Handler_read_first 19 +Handler_read_key 16 +Handler_read_last 0 +Handler_read_next 0 +Handler_read_prev 0 +Handler_read_rnd 0 +Handler_read_rnd_next 49487 +Handler_rollback 15 +Handler_savepoint 0 +Handler_savepoint_rollback 0 +Handler_update 6 +Handler_write 47754 +Innodb_adaptive_hash_cells 138337 +Innodb_adaptive_hash_heap_buffers 6 +Innodb_adaptive_hash_hash_searches 128675 +Innodb_adaptive_hash_non_hash_searches 52783 +Innodb_background_log_sync 35 +Innodb_buffer_pool_pages_data 693 +Innodb_buffer_pool_pages_dirty 0 +Innodb_buffer_pool_pages_flushed 811 +Innodb_buffer_pool_pages_LRU_flushed 0 +Innodb_buffer_pool_pages_free 1347 +Innodb_buffer_pool_pages_made_not_young 0 +Innodb_buffer_pool_pages_made_young 0 +Innodb_buffer_pool_pages_misc 7 +Innodb_buffer_pool_pages_old 235 +Innodb_buffer_pool_pages_total 2047 +Innodb_buffer_pool_read_ahead_rnd 0 +Innodb_buffer_pool_read_ahead 0 +Innodb_buffer_pool_read_ahead_evicted 0 +Innodb_buffer_pool_read_requests 441583 +Innodb_buffer_pool_reads 0 +Innodb_buffer_pool_wait_free 0 +Innodb_buffer_pool_write_requests 234413 +Innodb_checkpoint_age 0 +Innodb_checkpoint_max_age 7782360 +Innodb_checkpoint_target_age 7539162 +Innodb_data_fsyncs 125 +Innodb_data_pending_fsyncs 0 +Innodb_data_pending_reads 0 +Innodb_data_pending_writes 0 +Innodb_data_read 0 +Innodb_data_reads 0 +Innodb_data_writes 955 +Innodb_data_written 32364544 +Innodb_dblwr_pages_written 637 +Innodb_dblwr_writes 16 +Innodb_deadlocks 0 +Innodb_dict_tables 26 +Innodb_have_atomic_builtins ON +Innodb_history_list_length 0 +Innodb_ibuf_discarded_delete_marks 0 +Innodb_ibuf_discarded_deletes 0 +Innodb_ibuf_discarded_inserts 0 +Innodb_ibuf_free_list 0 +Innodb_ibuf_merged_delete_marks 0 +Innodb_ibuf_merged_deletes 0 +Innodb_ibuf_merged_inserts 0 +Innodb_ibuf_merges 0 +Innodb_ibuf_segment_size 2 +Innodb_ibuf_size 1 +Innodb_log_waits 0 +Innodb_log_write_requests 17776 +Innodb_log_writes 66 +Innodb_lsn_current 8603780 +Innodb_lsn_flushed 8603780 +Innodb_lsn_last_checkpoint 8603780 +Innodb_master_thread_1_second_loops 32 +Innodb_master_thread_10_second_loops 3 +Innodb_master_thread_background_loops 4 +Innodb_master_thread_main_flush_loops 4 +Innodb_master_thread_sleeps 32 +Innodb_max_trx_id 840 +Innodb_mem_adaptive_hash 672196 +Innodb_mem_dictionary 219018 +Innodb_mem_total 34062336 +Innodb_mutex_os_waits 4 +Innodb_mutex_spin_rounds 222 +Innodb_mutex_spin_waits 14 +Innodb_oldest_view_low_limit_trx_id 768 +Innodb_os_log_fsyncs 87 +Innodb_os_log_pending_fsyncs 0 +Innodb_os_log_pending_writes 0 +Innodb_os_log_written 8628736 +Innodb_page_size 16384 +Innodb_pages_created 693 +Innodb_pages_read 0 +Innodb_pages_written 811 +Innodb_purge_trx_id 0 +Innodb_purge_undo_no 0 +Innodb_row_lock_current_waits 0 +Innodb_current_row_locks 0 +Innodb_row_lock_time 0 +Innodb_row_lock_time_avg 0 +Innodb_row_lock_time_max 0 +Innodb_row_lock_waits 0 +Innodb_rows_deleted 0 +Innodb_rows_inserted 46315 +Innodb_rows_read 46274 +Innodb_rows_updated 0 +Innodb_s_lock_os_waits 24 +Innodb_s_lock_spin_rounds 722 +Innodb_s_lock_spin_waits 25 +Innodb_truncated_status_writes 0 +Innodb_x_lock_os_waits 8 +Innodb_x_lock_spin_rounds 240 +Innodb_x_lock_spin_waits 0 +Key_blocks_not_flushed 0 +Key_blocks_unused 14295 +Key_blocks_used 202 +Key_read_requests 28816 +Key_reads 1 +Key_write_requests 11127 +Key_writes 212 +Last_query_cost 0.000000 +Max_used_connections 2 +Not_flushed_delayed_rows 0 +Open_files 54 +Open_streams 0 +Open_table_definitions 60 +Open_tables 62 +Opened_files 235 +Opened_table_definitions 85 +Opened_tables 94 +Performance_schema_cond_classes_lost 0 +Performance_schema_cond_instances_lost 0 +Performance_schema_file_classes_lost 0 +Performance_schema_file_handles_lost 0 +Performance_schema_file_instances_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_table_handles_lost 0 +Performance_schema_table_instances_lost 0 +Performance_schema_thread_classes_lost 0 +Performance_schema_thread_instances_lost 0 +Prepared_stmt_count 0 +Qcache_free_blocks 0 +Qcache_free_memory 0 +Qcache_hits 0 +Qcache_inserts 0 +Qcache_lowmem_prunes 0 +Qcache_not_cached 0 +Qcache_queries_in_cache 0 +Qcache_total_blocks 0 +Queries 1158 +Questions 158 +Rpl_status AUTH_MASTER +Select_full_join 0 +Select_full_range_join 0 +Select_range 0 +Select_range_check 0 +Select_scan 5 +Slave_heartbeat_period 0.000 +Slave_open_temp_tables 0 +Slave_received_heartbeats 0 +Slave_retried_transactions 0 +Slave_running OFF +Slow_launch_threads 0 +Slow_queries 0 +Sort_merge_passes 0 +Sort_range 0 +Sort_rows 0 +Sort_scan 0 +Ssl_accept_renegotiates 0 +Ssl_accepts 0 +Ssl_callback_cache_hits 0 +Ssl_cipher +Ssl_cipher_list +Ssl_client_connects 0 +Ssl_connect_renegotiates 0 +Ssl_ctx_verify_depth 0 +Ssl_ctx_verify_mode 0 +Ssl_default_timeout 0 +Ssl_finished_accepts 0 +Ssl_finished_connects 0 +Ssl_session_cache_hits 0 +Ssl_session_cache_misses 0 +Ssl_session_cache_mode NONE +Ssl_session_cache_overflows 0 +Ssl_session_cache_size 0 +Ssl_session_cache_timeouts 0 +Ssl_sessions_reused 0 +Ssl_used_session_cache_entries 0 +Ssl_verify_depth 0 +Ssl_verify_mode 0 +Ssl_version +Table_locks_immediate 189 +Table_locks_waited 0 +Tc_log_max_pages_used 0 +Tc_log_page_size 0 +Tc_log_page_waits 0 +Threads_cached 0 +Threads_connected 2 +Threads_created 14 +Threads_running 2 +Uptime 96 +Uptime_since_flush_status 96 +binlog_commits 5 +binlog_group_commits 5 +wsrep_cluster_conf_id 18446744073709551615 +wsrep_cluster_size 0 +wsrep_cluster_state_uuid +wsrep_cluster_status Disconnected +wsrep_connected OFF +wsrep_local_index 4294967295 +wsrep_provider_name +wsrep_provider_vendor +wsrep_provider_version +wsrep_ready ON diff --git a/t/pt-mysql-summary/samples/temp007/mysql-status-defer b/t/pt-mysql-summary/samples/temp007/mysql-status-defer new file mode 100644 index 00000000..ccd34a8d --- /dev/null +++ b/t/pt-mysql-summary/samples/temp007/mysql-status-defer @@ -0,0 +1,380 @@ +Aborted_clients 0 0 +Aborted_connects 0 0 +Binlog_cache_disk_use 1 1 +Binlog_cache_use 4 4 +Binlog_stmt_cache_disk_use 0 0 +Binlog_stmt_cache_use 1 1 +Bytes_received 3254928 3257215 +Bytes_sent 3284914 3309052 +Com_admin_commands 2 2 +Com_assign_to_keycache 0 0 +Com_alter_db 0 0 +Com_alter_db_upgrade 0 0 +Com_alter_event 0 0 +Com_alter_function 0 0 +Com_alter_procedure 0 0 +Com_alter_server 0 0 +Com_alter_table 0 0 +Com_alter_tablespace 0 0 +Com_analyze 0 0 +Com_begin 1 1 +Com_binlog 0 0 +Com_call_procedure 0 0 +Com_change_db 2 2 +Com_change_master 0 0 +Com_check 0 0 +Com_checksum 1 1 +Com_commit 2 2 +Com_create_db 2 2 +Com_create_event 0 0 +Com_create_function 3 3 +Com_create_index 0 0 +Com_create_procedure 3 3 +Com_create_server 0 0 +Com_create_table 19 19 +Com_create_trigger 6 6 +Com_create_udf 0 0 +Com_create_user 0 0 +Com_create_view 7 7 +Com_dealloc_sql 0 0 +Com_delete 0 0 +Com_delete_multi 0 0 +Com_do 0 0 +Com_drop_db 1 1 +Com_drop_event 0 0 +Com_drop_function 0 0 +Com_drop_index 0 0 +Com_drop_procedure 0 0 +Com_drop_server 0 0 +Com_drop_table 1 1 +Com_drop_trigger 0 0 +Com_drop_user 0 0 +Com_drop_view 0 0 +Com_empty_query 0 0 +Com_execute_sql 0 0 +Com_flush 0 0 +Com_grant 0 0 +Com_ha_close 0 0 +Com_ha_open 0 0 +Com_ha_read 0 0 +Com_help 0 0 +Com_insert 1059 1059 +Com_insert_select 0 0 +Com_install_plugin 0 0 +Com_kill 0 0 +Com_load 1 1 +Com_lock_tables 0 0 +Com_optimize 0 0 +Com_preload_keys 0 0 +Com_prepare_sql 0 0 +Com_purge 0 0 +Com_purge_before_date 0 0 +Com_release_savepoint 0 0 +Com_rename_table 0 0 +Com_rename_user 0 0 +Com_repair 0 0 +Com_replace 0 0 +Com_replace_select 0 0 +Com_reset 0 0 +Com_resignal 0 0 +Com_revoke 0 0 +Com_revoke_all 0 0 +Com_rollback 1 1 +Com_rollback_to_savepoint 0 0 +Com_savepoint 0 0 +Com_select 17 36 +Com_set_option 12 12 +Com_signal 0 0 +Com_show_authors 0 0 +Com_show_binlog_events 0 0 +Com_show_binlogs 0 1 +Com_show_charsets 0 0 +Com_show_client_statistics 0 0 +Com_show_collations 0 0 +Com_show_contributors 0 0 +Com_show_create_db 0 0 +Com_show_create_event 0 0 +Com_show_create_func 0 0 +Com_show_create_proc 0 0 +Com_show_create_table 0 0 +Com_show_create_trigger 0 0 +Com_show_databases 0 1 +Com_show_engine_logs 0 0 +Com_show_engine_mutex 0 0 +Com_show_engine_status 1 2 +Com_show_events 0 0 +Com_show_errors 0 0 +Com_show_fields 0 0 +Com_show_function_status 0 0 +Com_show_grants 0 0 +Com_show_index_statistics 0 0 +Com_show_keys 0 0 +Com_show_master_status 0 1 +Com_show_open_tables 0 0 +Com_show_plugins 0 1 +Com_show_privileges 0 0 +Com_show_procedure_status 0 0 +Com_show_processlist 0 1 +Com_show_profile 0 0 +Com_show_profiles 0 0 +Com_show_relaylog_events 0 0 +Com_show_slave_hosts 0 0 +Com_show_slave_status 0 1 +Com_show_slave_status_nolock 0 0 +Com_show_status 1 2 +Com_show_storage_engines 0 0 +Com_show_table_statistics 0 0 +Com_show_table_status 0 0 +Com_show_tables 1 1 +Com_show_temporary_tables 0 0 +Com_show_thread_statistics 0 0 +Com_show_triggers 0 0 +Com_show_user_statistics 0 0 +Com_show_variables 2 2 +Com_show_warnings 0 0 +Com_slave_start 0 0 +Com_slave_stop 0 0 +Com_stmt_close 0 0 +Com_stmt_execute 0 0 +Com_stmt_fetch 0 0 +Com_stmt_prepare 0 0 +Com_stmt_reprepare 0 0 +Com_stmt_reset 0 0 +Com_stmt_send_long_data 0 0 +Com_truncate 0 0 +Com_uninstall_plugin 0 0 +Com_unlock_tables 0 0 +Com_update 1 1 +Com_update_multi 0 0 +Com_xa_commit 0 0 +Com_xa_end 0 0 +Com_xa_prepare 0 0 +Com_xa_recover 0 0 +Com_xa_rollback 0 0 +Com_xa_start 0 0 +Compression OFF OFF +Connections 15 29 +Created_tmp_disk_tables 0 11 +Created_tmp_files 7 7 +Created_tmp_tables 4 73 +Delayed_errors 0 0 +Delayed_insert_threads 0 0 +Delayed_writes 0 0 +Flashcache_enabled OFF OFF +Flush_commands 1 1 +Handler_commit 141 141 +Handler_delete 0 0 +Handler_discover 0 0 +Handler_prepare 122 122 +Handler_read_first 19 19 +Handler_read_key 16 16 +Handler_read_last 0 0 +Handler_read_next 0 0 +Handler_read_prev 0 0 +Handler_read_rnd 0 0 +Handler_read_rnd_next 49487 49926 +Handler_rollback 15 15 +Handler_savepoint 0 0 +Handler_savepoint_rollback 0 0 +Handler_update 6 6 +Handler_write 47754 48186 +Innodb_adaptive_hash_cells 138337 138337 +Innodb_adaptive_hash_heap_buffers 6 6 +Innodb_adaptive_hash_hash_searches 128675 128675 +Innodb_adaptive_hash_non_hash_searches 52783 52783 +Innodb_background_log_sync 35 35 +Innodb_buffer_pool_pages_data 693 693 +Innodb_buffer_pool_pages_dirty 0 0 +Innodb_buffer_pool_pages_flushed 811 811 +Innodb_buffer_pool_pages_LRU_flushed 0 0 +Innodb_buffer_pool_pages_free 1347 1347 +Innodb_buffer_pool_pages_made_not_young 0 0 +Innodb_buffer_pool_pages_made_young 0 0 +Innodb_buffer_pool_pages_misc 7 7 +Innodb_buffer_pool_pages_old 235 235 +Innodb_buffer_pool_pages_total 2047 2047 +Innodb_buffer_pool_read_ahead_rnd 0 0 +Innodb_buffer_pool_read_ahead 0 0 +Innodb_buffer_pool_read_ahead_evicted 0 0 +Innodb_buffer_pool_read_requests 441583 441583 +Innodb_buffer_pool_reads 0 0 +Innodb_buffer_pool_wait_free 0 0 +Innodb_buffer_pool_write_requests 234413 234413 +Innodb_checkpoint_age 0 0 +Innodb_checkpoint_max_age 7782360 7782360 +Innodb_checkpoint_target_age 7539162 7539162 +Innodb_data_fsyncs 125 125 +Innodb_data_pending_fsyncs 0 0 +Innodb_data_pending_reads 0 0 +Innodb_data_pending_writes 0 0 +Innodb_data_read 0 0 +Innodb_data_reads 0 0 +Innodb_data_writes 955 955 +Innodb_data_written 32364544 32364544 +Innodb_dblwr_pages_written 637 637 +Innodb_dblwr_writes 16 16 +Innodb_deadlocks 0 0 +Innodb_dict_tables 26 26 +Innodb_have_atomic_builtins ON ON +Innodb_history_list_length 0 0 +Innodb_ibuf_discarded_delete_marks 0 0 +Innodb_ibuf_discarded_deletes 0 0 +Innodb_ibuf_discarded_inserts 0 0 +Innodb_ibuf_free_list 0 0 +Innodb_ibuf_merged_delete_marks 0 0 +Innodb_ibuf_merged_deletes 0 0 +Innodb_ibuf_merged_inserts 0 0 +Innodb_ibuf_merges 0 0 +Innodb_ibuf_segment_size 2 2 +Innodb_ibuf_size 1 1 +Innodb_log_waits 0 0 +Innodb_log_write_requests 17776 17776 +Innodb_log_writes 66 66 +Innodb_lsn_current 8603780 8603780 +Innodb_lsn_flushed 8603780 8603780 +Innodb_lsn_last_checkpoint 8603780 8603780 +Innodb_master_thread_1_second_loops 32 32 +Innodb_master_thread_10_second_loops 3 3 +Innodb_master_thread_background_loops 4 4 +Innodb_master_thread_main_flush_loops 4 4 +Innodb_master_thread_sleeps 32 32 +Innodb_max_trx_id 840 840 +Innodb_mem_adaptive_hash 672196 672196 +Innodb_mem_dictionary 219018 219018 +Innodb_mem_total 34062336 34062336 +Innodb_mutex_os_waits 4 4 +Innodb_mutex_spin_rounds 222 222 +Innodb_mutex_spin_waits 14 14 +Innodb_oldest_view_low_limit_trx_id 768 768 +Innodb_os_log_fsyncs 87 87 +Innodb_os_log_pending_fsyncs 0 0 +Innodb_os_log_pending_writes 0 0 +Innodb_os_log_written 8628736 8628736 +Innodb_page_size 16384 16384 +Innodb_pages_created 693 693 +Innodb_pages_read 0 0 +Innodb_pages_written 811 811 +Innodb_purge_trx_id 0 0 +Innodb_purge_undo_no 0 0 +Innodb_row_lock_current_waits 0 0 +Innodb_current_row_locks 0 0 +Innodb_row_lock_time 0 0 +Innodb_row_lock_time_avg 0 0 +Innodb_row_lock_time_max 0 0 +Innodb_row_lock_waits 0 0 +Innodb_rows_deleted 0 0 +Innodb_rows_inserted 46315 46315 +Innodb_rows_read 46274 46274 +Innodb_rows_updated 0 0 +Innodb_s_lock_os_waits 24 24 +Innodb_s_lock_spin_rounds 722 722 +Innodb_s_lock_spin_waits 25 25 +Innodb_truncated_status_writes 0 0 +Innodb_x_lock_os_waits 8 8 +Innodb_x_lock_spin_rounds 240 240 +Innodb_x_lock_spin_waits 0 0 +Key_blocks_not_flushed 0 0 +Key_blocks_unused 14295 14295 +Key_blocks_used 202 202 +Key_read_requests 28816 28816 +Key_reads 1 1 +Key_write_requests 11127 11127 +Key_writes 212 212 +Last_query_cost 0.000000 0.000000 +Max_used_connections 2 2 +Not_flushed_delayed_rows 0 0 +Open_files 54 54 +Open_streams 0 0 +Open_table_definitions 60 60 +Open_tables 62 62 +Opened_files 235 284 +Opened_table_definitions 85 85 +Opened_tables 94 94 +Performance_schema_cond_classes_lost 0 0 +Performance_schema_cond_instances_lost 0 0 +Performance_schema_file_classes_lost 0 0 +Performance_schema_file_handles_lost 0 0 +Performance_schema_file_instances_lost 0 0 +Performance_schema_locker_lost 0 0 +Performance_schema_mutex_classes_lost 0 0 +Performance_schema_mutex_instances_lost 0 0 +Performance_schema_rwlock_classes_lost 0 0 +Performance_schema_rwlock_instances_lost 0 0 +Performance_schema_table_handles_lost 0 0 +Performance_schema_table_instances_lost 0 0 +Performance_schema_thread_classes_lost 0 0 +Performance_schema_thread_instances_lost 0 0 +Prepared_stmt_count 0 0 +Qcache_free_blocks 0 0 +Qcache_free_memory 0 0 +Qcache_hits 0 0 +Qcache_inserts 0 0 +Qcache_lowmem_prunes 0 0 +Qcache_not_cached 0 0 +Qcache_queries_in_cache 0 0 +Qcache_total_blocks 0 0 +Queries 1158 1200 +Questions 158 200 +Rpl_status AUTH_MASTER AUTH_MASTER +Select_full_join 0 0 +Select_full_range_join 0 0 +Select_range 0 0 +Select_range_check 0 0 +Select_scan 5 10 +Slave_heartbeat_period 0.000 0.000 +Slave_open_temp_tables 0 0 +Slave_received_heartbeats 0 0 +Slave_retried_transactions 0 0 +Slave_running OFF OFF +Slow_launch_threads 0 0 +Slow_queries 0 0 +Sort_merge_passes 0 0 +Sort_range 0 0 +Sort_rows 0 0 +Sort_scan 0 0 +Ssl_accept_renegotiates 0 0 +Ssl_accepts 0 0 +Ssl_callback_cache_hits 0 0 +Ssl_cipher +Ssl_cipher_list +Ssl_client_connects 0 0 +Ssl_connect_renegotiates 0 0 +Ssl_ctx_verify_depth 0 0 +Ssl_ctx_verify_mode 0 0 +Ssl_default_timeout 0 0 +Ssl_finished_accepts 0 0 +Ssl_finished_connects 0 0 +Ssl_session_cache_hits 0 0 +Ssl_session_cache_misses 0 0 +Ssl_session_cache_mode NONE NONE +Ssl_session_cache_overflows 0 0 +Ssl_session_cache_size 0 0 +Ssl_session_cache_timeouts 0 0 +Ssl_sessions_reused 0 0 +Ssl_used_session_cache_entries 0 0 +Ssl_verify_depth 0 0 +Ssl_verify_mode 0 0 +Ssl_version +Table_locks_immediate 189 190 +Table_locks_waited 0 0 +Tc_log_max_pages_used 0 0 +Tc_log_page_size 0 0 +Tc_log_page_waits 0 0 +Threads_cached 0 0 +Threads_connected 2 2 +Threads_created 14 28 +Threads_running 2 2 +Uptime 96 107 +Uptime_since_flush_status 96 107 +binlog_commits 5 5 +binlog_group_commits 5 5 +wsrep_cluster_conf_id 18446744073709551615 18446744073709551615 +wsrep_cluster_size 0 0 +wsrep_cluster_state_uuid +wsrep_cluster_status Disconnected Disconnected +wsrep_connected OFF OFF +wsrep_local_index 4294967295 4294967295 +wsrep_provider_name +wsrep_provider_vendor +wsrep_provider_version +wsrep_ready ON ON diff --git a/t/pt-mysql-summary/samples/temp007/mysql-users b/t/pt-mysql-summary/samples/temp007/mysql-users new file mode 100644 index 00000000..6679bb64 --- /dev/null +++ b/t/pt-mysql-summary/samples/temp007/mysql-users @@ -0,0 +1 @@ +2 0 0 0 diff --git a/t/pt-mysql-summary/samples/temp007/mysql-variables b/t/pt-mysql-summary/samples/temp007/mysql-variables new file mode 100644 index 00000000..f6da32f5 --- /dev/null +++ b/t/pt-mysql-summary/samples/temp007/mysql-variables @@ -0,0 +1,423 @@ +auto_increment_increment 1 +auto_increment_offset 1 +autocommit ON +automatic_sp_privileges ON +back_log 50 +basedir /home/hugmeir/mysql5/mysqlbrew/mysqls/Percona-XtraDB-Cluster-5.5.28-23.7.373.Linux.i686 +big_tables OFF +binlog_cache_size 32768 +binlog_direct_non_transactional_updates OFF +binlog_format STATEMENT +binlog_stmt_cache_size 32768 +bulk_insert_buffer_size 8388608 +character_set_client latin1 +character_set_connection latin1 +character_set_database latin1 +character_set_filesystem binary +character_set_results latin1 +character_set_server latin1 +character_set_system utf8 +character_sets_dir /home/hugmeir/mysql5/mysqlbrew/mysqls/Percona-XtraDB-Cluster-5.5.28-23.7.373.Linux.i686/share/charsets/ +collation_connection latin1_swedish_ci +collation_database latin1_swedish_ci +collation_server latin1_swedish_ci +completion_type NO_CHAIN +concurrent_insert AUTO +connect_timeout 10 +datadir /tmp/12345/data/ +date_format %Y-%m-%d +datetime_format %Y-%m-%d %H:%i:%s +default_storage_engine InnoDB +default_week_format 0 +delay_key_write ON +delayed_insert_limit 100 +delayed_insert_timeout 300 +delayed_queue_size 1000 +div_precision_increment 4 +enforce_storage_engine +engine_condition_pushdown ON +event_scheduler OFF +expand_fast_index_creation OFF +expire_logs_days 0 +fast_index_creation ON +flush OFF +flush_time 0 +foreign_key_checks ON +ft_boolean_syntax + -><()~*:""&| +ft_max_word_len 84 +ft_min_word_len 4 +ft_query_expansion_limit 20 +ft_stopword_file (built-in) +general_log ON +general_log_file genlog +group_concat_max_len 1024 +have_compress YES +have_crypt YES +have_csv YES +have_dynamic_loading YES +have_flashcache YES +have_geometry YES +have_innodb YES +have_ndbcluster NO +have_openssl DISABLED +have_partitioning YES +have_profiling YES +have_query_cache YES +have_response_time_distribution YES +have_rtree_keys YES +have_ssl DISABLED +have_symlink YES +hostname hugmeir +ignore_builtin_innodb OFF +init_connect +init_file +init_slave +innodb_adaptive_flushing ON +innodb_adaptive_flushing_method estimate +innodb_adaptive_hash_index ON +innodb_adaptive_hash_index_partitions 1 +innodb_additional_mem_pool_size 8388608 +innodb_autoextend_increment 8 +innodb_autoinc_lock_mode 1 +innodb_blocking_buffer_pool_restore OFF +innodb_buffer_pool_instances 1 +innodb_buffer_pool_populate OFF +innodb_buffer_pool_restore_at_startup 0 +innodb_buffer_pool_shm_checksum ON +innodb_buffer_pool_shm_key 0 +innodb_buffer_pool_size 33554432 +innodb_change_buffering all +innodb_changed_pages_limit 1000000 +innodb_checkpoint_age_target 0 +innodb_checksums ON +innodb_commit_concurrency 0 +innodb_concurrency_tickets 500 +innodb_corrupt_table_action assert +innodb_data_file_path ibdata1:10M:autoextend +innodb_data_home_dir /tmp/12345/data +innodb_dict_size_limit 0 +innodb_disallow_writes OFF +innodb_doublewrite ON +innodb_doublewrite_file +innodb_fake_changes OFF +innodb_fast_checksum OFF +innodb_fast_shutdown 1 +innodb_file_format Antelope +innodb_file_format_check ON +innodb_file_format_max Antelope +innodb_file_per_table OFF +innodb_flush_log_at_trx_commit 1 +innodb_flush_method +innodb_flush_neighbor_pages area +innodb_force_load_corrupted OFF +innodb_force_recovery 0 +innodb_ibuf_accel_rate 100 +innodb_ibuf_active_contract 1 +innodb_ibuf_max_size 16760832 +innodb_import_table_from_xtrabackup 0 +innodb_io_capacity 200 +innodb_kill_idle_transaction 0 +innodb_large_prefix OFF +innodb_lazy_drop_table 0 +innodb_lock_wait_timeout 3 +innodb_locks_unsafe_for_binlog OFF +innodb_log_block_size 512 +innodb_log_buffer_size 8388608 +innodb_log_file_size 5242880 +innodb_log_files_in_group 2 +innodb_log_group_home_dir /tmp/12345/data +innodb_max_dirty_pages_pct 75 +innodb_max_purge_lag 0 +innodb_merge_sort_block_size 1048576 +innodb_mirrored_log_groups 1 +innodb_old_blocks_pct 37 +innodb_old_blocks_time 0 +innodb_open_files 300 +innodb_page_size 16384 +innodb_purge_batch_size 20 +innodb_purge_threads 1 +innodb_random_read_ahead OFF +innodb_read_ahead linear +innodb_read_ahead_threshold 56 +innodb_read_io_threads 4 +innodb_recovery_stats OFF +innodb_recovery_update_relay_log OFF +innodb_replication_delay 0 +innodb_rollback_on_timeout OFF +innodb_rollback_segments 128 +innodb_show_locks_held 10 +innodb_show_verbose_locks 0 +innodb_spin_wait_delay 6 +innodb_stats_auto_update 1 +innodb_stats_method nulls_equal +innodb_stats_on_metadata ON +innodb_stats_sample_pages 8 +innodb_stats_update_need_lock 1 +innodb_strict_mode OFF +innodb_support_xa ON +innodb_sync_spin_loops 30 +innodb_table_locks ON +innodb_thread_concurrency 0 +innodb_thread_concurrency_timer_based OFF +innodb_thread_sleep_delay 10000 +innodb_track_changed_pages OFF +innodb_use_global_flush_log_at_trx_commit ON +innodb_use_native_aio ON +innodb_use_sys_malloc ON +innodb_use_sys_stats_table OFF +innodb_version 1.1.8-rel29.1 +innodb_write_io_threads 4 +interactive_timeout 28800 +join_buffer_size 131072 +keep_files_on_create OFF +key_buffer_size 16777216 +key_cache_age_threshold 300 +key_cache_block_size 1024 +key_cache_division_limit 100 +large_files_support ON +large_page_size 0 +large_pages OFF +lc_messages en_US +lc_messages_dir /home/hugmeir/mysql5/mysqlbrew/mysqls/Percona-XtraDB-Cluster-5.5.28-23.7.373.Linux.i686/share/ +lc_time_names en_US +license GPL +local_infile ON +lock_wait_timeout 31536000 +locked_in_memory OFF +log ON +log_bin ON +log_bin_trust_function_creators OFF +log_error /tmp/12345/data/mysqld.log +log_output FILE +log_queries_not_using_indexes OFF +log_slave_updates ON +log_slow_admin_statements OFF +log_slow_filter +log_slow_queries OFF +log_slow_rate_limit 1 +log_slow_rate_type session +log_slow_slave_statements OFF +log_slow_sp_statements ON +log_slow_verbosity +log_warnings 1 +log_warnings_suppress +long_query_time 10.000000 +low_priority_updates OFF +lower_case_file_system OFF +lower_case_table_names 0 +max_allowed_packet 1048576 +max_binlog_cache_size 18446744073709547520 +max_binlog_files 0 +max_binlog_size 1073741824 +max_binlog_stmt_cache_size 18446744073709547520 +max_connect_errors 10 +max_connections 151 +max_delayed_threads 20 +max_error_count 64 +max_heap_table_size 16777216 +max_insert_delayed_threads 20 +max_join_size 18446744073709551615 +max_length_for_sort_data 1024 +max_long_data_size 1048576 +max_prepared_stmt_count 16382 +max_relay_log_size 0 +max_seeks_for_key 4294967295 +max_sort_length 1024 +max_sp_recursion_depth 0 +max_tmp_tables 32 +max_user_connections 0 +max_write_lock_count 4294967295 +metadata_locks_cache_size 1024 +min_examined_row_limit 0 +multi_range_count 256 +myisam_data_pointer_size 6 +myisam_max_sort_file_size 2146435072 +myisam_mmap_size 4294967295 +myisam_recover_options OFF +myisam_repair_threads 1 +myisam_sort_buffer_size 8388608 +myisam_stats_method nulls_unequal +myisam_use_mmap OFF +net_buffer_length 16384 +net_read_timeout 30 +net_retry_count 10 +net_write_timeout 60 +new OFF +old OFF +old_alter_table OFF +old_passwords OFF +open_files_limit 1024 +optimizer_fix ON +optimizer_prune_level 1 +optimizer_search_depth 62 +optimizer_switch index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on +performance_schema OFF +performance_schema_events_waits_history_long_size 10000 +performance_schema_events_waits_history_size 10 +performance_schema_max_cond_classes 80 +performance_schema_max_cond_instances 1000 +performance_schema_max_file_classes 50 +performance_schema_max_file_handles 32768 +performance_schema_max_file_instances 10000 +performance_schema_max_mutex_classes 200 +performance_schema_max_mutex_instances 1000000 +performance_schema_max_rwlock_classes 30 +performance_schema_max_rwlock_instances 1000000 +performance_schema_max_table_handles 100000 +performance_schema_max_table_instances 50000 +performance_schema_max_thread_classes 50 +performance_schema_max_thread_instances 1000 +pid_file /tmp/12345/data/mysql_sandbox12345.pid +plugin_dir /home/hugmeir/mysql5/mysqlbrew/mysqls/Percona-XtraDB-Cluster-5.5.28-23.7.373.Linux.i686/lib/mysql/plugin/ +port 12345 +preload_buffer_size 32768 +profiling OFF +profiling_history_size 15 +protocol_version 10 +query_alloc_block_size 8192 +query_cache_limit 1048576 +query_cache_min_res_unit 4096 +query_cache_size 0 +query_cache_strip_comments OFF +query_cache_type ON +query_cache_wlock_invalidate OFF +query_prealloc_size 8192 +query_response_time_range_base 10 +query_response_time_stats OFF +range_alloc_block_size 4096 +read_buffer_size 131072 +read_only OFF +read_rnd_buffer_size 262144 +relay_log mysql-relay-bin +relay_log_index +relay_log_info_file relay-log.info +relay_log_purge ON +relay_log_recovery OFF +relay_log_space_limit 0 +report_host 127.0.0.1 +report_password +report_port 12345 +report_user +rpl_recovery_rank 0 +secure_auth OFF +secure_file_priv +server_id 12345 +skip_external_locking ON +skip_name_resolve OFF +skip_networking OFF +skip_show_database OFF +slave_compressed_protocol OFF +slave_exec_mode STRICT +slave_load_tmpdir /tmp +slave_max_allowed_packet 1073741824 +slave_net_timeout 3600 +slave_skip_errors OFF +slave_transaction_retries 10 +slave_type_conversions +slow_launch_time 2 +slow_query_log OFF +slow_query_log_file /tmp/12345/data/hugmeir-slow.log +slow_query_log_timestamp_always OFF +slow_query_log_timestamp_precision second +slow_query_log_use_global_control +socket /tmp/12345/mysql_sandbox12345.sock +sort_buffer_size 2097152 +sql_auto_is_null OFF +sql_big_selects ON +sql_big_tables OFF +sql_buffer_result OFF +sql_log_bin ON +sql_log_off OFF +sql_low_priority_updates OFF +sql_max_join_size 18446744073709551615 +sql_mode +sql_notes ON +sql_quote_show_create ON +sql_safe_updates OFF +sql_select_limit 18446744073709551615 +sql_slave_skip_counter 0 +sql_warnings OFF +ssl_ca +ssl_capath +ssl_cert +ssl_cipher +ssl_key +storage_engine InnoDB +stored_program_cache 256 +sync_binlog 0 +sync_frm ON +sync_master_info 0 +sync_relay_log 0 +sync_relay_log_info 0 +system_time_zone ART +table_definition_cache 400 +table_open_cache 400 +thread_cache_size 0 +thread_concurrency 10 +thread_handling one-thread-per-connection +thread_stack 196608 +thread_statistics OFF +time_format %H:%i:%s +time_zone SYSTEM +timed_mutexes OFF +tmp_table_size 16777216 +tmpdir /tmp +transaction_alloc_block_size 8192 +transaction_prealloc_size 4096 +tx_isolation REPEATABLE-READ +unique_checks ON +updatable_views_with_limit YES +userstat OFF +version 5.5.28-23.7-log +version_comment Percona XtraDB Cluster (GPL) 5.5.28-23.7, Revision 373, wsrep_23.7.r3821 +version_compile_machine i686 +version_compile_os Linux +wait_timeout 28800 +wsrep_OSU_method TOI +wsrep_auto_increment_control ON +wsrep_causal_reads OFF +wsrep_certify_nonPK ON +wsrep_cluster_address +wsrep_cluster_name my_wsrep_cluster +wsrep_convert_LOCK_to_trx OFF +wsrep_data_home_dir +wsrep_dbug_option +wsrep_debug OFF +wsrep_drupal_282555_workaround OFF +wsrep_forced_binlog_format NONE +wsrep_log_conflicts OFF +wsrep_max_ws_rows 131072 +wsrep_max_ws_size 1073741824 +wsrep_mysql_replication_bundle 0 +wsrep_node_address +wsrep_node_incoming_address AUTO +wsrep_node_name +wsrep_notify_cmd +wsrep_on OFF +wsrep_provider none +wsrep_provider_options +wsrep_recover OFF +wsrep_replicate_myisam OFF +wsrep_retry_autocommit 1 +wsrep_slave_threads 1 +wsrep_sst_auth +wsrep_sst_donor +wsrep_sst_donor_rejects_queries OFF +wsrep_sst_method mysqldump +wsrep_sst_receive_address AUTO +wsrep_start_position 00000000-0000-0000-0000-000000000000:-1 +internal::nice_of_31026 0 +internal::oom_of_31026 0 +internal::nice_of_30949 0 +internal::oom_of_30949 0 +internal::nice_of_30877 0 +internal::oom_of_30877 0 +pt-summary-internal-pid_file_exists 1 +pt-summary-internal-current_time 2012-11-27 18:58 +pt-summary-internal-Config_File_path +pt-summary-internal-mysql_executable /usr/bin/mysql +pt-summary-internal-now 2012-11-27 18:59:59 +pt-summary-internal-user msandbox@% +pt-summary-internal-FNV_64 Unknown +pt-summary-internal-trigger_count 6 +pt-summary-internal-mysqld_executable_1 Yes diff --git a/t/pt-mysql-summary/samples/temp007/mysqld-executables b/t/pt-mysql-summary/samples/temp007/mysqld-executables new file mode 100644 index 00000000..0f2dcd69 --- /dev/null +++ b/t/pt-mysql-summary/samples/temp007/mysqld-executables @@ -0,0 +1 @@ +/home/hugmeir/mysql5/mysqlbrew/mysqls/Percona-XtraDB-Cluster-5.5.28-23.7.373.Linux.i686/bin/mysqld diff --git a/t/pt-mysql-summary/samples/temp007/mysqld-instances b/t/pt-mysql-summary/samples/temp007/mysqld-instances new file mode 100644 index 00000000..fc26351b --- /dev/null +++ b/t/pt-mysql-summary/samples/temp007/mysqld-instances @@ -0,0 +1,4 @@ + PID TTY STAT TIME COMMAND +30877 pts/6 Sl 0:09 /home/hugmeir/mysql5/mysqlbrew/mysqls/Percona-XtraDB-Cluster-5.5.28-23.7.373.Linux.i686/bin/mysqld --defaults-file=/tmp/12345/my.sandbox.cnf +30949 pts/6 Sl 0:09 /home/hugmeir/mysql5/mysqlbrew/mysqls/Percona-XtraDB-Cluster-5.5.28-23.7.373.Linux.i686/bin/mysqld --defaults-file=/tmp/12346/my.sandbox.cnf +31026 pts/6 Sl 0:09 /home/hugmeir/mysql5/mysqlbrew/mysqls/Percona-XtraDB-Cluster-5.5.28-23.7.373.Linux.i686/bin/mysqld --defaults-file=/tmp/12347/my.sandbox.cnf diff --git a/t/pt-mysql-summary/samples/temp007/mysqldump b/t/pt-mysql-summary/samples/temp007/mysqldump new file mode 100644 index 00000000..26628a28 --- /dev/null +++ b/t/pt-mysql-summary/samples/temp007/mysqldump @@ -0,0 +1,1129 @@ + +CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysql` /*!40100 DEFAULT CHARACTER SET latin1 */; + +USE `mysql`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `columns_priv` ( + `Host` char(60) COLLATE utf8_bin NOT NULL DEFAULT '', + `Db` char(64) COLLATE utf8_bin NOT NULL DEFAULT '', + `User` char(16) COLLATE utf8_bin NOT NULL DEFAULT '', + `Table_name` char(64) COLLATE utf8_bin NOT NULL DEFAULT '', + `Column_name` char(64) COLLATE utf8_bin NOT NULL DEFAULT '', + `Timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `Column_priv` set('Select','Insert','Update','References') CHARACTER SET utf8 NOT NULL DEFAULT '', + PRIMARY KEY (`Host`,`Db`,`User`,`Table_name`,`Column_name`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Column privileges'; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `db` ( + `Host` char(60) COLLATE utf8_bin NOT NULL DEFAULT '', + `Db` char(64) COLLATE utf8_bin NOT NULL DEFAULT '', + `User` char(16) COLLATE utf8_bin NOT NULL DEFAULT '', + `Select_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Insert_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Update_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Delete_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Create_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Drop_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Grant_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `References_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Index_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Alter_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Create_tmp_table_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Lock_tables_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Create_view_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Show_view_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Create_routine_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Alter_routine_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Execute_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Event_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Trigger_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + PRIMARY KEY (`Host`,`Db`,`User`), + KEY `User` (`User`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Database privileges'; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `event` ( + `db` char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '', + `name` char(64) NOT NULL DEFAULT '', + `body` longblob NOT NULL, + `definer` char(77) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '', + `execute_at` datetime DEFAULT NULL, + `interval_value` int(11) DEFAULT NULL, + `interval_field` enum('YEAR','QUARTER','MONTH','DAY','HOUR','MINUTE','WEEK','SECOND','MICROSECOND','YEAR_MONTH','DAY_HOUR','DAY_MINUTE','DAY_SECOND','HOUR_MINUTE','HOUR_SECOND','MINUTE_SECOND','DAY_MICROSECOND','HOUR_MICROSECOND','MINUTE_MICROSECOND','SECOND_MICROSECOND') DEFAULT NULL, + `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', + `last_executed` datetime DEFAULT NULL, + `starts` datetime DEFAULT NULL, + `ends` datetime DEFAULT NULL, + `status` enum('ENABLED','DISABLED','SLAVESIDE_DISABLED') NOT NULL DEFAULT 'ENABLED', + `on_completion` enum('DROP','PRESERVE') NOT NULL DEFAULT 'DROP', + `sql_mode` set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','NOT_USED','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE','NO_ENGINE_SUBSTITUTION','PAD_CHAR_TO_FULL_LENGTH') NOT NULL DEFAULT '', + `comment` char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '', + `originator` int(10) unsigned NOT NULL, + `time_zone` char(64) CHARACTER SET latin1 NOT NULL DEFAULT 'SYSTEM', + `character_set_client` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, + `collation_connection` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, + `db_collation` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, + `body_utf8` longblob, + PRIMARY KEY (`db`,`name`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Events'; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `func` ( + `name` char(64) COLLATE utf8_bin NOT NULL DEFAULT '', + `ret` tinyint(1) NOT NULL DEFAULT '0', + `dl` char(128) COLLATE utf8_bin NOT NULL DEFAULT '', + `type` enum('function','aggregate') CHARACTER SET utf8 NOT NULL, + PRIMARY KEY (`name`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='User defined functions'; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `help_category` ( + `help_category_id` smallint(5) unsigned NOT NULL, + `name` char(64) NOT NULL, + `parent_category_id` smallint(5) unsigned DEFAULT NULL, + `url` char(128) NOT NULL, + PRIMARY KEY (`help_category_id`), + UNIQUE KEY `name` (`name`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='help categories'; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `help_keyword` ( + `help_keyword_id` int(10) unsigned NOT NULL, + `name` char(64) NOT NULL, + PRIMARY KEY (`help_keyword_id`), + UNIQUE KEY `name` (`name`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='help keywords'; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `help_relation` ( + `help_topic_id` int(10) unsigned NOT NULL, + `help_keyword_id` int(10) unsigned NOT NULL, + PRIMARY KEY (`help_keyword_id`,`help_topic_id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='keyword-topic relation'; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `help_topic` ( + `help_topic_id` int(10) unsigned NOT NULL, + `name` char(64) NOT NULL, + `help_category_id` smallint(5) unsigned NOT NULL, + `description` text NOT NULL, + `example` text NOT NULL, + `url` char(128) NOT NULL, + PRIMARY KEY (`help_topic_id`), + UNIQUE KEY `name` (`name`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='help topics'; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `host` ( + `Host` char(60) COLLATE utf8_bin NOT NULL DEFAULT '', + `Db` char(64) COLLATE utf8_bin NOT NULL DEFAULT '', + `Select_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Insert_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Update_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Delete_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Create_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Drop_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Grant_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `References_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Index_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Alter_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Create_tmp_table_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Lock_tables_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Create_view_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Show_view_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Create_routine_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Alter_routine_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Execute_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Trigger_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + PRIMARY KEY (`Host`,`Db`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Host privileges; Merged with database privileges'; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ndb_binlog_index` ( + `Position` bigint(20) unsigned NOT NULL, + `File` varchar(255) NOT NULL, + `epoch` bigint(20) unsigned NOT NULL, + `inserts` bigint(20) unsigned NOT NULL, + `updates` bigint(20) unsigned NOT NULL, + `deletes` bigint(20) unsigned NOT NULL, + `schemaops` bigint(20) unsigned NOT NULL, + PRIMARY KEY (`epoch`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `plugin` ( + `name` varchar(64) NOT NULL DEFAULT '', + `dl` varchar(128) NOT NULL DEFAULT '', + PRIMARY KEY (`name`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='MySQL plugins'; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `proc` ( + `db` char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '', + `name` char(64) NOT NULL DEFAULT '', + `type` enum('FUNCTION','PROCEDURE') NOT NULL, + `specific_name` char(64) NOT NULL DEFAULT '', + `language` enum('SQL') NOT NULL DEFAULT 'SQL', + `sql_data_access` enum('CONTAINS_SQL','NO_SQL','READS_SQL_DATA','MODIFIES_SQL_DATA') NOT NULL DEFAULT 'CONTAINS_SQL', + `is_deterministic` enum('YES','NO') NOT NULL DEFAULT 'NO', + `security_type` enum('INVOKER','DEFINER') NOT NULL DEFAULT 'DEFINER', + `param_list` blob NOT NULL, + `returns` longblob NOT NULL, + `body` longblob NOT NULL, + `definer` char(77) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '', + `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', + `sql_mode` set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','NOT_USED','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE','NO_ENGINE_SUBSTITUTION','PAD_CHAR_TO_FULL_LENGTH') NOT NULL DEFAULT '', + `comment` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `character_set_client` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, + `collation_connection` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, + `db_collation` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, + `body_utf8` longblob, + PRIMARY KEY (`db`,`name`,`type`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Stored Procedures'; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `procs_priv` ( + `Host` char(60) COLLATE utf8_bin NOT NULL DEFAULT '', + `Db` char(64) COLLATE utf8_bin NOT NULL DEFAULT '', + `User` char(16) COLLATE utf8_bin NOT NULL DEFAULT '', + `Routine_name` char(64) CHARACTER SET utf8 NOT NULL DEFAULT '', + `Routine_type` enum('FUNCTION','PROCEDURE') COLLATE utf8_bin NOT NULL, + `Grantor` char(77) COLLATE utf8_bin NOT NULL DEFAULT '', + `Proc_priv` set('Execute','Alter Routine','Grant') CHARACTER SET utf8 NOT NULL DEFAULT '', + `Timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`Host`,`Db`,`User`,`Routine_name`,`Routine_type`), + KEY `Grantor` (`Grantor`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Procedure privileges'; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `proxies_priv` ( + `Host` char(60) COLLATE utf8_bin NOT NULL DEFAULT '', + `User` char(16) COLLATE utf8_bin NOT NULL DEFAULT '', + `Proxied_host` char(60) COLLATE utf8_bin NOT NULL DEFAULT '', + `Proxied_user` char(16) COLLATE utf8_bin NOT NULL DEFAULT '', + `With_grant` tinyint(1) NOT NULL DEFAULT '0', + `Grantor` char(77) COLLATE utf8_bin NOT NULL DEFAULT '', + `Timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`Host`,`User`,`Proxied_host`,`Proxied_user`), + KEY `Grantor` (`Grantor`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='User proxy privileges'; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `servers` ( + `Server_name` char(64) NOT NULL DEFAULT '', + `Host` char(64) NOT NULL DEFAULT '', + `Db` char(64) NOT NULL DEFAULT '', + `Username` char(64) NOT NULL DEFAULT '', + `Password` char(64) NOT NULL DEFAULT '', + `Port` int(4) NOT NULL DEFAULT '0', + `Socket` char(64) NOT NULL DEFAULT '', + `Wrapper` char(64) NOT NULL DEFAULT '', + `Owner` char(64) NOT NULL DEFAULT '', + PRIMARY KEY (`Server_name`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='MySQL Foreign Servers table'; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `tables_priv` ( + `Host` char(60) COLLATE utf8_bin NOT NULL DEFAULT '', + `Db` char(64) COLLATE utf8_bin NOT NULL DEFAULT '', + `User` char(16) COLLATE utf8_bin NOT NULL DEFAULT '', + `Table_name` char(64) COLLATE utf8_bin NOT NULL DEFAULT '', + `Grantor` char(77) COLLATE utf8_bin NOT NULL DEFAULT '', + `Timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `Table_priv` set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view','Trigger') CHARACTER SET utf8 NOT NULL DEFAULT '', + `Column_priv` set('Select','Insert','Update','References') CHARACTER SET utf8 NOT NULL DEFAULT '', + PRIMARY KEY (`Host`,`Db`,`User`,`Table_name`), + KEY `Grantor` (`Grantor`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Table privileges'; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `time_zone` ( + `Time_zone_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `Use_leap_seconds` enum('Y','N') NOT NULL DEFAULT 'N', + PRIMARY KEY (`Time_zone_id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Time zones'; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `time_zone_leap_second` ( + `Transition_time` bigint(20) NOT NULL, + `Correction` int(11) NOT NULL, + PRIMARY KEY (`Transition_time`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Leap seconds information for time zones'; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `time_zone_name` ( + `Name` char(64) NOT NULL, + `Time_zone_id` int(10) unsigned NOT NULL, + PRIMARY KEY (`Name`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Time zone names'; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `time_zone_transition` ( + `Time_zone_id` int(10) unsigned NOT NULL, + `Transition_time` bigint(20) NOT NULL, + `Transition_type_id` int(10) unsigned NOT NULL, + PRIMARY KEY (`Time_zone_id`,`Transition_time`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Time zone transitions'; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `time_zone_transition_type` ( + `Time_zone_id` int(10) unsigned NOT NULL, + `Transition_type_id` int(10) unsigned NOT NULL, + `Offset` int(11) NOT NULL DEFAULT '0', + `Is_DST` tinyint(3) unsigned NOT NULL DEFAULT '0', + `Abbreviation` char(8) NOT NULL DEFAULT '', + PRIMARY KEY (`Time_zone_id`,`Transition_type_id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Time zone transition types'; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `user` ( + `Host` char(60) COLLATE utf8_bin NOT NULL DEFAULT '', + `User` char(16) COLLATE utf8_bin NOT NULL DEFAULT '', + `Password` char(41) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + `Select_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Insert_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Update_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Delete_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Create_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Drop_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Reload_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Shutdown_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Process_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `File_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Grant_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `References_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Index_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Alter_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Show_db_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Super_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Create_tmp_table_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Lock_tables_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Execute_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Repl_slave_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Repl_client_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Create_view_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Show_view_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Create_routine_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Alter_routine_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Create_user_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Event_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Trigger_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Create_tablespace_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `ssl_type` enum('','ANY','X509','SPECIFIED') CHARACTER SET utf8 NOT NULL DEFAULT '', + `ssl_cipher` blob NOT NULL, + `x509_issuer` blob NOT NULL, + `x509_subject` blob NOT NULL, + `max_questions` int(11) unsigned NOT NULL DEFAULT '0', + `max_updates` int(11) unsigned NOT NULL DEFAULT '0', + `max_connections` int(11) unsigned NOT NULL DEFAULT '0', + `max_user_connections` int(11) unsigned NOT NULL DEFAULT '0', + `plugin` char(60) COLLATE utf8_bin NOT NULL DEFAULT '', + `authentication_string` text COLLATE utf8_bin NOT NULL, + PRIMARY KEY (`Host`,`User`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Users and global privileges'; +/*!40101 SET character_set_client = @saved_cs_client */; + +CREATE DATABASE /*!32312 IF NOT EXISTS*/ `percona_test` /*!40100 DEFAULT CHARACTER SET latin1 */; + +USE `percona_test`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `checksums` ( + `db_tbl` varchar(128) NOT NULL, + `checksum` int(10) unsigned NOT NULL, + PRIMARY KEY (`db_tbl`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `load_data` ( + `i` int(11) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `sentinel` ( + `id` int(11) NOT NULL, + `ping` varchar(64) NOT NULL DEFAULT '', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + +CREATE DATABASE /*!32312 IF NOT EXISTS*/ `sakila` /*!40100 DEFAULT CHARACTER SET latin1 */; + +USE `sakila`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `actor` ( + `actor_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT, + `first_name` varchar(45) NOT NULL, + `last_name` varchar(45) NOT NULL, + `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`actor_id`), + KEY `idx_actor_last_name` (`last_name`) +) ENGINE=InnoDB AUTO_INCREMENT=201 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +/*!50001 CREATE TABLE `actor_info` ( + `actor_id` smallint(5) unsigned, + `first_name` varchar(45), + `last_name` varchar(45), + `film_info` text +) ENGINE=MyISAM */; +SET character_set_client = @saved_cs_client; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `address` ( + `address_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT, + `address` varchar(50) NOT NULL, + `address2` varchar(50) DEFAULT NULL, + `district` varchar(20) NOT NULL, + `city_id` smallint(5) unsigned NOT NULL, + `postal_code` varchar(10) DEFAULT NULL, + `phone` varchar(20) NOT NULL, + `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`address_id`), + KEY `idx_fk_city_id` (`city_id`), + CONSTRAINT `fk_address_city` FOREIGN KEY (`city_id`) REFERENCES `city` (`city_id`) ON UPDATE CASCADE +) ENGINE=InnoDB AUTO_INCREMENT=606 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `category` ( + `category_id` tinyint(3) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(25) NOT NULL, + `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`category_id`) +) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `city` ( + `city_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT, + `city` varchar(50) NOT NULL, + `country_id` smallint(5) unsigned NOT NULL, + `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`city_id`), + KEY `idx_fk_country_id` (`country_id`), + CONSTRAINT `fk_city_country` FOREIGN KEY (`country_id`) REFERENCES `country` (`country_id`) ON UPDATE CASCADE +) ENGINE=InnoDB AUTO_INCREMENT=601 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `country` ( + `country_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT, + `country` varchar(50) NOT NULL, + `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`country_id`) +) ENGINE=InnoDB AUTO_INCREMENT=110 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `customer` ( + `customer_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT, + `store_id` tinyint(3) unsigned NOT NULL, + `first_name` varchar(45) NOT NULL, + `last_name` varchar(45) NOT NULL, + `email` varchar(50) DEFAULT NULL, + `address_id` smallint(5) unsigned NOT NULL, + `active` tinyint(1) NOT NULL DEFAULT '1', + `create_date` datetime NOT NULL, + `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`customer_id`), + KEY `idx_fk_store_id` (`store_id`), + KEY `idx_fk_address_id` (`address_id`), + KEY `idx_last_name` (`last_name`), + CONSTRAINT `fk_customer_address` FOREIGN KEY (`address_id`) REFERENCES `address` (`address_id`) ON UPDATE CASCADE, + CONSTRAINT `fk_customer_store` FOREIGN KEY (`store_id`) REFERENCES `store` (`store_id`) ON UPDATE CASCADE +) ENGINE=InnoDB AUTO_INCREMENT=600 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = utf8 */ ; +/*!50003 SET character_set_results = utf8 */ ; +/*!50003 SET collation_connection = utf8_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = '' */ ; +DELIMITER ;; +/*!50003 CREATE*/ /*!50017 DEFINER=`msandbox`@`%`*/ /*!50003 TRIGGER customer_create_date BEFORE INSERT ON customer + FOR EACH ROW SET NEW.create_date = NOW() */;; +DELIMITER ; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +/*!50001 CREATE TABLE `customer_list` ( + `ID` smallint(5) unsigned, + `name` varchar(91), + `address` varchar(50), + `zip code` varchar(10), + `phone` varchar(20), + `city` varchar(50), + `country` varchar(50), + `notes` varchar(6), + `SID` tinyint(3) unsigned +) ENGINE=MyISAM */; +SET character_set_client = @saved_cs_client; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `film` ( + `film_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT, + `title` varchar(255) NOT NULL, + `description` text, + `release_year` year(4) DEFAULT NULL, + `language_id` tinyint(3) unsigned NOT NULL, + `original_language_id` tinyint(3) unsigned DEFAULT NULL, + `rental_duration` tinyint(3) unsigned NOT NULL DEFAULT '3', + `rental_rate` decimal(4,2) NOT NULL DEFAULT '4.99', + `length` smallint(5) unsigned DEFAULT NULL, + `replacement_cost` decimal(5,2) NOT NULL DEFAULT '19.99', + `rating` enum('G','PG','PG-13','R','NC-17') DEFAULT 'G', + `special_features` set('Trailers','Commentaries','Deleted Scenes','Behind the Scenes') DEFAULT NULL, + `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`film_id`), + KEY `idx_title` (`title`), + KEY `idx_fk_language_id` (`language_id`), + KEY `idx_fk_original_language_id` (`original_language_id`), + CONSTRAINT `fk_film_language` FOREIGN KEY (`language_id`) REFERENCES `language` (`language_id`) ON UPDATE CASCADE, + CONSTRAINT `fk_film_language_original` FOREIGN KEY (`original_language_id`) REFERENCES `language` (`language_id`) ON UPDATE CASCADE +) ENGINE=InnoDB AUTO_INCREMENT=1001 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = utf8 */ ; +/*!50003 SET character_set_results = utf8 */ ; +/*!50003 SET collation_connection = utf8_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */ ; +DELIMITER ;; +/*!50003 CREATE*/ /*!50017 DEFINER=`msandbox`@`%`*/ /*!50003 TRIGGER `ins_film` AFTER INSERT ON `film` FOR EACH ROW BEGIN + INSERT INTO film_text (film_id, title, description) + VALUES (new.film_id, new.title, new.description); + END */;; +DELIMITER ; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = utf8 */ ; +/*!50003 SET character_set_results = utf8 */ ; +/*!50003 SET collation_connection = utf8_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */ ; +DELIMITER ;; +/*!50003 CREATE*/ /*!50017 DEFINER=`msandbox`@`%`*/ /*!50003 TRIGGER `upd_film` AFTER UPDATE ON `film` FOR EACH ROW BEGIN + IF (old.title != new.title) or (old.description != new.description) + THEN + UPDATE film_text + SET title=new.title, + description=new.description, + film_id=new.film_id + WHERE film_id=old.film_id; + END IF; + END */;; +DELIMITER ; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = utf8 */ ; +/*!50003 SET character_set_results = utf8 */ ; +/*!50003 SET collation_connection = utf8_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */ ; +DELIMITER ;; +/*!50003 CREATE*/ /*!50017 DEFINER=`msandbox`@`%`*/ /*!50003 TRIGGER `del_film` AFTER DELETE ON `film` FOR EACH ROW BEGIN + DELETE FROM film_text WHERE film_id = old.film_id; + END */;; +DELIMITER ; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `film_actor` ( + `actor_id` smallint(5) unsigned NOT NULL, + `film_id` smallint(5) unsigned NOT NULL, + `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`actor_id`,`film_id`), + KEY `idx_fk_film_id` (`film_id`), + CONSTRAINT `fk_film_actor_actor` FOREIGN KEY (`actor_id`) REFERENCES `actor` (`actor_id`) ON UPDATE CASCADE, + CONSTRAINT `fk_film_actor_film` FOREIGN KEY (`film_id`) REFERENCES `film` (`film_id`) ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `film_category` ( + `film_id` smallint(5) unsigned NOT NULL, + `category_id` tinyint(3) unsigned NOT NULL, + `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`film_id`,`category_id`), + KEY `fk_film_category_category` (`category_id`), + CONSTRAINT `fk_film_category_film` FOREIGN KEY (`film_id`) REFERENCES `film` (`film_id`) ON UPDATE CASCADE, + CONSTRAINT `fk_film_category_category` FOREIGN KEY (`category_id`) REFERENCES `category` (`category_id`) ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +/*!50001 CREATE TABLE `film_list` ( + `FID` smallint(5) unsigned, + `title` varchar(255), + `description` text, + `category` varchar(25), + `price` decimal(4,2), + `length` smallint(5) unsigned, + `rating` enum('G','PG','PG-13','R','NC-17'), + `actors` text +) ENGINE=MyISAM */; +SET character_set_client = @saved_cs_client; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `film_text` ( + `film_id` smallint(6) NOT NULL, + `title` varchar(255) NOT NULL, + `description` text, + PRIMARY KEY (`film_id`), + FULLTEXT KEY `idx_title_description` (`title`,`description`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `inventory` ( + `inventory_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `film_id` smallint(5) unsigned NOT NULL, + `store_id` tinyint(3) unsigned NOT NULL, + `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`inventory_id`), + KEY `idx_fk_film_id` (`film_id`), + KEY `idx_store_id_film_id` (`store_id`,`film_id`), + CONSTRAINT `fk_inventory_store` FOREIGN KEY (`store_id`) REFERENCES `store` (`store_id`) ON UPDATE CASCADE, + CONSTRAINT `fk_inventory_film` FOREIGN KEY (`film_id`) REFERENCES `film` (`film_id`) ON UPDATE CASCADE +) ENGINE=InnoDB AUTO_INCREMENT=4582 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `language` ( + `language_id` tinyint(3) unsigned NOT NULL AUTO_INCREMENT, + `name` char(20) NOT NULL, + `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`language_id`) +) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +/*!50001 CREATE TABLE `nicer_but_slower_film_list` ( + `FID` smallint(5) unsigned, + `title` varchar(255), + `description` text, + `category` varchar(25), + `price` decimal(4,2), + `length` smallint(5) unsigned, + `rating` enum('G','PG','PG-13','R','NC-17'), + `actors` text +) ENGINE=MyISAM */; +SET character_set_client = @saved_cs_client; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `payment` ( + `payment_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT, + `customer_id` smallint(5) unsigned NOT NULL, + `staff_id` tinyint(3) unsigned NOT NULL, + `rental_id` int(11) DEFAULT NULL, + `amount` decimal(5,2) NOT NULL, + `payment_date` datetime NOT NULL, + `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`payment_id`), + KEY `idx_fk_staff_id` (`staff_id`), + KEY `idx_fk_customer_id` (`customer_id`), + KEY `fk_payment_rental` (`rental_id`), + CONSTRAINT `fk_payment_rental` FOREIGN KEY (`rental_id`) REFERENCES `rental` (`rental_id`) ON DELETE SET NULL ON UPDATE CASCADE, + CONSTRAINT `fk_payment_customer` FOREIGN KEY (`customer_id`) REFERENCES `customer` (`customer_id`) ON UPDATE CASCADE, + CONSTRAINT `fk_payment_staff` FOREIGN KEY (`staff_id`) REFERENCES `staff` (`staff_id`) ON UPDATE CASCADE +) ENGINE=InnoDB AUTO_INCREMENT=16050 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = utf8 */ ; +/*!50003 SET character_set_results = utf8 */ ; +/*!50003 SET collation_connection = utf8_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = '' */ ; +DELIMITER ;; +/*!50003 CREATE*/ /*!50017 DEFINER=`msandbox`@`%`*/ /*!50003 TRIGGER payment_date BEFORE INSERT ON payment + FOR EACH ROW SET NEW.payment_date = NOW() */;; +DELIMITER ; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `rental` ( + `rental_id` int(11) NOT NULL AUTO_INCREMENT, + `rental_date` datetime NOT NULL, + `inventory_id` mediumint(8) unsigned NOT NULL, + `customer_id` smallint(5) unsigned NOT NULL, + `return_date` datetime DEFAULT NULL, + `staff_id` tinyint(3) unsigned NOT NULL, + `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`rental_id`), + UNIQUE KEY `rental_date` (`rental_date`,`inventory_id`,`customer_id`), + KEY `idx_fk_inventory_id` (`inventory_id`), + KEY `idx_fk_customer_id` (`customer_id`), + KEY `idx_fk_staff_id` (`staff_id`), + CONSTRAINT `fk_rental_staff` FOREIGN KEY (`staff_id`) REFERENCES `staff` (`staff_id`) ON UPDATE CASCADE, + CONSTRAINT `fk_rental_inventory` FOREIGN KEY (`inventory_id`) REFERENCES `inventory` (`inventory_id`) ON UPDATE CASCADE, + CONSTRAINT `fk_rental_customer` FOREIGN KEY (`customer_id`) REFERENCES `customer` (`customer_id`) ON UPDATE CASCADE +) ENGINE=InnoDB AUTO_INCREMENT=16050 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = utf8 */ ; +/*!50003 SET character_set_results = utf8 */ ; +/*!50003 SET collation_connection = utf8_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = '' */ ; +DELIMITER ;; +/*!50003 CREATE*/ /*!50017 DEFINER=`msandbox`@`%`*/ /*!50003 TRIGGER rental_date BEFORE INSERT ON rental + FOR EACH ROW SET NEW.rental_date = NOW() */;; +DELIMITER ; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +/*!50001 CREATE TABLE `sales_by_film_category` ( + `category` varchar(25), + `total_sales` decimal(27,2) +) ENGINE=MyISAM */; +SET character_set_client = @saved_cs_client; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +/*!50001 CREATE TABLE `sales_by_store` ( + `store` varchar(101), + `manager` varchar(91), + `total_sales` decimal(27,2) +) ENGINE=MyISAM */; +SET character_set_client = @saved_cs_client; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `staff` ( + `staff_id` tinyint(3) unsigned NOT NULL AUTO_INCREMENT, + `first_name` varchar(45) NOT NULL, + `last_name` varchar(45) NOT NULL, + `address_id` smallint(5) unsigned NOT NULL, + `picture` blob, + `email` varchar(50) DEFAULT NULL, + `store_id` tinyint(3) unsigned NOT NULL, + `active` tinyint(1) NOT NULL DEFAULT '1', + `username` varchar(16) NOT NULL, + `password` varchar(40) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, + `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`staff_id`), + KEY `idx_fk_store_id` (`store_id`), + KEY `idx_fk_address_id` (`address_id`), + CONSTRAINT `fk_staff_store` FOREIGN KEY (`store_id`) REFERENCES `store` (`store_id`) ON UPDATE CASCADE, + CONSTRAINT `fk_staff_address` FOREIGN KEY (`address_id`) REFERENCES `address` (`address_id`) ON UPDATE CASCADE +) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +/*!50001 CREATE TABLE `staff_list` ( + `ID` tinyint(3) unsigned, + `name` varchar(91), + `address` varchar(50), + `zip code` varchar(10), + `phone` varchar(20), + `city` varchar(50), + `country` varchar(50), + `SID` tinyint(3) unsigned +) ENGINE=MyISAM */; +SET character_set_client = @saved_cs_client; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `store` ( + `store_id` tinyint(3) unsigned NOT NULL AUTO_INCREMENT, + `manager_staff_id` tinyint(3) unsigned NOT NULL, + `address_id` smallint(5) unsigned NOT NULL, + `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`store_id`), + UNIQUE KEY `idx_unique_manager` (`manager_staff_id`), + KEY `idx_fk_address_id` (`address_id`), + CONSTRAINT `fk_store_staff` FOREIGN KEY (`manager_staff_id`) REFERENCES `staff` (`staff_id`) ON UPDATE CASCADE, + CONSTRAINT `fk_store_address` FOREIGN KEY (`address_id`) REFERENCES `address` (`address_id`) ON UPDATE CASCADE +) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = utf8 */ ; +/*!50003 SET character_set_results = utf8 */ ; +/*!50003 SET collation_connection = utf8_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */ ; +DELIMITER ;; +/*!50003 CREATE*/ /*!50020 DEFINER=`msandbox`@`%`*/ /*!50003 FUNCTION `get_customer_balance`(p_customer_id INT, p_effective_date DATETIME) RETURNS decimal(5,2) + READS SQL DATA + DETERMINISTIC +BEGIN + + + + + + + + + DECLARE v_rentfees DECIMAL(5,2); + DECLARE v_overfees INTEGER; + DECLARE v_payments DECIMAL(5,2); + + SELECT IFNULL(SUM(film.rental_rate),0) INTO v_rentfees + FROM film, inventory, rental + WHERE film.film_id = inventory.film_id + AND inventory.inventory_id = rental.inventory_id + AND rental.rental_date <= p_effective_date + AND rental.customer_id = p_customer_id; + + SELECT IFNULL(SUM(IF((TO_DAYS(rental.return_date) - TO_DAYS(rental.rental_date)) > film.rental_duration, + ((TO_DAYS(rental.return_date) - TO_DAYS(rental.rental_date)) - film.rental_duration),0)),0) INTO v_overfees + FROM rental, inventory, film + WHERE film.film_id = inventory.film_id + AND inventory.inventory_id = rental.inventory_id + AND rental.rental_date <= p_effective_date + AND rental.customer_id = p_customer_id; + + + SELECT IFNULL(SUM(payment.amount),0) INTO v_payments + FROM payment + + WHERE payment.payment_date <= p_effective_date + AND payment.customer_id = p_customer_id; + + RETURN v_rentfees + v_overfees - v_payments; +END */;; +DELIMITER ; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = utf8 */ ; +/*!50003 SET character_set_results = utf8 */ ; +/*!50003 SET collation_connection = utf8_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */ ; +DELIMITER ;; +/*!50003 CREATE*/ /*!50020 DEFINER=`msandbox`@`%`*/ /*!50003 FUNCTION `inventory_held_by_customer`(p_inventory_id INT) RETURNS int(11) + READS SQL DATA +BEGIN + DECLARE v_customer_id INT; + DECLARE EXIT HANDLER FOR NOT FOUND RETURN NULL; + + SELECT customer_id INTO v_customer_id + FROM rental + WHERE return_date IS NULL + AND inventory_id = p_inventory_id; + + RETURN v_customer_id; +END */;; +DELIMITER ; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = utf8 */ ; +/*!50003 SET character_set_results = utf8 */ ; +/*!50003 SET collation_connection = utf8_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */ ; +DELIMITER ;; +/*!50003 CREATE*/ /*!50020 DEFINER=`msandbox`@`%`*/ /*!50003 FUNCTION `inventory_in_stock`(p_inventory_id INT) RETURNS tinyint(1) + READS SQL DATA +BEGIN + DECLARE v_rentals INT; + DECLARE v_out INT; + + + + + SELECT COUNT(*) INTO v_rentals + FROM rental + WHERE inventory_id = p_inventory_id; + + IF v_rentals = 0 THEN + RETURN TRUE; + END IF; + + SELECT COUNT(rental_id) INTO v_out + FROM inventory LEFT JOIN rental USING(inventory_id) + WHERE inventory.inventory_id = p_inventory_id + AND rental.return_date IS NULL; + + IF v_out > 0 THEN + RETURN FALSE; + ELSE + RETURN TRUE; + END IF; +END */;; +DELIMITER ; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = utf8 */ ; +/*!50003 SET character_set_results = utf8 */ ; +/*!50003 SET collation_connection = utf8_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */ ; +DELIMITER ;; +/*!50003 CREATE*/ /*!50020 DEFINER=`msandbox`@`%`*/ /*!50003 PROCEDURE `film_in_stock`(IN p_film_id INT, IN p_store_id INT, OUT p_film_count INT) + READS SQL DATA +BEGIN + SELECT inventory_id + FROM inventory + WHERE film_id = p_film_id + AND store_id = p_store_id + AND inventory_in_stock(inventory_id); + + SELECT FOUND_ROWS() INTO p_film_count; +END */;; +DELIMITER ; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = utf8 */ ; +/*!50003 SET character_set_results = utf8 */ ; +/*!50003 SET collation_connection = utf8_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */ ; +DELIMITER ;; +/*!50003 CREATE*/ /*!50020 DEFINER=`msandbox`@`%`*/ /*!50003 PROCEDURE `film_not_in_stock`(IN p_film_id INT, IN p_store_id INT, OUT p_film_count INT) + READS SQL DATA +BEGIN + SELECT inventory_id + FROM inventory + WHERE film_id = p_film_id + AND store_id = p_store_id + AND NOT inventory_in_stock(inventory_id); + + SELECT FOUND_ROWS() INTO p_film_count; +END */;; +DELIMITER ; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = utf8 */ ; +/*!50003 SET character_set_results = utf8 */ ; +/*!50003 SET collation_connection = utf8_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */ ; +DELIMITER ;; +/*!50003 CREATE*/ /*!50020 DEFINER=`msandbox`@`%`*/ /*!50003 PROCEDURE `rewards_report`( + IN min_monthly_purchases TINYINT UNSIGNED + , IN min_dollar_amount_purchased DECIMAL(10,2) UNSIGNED + , OUT count_rewardees INT +) + READS SQL DATA + COMMENT 'Provides a customizable report on best customers' +proc: BEGIN + + DECLARE last_month_start DATE; + DECLARE last_month_end DATE; + + + IF min_monthly_purchases = 0 THEN + SELECT 'Minimum monthly purchases parameter must be > 0'; + LEAVE proc; + END IF; + IF min_dollar_amount_purchased = 0.00 THEN + SELECT 'Minimum monthly dollar amount purchased parameter must be > $0.00'; + LEAVE proc; + END IF; + + + SET last_month_start = DATE_SUB(CURRENT_DATE(), INTERVAL 1 MONTH); + SET last_month_start = STR_TO_DATE(CONCAT(YEAR(last_month_start),'-',MONTH(last_month_start),'-01'),'%Y-%m-%d'); + SET last_month_end = LAST_DAY(last_month_start); + + + CREATE TEMPORARY TABLE tmpCustomer (customer_id SMALLINT UNSIGNED NOT NULL PRIMARY KEY); + + + INSERT INTO tmpCustomer (customer_id) + SELECT p.customer_id + FROM payment AS p + WHERE DATE(p.payment_date) BETWEEN last_month_start AND last_month_end + GROUP BY customer_id + HAVING SUM(p.amount) > min_dollar_amount_purchased + AND COUNT(customer_id) > min_monthly_purchases; + + + SELECT COUNT(*) FROM tmpCustomer INTO count_rewardees; + + + SELECT c.* + FROM tmpCustomer AS t + INNER JOIN customer AS c ON t.customer_id = c.customer_id; + + + DROP TABLE tmpCustomer; +END */;; +DELIMITER ; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; + +USE `mysql`; + +USE `percona_test`; + +USE `sakila`; +/*!50001 DROP TABLE IF EXISTS `actor_info`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = utf8 */; +/*!50001 SET character_set_results = utf8 */; +/*!50001 SET collation_connection = utf8_general_ci */; +/*!50001 CREATE ALGORITHM=UNDEFINED */ +/*!50013 DEFINER=`msandbox`@`%` SQL SECURITY INVOKER */ +/*!50001 VIEW `actor_info` AS select `a`.`actor_id` AS `actor_id`,`a`.`first_name` AS `first_name`,`a`.`last_name` AS `last_name`,group_concat(distinct concat(`c`.`name`,': ',(select group_concat(`f`.`title` order by `f`.`title` ASC separator ', ') from ((`film` `f` join `film_category` `fc` on((`f`.`film_id` = `fc`.`film_id`))) join `film_actor` `fa` on((`f`.`film_id` = `fa`.`film_id`))) where ((`fc`.`category_id` = `c`.`category_id`) and (`fa`.`actor_id` = `a`.`actor_id`)))) order by `c`.`name` ASC separator '; ') AS `film_info` from (((`actor` `a` left join `film_actor` `fa` on((`a`.`actor_id` = `fa`.`actor_id`))) left join `film_category` `fc` on((`fa`.`film_id` = `fc`.`film_id`))) left join `category` `c` on((`fc`.`category_id` = `c`.`category_id`))) group by `a`.`actor_id`,`a`.`first_name`,`a`.`last_name` */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; +/*!50001 DROP TABLE IF EXISTS `customer_list`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = utf8 */; +/*!50001 SET character_set_results = utf8 */; +/*!50001 SET collation_connection = utf8_general_ci */; +/*!50001 CREATE ALGORITHM=UNDEFINED */ +/*!50013 DEFINER=`msandbox`@`%` SQL SECURITY DEFINER */ +/*!50001 VIEW `customer_list` AS select `cu`.`customer_id` AS `ID`,concat(`cu`.`first_name`,_utf8' ',`cu`.`last_name`) AS `name`,`a`.`address` AS `address`,`a`.`postal_code` AS `zip code`,`a`.`phone` AS `phone`,`city`.`city` AS `city`,`country`.`country` AS `country`,if(`cu`.`active`,_utf8'active',_utf8'') AS `notes`,`cu`.`store_id` AS `SID` from (((`customer` `cu` join `address` `a` on((`cu`.`address_id` = `a`.`address_id`))) join `city` on((`a`.`city_id` = `city`.`city_id`))) join `country` on((`city`.`country_id` = `country`.`country_id`))) */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; +/*!50001 DROP TABLE IF EXISTS `film_list`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = utf8 */; +/*!50001 SET character_set_results = utf8 */; +/*!50001 SET collation_connection = utf8_general_ci */; +/*!50001 CREATE ALGORITHM=UNDEFINED */ +/*!50013 DEFINER=`msandbox`@`%` SQL SECURITY DEFINER */ +/*!50001 VIEW `film_list` AS select `film`.`film_id` AS `FID`,`film`.`title` AS `title`,`film`.`description` AS `description`,`category`.`name` AS `category`,`film`.`rental_rate` AS `price`,`film`.`length` AS `length`,`film`.`rating` AS `rating`,group_concat(concat(`actor`.`first_name`,_utf8' ',`actor`.`last_name`) separator ', ') AS `actors` from ((((`category` left join `film_category` on((`category`.`category_id` = `film_category`.`category_id`))) left join `film` on((`film_category`.`film_id` = `film`.`film_id`))) join `film_actor` on((`film`.`film_id` = `film_actor`.`film_id`))) join `actor` on((`film_actor`.`actor_id` = `actor`.`actor_id`))) group by `film`.`film_id` */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; +/*!50001 DROP TABLE IF EXISTS `nicer_but_slower_film_list`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = utf8 */; +/*!50001 SET character_set_results = utf8 */; +/*!50001 SET collation_connection = utf8_general_ci */; +/*!50001 CREATE ALGORITHM=UNDEFINED */ +/*!50013 DEFINER=`msandbox`@`%` SQL SECURITY DEFINER */ +/*!50001 VIEW `nicer_but_slower_film_list` AS select `film`.`film_id` AS `FID`,`film`.`title` AS `title`,`film`.`description` AS `description`,`category`.`name` AS `category`,`film`.`rental_rate` AS `price`,`film`.`length` AS `length`,`film`.`rating` AS `rating`,group_concat(concat(concat(ucase(substr(`actor`.`first_name`,1,1)),lcase(substr(`actor`.`first_name`,2,length(`actor`.`first_name`))),_utf8' ',concat(ucase(substr(`actor`.`last_name`,1,1)),lcase(substr(`actor`.`last_name`,2,length(`actor`.`last_name`)))))) separator ', ') AS `actors` from ((((`category` left join `film_category` on((`category`.`category_id` = `film_category`.`category_id`))) left join `film` on((`film_category`.`film_id` = `film`.`film_id`))) join `film_actor` on((`film`.`film_id` = `film_actor`.`film_id`))) join `actor` on((`film_actor`.`actor_id` = `actor`.`actor_id`))) group by `film`.`film_id` */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; +/*!50001 DROP TABLE IF EXISTS `sales_by_film_category`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = utf8 */; +/*!50001 SET character_set_results = utf8 */; +/*!50001 SET collation_connection = utf8_general_ci */; +/*!50001 CREATE ALGORITHM=UNDEFINED */ +/*!50013 DEFINER=`msandbox`@`%` SQL SECURITY DEFINER */ +/*!50001 VIEW `sales_by_film_category` AS select `c`.`name` AS `category`,sum(`p`.`amount`) AS `total_sales` from (((((`payment` `p` join `rental` `r` on((`p`.`rental_id` = `r`.`rental_id`))) join `inventory` `i` on((`r`.`inventory_id` = `i`.`inventory_id`))) join `film` `f` on((`i`.`film_id` = `f`.`film_id`))) join `film_category` `fc` on((`f`.`film_id` = `fc`.`film_id`))) join `category` `c` on((`fc`.`category_id` = `c`.`category_id`))) group by `c`.`name` order by sum(`p`.`amount`) desc */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; +/*!50001 DROP TABLE IF EXISTS `sales_by_store`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = utf8 */; +/*!50001 SET character_set_results = utf8 */; +/*!50001 SET collation_connection = utf8_general_ci */; +/*!50001 CREATE ALGORITHM=UNDEFINED */ +/*!50013 DEFINER=`msandbox`@`%` SQL SECURITY DEFINER */ +/*!50001 VIEW `sales_by_store` AS select concat(`c`.`city`,_utf8',',`cy`.`country`) AS `store`,concat(`m`.`first_name`,_utf8' ',`m`.`last_name`) AS `manager`,sum(`p`.`amount`) AS `total_sales` from (((((((`payment` `p` join `rental` `r` on((`p`.`rental_id` = `r`.`rental_id`))) join `inventory` `i` on((`r`.`inventory_id` = `i`.`inventory_id`))) join `store` `s` on((`i`.`store_id` = `s`.`store_id`))) join `address` `a` on((`s`.`address_id` = `a`.`address_id`))) join `city` `c` on((`a`.`city_id` = `c`.`city_id`))) join `country` `cy` on((`c`.`country_id` = `cy`.`country_id`))) join `staff` `m` on((`s`.`manager_staff_id` = `m`.`staff_id`))) group by `s`.`store_id` order by `cy`.`country`,`c`.`city` */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; +/*!50001 DROP TABLE IF EXISTS `staff_list`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = utf8 */; +/*!50001 SET character_set_results = utf8 */; +/*!50001 SET collation_connection = utf8_general_ci */; +/*!50001 CREATE ALGORITHM=UNDEFINED */ +/*!50013 DEFINER=`msandbox`@`%` SQL SECURITY DEFINER */ +/*!50001 VIEW `staff_list` AS select `s`.`staff_id` AS `ID`,concat(`s`.`first_name`,_utf8' ',`s`.`last_name`) AS `name`,`a`.`address` AS `address`,`a`.`postal_code` AS `zip code`,`a`.`phone` AS `phone`,`city`.`city` AS `city`,`country`.`country` AS `country`,`s`.`store_id` AS `SID` from (((`staff` `s` join `address` `a` on((`s`.`address_id` = `a`.`address_id`))) join `city` on((`a`.`city_id` = `city`.`city_id`))) join `country` on((`city`.`country_id` = `country`.`country_id`))) */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */;