summaryrefslogtreecommitdiff
path: root/sql/sql_table.cc
diff options
context:
space:
mode:
authorMichael Widenius <monty@askmonty.org>2012-03-23 18:22:39 +0200
committerMichael Widenius <monty@askmonty.org>2012-03-23 18:22:39 +0200
commitc36bdf1c889539413d5369ae628aff97d044b276 (patch)
treed53d59e615088a42a15e4eaae85b20acf6e2fe2a /sql/sql_table.cc
parent8e825a2249440e7df0fce0123f6d543b09b29194 (diff)
downloadmariadb-git-c36bdf1c889539413d5369ae628aff97d044b276.tar.gz
Speedup:
- Don't call update_virtual_fields() if table->vfield is not set - Don't prealloc memory for in open_tables() as this is very seldom used. sql/records.cc: Don't call update_virtual_fields() if table->vfield is not set sql/sql_base.cc: Don't prealloc memory for in open_tables() as this is very seldom used. Don't call update_virtual_fields() if table->vfield is not set sql/sql_delete.cc: Don't call update_virtual_fields() if table->vfield is not set sql/sql_handler.cc: Don't call update_virtual_fields() if table->vfield is not set sql/sql_join_cache.cc: Don't call update_virtual_fields() if table->vfield is not set Move some frequent values to local variables sql/sql_table.cc: Don't call update_virtual_fields() if table->vfield is not set sql/sql_update.cc: Don't call update_virtual_fields() if table->vfield is not set sql/table.cc: Assert if update_virtual_fields is called with wrong parameters
Diffstat (limited to 'sql/sql_table.cc')
-rw-r--r--sql/sql_table.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index 222f6e07bc2..1b9ec320f7e 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -8078,7 +8078,8 @@ copy_data_between_tables(THD *thd, TABLE *from,TABLE *to,
error= 1;
break;
}
- update_virtual_fields(thd, from);
+ if (from->vfield)
+ update_virtual_fields(thd, from);
thd->row_count++;
if (++thd->progress.counter >= time_to_report_progress)
{
@@ -8106,7 +8107,8 @@ copy_data_between_tables(THD *thd, TABLE *from,TABLE *to,
copy_ptr->do_copy(copy_ptr);
}
prev_insert_id= to->file->next_insert_id;
- update_virtual_fields(thd, to, TRUE);
+ if (to->vfield)
+ update_virtual_fields(thd, to, TRUE);
if (thd->is_error())
{
error= 1;