summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <monty@donna.mysql.com>2000-09-07 15:27:08 +0300
committerunknown <monty@donna.mysql.com>2000-09-07 15:27:08 +0300
commite7ab159a75662aa7845715b8217cef88b74b77c0 (patch)
tree3297b22a61870442e4dda3ab8fd248923d155211 /sql
parentc2b471009974c8bd190d85bfd0fe47c40452c4b8 (diff)
downloadmariadb-git-e7ab159a75662aa7845715b8217cef88b74b77c0.tar.gz
Added create_tmp_disk_tables + comments for 3.23.24
Docs/manual.texi: Update for 3.23.24 sql/mysql_priv.h: Added create_tmp_disk_tables sql/mysqld.cc: Added create_tmp_disk_tables sql/sql_select.cc: Added create_tmp_disk_tables
Diffstat (limited to 'sql')
-rw-r--r--sql/mysql_priv.h3
-rw-r--r--sql/mysqld.cc4
-rw-r--r--sql/sql_select.cc13
3 files changed, 12 insertions, 8 deletions
diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h
index a7d53b607b9..d9719b9bd68 100644
--- a/sql/mysql_priv.h
+++ b/sql/mysql_priv.h
@@ -428,7 +428,8 @@ extern char mysql_data_home[2],server_version[50],max_sort_char,
extern my_string mysql_unix_port,mysql_tmpdir;
extern const char *first_keyword, *localhost;
extern ulong refresh_version,flush_version, thread_id,query_id,opened_tables,
- created_tmp_tables, aborted_threads,aborted_connects,
+ created_tmp_tables, created_tmp_disk_tables,
+ aborted_threads,aborted_connects,
delayed_insert_timeout,
delayed_insert_limit, delayed_queue_size,
delayed_insert_threads, delayed_insert_writes,
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 0e10a144830..af8d66cc046 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -205,7 +205,8 @@ ulong query_id=1L,long_query_count,long_query_time,aborted_threads,
aborted_connects,delayed_insert_timeout,delayed_insert_limit,
delayed_queue_size,delayed_insert_threads,delayed_insert_writes,
delayed_rows_in_use,delayed_insert_errors,flush_time;
-ulong specialflag=0,opened_tables=0,created_tmp_tables=0;
+ulong specialflag=0,opened_tables=0,created_tmp_tables=0,
+ created_tmp_disk_tables=0;
ulong max_connections,max_insert_delayed_threads,max_used_connections,
max_connect_errors;
ulong thread_id=1L,current_pid;
@@ -2411,6 +2412,7 @@ struct show_var_st status_vars[]= {
{"Bytes_received", (char*) &bytes_received, SHOW_LONG},
{"Bytes_sent", (char*) &bytes_sent, SHOW_LONG},
{"Connections", (char*) &thread_id, SHOW_LONG_CONST},
+ {"Created_tmp_disk_tables", (char*) &created_tmp_disk_tables,SHOW_LONG},
{"Created_tmp_tables", (char*) &created_tmp_tables, SHOW_LONG},
{"Delayed_insert_threads", (char*) &delayed_insert_threads, SHOW_LONG},
{"Delayed_writes", (char*) &delayed_insert_writes, SHOW_LONG},
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index 4ee0343274a..d70dcc82df4 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -3161,7 +3161,7 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
(int) distinct, (int) save_sum_fields,
(int) allow_distinct_limit,test(group)));
- created_tmp_tables++; // Global, but should be safe
+ statistic_increment(created_tmp_tables, &LOCK_status);
sprintf(path,"%s%s%lx_%lx_%x",mysql_tmpdir,tmp_file_prefix,current_pid,
thd->thread_id, thd->tmp_table++);
if (group)
@@ -3681,6 +3681,7 @@ bool create_myisam_from_heap(TABLE *table, TMP_TABLE_PARAM *param, int error,
save_proc_info=thd->proc_info;
thd->proc_info="converting HEAP to MyISAM";
+ statistic_increment(created_tmp_disk_tables, &LOCK_status);
if (create_myisam_tmp_table(&new_table,param,
thd->lex.options | thd->options))
goto err2;
@@ -3849,13 +3850,13 @@ sub_select_cache(JOIN *join,JOIN_TAB *join_tab,bool end_of_records)
return error; /* purecov: inspected */
return sub_select(join,join_tab,end_of_records);
}
+ if (join->thd->killed) // If aborted by user
+ {
+ my_error(ER_SERVER_SHUTDOWN,MYF(0)); /* purecov: inspected */
+ return -2; /* purecov: inspected */
+ }
if (join_tab->use_quick != 2 || test_if_quick_select(join_tab) <= 0)
{
- if (join->thd->killed)
- {
- my_error(ER_SERVER_SHUTDOWN,MYF(0)); /* purecov: inspected */
- return -2; // Aborted by user /* purecov: inspected */
- }
if (!store_record_in_cache(&join_tab->cache))
return 0; // There is more room in cache
return flush_cached_records(join,join_tab,FALSE);