1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

merge of 5.1-main into 5.1-maria. Myisam->Maria change propagation will follow.

There were so many changes into mtr (this is the new mtr coming) that I rather
copied mtr from 6.0-main here (at least this one knows how to run Maria tests).
I also fixed suite/maria tests to be accepted by the new mtr.

mysys/thr_mutex.c:
  adding DBUG_PRINT here, so that we can locate where the warning is issued.
This commit is contained in:
Guilhem Bichot
2009-02-12 15:08:56 +01:00
1658 changed files with 37656 additions and 20494 deletions

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2000-2006 MySQL AB
/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -1111,6 +1111,27 @@ static void mark_temp_tables_as_free_for_reuse(THD *thd)
*/
if (table->child_l || table->parent)
detach_merge_children(table, TRUE);
/*
Reset temporary table lock type to it's default value (TL_WRITE).
Statements such as INSERT INTO .. SELECT FROM tmp, CREATE TABLE
.. SELECT FROM tmp and UPDATE may under some circumstances modify
the lock type of the tables participating in the statement. This
isn't a problem for non-temporary tables since their lock type is
reset at every open, but the same does not occur for temporary
tables for historical reasons.
Furthermore, the lock type of temporary tables is not really that
important because they can only be used by one query at a time and
not even twice in a query -- a temporary table is represented by
only one TABLE object. Nonetheless, it's safer from a maintenance
point of view to reset the lock type of this singleton TABLE object
as to not cause problems when the table is reused.
Even under LOCK TABLES mode its okay to reset the lock type as
LOCK TABLES is allowed (but ignored) for a temporary table.
*/
table->reginfo.lock_type= TL_WRITE;
}
}
}
@ -4699,7 +4720,7 @@ int open_tables(THD *thd, TABLE_LIST **start, uint *counter, uint flags)
else if (tables->lock_type == TL_READ_DEFAULT)
tables->table->reginfo.lock_type=
read_lock_type_for_table(thd, tables->table);
else if (tables->table->s->tmp_table == NO_TMP_TABLE)
else
tables->table->reginfo.lock_type= tables->lock_type;
}
tables->table->grant= tables->grant;