summaryrefslogtreecommitdiff
path: root/sql/table.cc
diff options
context:
space:
mode:
authordlenev@brandersnatch.localdomain <>2004-03-28 04:11:54 +0400
committerdlenev@brandersnatch.localdomain <>2004-03-28 04:11:54 +0400
commit9e28b7698d487f188c8669d5b7918fca1d750753 (patch)
treec5035ed539732100b50eb469c056b49a572c70d4 /sql/table.cc
parentb84a9dcf866ae810701c68a1fa07612213506a47 (diff)
downloadmariadb-git-9e28b7698d487f188c8669d5b7918fca1d750753.tar.gz
"Fix" for BUG #2050 "10 to 1 performance drop with server 4.1.1".
Actually it is not a bug but right behavior observed as pefomance degradation after we have forced Item_field::fix_fields() to re-execute each time when we are executing prep stmt. This patch implements small optimization which heals this bad behavior. We are caching field position in TABLE::field array in Item's member and are using this position for speeding up field lookups in fix_fields() in case of its re-execution.
Diffstat (limited to 'sql/table.cc')
-rw-r--r--sql/table.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/sql/table.cc b/sql/table.cc
index 526810de74a..dcd0d39d855 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -30,11 +30,11 @@ static void fix_type_pointers(const char ***array, TYPELIB *point_to_type,
static uint find_field(TABLE *form,uint start,uint length);
-static byte* get_field_name(Field *buff,uint *length,
+static byte* get_field_name(Field **buff,uint *length,
my_bool not_used __attribute__((unused)))
{
- *length= (uint) strlen(buff->field_name);
- return (byte*) buff->field_name;
+ *length= (uint) strlen((*buff)->field_name);
+ return (byte*) (*buff)->field_name;
}
/*
@@ -479,7 +479,7 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag,
if (outparam->timestamp_field == reg_field)
outparam->timestamp_field_offset=i;
if (use_hash)
- (void) my_hash_insert(&outparam->name_hash,(byte*) *field_ptr); // Will never fail
+ (void) my_hash_insert(&outparam->name_hash,(byte*) field_ptr); // Will never fail
}
*field_ptr=0; // End marker