- 09 Sep, 2010 1 commit
-
-
Dmitry Lenev authored
table causes assert failure". Attempting to use FLUSH TABLE table_list WITH READ LOCK statement for a MERGE table led to an assertion failure if one of its children was not present in the list of tables to be flushed. The problem was not visible in non-debug builds. The assertion failure was caused by the fact that in such situations FLUSH TABLES table_list WITH READ LOCK implementation tried to use (e.g. lock) such child tables without acquiring metadata lock on them. This happened because when opening tables we assumed metadata locks on all tables were already acquired earlier during statement execution and a such assumption was false for MERGE children. This patch fixes the problem by ensuring at open_tables() time that we try to acquire metadata locks on all tables to be opened. For normal tables such requests are satisfied instantly since locks are already acquired for them. For MERGE children metadata locks are acquired in normal fashion. Note that FLUSH TABLES merge_table WITH READ LOCK will lock for read both the MERGE table and its children but will flush only the MERGE table. To flush children one has to mention them in table list explicitly. This is expected behavior and it is consistent with usage patterns for this statement (e.g. in mysqlhotcopy script).
-
- 08 Sep, 2010 1 commit
-
-
Jon Olav Hauglid authored
ALTER TABLE on a MERGE table could cause a deadlock with two other connections if we reached a situation where: 1) A connection doing ALTER TABLE can't upgrade to MDL_EXCLUSIVE on the parent table, but holds TL_READ_NO_INSERT on the child tables. 2) A connection doing DELETE on a child table can't get TL_WRITE on it since ALTER TABLE holds TL_READ_NO_INSERT. 3) A connection doing SELECT on the parent table can't get TL_READ on the child tables since TL_WRITE is ahead in the lock queue, but holds MDL_SHARED_READ on the parent table preventing ALTER TABLE from upgrading. For regular tables, this deadlock is avoided by having ALTER TABLE take a MDL_SHARED_NO_WRITE metadata lock on the table. This prevents DELETE from acquiring MDL_SHARED_WRITE on the table before ALTER TABLE tries to upgrade to MDL_EXCLUSIVE. In the example above, SELECT would therefore not be blocked by the pending DELETE as DELETE would not be able to enter TL_WRITE in the table lock queue. This patch fixes the problem for merge tables by using the same metadata lock type for child tables as for the parent table. The child tables will in this case therefore be locked with MDL_SHARED_NO_WRITE, preventing DELETE from acquiring a metadata lock and enter into the table lock queue. Change in behavior: By taking the same metadata lock for child tables as for the parent table, LOCK TABLE on the parent table will now also implicitly lock the child tables. Since LOCK TABLE on the parent table now takes more than one metadata lock, it is possible for LOCK TABLE ... WRITE on the parent table or child tables to give ER_LOCK_DEADLOCK error. Test case added to mdl_sync.test. Merge.test/.result has been updated to reflect the change to LOCK TABLE.
-
- 03 Sep, 2010 1 commit
-
-
Jon Olav Hauglid authored
-
- 02 Sep, 2010 2 commits
-
-
Vladislav Vaintroub authored
create data dir correctly in initial_database target on Windows handle case where INSTALL_MYSQLTESTDIR is empty (e.g someone does not want to install tests)
-
Marc Alff authored
Merge cleanup, fixed a build warning: my_getopt.c:156: warning: 'opt_found' may be used uninitialized in this function
-
- 01 Sep, 2010 5 commits
-
-
Alexey Botchkov authored
-
Alexander Nozdrin authored
-
Alexander Nozdrin authored
-
Jon Olav Hauglid authored
-
Alexey Botchkov authored
made libmysqld/Makefile.am to have same licence as libmysqld/CMakeLists.txt per-file comments: libmysqld/Makefile.am Bug#54906 Inconsistent license of libmysqld Added GPL license header instead of Library GPL.
-
- 31 Aug, 2010 10 commits
-
-
Alexander Nozdrin authored
-
Alexander Nozdrin authored
Problem: - ORDER BY for utf8mb4_bin, utf16_bin and utf32_bin returned results in a wrong order, because old functions (supporting only BMP range) were used to handle these collations. - Additionally, utf16_bin did not sort supplementary characters between U+D700 and U+E000, as WL#1213 specification specified.
-
Alexander Nozdrin authored
to allow temp table operations) -- prerequisite patch #3. Rename open_temporary_table() to open_table_uncached(). open_temporary_table() will be introduced in following patches to open temporary tables for a statement.
-
Alexander Nozdrin authored
check_merge_table_access() used to do two things: - set proper database for every merge table child; - check SELECT | UPDATE | DELETE for merge table children. Setting database is not needed anymore, since it's done on the parsing stage. Thus, check_merge_table_access() can be removed; needed privileges can be checked using check_table_access().
-
Alexander Nozdrin authored
This allows to avoid mixing it up with pointer to TABLE object which will be introduced to this function in one of upcoming patches.
-
Alexander Nozdrin authored
It was added by mistake during backport from 6.0.
-
Alexander Nozdrin authored
to allow temp table operations) -- prerequisite patch #2. Introduce a new form of find_temporary_table() function: find_temporary_table() by a table key. It will be used in further patches. Replace find_temporary_table(table_list->db, table_list->name) by more appropiate find_temporary_table(table_list) across the codebase.
-
Alexander Nozdrin authored
-
Dmitry Lenev authored
from 5.1.50 to 5.5.6". Debug builds of the server aborted due to an assertion failure when DROP DATABASE statement was run on an installation which had outdated or corrupt mysql.proc table. Particularly this affected the mysql_upgrade tool which is run as part of 5.1 to 5.5 upgrade. The problem was that sp_drop_db_routines(), which was invoked during dropping of the database, could have returned without closing and unlocking mysql.proc table in cases when this table was not up-to-date with the current server. As a result further attempt to open and lock the mysql.event table, which was necessary to complete dropping of the database, ended up with an assert. This patch solves this problem by ensuring that sp_drop_db_routines() always closes mysql.proc table and releases metadata locks on it. This is achieved by changing open_proc_table_for_update() function to close tables and release metadata locks acquired by it in case of failure. This step also makes behavior of the latter function consistent with behavior of open_proc_table_for_read()/ open_and_lock_tables(). Test case for this bug was added to sp-destruct.test.
-
Alexander Nozdrin authored
-
- 30 Aug, 2010 10 commits
-
-
Gleb Shchepa authored
-
Gleb Shchepa authored
"Access compatibility" syntax The "wild" "DELETE FROM table_name.* ... USING ..." syntax for multi-table DELETE statements is documented but it was lost in the fix for the bug 30234. The table_ident_opt_wild parser rule has been added to restore the lost syntax.
-
Alexander Nozdrin authored
-
Magnus Blåudd authored
- Remove include of ha_ndbcluster_tables.h from mysqldump.c
-
Dmitry Shulga authored
so test case has to be updated.
-
Alexander Nozdrin authored
-
Alexander Nozdrin authored
-
Alexander Nozdrin authored
-
Alexey Kopytov authored
-
- 28 Aug, 2010 1 commit
-
-
Alexander Nozdrin authored
-
- 27 Aug, 2010 7 commits
-
-
Marc Alff authored
-
Sergey Vojtovich authored
-
Alexey Kopytov authored
== MYSQL_TYPE_LONGLONG A MIN/MAX() function with a subquery as its argument could lead to a debug assertion on debug builds or wrong data on release ones. The problem was a combination of the following factors: - Item_sum_hybrid::fix_fields() might use the argument (args[0]) to calculate 'hybrid_field_type' which was later used to decide how the data should be sent to the client. - Item_sum::make_field() might use the argument again to calculate the field's type when sending result set metadata to the client. - The argument could be changed in between these two calls via Item::set_arg() leading to inconsistent metadata being reported. Here is what was happening for the bug's test case: 1. Item_sum_hybrid::fix_fields() calculates hybrid_field_type as MYSQL_TYPE_LONGLONG based on args[0] which is an Item::SUBSELECT_ITEM at that time. 2. A temporary table is created to execute the query. create_tmp_field_from_item() creates a Field_long object according to the subselect's max_length. 3. The subselect item in Item_sum_hybrid is replaced by the Item_field object referencing the newly created Field_long. 4. Item_sum::make_field() rightfully returns the MYSQL_TYPE_LONG type when calculating the result set metadata. 5. When sending the actual data, Item::send() relies on the virtual field_type() function which in our case returns previously calculated hybrid_field_type == MYSQL_TYPE_LONGLONG. It looks like the only solution is to never refer to the argument's metadata after the result metadata has been calculated in fix_fields(), since the argument itself may be different by then. In this sense, Item_sum::make_field() should never be used, because it may rely on the argument's metadata and is only called after fix_fields(). The "default" implementation in Item::make_field() should be used instead as it relies only on field_type(), but not on the argument's type. Fixed by removing Item_sum::make_field() so that the superclass implementation Item::make_field() is always used.
-
Alexander Nozdrin authored
to allow temp table operations) -- prerequisite patch #1. Move a piece of code that initialiazes TABLE instance after it was successfully opened into a separate function. This function will be reused in the following patches.
-
Ramil Kalimullin authored
Free memory allocated by the server for all plugins, with or without deinit() method.
-
Sergey Vojtovich authored
-
Sergey Vojtovich authored
not tested by ABI check plugin_audit.h and plugin_ftparser.h are now subject for ABI check. plugin.h is now tested implicitly. Also fixed broken ABI check cmake rules.
-
- 26 Aug, 2010 2 commits
-
-
Marc Alff authored
-
Christopher Powers authored
Handle combined instrument states of ENABLED and/or TIMED: ENABLED TIMED 1 1 Aggregate stats, increment counter 1 0 Increment counter 0 1 Do nothing 0 0 Do nothing
-