1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Merge bk-internal.mysql.com:/home/bk/mysql-5.1-runtime

into  dipika.(none):/opt/local/work/mysql-5.1-2pc-opt-merge-push
This commit is contained in:
kostja@dipika.(none)
2008-02-19 14:53:22 +03:00
27 changed files with 2514 additions and 249 deletions

View File

@ -4162,6 +4162,7 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables,
switch ((*prepare_func)(thd, table, check_opt)) {
case 1: // error, message written to net
ha_autocommit_or_rollback(thd, 1);
end_trans(thd, ROLLBACK);
close_thread_tables(thd);
DBUG_PRINT("admin", ("simple error, admin next table"));
continue;
@ -4220,6 +4221,7 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables,
table_name);
protocol->store(buff, length, system_charset_info);
ha_autocommit_or_rollback(thd, 0);
end_trans(thd, COMMIT);
close_thread_tables(thd);
lex->reset_query_tables_list(FALSE);
table->table=0; // For query cache
@ -4492,6 +4494,7 @@ send_result_message:
}
}
ha_autocommit_or_rollback(thd, 0);
end_trans(thd, COMMIT);
close_thread_tables(thd);
table->table=0; // For query cache
if (protocol->write())
@ -4501,8 +4504,9 @@ send_result_message:
send_eof(thd);
DBUG_RETURN(FALSE);
err:
err:
ha_autocommit_or_rollback(thd, 1);
end_trans(thd, ROLLBACK);
close_thread_tables(thd); // Shouldn't be needed
if (table)
table->table=0;
@ -5025,8 +5029,8 @@ mysql_discard_or_import_tablespace(THD *thd,
query_cache_invalidate3(thd, table_list, 0);
/* The ALTER TABLE is always in its own transaction */
error = ha_commit_stmt(thd);
if (ha_commit(thd))
error = ha_autocommit_or_rollback(thd, 0);
if (end_active_trans(thd))
error=1;
if (error)
goto err;
@ -5034,7 +5038,6 @@ mysql_discard_or_import_tablespace(THD *thd,
err:
ha_autocommit_or_rollback(thd, error);
close_thread_tables(thd);
thd->tablespace_op=FALSE;
if (error == 0)
@ -6557,8 +6560,8 @@ view_err:
VOID(pthread_mutex_unlock(&LOCK_open));
alter_table_manage_keys(table, table->file->indexes_are_disabled(),
alter_info->keys_onoff);
error= ha_commit_stmt(thd);
if (ha_commit(thd))
error= ha_autocommit_or_rollback(thd, 0);
if (end_active_trans(thd))
error= 1;
}
thd->count_cuted_fields= CHECK_FIELD_IGNORE;
@ -6646,7 +6649,7 @@ view_err:
/* Need to commit before a table is unlocked (NDB requirement). */
DBUG_PRINT("info", ("Committing before unlocking table"));
if (ha_commit_stmt(thd) || ha_commit(thd))
if (ha_autocommit_or_rollback(thd, 0) || end_active_trans(thd))
goto err1;
committed= 1;
}
@ -7147,9 +7150,9 @@ copy_data_between_tables(TABLE *from,TABLE *to,
Ensure that the new table is saved properly to disk so that we
can do a rename
*/
if (ha_commit_stmt(thd))
if (ha_autocommit_or_rollback(thd, 0))
error=1;
if (ha_commit(thd))
if (end_active_trans(thd))
error=1;
err: