summaryrefslogtreecommitdiff
path: root/mysql-test/r/view.result
Commit message (Collapse)AuthorAgeFilesLines
* MDEV-9701: CREATE VIEW with GROUP BY or ORDER BY and constant produces ↵Oleksandr Byelkin2016-03-181-0/+19
| | | | | | | invalid definition Fixed printing integer constant in the ORDER clause (MySQL solution) Removed workaround for double resolving counter in the ORDER.
* Merge branch '10.0' into 10.1Sergei Golubchik2016-02-231-6/+14
|\
| * Merge branch '5.5' into 10.0Sergei Golubchik2016-02-151-6/+14
| |\
| | * Bug#19817021Sergei Golubchik2016-02-091-0/+8
| | | | | | | | | | | | test case for ALTER TABLE view CHECK PARTITION
| | * Merge branch 'mysql/5.5' into 5.5Sergei Golubchik2016-02-091-6/+6
| | |\ | | | | | | | | | | | | | | | | reverted about half of commits as either not applicable or outright wrong
| | | * Bug#19817021 CRASH IN TABLE_LIST::PREPARE_SECURITY WHENAjo Robert2015-11-131-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | DOING BAD DDL IN PREPARED STATEMENT Analysis ======== A repeat execution of the prepared statement 'ALTER TABLE v1 CHECK PARTITION' where v1 is a view leads to server exit. ALTER TABLE ... CHECK PARTITION is not applicable for views and check for the same check is missing. This leads to further execution and creation of derived table for the view (Allocated under temp_table mem_root). Any reference to open view or related pointers from second execution leads to server exit as the same was freed at previous execution closure. Fix: ====== Added check for view in mysql_admin_table() on PARTITION operation. This will prevent mysql_admin_table() from going ahead and creating temp table and related issues. Changed message on admin table view operation error to be more appropriate.
* | | | Merge branch '10.0' into 10.1Sergei Golubchik2015-11-191-0/+176
|\ \ \ \ | |/ / /
| * | | Merge branch '5.5' into 10.0Sergei Golubchik2015-11-181-0/+33
| |\ \ \ | | |/ /
| | * | DEV-8632 Segmentation fault on INSERTOleksandr Byelkin2015-11-091-0/+33
| | | | | | | | | | | | | | | | | | | | | | | | View/derived fields should be taken into account when we build ref_pointer_array constructed. DBUG_ASSERTs added to avoid memory overrun.
| * | | MDEV-8913 Derived queries with same column names as final projection causes ↵Oleksandr Byelkin2015-10-301-0/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | issues when using Order By find_item_in_list() now recognize view fields like a fields even if they rever to an expression. The problem of schema name do not taken into account for field with it and derived table fixed. Duplicating code removed
| * | | MDEV-8525 mariadb 10.0.20 crashing when data is read by Kodi media center ↵Oleksandr Byelkin2015-10-281-0/+102
| | | | | | | | | | | | | | | | | | | | | | | | (http://kodi.tv). Item_direct_view_ref maintains its own item_const() method so should use it when asked of temporary table field to be in sync with it.
* | | | Merge branch '10.0' into 10.1Sergei Golubchik2015-10-121-0/+35
|\ \ \ \ | |/ / /
| * | | Merge branch '5.5' into 10.0Sergei Golubchik2015-10-091-0/+35
| |\ \ \ | | |/ /
| | * | Merge remote-tracking branch 'mysql/5.5' into 5.5Sergei Golubchik2015-10-081-0/+35
| | |\ \ | | | |/
| | | * BUG#19886430: VIEW CREATION WITH NAMED COLUMNS, OVER UNION,Nisha Gopalakrishnan2015-07-231-0/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | IS REJECTED. Analysis ======== View creation with named columns over UNION is rejected. Consider the following view definition: CREATE VIEW v1 (fld1, fld2) AS SELECT 1 AS a, 2 AS b UNION ALL SELECT 1 AS a, 1 AS a; A 'duplicate column' error was reported due to the duplicate alias name in the secondary SELECT. The VIEW column names are either explicitly specified or determined from the first SELECT (which can be auto generated if not specified). Since a duplicate column name check was performed even for the secondary SELECTs, an error was reported. Fix ==== Check for duplicate column names only for the named columns if specified or only for the first SELECT.
* | | | MDEV-8466 CAST works differently for DECIMAL/INT vs DOUBLE for empty stringsAlexander Barkov2015-09-171-0/+11
| | | | | | | | | | | | | | | | MDEV-8468 CAST and INSERT work differently for DECIMAL/INT vs DOUBLE for a string with trailing spaces
* | | | MDEV-8742 Wrong result for SELECT..WHERE view_latin1_swedish_ci_field='a' ↵Alexander Barkov2015-09-071-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | COLLATE latin1_bin The fix for MDEV-8749 also fixed MDEV-8742. Just adding the test case from the bug report.
* | | | MDEV-8747 Wrong result for SELECT..WHERE derived_table_column='a' AND ↵Alexander Barkov2015-09-061-8/+82
| | | | | | | | | | | | | | | | | | | | | | | | derived_table_column<>_latin1'A' COLLATE latin1_bin MDEV-8749 Wrong result for SELECT..WHERE derived_table_enum_column='number' AND derived_table_enum_column OP number
* | | | MDEV-6066: Merge new defaults from 5.6 and 5.7 (defaults changed, QC can be ↵Oleksandr Byelkin2015-09-041-2/+6
| | | | | | | | | | | | | | | | stopped with no-zero size)
* | | | Merge branch '10.0' into 10.1Sergei Golubchik2015-09-031-0/+15
|\ \ \ \ | |/ / / | | | | | | | | | | | | referenced_by_foreign_key2(), needed for InnoDB to compile, was taken from 10.0-galera
| * | | Merge branch '5.5' into 10.0Sergei Golubchik2015-08-051-0/+15
| |\ \ \ | | |/ / | | | | | | | | 5.5 without InnoDB/XtraDB changes
| | * | MDEV-8554: Server crashes in base_list_iterator::next_fast ...Sergei Petrunia2015-08-031-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | THD::>save_prep_leaf_list was set to true by multi-table update statements with mergeable selects and never reset. Make every statement reset it at start.
* | | | Merge tag 'mariadb-10.0.20' into 10.1Sergei Golubchik2015-06-271-0/+18
|\ \ \ \ | |/ / /
| * | | Merge branch '5.5' into 10.0Sergei Golubchik2015-06-111-0/+18
| |\ \ \ | | |/ /
| | * | MDEV-7207 - ALTER VIEW does not change ALGORITMSergey Vojtovich2015-06-051-0/+18
| | | | | | | | | | | | | | | | | | | | Fixed that ALTER VIEW ALGORITHM=UNDEFINED behaved as if algorithm was not specified.
* | | | mtr: make search_pattern_in_file.inc more verboseSergei Golubchik2015-04-111-0/+1
|/ / / | | | | | | | | | | | | report when a pattern is found do not abort, but merely report when a pattern is not found
* | | Merge branch '5.5' into 10.0Sergei Golubchik2015-02-181-1/+14
|\ \ \ | |/ /
| * | Merge remote-tracking branch 'bzr/5.5' into bb-5.5-mergeSergei Golubchik2015-02-121-0/+13
| |\ \
| | * | MDEV-7260: Crash in get_best_combination when executing multi-table UPDATE ↵unknown2015-02-111-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | with nested views Do not use merge_for_insert for commands which use SELECT because optimizer can't work with such tables. Fixes which makes multi-delete working with normally merged views.
| * | | Merge remote-tracking branch 'mysql/5.5' into bb-5.5-merge @ mysql-5.5.42Sergei Golubchik2015-02-111-1/+1
| |\ \ \ | | |/ / | |/| / | | |/
| | * BUG#18405221: SHOW CREATE VIEW OUTPUT INCORRECTNisha Gopalakrishnan2014-06-251-0/+37
| | | | | | | | | | | | | | | | | | | | | Fix: --- The issue reported is same as the BUG#14117018. Hence backporting the patch from mysql-trunk to mysql-5.5 and mysql-5.6
| | * Bug#12626844 : WE ARE NOT CHECKING VIEW TABLE NAMESChaithra Gopalareddy2012-03-141-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ENOUGH - CONCAT() HACKS. ALSO WRONG ERROR MESSAGE WHILE TRYING TO CREATE A VIEW ON A NON EXISTING DATABASE PROBLEM: The first part of the problem is concluded as not a bug, as 'concat' is not a reserved word and it is completely valid to create a view with the name 'concat'. The second issue is, while trying to create a view on a non existing database, we are not giving a proper error message. FIX: We have added a check for the database existence while trying to create a view. This check would give an error as 'unknown database' when the database does not exist. This patch is a backport of the patch for Bug#13601606
| | * manual merge 5.1-->5.5 (bug 11829681)Gleb Shchepa2011-04-081-0/+9
| | |\
| | | * Bug #11829681 - 60295: ERROR 1356 ON VIEW THAT EXECUTES FINE AS A QUERYGleb Shchepa2011-04-081-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Select from a view with the underlying HAVING clause failed with a message: "1356: View '...' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them" The bug is a regression of the fix for bug 11750328 - 40825 (similar case, but the HAVING cause references an aliased field). In the old fix for bug 40825 the Item_field::name_length value has been used in place of the real length of Item_field::name. However, in some cases Item_field::name_length is not in sync with the actual name length (TODO: combine name and name_length into a solid String field). The Item_ref::print() method has been modified to calculate actual name length every time.
| | * | 5.1-bugteam->5.5-bugteam mergeSergey Glukhov2010-12-141-0/+13
| | |\ \ | | | |/
| | | * Fixed following problems:Sergey Glukhov2010-12-141-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | --Bug#52157 various crashes and assertions with multi-table update, stored function --Bug#54475 improper error handling causes cascading crashing failures in innodb/ndb --Bug#57703 create view cause Assertion failed: 0, file .\item_subselect.cc, line 846 --Bug#57352 valgrind warnings when creating view --Recently discovered problem when a nested materialized derived table is used before being populated and it leads to incorrect result We have several modes when we should disable subquery evaluation. The reasons for disabling are different. It could be uselessness of the evaluation as in case of 'CREATE VIEW' or 'PREPARE stmt', or we should disable subquery evaluation if tables are not locked yet as it happens in bug#54475, or too early evaluation of subqueries can lead to wrong result as it happened in Bug#19077. Main problem is that if subquery items are treated as const they are evaluated in ::fix_fields(), ::fix_length_and_dec() of the parental items as a lot of these methods have Item::val_...() calls inside. We have to make subqueries non-const to prevent unnecessary subquery evaluation. At the moment we have different methods for this. Here is a list of these modes: 1. PREPARE stmt; We use UNCACHEABLE_PREPARE flag. It is set during parsing in sql_parse.cc, mysql_new_select() for each SELECT_LEX object and cleared at the end of PREPARE in sql_prepare.cc, init_stmt_after_parse(). If this flag is set subquery becomes non-const and evaluation does not happen. 2. CREATE|ALTER VIEW, SHOW CREATE VIEW, I_S tables which process FRM files We use LEX::view_prepare_mode field. We set it before view preparation and check this flag in ::fix_fields(), ::fix_length_and_dec(). Some bugs are fixed using this approach, some are not(Bug#57352, Bug#57703). The problem here is that we have a lot of ::fix_fields(), ::fix_length_and_dec() where we use Item::val_...() calls for const items. 3. Derived tables with subquery = wrong result(Bug19077) The reason of this bug is too early subquery evaluation. It was fixed by adding Item::with_subselect field The check of this field in appropriate places prevents const item evaluation if the item have subquery. The fix for Bug19077 fixes only the problem with convert_constant_item() function and does not cover other places(::fix_fields(), ::fix_length_and_dec() again) where subqueries could be evaluated. Example: CREATE TABLE t1 (i INT, j BIGINT); INSERT INTO t1 VALUES (1, 2), (2, 2), (3, 2); SELECT * FROM (SELECT MIN(i) FROM t1 WHERE j = SUBSTRING('12', (SELECT * FROM (SELECT MIN(j) FROM t1) t2))) t3; DROP TABLE t1; 4. Derived tables with subquery where subquery is evaluated before table locking(Bug#54475, Bug#52157) Suggested solution is following: -Introduce new field LEX::context_analysis_only with the following possible flags: #define CONTEXT_ANALYSIS_ONLY_PREPARE 1 #define CONTEXT_ANALYSIS_ONLY_VIEW 2 #define CONTEXT_ANALYSIS_ONLY_DERIVED 4 -Set/clean these flags when we perform context analysis operation -Item_subselect::const_item() returns result depending on LEX::context_analysis_only. If context_analysis_only is set then we return FALSE that means that subquery is non-const. As all subquery types are wrapped by Item_subselect it allow as to make subquery non-const when it's necessary.
| | | * Bug#35333, "If Federated table can't connect to remote host, can't retrieveChristopher Powers2010-11-291-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | metadata" Improved error handling such that queries against Information_Schema.Tables won't fail if a federated table can't make a remote connection.
| | * | Bug#35333, "If Federated table can't connect to remote host, can't retrieveChristopher Powers2010-11-301-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | metadata" Improved error handling such that queries against Information_Schema.Tables won't fail if a federated table can't make a remote connection.
| | * | Auto-merge from mysql-trunk-bugfixing.Alexander Nozdrin2010-07-301-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ****** This patch fixes the following bugs: - Bug#5889: Exit handler for a warning doesn't hide the warning in trigger - Bug#9857: Stored procedures: handler for sqlwarning ignored - Bug#23032: Handlers declared in a SP do not handle warnings generated in sub-SP - Bug#36185: Incorrect precedence for warning and exception handlers The problem was in the way warnings/errors during stored routine execution were handled. Prior to this patch the logic was as follows: - when a warning/an error happens: if we're executing a stored routine, and there is a handler for that warning/error, remember the handler, ignore the warning/error and continue execution. - after a stored routine instruction is executed: check for a remembered handler and activate one (if any). This logic caused several problems: - if one instruction generates several warnings (errors) it's impossible to choose the right handler -- a handler for the first generated condition was chosen and remembered for activation. - mess with handling conditions in scopes different from the current one. - not putting generated warnings/errors into Warning Info (Diagnostic Area) is against The Standard. The patch changes the logic as follows: - Diagnostic Area is cleared on the beginning of each statement that either is able to generate warnings, or is able to work with tables. - at the end of a stored routine instruction, Diagnostic Area is left intact. - Diagnostic Area is checked after each stored routine instruction. If an instruction generates several condition, it's now possible to take a look at all of them and determine an appropriate handler.
| | * | A pre-requisite patch for the fix for Bug#52044.Konstantin Osipov2010-07-271-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch also fixes Bug#55452 "SET PASSWORD is replicated twice in RBR mode". The goal of this patch is to remove the release of metadata locks from close_thread_tables(). This is necessary to not mistakenly release the locks in the course of a multi-step operation that involves multiple close_thread_tables() or close_tables_for_reopen(). On the same token, move statement commit outside close_thread_tables(). Other cleanups: Cleanup COM_FIELD_LIST. Don't call close_thread_tables() in COM_SHUTDOWN -- there are no open tables there that can be closed (we leave the locked tables mode in THD destructor, and this close_thread_tables() won't leave it anyway). Make open_and_lock_tables() and open_and_lock_tables_derived() call close_thread_tables() upon failure. Remove the calls to close_thread_tables() that are now unnecessary. Simplify the back off condition in Open_table_context. Streamline metadata lock handling in LOCK TABLES implementation. Add asserts to ensure correct life cycle of statement transaction in a session. Remove a piece of dead code that has also become redundant after the fix for Bug 37521.
| | * | manual merge from mysql-trunk-bugfixingJon Olav Hauglid2010-06-061-0/+8
| | |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: Text conflict in mysql-test/r/archive.result Contents conflict in mysql-test/r/innodb_bug38231.result Text conflict in mysql-test/r/mdl_sync.result Text conflict in mysql-test/suite/binlog/t/disabled.def Text conflict in mysql-test/suite/rpl_ndb/r/rpl_ndb_binlog_format_errors.result Text conflict in mysql-test/t/archive.test Contents conflict in mysql-test/t/innodb_bug38231.test Text conflict in mysql-test/t/mdl_sync.test Text conflict in sql/sp_head.cc Text conflict in sql/sql_show.cc Text conflict in sql/table.cc Text conflict in sql/table.h
| | | * \ Automerge of mysql-5.1-bugteam to mysql-trunk-merge.Alexey Kopytov2010-04-111-0/+8
| | | |\ \ | | | | |/
| | | | * Bug#52120 create view cause Assertion failed: 0, file .\item_subselect.cc, ↵Sergey Glukhov2010-04-061-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | line 817 We should disable const subselect item evaluation because subselect transformation does not happen in view_prepare_mode and thus val_...() methods can not be called.
| | * | | Patch that addresses bug #53976 "ALTER TABLE RENAMEDmitry Lenev2010-05-281-0/+1
| | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | is allowed on views (not documented, broken)". Remove support of ALTER TABLE RENAME for views as: a) this feature was not documented, c) does not add any compatibility with other databases, b) its implementation doesn't follow metadata locking protocol by accessing .FRM without holding any metadata lock, c) its implementation complicates ALTER TABLE's code by introducing yet another separate branch to it. After this patch one can rename a view by using the documented way - RENAME TABLE statement.
| | * | Manual merge of mysql-trunk into mysql-trunk-merge.Alexey Kopytov2010-03-241-7/+86
| | |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: Text conflict in client/mysqlbinlog.cc Text conflict in mysql-test/Makefile.am Text conflict in mysql-test/collections/default.daily Text conflict in mysql-test/r/mysqlbinlog_row_innodb.result Text conflict in mysql-test/suite/rpl/r/rpl_typeconv_innodb.result Text conflict in mysql-test/suite/rpl/t/rpl_get_master_version_and_clock.test Text conflict in mysql-test/suite/rpl/t/rpl_row_create_table.test Text conflict in mysql-test/suite/rpl/t/rpl_slave_skip.test Text conflict in mysql-test/suite/rpl/t/rpl_typeconv_innodb.test Text conflict in mysys/charset.c Text conflict in sql/field.cc Text conflict in sql/field.h Text conflict in sql/item.h Text conflict in sql/item_func.cc Text conflict in sql/log.cc Text conflict in sql/log_event.cc Text conflict in sql/log_event_old.cc Text conflict in sql/mysqld.cc Text conflict in sql/rpl_utility.cc Text conflict in sql/rpl_utility.h Text conflict in sql/set_var.cc Text conflict in sql/share/Makefile.am Text conflict in sql/sql_delete.cc Text conflict in sql/sql_plugin.cc Text conflict in sql/sql_select.cc Text conflict in sql/sql_table.cc Text conflict in storage/example/ha_example.h Text conflict in storage/federated/ha_federated.cc Text conflict in storage/myisammrg/ha_myisammrg.cc Text conflict in storage/myisammrg/myrg_open.c
| | | * \ Manual merge from mysql-trunk-merge.Alexander Nozdrin2010-02-241-0/+30
| | | |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: - client/mysql.cc - client/mysqldump.c - configure.in - mysql-test/r/csv.result - mysql-test/r/func_time.result - mysql-test/r/show_check.result - mysql-test/r/sp-error.result - mysql-test/r/sp.result - mysql-test/r/sp_trans.result - mysql-test/r/type_blob.result - mysql-test/r/type_timestamp.result - mysql-test/r/warnings.result - mysql-test/suite/rpl/r/rpl_sp.result - sql/mysql_priv.h - sql/mysqld.cc - sql/sp.cc - sql/sql_base.cc - sql/sql_table.cc - sql/sql_trigger.cc - sql/sql_view.cc - sql/table.h - sql/share/errmsg.txt - mysql-test/suite/sys_vars/r/log_bin_trust_routine_creators_basic.result
| | | * | | Bug#31767 DROP FUNCTION name resolutionMarc Alff2010-02-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Backport to 5.5.99
| | | * | | Auto-merge from mysql-next-mr-bugfixing.Alexander Nozdrin2010-02-231-2/+2
| | | |\ \ \
| | | | * | | Patch for WL#3736: Extended Table, Column and Index Comments.Alexander Nozdrin2010-02-201-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The task is to (a) add a comment on indexes and (b) increase the maximum length of column, table and the new index comments. The patch committed on behalf of Yoshinori Matsunobu (Yoshinori.Matsunobu@Sun.COM).
| | | * | | | Bug #48315 Metadata lock is not taken for merged views that useJon Olav Hauglid2010-02-181-0/+33
| | | |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | an INFORMATION_SCHEMA table When a prepared statement using a merged view containing an information schema table was executed, a metadata lock of the view was not taken. This meant that it was possible for concurrent view DDL to execute, thereby breaking the binary log. For example, it was possible for DROP VIEW to appear in the binary log before a query using the view. This also happened when a statement in a stored routine was executed a second time. For such views, the information schema table is merged into the view during the prepare phase (or first execution of a statement in a routine). The problem was that we took a short cut and were not executing full-blown view opening during subsequent executions of the statement. As a result, a metadata lock on the view was not taken to protect the view definition. This patch resolves the problem by making sure a metadata lock is taken for views even after information schema tables are merged into them. Test cased added to view.test.