summaryrefslogtreecommitdiff
path: root/sql/sql_view.cc
Commit message (Collapse)AuthorAgeFilesLines
* 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
|\ \ \ \ \ \ | |/ / / / / | | | | | / | |_|_|_|/ |/| | | |
| * | | | MDEV-318 IF (NOT) EXIST clauses for ALTER TABLE (MWL #252).Alexey Botchkov2013-04-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Syntax modified to allow statements: ALTER TABLE ADD/DROP COLUMN ALTER TABLE ADD/DROP INDEX ALTER TABLE ADD/DROP FOREIGN KEY ALTER TABLE ADD/DROP PARTITION ALTER TABLE CHANGE COLUMN ALTER TABLE MODIFY COLUMN DROP INDEX to have IF (NOT) EXISTS options. Appropriate implementations added to mysql_alter_table(). per-file comments: mysql-test/r/alter_table.result MDEV-318 IF (NOT) EXIST clauses for ALTER TABLE (MWL #252). test result updated. mysql-test/r/fulltext.result MDEV-318 IF (NOT) EXIST clauses for ALTER TABLE (MWL #252). mysql-test/r/partition.result test result updated. MDEV-318 IF (NOT) EXIST clauses for ALTER TABLE (MWL #252). mysql-test/t/alter_table.test tests added. MDEV-318 IF (NOT) EXIST clauses for ALTER TABLE (MWL #252). mysql-test/t/fulltext.test MDEV-318 IF (NOT) EXIST clauses for ALTER TABLE (MWL #252). tests added. mysql-test/t/partition.test MDEV-318 IF (NOT) EXIST clauses for ALTER TABLE (MWL #252). tests added. sql/field.cc MDEV-318 IF (NOT) EXIST clauses for ALTER TABLE (MWL #252). create_if_not_exists field added. sql/field.h MDEV-318 IF (NOT) EXIST clauses for ALTER TABLE (MWL #252). create_if_not_exists field added. sql/partition_info.h MDEV-318 IF (NOT) EXIST clauses for ALTER TABLE (MWL #252). has_unique_name made public. sql/sp_head.cc MDEV-318 IF (NOT) EXIST clauses for ALTER TABLE (MWL #252). sql/sql_class.cc MDEV-318 IF (NOT) EXIST clauses for ALTER TABLE (MWL #252). create_if_not_exists inited. sql/sql_class.h MDEV-318 IF (NOT) EXIST clauses for ALTER TABLE (MWL #252). create_if_not_exists inited. sql/sql_lex.cc MDEV-318 IF (NOT) EXIST clauses for ALTER TABLE (MWL #252). check_exists inited. sql/sql_lex.h MDEV-318 IF (NOT) EXIST clauses for ALTER TABLE (MWL #252). check_exists inited. sql/sql_parse.cc MDEV-318 IF (NOT) EXIST clauses for ALTER TABLE (MWL #252). check_exists inited. sql/sql_table.cc MDEV-318 IF (NOT) EXIST clauses for ALTER TABLE (MWL #252). handle_if_exists_options() added. it's called in mysql_alter_table(). sql/sql_trigger.cc MDEV-318 IF (NOT) EXIST clauses for ALTER TABLE (MWL #252). check_exists instead of drop_if_exists. sql/sql_view.cc MDEV-318 IF (NOT) EXIST clauses for ALTER TABLE (MWL #252). check_exists instead of drop_if_exists. sql/sql_yacc.yy MDEV-318 IF (NOT) EXIST clauses for ALTER TABLE (MWL #252). sintax modified.
| * | | | remove dd_frm_type(), dd_frm_storage_engine(), dd_check_storage_engine_flag()Sergei Golubchik2013-04-091-12/+10
| | | | | | | | | | | | | | | | | | | | | | | | | from everywhere - now RENAME, SHOW FULL TABLES, and TRUNCATE work with discovery. improve error messages in truncate
| * | | | convenience helpers for get_table_share() and tdc_open_view().Sergei Golubchik2013-04-091-6/+2
| | | | | | | | | | | | | | | | | | | | | | | | | Pass db and table_name into a function instead of the table_list, when only db and table name are needed.
| * | | | moving LOCK_open into get_table_share()Sergei Golubchik2013-04-091-3/+2
| | | | |
| * | | | split THD::make_lex_string() in twoSergei Golubchik2013-04-071-3/+3
| |/ / /
* | | | fixes for test failuresSergei Golubchik2012-09-271-1/+1
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and small collateral changes mysql-test/lib/My/Test.pm: somehow with "print" we get truncated writes sometimes mysql-test/suite/perfschema/r/digest_table_full.result: md5 hashes of statement digests differ, because yacc token codes are different in mariadb mysql-test/suite/perfschema/r/dml_handler.result: host table is not ported over yet mysql-test/suite/perfschema/r/information_schema.result: host table is not ported over yet mysql-test/suite/perfschema/r/nesting.result: this differs, because we don't rewrite general log queries, and multi-statement packets are logged as a one entry. this result file is identical to what mysql-5.6.5 produces with the --log-raw option. mysql-test/suite/perfschema/r/relaylog.result: MariaDB modifies the binlog index file directly, while MySQL 5.6 has a feature "crash-safe binlog index" and modifies a special "crash-safe" shadow copy of the index file and then moves it over. That's why this test shows "NONE" index file writes in MySQL and "MANY" in MariaDB. mysql-test/suite/perfschema/r/server_init.result: MariaDB initializes the "manager" resources from the "manager" thread, and starts this thread only when --flush-time is not 0. MySQL 5.6 initializes "manager" resources unconditionally on server startup. mysql-test/suite/perfschema/r/stage_mdl_global.result: this differs, because MariaDB disables query cache when query_cache_size=0. MySQL does not do that, and this causes useless mutex locks and waits. mysql-test/suite/perfschema/r/statement_digest.result: md5 hashes of statement digests differ, because yacc token codes are different in mariadb mysql-test/suite/perfschema/r/statement_digest_consumers.result: md5 hashes of statement digests differ, because yacc token codes are different in mariadb mysql-test/suite/perfschema/r/statement_digest_long_query.result: md5 hashes of statement digests differ, because yacc token codes are different in mariadb mysql-test/suite/rpl/r/rpl_mixed_drop_create_temp_table.result: will be updated to match 5.6 when alfranio.correia@oracle.com-20110512172919-c1b5kmum4h52g0ni and anders.song@greatopensource.com-20110105052107-zoab0bsf5a6xxk2y are merged mysql-test/suite/rpl/r/rpl_non_direct_mixed_mixing_engines.result: will be updated to match 5.6 when anders.song@greatopensource.com-20110105052107-zoab0bsf5a6xxk2y is merged
* | | 5.3 mergeSergei Golubchik2012-05-041-1/+1
|\ \ \
| * | | LPBUG#983285 - incompatibility in frm in case of VIEWs with non-default ↵Vladislav Vaintroub2012-04-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ALGORITHM option. As part of derived tables redesign, values for VIEW_ALGORITHM_MERGE and VIEW_ALGORITHM_TMPTABLE have changed from (former values 1 rsp 2 , new values 5 rsp 9). This lead to the problem that views, created with version 5.2 or earlier would not work in all situations (e.g "SHOW CREATE VIEW"), or with mysqldump. The fix is to restore backward compatibility for the from file, and convert algorithm={1,2} in the frm to {5,9} when reading .frm from disk, and store backward compatible values when writing from to disk. Also allow processing correct processing for "invalid" .frms created with MariaDB 5.3/5.5 GA releases (where algorithm stored in memory matched the one stored in frm).
* | | | mysql 5.5.23 mergeSergei Golubchik2012-04-101-0/+7
|\ \ \ \ | | |/ / | |/| |
| * | | 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 mysql-test/r/view.result: Added test case result of Bug#12626844 mysql-test/t/view.test: Added test case for Bug#12626844 sql/sql_view.cc: Added a check for database existence in mysql_create_view
* | | | Merged the implementation of MDEV-28 LIMIT ROWS EXAMINED into MariaDB 5.5.unknown2012-03-121-0/+11
|\ \ \ \
| * | | | Implementation of MDEV-28 LIMIT ROWS EXAMINEDunknown2012-03-111-0/+11
| | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://mariadb.atlassian.net/browse/MDEV-28 This task implements a new clause LIMIT ROWS EXAMINED <num> as an extention to the ANSI LIMIT clause. This extension allows to limit the number of rows and/or keys a query would access (read and/or write) during query execution.
* | | | mysql-5.5 mergeSergei Golubchik2012-01-161-3/+4
|\ \ \ \ | | |/ / | |/| |
| * | | manual mergeTatjana Azundris Nuernberg2011-10-061-9/+11
| |\ \ \ | | | |/ | | |/|
| * | | manual merge to reconcile with MySQL ticket 27145Tatjana Azundris Nuernberg2011-10-061-3/+33
| |\ \ \
* | \ \ \ 5.3 mergeSergei Golubchik2012-01-131-1/+32
|\ \ \ \ \ | | |_|_|/ | |/| | |
| * | | | Merge with 5.2.Michael Widenius2011-12-111-3/+34
| |\ \ \ \ | | | | | | | | | | | | | | | | | | no_error handling for select (used by INSERT ... SELECT) still needs to be fixed, but I will do that in a separate commit
| | * \ \ \ Merge with 5.1Michael Widenius2011-11-301-1/+1
| | |\ \ \ \
| | | * | | | Fixed compiler warnings and other bugs found by buildbot.Michael Widenius2011-11-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | client/mysqltest.cc: Free mutex after usage (fixes valgrind warnings in embedded server) mysql-test/include/gis_keys.inc: Fixed failure in innodb.gis_test mysql-test/r/gis.result: Updated result mysql-test/suite/innodb/r/innodb_gis.result: Updated results mysql-test/suite/innodb/t/innodb_bug38231.test: Added handling of timeouts (happend on some servers in buildbot) mysql-test/suite/innodb_plugin/r/innodb_gis.result: Updated results mysql-test/suite/innodb_plugin/t/innodb.test: Use error names instead of numbers mysql-test/suite/innodb_plugin/t/innodb_misc1.test: This test requires utf8 mysql-test/suite/innodb_plugin/t/innodb_mysql.test: This test requires Xtradb sql/sql_base.cc: Don't print table names for placeholders. sql/sql_show.cc: Temporary fix: Save and restore db and table_name in mysqld_show_create (to get rid of valgrind warning) A better solution that needs to be investgated is to not change these fields in mysql_derived_prepare() sql/sql_view.cc: Fixed valgrind warning storage/xtradb/handler/ha_innodb.cc: Don't access THD directly
| | * | | | | Merge with MariaDB 5.1Michael Widenius2011-11-241-2/+33
| | |\ \ \ \ \ | | | |/ / / /
| | | * | | | Merge with MySQL 5.1.60Michael Widenius2011-11-231-2/+33
| | | |\ \ \ \ | | | | | |_|/ | | | | |/| |
| | | | * | | manual mergeTatjana Azundris Nuernberg2011-10-061-9/+10
| | | | |\ \ \ | | | | | |_|/ | | | | |/| |
| | | | | * | additional clean-up for 11765687Tatjana Azundris Nuernberg2011-10-061-9/+10
| | | | | | |
| | | | * | | manual mergeTatjana Azundris Nuernberg2011-09-291-2/+32
| | | | |\ \ \ | | | | | |/ /
| | | | | * | Bug#11765687 (MySQL58677): No privilege on table / view, but can know #rows ↵Tatjana Azundris Nuernberg2011-09-291-2/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | / underlying table's name 1 - If a user had SHOW VIEW and SELECT privileges on a view and this view was referencing another view, EXPLAIN SELECT on the outer view (that the user had privileges on) could reveal the structure of the underlying "inner" view as well as the number of rows in the underlying tables, even if the user had privileges on none of these referenced objects. This happened because we used DEFINER's UID ("SUID") not just for the view given in EXPLAIN, but also when checking privileges on the underlying views (where we should use the UID of the EXPLAIN's INVOKER instead). We no longer run the EXPLAIN SUID (with DEFINER's privileges). This prevents a possible exploit and makes permissions more orthogonal. 2 - EXPLAIN SELECT would reveal a view's structure even if the user did not have SHOW VIEW privileges for that view, as long as they had SELECT privilege on the underlying tables. Instead of requiring both SHOW VIEW privilege on a view and SELECT privilege on all underlying tables, we were checking for presence of either of them. We now explicitly require SHOW VIEW and SELECT privileges on the view we run EXPLAIN SELECT on, as well as all its underlying views. We also require SELECT on all relevant tables. mysql-test/r/view_grant.result: add extensive tests to illustrate desired behavior and prevent regressions (as always). mysql-test/t/view_grant.test: add extensive tests to illustrate desired behavior and prevent regressions (as always). sql/sql_view.cc: We no longer run the EXPLAIN SUID (with DEFINER's privileges). To achieve this, we use a temporary, SUID-less TABLE_LIST for the views while checking privileges.
| | | | | * | Updated/added copyright headersKent Boortz2011-06-301-2/+3
| | | | | | |
| * | | | | | Fixed LP BUG#747278unknown2011-11-281-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The problem was that when we have single row subquery with no rows Item_cache(es) which represent result row was not null and being requested via element_index() returned random value. The fix is setting all Item_cache(es) in NULL before executing the query (reset() method) which guaranty NULL value of whole query or its elements requested in any way if no rows was found. set_null() method was added to Item_cache to guaranty correct NULL value in case of reseting the cache.