diff options
author | unknown <serg@serg.mylan> | 2005-04-29 19:31:56 +0200 |
---|---|---|
committer | unknown <serg@serg.mylan> | 2005-04-29 19:31:56 +0200 |
commit | 927d747a21b7fe05a52074e511e75a600965c139 (patch) | |
tree | 5668aa9ce7b897640a509c918d6dc0f26852dc2d /sql/ha_innodb.cc | |
parent | e31358aecba242fc58ed30c81d71e46ff67ec4cb (diff) | |
parent | 90110b842979c65cf772d2c44167874995cc61dd (diff) | |
download | mariadb-git-927d747a21b7fe05a52074e511e75a600965c139.tar.gz |
Merge bk-internal:/home/bk/mysql-5.0
into serg.mylan:/usr/home/serg/Abk/mysql-5.0
configure.in:
Auto merged
Diffstat (limited to 'sql/ha_innodb.cc')
-rw-r--r-- | sql/ha_innodb.cc | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index e68a85bdac9..4217b694f06 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -1611,6 +1611,7 @@ innobase_report_binlog_offset_and_commit( trx->mysql_log_file_name = log_file_name; trx->mysql_log_offset = (ib_longlong)end_offset; +#ifdef HAVE_REPLICATION if (thd->variables.sync_replication) { /* Let us store the binlog file name and the position, so that we know how long to wait for the binlog to the replicated to @@ -1619,19 +1620,19 @@ innobase_report_binlog_offset_and_commit( if (trx->repl_wait_binlog_name == NULL) { trx->repl_wait_binlog_name = - (char*)mem_alloc(FN_REFLEN + 100); + (char*)mem_alloc_noninline(FN_REFLEN + 100); } - ut_a(strlen(log_file_name) <= FN_REFLEN + 100); + ut_a(strlen(log_file_name) < FN_REFLEN + 100); strcpy(trx->repl_wait_binlog_name, log_file_name); trx->repl_wait_binlog_pos = (ib_longlong)end_offset; } - +#endif /* HAVE_REPLICATION */ trx->flush_log_later = TRUE; - innobase_commit(thd, trx_handle); + innobase_commit(thd, TRUE); trx->flush_log_later = FALSE; @@ -1681,10 +1682,7 @@ innobase_commit_complete( /* out: 0 */ THD* thd) /* in: user thread */ { - struct timespec abstime; trx_t* trx; - int cmp; - int ret; trx = (trx_t*) thd->ha_data[innobase_hton.slot]; @@ -1700,21 +1698,19 @@ innobase_commit_complete( trx_commit_complete_for_mysql(trx); } - printf("Wait binlog name %s, repl state %lu\n", - trx->repl_wait_binlog_name, - (uint)innobase_repl_state); - +#ifdef HAVE_REPLICATION if (thd->variables.sync_replication && trx->repl_wait_binlog_name && innobase_repl_state != 0) { + struct timespec abstime; + int cmp; + int ret; + /* In synchronous replication, let us wait until the MySQL replication has sent the relevant binlog segment to the replication slave. */ -/* TODO: Make sure MySQL uses some way (TCP_NODELAY?) to ensure that the data -has been received in the slave! */ - pthread_mutex_lock(&innobase_repl_cond_mutex); try_again: if (innobase_repl_state == 0) { @@ -1809,10 +1805,11 @@ try_again: goto try_again; } - +#endif HAVE_REPLICATION return(0); } +#ifdef HAVE_REPLICATION /********************************************************************* In synchronous replication, reports to InnoDB up to which binlog position we have sent the binlog to the slave. Note that replication is synchronous @@ -1908,6 +1905,7 @@ innobase_repl_report_sent_binlog( pthread_cond_broadcast(&innobase_repl_cond); } } +#endif /* HAVE_REPLICATION */ /********************************************************************* Rolls back a transaction or the latest SQL statement. */ @@ -2138,17 +2136,20 @@ ha_innobase::get_row_type() const /******************************************************************** Gives the file extension of an InnoDB single-table tablespace. */ +static const char* ha_innobase_exts[] = { + ".ibd", + NullS +}; const char** ha_innobase::bas_ext() const /*========================*/ /* out: file extension string */ { - static const char* ext[] = {".ibd", NullS}; - - return(ext); + return ha_innobase_exts; } + /********************************************************************* Normalizes a table name string. A normalized name consists of the database name catenated to '/' and table name. An example: |