summaryrefslogtreecommitdiff
path: root/sql/sql_view.cc
Commit message (Collapse)AuthorAgeFilesLines
* MDEV-7025 ANALYZE SELECT/INSERT/UPDATE/DELETE from a view does not check ↵Vicențiu Ciorbaru2015-03-101-3/+4
| | | | | | access permissions on the view Added access checking for the ANALYZE statement command.
* Merge branch '10.0' into merge-wipSergei Golubchik2015-01-311-1/+15
|\
| * MDEV-6668: Server crashes in check_view_single_update on concurrent DDL/DML ↵Michael Widenius2015-01-291-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | flow with views and triggers Call mysql_derived_reinit() if we are reusing view. This is needed as during a previous error condition the view may not have been reset sql/sql_derived.cc: More DBUG_PRINT Always reset merged_for_insert (no reason to not do that) sql/sql_derived.h: Added prototype sql/sql_insert.cc: More DBUG_PRINT Added DBUG_ASSERT sql/sql_view.cc: Call mysql_derived_reinit() if we are reusing view. This is needed as during a previous error condition the view may not have been reset sql/table.cc: More DBUG_PRINT
| * 5.5 mergeSergei Golubchik2015-01-211-1/+5
| |\
| | * Adding mariadb-version on the view creation to view frm. (MDEV-6916 followup)unknown2014-12-211-1/+5
| | |
* | | MDEV-7287 VIEW: CREATE IF NOT EXISTSAlexander Barkov2014-12-101-1/+21
| | | | | | | | | | | | Forgot to do "git add" for a number of files in the previous commit.
* | | MDEV-7112 Split HA_CREATE_INFOAlexander Barkov2014-12-081-1/+1
|/ /
* | MDEV-5120 Test suite test maria-no-logging failsMichael Widenius2014-09-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The reason for the failure was a bug in an include file on debian that causes 'struct stat' to have different sized depending on the environment. This patch fixes so that we always include my_global.h or my_config.h before we include any other files. Other things: - Removed #include <my_global.h> in some include files; Better to always do this at the top level to have as few "always-include-this-file-first' files as possible. - Removed usage of some include files that where already included by my_global.h or by other files. client/mysql_plugin.c: Use my_global.h first client/mysqlslap.c: Remove duplicated include files extra/comp_err.c: Remove duplicated include files include/m_string.h: Remove duplicated include files include/maria.h: Remove duplicated include files libmysqld/emb_qcache.cc: Use my_global.h first plugin/semisync/semisync.h: Use my_pthread.h first sql/datadict.cc: Use my_global.h first sql/debug_sync.cc: Use my_global.h first sql/derror.cc: Use my_global.h first sql/des_key_file.cc: Use my_global.h first sql/discover.cc: Use my_global.h first sql/event_data_objects.cc: Use my_global.h first sql/event_db_repository.cc: Use my_global.h first sql/event_parse_data.cc: Use my_global.h first sql/event_queue.cc: Use my_global.h first sql/event_scheduler.cc: Use my_global.h first sql/events.cc: Use my_global.h first sql/field.cc: Use my_global.h first Remove duplicated include files sql/field_conv.cc: Use my_global.h first sql/filesort.cc: Use my_global.h first Remove duplicated include files sql/gstream.cc: Use my_global.h first sql/ha_ndbcluster.cc: Use my_global.h first sql/ha_ndbcluster_binlog.cc: Use my_global.h first sql/ha_ndbcluster_cond.cc: Use my_global.h first sql/ha_partition.cc: Use my_global.h first sql/handler.cc: Use my_global.h first sql/hash_filo.cc: Use my_global.h first sql/hostname.cc: Use my_global.h first sql/init.cc: Use my_global.h first sql/item.cc: Use my_global.h first sql/item_buff.cc: Use my_global.h first sql/item_cmpfunc.cc: Use my_global.h first sql/item_create.cc: Use my_global.h first sql/item_geofunc.cc: Use my_global.h first sql/item_inetfunc.cc: Use my_global.h first sql/item_row.cc: Use my_global.h first sql/item_strfunc.cc: Use my_global.h first sql/item_subselect.cc: Use my_global.h first sql/item_sum.cc: Use my_global.h first sql/item_timefunc.cc: Use my_global.h first sql/item_xmlfunc.cc: Use my_global.h first sql/key.cc: Use my_global.h first sql/lock.cc: Use my_global.h first sql/log.cc: Use my_global.h first sql/log_event.cc: Use my_global.h first sql/log_event_old.cc: Use my_global.h first sql/mf_iocache.cc: Use my_global.h first sql/mysql_install_db.cc: Remove duplicated include files sql/mysqld.cc: Remove duplicated include files sql/net_serv.cc: Remove duplicated include files sql/opt_range.cc: Use my_global.h first sql/opt_subselect.cc: Use my_global.h first sql/opt_sum.cc: Use my_global.h first sql/parse_file.cc: Use my_global.h first sql/partition_info.cc: Use my_global.h first sql/procedure.cc: Use my_global.h first sql/protocol.cc: Use my_global.h first sql/records.cc: Use my_global.h first sql/records.h: Don't include my_global.h Better to do this at the upper level sql/repl_failsafe.cc: Use my_global.h first sql/rpl_filter.cc: Use my_global.h first sql/rpl_gtid.cc: Use my_global.h first sql/rpl_handler.cc: Use my_global.h first sql/rpl_injector.cc: Use my_global.h first sql/rpl_record.cc: Use my_global.h first sql/rpl_record_old.cc: Use my_global.h first sql/rpl_reporting.cc: Use my_global.h first sql/rpl_rli.cc: Use my_global.h first sql/rpl_tblmap.cc: Use my_global.h first sql/rpl_utility.cc: Use my_global.h first sql/set_var.cc: Added comment sql/slave.cc: Use my_global.h first sql/sp.cc: Use my_global.h first sql/sp_cache.cc: Use my_global.h first sql/sp_head.cc: Use my_global.h first sql/sp_pcontext.cc: Use my_global.h first sql/sp_rcontext.cc: Use my_global.h first sql/spatial.cc: Use my_global.h first sql/sql_acl.cc: Use my_global.h first sql/sql_admin.cc: Use my_global.h first sql/sql_analyse.cc: Use my_global.h first sql/sql_audit.cc: Use my_global.h first sql/sql_base.cc: Use my_global.h first sql/sql_binlog.cc: Use my_global.h first sql/sql_bootstrap.cc: Use my_global.h first Use my_global.h first sql/sql_cache.cc: Use my_global.h first sql/sql_class.cc: Use my_global.h first sql/sql_client.cc: Use my_global.h first sql/sql_connect.cc: Use my_global.h first sql/sql_crypt.cc: Use my_global.h first sql/sql_cursor.cc: Use my_global.h first sql/sql_db.cc: Use my_global.h first sql/sql_delete.cc: Use my_global.h first sql/sql_derived.cc: Use my_global.h first sql/sql_do.cc: Use my_global.h first sql/sql_error.cc: Use my_global.h first sql/sql_explain.cc: Use my_global.h first sql/sql_expression_cache.cc: Use my_global.h first sql/sql_handler.cc: Use my_global.h first sql/sql_help.cc: Use my_global.h first sql/sql_insert.cc: Use my_global.h first sql/sql_lex.cc: Use my_global.h first sql/sql_load.cc: Use my_global.h first sql/sql_locale.cc: Use my_global.h first sql/sql_manager.cc: Use my_global.h first sql/sql_parse.cc: Use my_global.h first sql/sql_partition.cc: Use my_global.h first sql/sql_plugin.cc: Added comment sql/sql_prepare.cc: Use my_global.h first sql/sql_priv.h: Added error if we use this before including my_global.h This check is here becasue so many files includes sql_priv.h first. sql/sql_profile.cc: Use my_global.h first sql/sql_reload.cc: Use my_global.h first sql/sql_rename.cc: Use my_global.h first sql/sql_repl.cc: Use my_global.h first sql/sql_select.cc: Use my_global.h first sql/sql_servers.cc: Use my_global.h first sql/sql_show.cc: Added comment sql/sql_signal.cc: Use my_global.h first sql/sql_statistics.cc: Use my_global.h first sql/sql_table.cc: Use my_global.h first sql/sql_tablespace.cc: Use my_global.h first sql/sql_test.cc: Use my_global.h first sql/sql_time.cc: Use my_global.h first sql/sql_trigger.cc: Use my_global.h first sql/sql_udf.cc: Use my_global.h first sql/sql_union.cc: Use my_global.h first sql/sql_update.cc: Use my_global.h first sql/sql_view.cc: Use my_global.h first sql/sys_vars.cc: Added comment sql/table.cc: Use my_global.h first sql/thr_malloc.cc: Use my_global.h first sql/transaction.cc: Use my_global.h first sql/uniques.cc: Use my_global.h first sql/unireg.cc: Use my_global.h first sql/unireg.h: Removed inclusion of my_global.h storage/archive/ha_archive.cc: Added comment storage/blackhole/ha_blackhole.cc: Use my_global.h first storage/csv/ha_tina.cc: Use my_global.h first storage/csv/transparent_file.cc: Use my_global.h first storage/federated/ha_federated.cc: Use my_global.h first storage/federatedx/federatedx_io.cc: Use my_global.h first storage/federatedx/federatedx_io_mysql.cc: Use my_global.h first storage/federatedx/federatedx_io_null.cc: Use my_global.h first storage/federatedx/federatedx_txn.cc: Use my_global.h first storage/heap/ha_heap.cc: Use my_global.h first storage/innobase/handler/handler0alter.cc: Use my_global.h first storage/maria/ha_maria.cc: Use my_global.h first storage/maria/unittest/ma_maria_log_cleanup.c: Remove duplicated include files storage/maria/unittest/test_file.c: Added comment storage/myisam/ha_myisam.cc: Move sql_plugin.h first as this includes my_global.h storage/myisammrg/ha_myisammrg.cc: Use my_global.h first storage/oqgraph/oqgraph_thunk.cc: Use my_config.h and my_global.h first One could not include my_global.h before oqgraph_thunk.h (don't know why) storage/spider/ha_spider.cc: Use my_global.h first storage/spider/hs_client/config.cpp: Use my_global.h first storage/spider/hs_client/escape.cpp: Use my_global.h first storage/spider/hs_client/fatal.cpp: Use my_global.h first storage/spider/hs_client/hstcpcli.cpp: Use my_global.h first storage/spider/hs_client/socket.cpp: Use my_global.h first storage/spider/hs_client/string_util.cpp: Use my_global.h first storage/spider/spd_conn.cc: Use my_global.h first storage/spider/spd_copy_tables.cc: Use my_global.h first storage/spider/spd_db_conn.cc: Use my_global.h first storage/spider/spd_db_handlersocket.cc: Use my_global.h first storage/spider/spd_db_mysql.cc: Use my_global.h first storage/spider/spd_db_oracle.cc: Use my_global.h first storage/spider/spd_direct_sql.cc: Use my_global.h first storage/spider/spd_i_s.cc: Use my_global.h first storage/spider/spd_malloc.cc: Use my_global.h first storage/spider/spd_param.cc: Use my_global.h first storage/spider/spd_ping_table.cc: Use my_global.h first storage/spider/spd_sys_table.cc: Use my_global.h first storage/spider/spd_table.cc: Use my_global.h first storage/spider/spd_trx.cc: Use my_global.h first storage/xtradb/handler/handler0alter.cc: Use my_global.h first storage/xtradb/handler/i_s.cc: Use my_global.h first
* | 5.5.39 mergeSergei Golubchik2014-08-071-4/+3
|\ \ | |/
| * mysql-5.5.39 mergeSergei Golubchik2014-08-021-3/+2
| |\ | | | | | | | | | | | | | | | | | | ~40% bugfixed(*) applied ~40$ bugfixed reverted (incorrect or we're not buggy) ~20% bugfixed applied, despite us being not buggy (*) only changes in the server code, e.g. not cmakefiles
| | * BUG#18405221: SHOW CREATE VIEW OUTPUT INCORRECTNisha Gopalakrishnan2014-06-251-14/+46
| | | | | | | | | | | | | | | | | | | | | | | | 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
| * | MDEV-6409 CREATE VIEW replication problem if error occurs in mysql_register_viewSergei Golubchik2014-07-231-3/+2
| | | | | | | | | | | | fix by Sriram Patil
* | | MDEV-5894 MySQL BUG#34750: Print database name in Unknown Table error messageSergei Golubchik2014-03-201-1/+1
| | |
* | | 10.0-base mergeSergei Golubchik2014-02-261-2/+2
|\ \ \
| * \ \ 5.5 mergeSergei Golubchik2014-02-251-2/+2
| |\ \ \ | | |/ /
| | * | MySQL-5.5.36 mergeSergei Golubchik2014-02-171-2/+2
| | |\ \ | | | |/ | | | | | | | | (without few incorrect bugfixes and with 1250 files where only a copyright year was changed)
| | | * Updated/added copyright headersMurthy Narkedimilli2014-01-061-1/+1
| | | |
* | | | 10.0-base mergeSergei Golubchik2014-02-031-5/+1
|\ \ \ \ | |/ / /
| * | | 5.5 mergeSergei Golubchik2014-02-011-5/+1
| |\ \ \ | | |/ /
| | * | merge 5.3->5.5unknown2014-01-261-5/+1
| | |\ \
| | | * \ merge of MDEV-5356 5.1->5.3 (with more fixes and test suite).unknown2014-01-231-5/+1
| | | |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | THD::thd->activate_stmt_arena_if_needed() should be used to temporary activating statement arena instead of direct usage of THD::set_n_backup_active_arena() because possible such scenario: 1) func1 saves current arena and activates copy1 of statement arena 2) func2 saves copy1 of statement arena setup by func1 and activates copy2 3) some changes made for copy 2 4) func2 stores changed copy2 back to statenet arena and activates copy1 5) func1 store unchanged copy1 back to statemnt arena (rewrite changed copy 2 so changes become lost) and activates arena which was before.
| | | | * | MDEV-5356: Server crashes in Item_equal::contains on 2nd execution of a PSunknown2014-01-231-5/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | THD::thd->activate_stmt_arena_if_needed() should be used to temporary activating statement arena instead of direct usage of THD::set_n_backup_active_arena() because possible such scenario: 1) func1 saves current arena and activates copy1 of statement arena 2) func2 saves copy1 of statement arena setup by func1 and activates copy2 3) some changes made for copy 2 4) func2 stores changed copy2 back to statenet arena and activates copy1 5) func1 store unchanged copy1 back to statemnt arena (rewrite changed copy 2 so changes become lost) and activates arena which was before.
* | | | | | 10.0-base mergeSergei Golubchik2013-12-161-1/+1
|\ \ \ \ \ \ | |/ / / / /
| * | | | | 5.5 mergeSergei Golubchik2013-11-231-1/+1
| |\ \ \ \ \ | | |/ / / /
| | * | | | mysql-5.5.34 mergeSergei Golubchik2013-11-191-1/+1
| | |\ \ \ \ | | | | |_|/ | | | |/| | | | | | | | (some patches reverted, test case added)
| | | * | | WL#7076: Backporting wl6715 to support both formats Ashish Agarwal2013-08-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | in 5.5, 5.6, 5.7.
* | | | | | MDEV-5438 A view can mask a table that supports discoverySergei Golubchik2013-12-131-1/+1
| | | | | |
* | | | | | 10.0-base merge (roles)Sergei Golubchik2013-10-291-63/+22
|\ \ \ \ \ \ | |/ / / / /
| * | | | | post-review cleanupSergei Golubchik2013-10-271-0/+4
| | | | | |
| * | | | | fixes for embeddedSergei Golubchik2013-10-181-1/+3
| | | | | |
| * | | | | support DEFINER=role and DEFINER=current_roleSergei Golubchik2013-10-181-2/+10
| | | | | |
| * | | | | cleanupSergei Golubchik2013-10-181-60/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | sql/sp.cc: don't split "user@host" string in db_load_routine, because the caller needs to generate it from user and host. instead pass user and host directly into db_load_routine sql/sql_parse.cc: 1. REVOKE ALL doesn't need invoker. 2. make sp_process_definer() reusable sql/sql_trigger.cc: don't duplicate the code from sp_process_definer(), reuse it sql/sql_view.cc: don't duplicate the code from sp_process_definer(), reuse it
* | | | | | Merge 10.0-base -> 10.0Sergey Petrunya2013-10-161-2/+1
|\ \ \ \ \ \ | |/ / / / /
| * | | | | MDEV-3798: EXPLAIN UPDATE/DELETE:Sergey Petrunya2013-10-151-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Port grant_explain_non_select.{test,result} from mysql-5.6 - Per Sanja's hint, fix mysql_make_view() to take into account that EXPLAIN now is not necessarily EXPLAIN SELECT.
* | | | | | MDEV-4786 - merge 10.0-monty - 10.0Sergey Vojtovich2013-09-031-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Merged missing changes from revision alexander.nozdrin@oracle.com-20111219114211-49pqi0wfs9p4o9yi
* | | | | | 10.0-monty mergeSergei Golubchik2013-07-211-15/+15
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | includes: * remove some remnants of "Bug#14521864: MYSQL 5.1 TO 5.5 BUGS PARTITIONING" * introduce LOCK_share, now LOCK_ha_data is strictly for engines * rea_create_table() always creates .par file (even in "frm-only" mode) * fix a 5.6 bug, temp file leak on dummy ALTER TABLE
| * | | | | | merge of 2876.430.11 & 2876.430.1unknown2013-06-271-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | CF_PREOPEN_TMP_TABLES & CF_HA_CLOSE & Patch for Bug#11746602 (27480: Extend CREATE TEMPORARY TABLES privilege to allow temp table operations).
| * | | | | | Fixed some merge issues:Michael Widenius2013-06-181-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - temporary tables now works - mysql-system_tables updated to not use temporary tables - PASSWORD() function fixed - Support for STATS_AUTO_RECALC, STATS_PERSISTENT and STATS_SAMPLE_PAGES table options
| * | | | | | Applied all changes from Igor and SanjaMichael Widenius2013-06-151-13/+14
| | | | | | |
| * | | | | | Push a lot of small fixes to get larger parts to compileMichael Widenius2013-05-211-1/+1
| | | | | | |
* | | | | | | 10.0-base mergeSergei Golubchik2013-07-181-1/+1
|\ \ \ \ \ \ \ | | |/ / / / / | |/| | | | |
| * | | | | | 5.5 mergeSergei Golubchik2013-07-171-1/+1
| |\ \ \ \ \ \ | | | |/ / / / | | |/| | | |
| | * | | | | mysql-5.5.32 mergeSergei Golubchik2013-07-161-1/+1
| | |\ \ \ \ \ | | | | |/ / / | | | |/| | |
| | | * | | | Fix for Bug 16395495 - OLD FSF ADDRESS IN GPL HEADERMurthy Narkedimilli2013-03-191-1/+1
| | | | | | |
* | | | | | | 10.0-base mergeSergei Golubchik2013-06-061-3/+9
|\ \ \ \ \ \ \ | |/ / / / / / | | | | | | | | | | | | | | (without InnoDB - all InnoDB changes were ignored)
| * | | | | | 5.5 mergeSergei Golubchik2013-06-061-3/+9
| |\ \ \ \ \ \ | | |/ / / / /
| | * | | | | mysql-5.5.31 mergeSergei Golubchik2013-05-071-3/+9
| | |\ \ \ \ \ | | | |/ / / /
| | | * | | | Merge from 5.1 to 5.5Praveenkumar Hulakund2013-01-101-3/+9
| | | |\ \ \ \
| | | | * | | | Bug#11749556: DEBUG ASSERTION WHEN ACCESSING A VIEW ANDPraveenkumar Hulakund2013-01-101-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | AVAILABLE MEMORY IS TOO LOW Analysis: --------- In function "mysql_make_view", "table->view" is initialized after parsing(using File_parser::parse) the view definition. If "::parse" function fails then control is moved to label "err:". Here we have assert (table->view == thd->lex). This assert fails if "::parse" function fails, as table->view is not initialized yet. File_parser::parse fails if data being parsed is incorrect/ corrupted or when memory allocation fails. In this scenario its failing because of failure in memory allocation. Fix: --------- In case of failure in function "File_parser::parse", moving to label "err:" is incorrect. Modified code to move to label "end:".
* | | | | | | | 10.0-base mergeSergei Golubchik2013-04-151-25/+18
|\ \ \ \ \ \ \ \ | |/ / / / / / / | | | | | / / / | |_|_|_|/ / / |/| | | | | |