summaryrefslogtreecommitdiff
path: root/sql/handler.cc
diff options
context:
space:
mode:
authorunknown <monty@mashka.mysql.fi>2003-05-22 02:57:27 +0300
committerunknown <monty@mashka.mysql.fi>2003-05-22 02:57:27 +0300
commitc23102ab5089fdf3a4f067a85bad53c8644bc4e9 (patch)
treeed5eeb9e58454d28807426e58e1c1c16e4c08de4 /sql/handler.cc
parent1bc4c11354cf90bd457afb875d495e67cc291fdf (diff)
parent7dd91a0e23e30b595e5af3f724ea997ec24f8eef (diff)
downloadmariadb-git-c23102ab5089fdf3a4f067a85bad53c8644bc4e9.tar.gz
merge
VC++Files/libmysql/libmysql.dsp: Auto merged client/mysqlbinlog.cc: Auto merged include/my_sys.h: Auto merged libmysql/libmysql.def: Auto merged mysql-test/r/create.result: Auto merged mysql-test/r/group_by.result: Auto merged mysql-test/r/key.result: Auto merged mysql-test/r/myisam.result: Auto merged mysql-test/r/null_key.result: Auto merged mysql-test/r/order_by.result: Auto merged mysql-test/r/type_decimal.result: Auto merged mysql-test/r/variables.result: Auto merged mysql-test/t/ctype_latin1_de-master.opt: Auto merged mysql-test/t/variables.test: Auto merged mysys/charset.c: Auto merged sql/field.cc: Auto merged sql/field.h: Auto merged sql/item.h: Auto merged sql/item_func.cc: Auto merged sql/item_strfunc.cc: Auto merged sql/log_event.cc: Auto merged sql/mysql_priv.h: Auto merged sql/set_var.cc: Auto merged sql/set_var.h: Auto merged sql/sql_class.h: Auto merged sql/sql_insert.cc: Auto merged sql/sql_load.cc: Auto merged sql/sql_parse.cc: Auto merged sql/sql_select.cc: Auto merged sql/sql_table.cc: Auto merged sql/sql_update.cc: Auto merged sql/sql_yacc.yy: Auto merged sql/share/czech/errmsg.txt: Auto merged sql/share/danish/errmsg.txt: Auto merged sql/share/dutch/errmsg.txt: Auto merged sql/share/english/errmsg.txt: Auto merged sql/share/estonian/errmsg.txt: Auto merged sql/share/french/errmsg.txt: Auto merged sql/share/german/errmsg.txt: Auto merged sql/share/greek/errmsg.txt: Auto merged sql/share/hungarian/errmsg.txt: Auto merged sql/share/italian/errmsg.txt: Auto merged sql/share/japanese/errmsg.txt: Auto merged sql/share/korean/errmsg.txt: Auto merged sql/share/norwegian-ny/errmsg.txt: Auto merged sql/share/norwegian/errmsg.txt: Auto merged sql/share/portuguese/errmsg.txt: Auto merged sql/share/romanian/errmsg.txt: Auto merged sql/share/russian/errmsg.txt: Auto merged sql/share/slovak/errmsg.txt: Auto merged sql/share/spanish/errmsg.txt: Auto merged sql/share/swedish/errmsg.txt: Auto merged sql/share/ukrainian/errmsg.txt: Auto merged
Diffstat (limited to 'sql/handler.cc')
-rw-r--r--sql/handler.cc40
1 files changed, 35 insertions, 5 deletions
diff --git a/sql/handler.cc b/sql/handler.cc
index f2b7dbdf531..db1857e938c 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -253,6 +253,9 @@ int ha_autocommit_or_rollback(THD *thd, int error)
replication. This function also calls the commit of the table
handler, because the order of transactions in the log of the table
handler must be the same as in the binlog.
+ NOTE that to eliminate the bottleneck of the group commit, we do not
+ flush the handler log files here, but only later in a call of
+ ha_commit_complete().
arguments:
thd: the thread handle of the current connection
@@ -279,13 +282,38 @@ int ha_report_binlog_offset_and_commit(THD *thd,
my_error(ER_ERROR_DURING_COMMIT, MYF(0), error);
error=1;
}
- trans->innodb_active_trans=0;
}
#endif
return error;
}
/*
+ Flushes the handler log files (if my.cnf settings do not free us from it)
+ after we have called ha_report_binlog_offset_and_commit(). To eliminate
+ the bottleneck from the group commit, this should be called when
+ LOCK_log has been released in log.cc.
+
+ arguments:
+ thd: the thread handle of the current connection
+ return value: always 0
+*/
+
+int ha_commit_complete(THD *thd)
+{
+#ifdef HAVE_INNOBASE_DB
+ THD_TRANS *trans;
+ trans = &thd->transaction.all;
+ if (trans->innobase_tid)
+ {
+ innobase_commit_complete(trans->innobase_tid);
+
+ trans->innodb_active_trans=0;
+ }
+#endif
+ return 0;
+}
+
+/*
This function should be called when MySQL sends rows of a SELECT result set
or the EOF mark to the client. It releases a possible adaptive hash index
S-latch held by thd in InnoDB and also releases a possible InnoDB query
@@ -812,7 +840,8 @@ void handler::print_error(int error, myf errflag)
DBUG_VOID_RETURN;
}
- /* Return key if error because of duplicated keys */
+
+/* Return key if error because of duplicated keys */
uint handler::get_dup_key(int error)
{
@@ -823,6 +852,7 @@ uint handler::get_dup_key(int error)
DBUG_RETURN(table->file->errkey);
}
+
int handler::delete_table(const char *name)
{
int error=0;
@@ -849,9 +879,10 @@ int handler::rename_table(const char * from, const char * to)
DBUG_RETURN(0);
}
-/* Tell the handler to turn on or off logging to the handler's
- recovery log
+/*
+ Tell the handler to turn on or off logging to the handler's recovery log
*/
+
int ha_recovery_logging(THD *thd, bool on)
{
int error=0;
@@ -906,7 +937,6 @@ bool handler::caching_allowed(THD* thd, char* table_key,
int ha_create_table(const char *name, HA_CREATE_INFO *create_info,
bool update_create_info)
-
{
int error;
TABLE table;