diff options
author | dlenev@brandersnatch.localdomain <> | 2004-03-28 04:11:54 +0400 |
---|---|---|
committer | dlenev@brandersnatch.localdomain <> | 2004-03-28 04:11:54 +0400 |
commit | 9e28b7698d487f188c8669d5b7918fca1d750753 (patch) | |
tree | c5035ed539732100b50eb469c056b49a572c70d4 /sql/sql_acl.cc | |
parent | b84a9dcf866ae810701c68a1fa07612213506a47 (diff) | |
download | mariadb-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/sql_acl.cc')
-rw-r--r-- | sql/sql_acl.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index 9284b1cd574..86a535ba493 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -2194,8 +2194,10 @@ int mysql_table_grant(THD *thd, TABLE_LIST *table_list, DBUG_RETURN(-1); while ((column = column_iter++)) { + int unused_field_idx= -1; if (!find_field_in_table(thd,table,column->column.ptr(), - column->column.length(),0,0)) + column->column.length(),0,0, + &unused_field_idx)) { my_error(ER_BAD_FIELD_ERROR, MYF(0), column->column.c_ptr(), table_list->alias); |