summaryrefslogtreecommitdiff
path: root/sql/share
Commit message (Collapse)AuthorAgeFilesLines
* MDEV-13095 Implement User Account lockingRobert Bindar2019-02-141-0/+3
| | | | | | | | | | | | | | Add server support for user account locking. This patch extends the ALTER/CREATE USER statements for denying a user's subsequent login attempts: ALTER USER user [, user2] ACCOUNT [LOCK | UNLOCK] CREATE USER user [, user2] ACCOUNT [LOCK | UNLOCK] The SHOW CREATE USER statement was updated to display the locking state of an user. Closes #1006
* MDEV-7598 Lock user after too many password errorsVladislav Vaintroub2019-01-081-0/+2
|
* Merge 10.3 into 10.4Marko Mäkelä2018-12-181-2/+2
|\
| * Merge 10.2 into 10.3Marko Mäkelä2018-12-181-2/+2
| |\
| | * MDEV-14576 Include full name of object in message about incorrect value for ↵Alexey Botchkov2018-12-161-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | column. The error message modified. Then the TABLE_SHARE::error_table_name() implementation taken from 10.3, to be used as a name of the table in this message.
* | | Added syntax and implementation for BACKUP STAGE'sMonty2018-12-091-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | Part of MDEV-5336 Implement LOCK FOR BACKUP - Changed check of Global_only_lock to also include BACKUP lock. - We store latest MDL_BACKUP_DDL lock in thd->mdl_backup_ticket to be able to downgrade lock during copy_data_between_tables()
* | | MDEV-12321 authentication plugin: SET PASSWORD supportSergei Golubchik2018-10-311-1/+1
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Support SET PASSWORD for authentication plugins. Authentication plugin API is extended with two optional methods: * hash_password() is used to compute a password hash (or digest) from the plain-text password. This digest will be stored in mysql.user table * preprocess_hash() is used to convert this digest into some memory representation that can be later used to authenticate a user. Build-in plugins convert the hash from hexadecimal or base64 to binary, to avoid doing it on every authentication attempt. Note a change in behavior: when loading privileges (on startup or on FLUSH PRIVILEGES) an account with an unknown plugin was loaded with a warning (e.g. "Plugin 'foo' is not loaded"). But such an account could not be used for authentication until the plugin is installed. Now an account like that will not be loaded at all (with a warning, still). Indeed, without plugin's preprocess_hash() method the server cannot know how to load an account. Thus, if a new authentication plugin is installed run-time, one might need FLUSH PRIVILEGES to activate all existing accounts that were using this new plugin.
* | MDEV-16328 ALTER TABLE…page_compression_level should not rebuild tableMarko Mäkelä2018-09-171-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The table option page_compression_level is something that only affects future writes, not actually the data format. Therefore, we can allow instant changes of this option. Similarly, the table option page_compressed can be set on a previously uncompressed table without rebuilding the table, because an uncompressed page would be considered valid when reading a page_compressed table. Removing the page_compressed option will continue to require the table to be rebuilt. ha_innobase_inplace_ctx::page_compression_level: The requested page_compression_level at the start of ALTER TABLE, or 0 if page_compressed=OFF. alter_options_need_rebuild(): Renamed from create_option_need_rebuild(). Allow page_compression_level and page_compressed to be changed as above, without rebuilding the table. ha_innobase::check_if_supported_inplace_alter(): Allow ALGORITHM=INSTANT for ALTER_OPTIONS if the table is not to be rebuilt. If rebuild is needed, set ha_alter_info->unsupported_reason. innobase_page_compression_try(): Update SYS_TABLES.TYPE according to the table flags, for an instant change of page_compression_level or page_compressed. commit_cache_norebuild(): Adjust dict_table_t::flags, fil_space_t::flags and (if needed) FSP_SPACE_FLAGS if page_compression_level was specified.
* | Merge 10.2 into 10.3Marko Mäkelä2018-08-031-5/+7
|\ \ | |/
| * Merge 10.1 into 10.2Marko Mäkelä2018-08-021-5/+7
| |\
| | * Merge branch '10.0' into bb-10.1-merge-sanjaOleksandr Byelkin2018-07-251-5/+7
| | |\
| | | * MDEV-11790 WITHOUT_SERVER installs mysqld_safe_helperSergei Golubchik2018-07-191-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Don't install server files if WITHOUT_SERVER is specified. "Server files" are defined as files going into the MariaDB-Server RPM, that is files in the components Server, ManPagesServer, Server_Scripts, IniFiles, SuportFiles, and Readme.
* | | | MDEV-15813 ASAN use-after-poison in hp_hashnr upon HANDLER READ on a ↵Alexey Botchkov2018-05-161-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | versioned HEAP table. Check index capabilities before executing HANDLER READ command.
* | | | MDEV-14823, MDEV-15956 Versioning error messages fixesAleksey Midenkov2018-05-121-0/+2
| | | | | | | | | | | | | | | | | | | | MDEV-14823 Wrong error message upon selecting from a system_time partition MDEV-15956 Strange ER_UNSUPPORTED_ACTION_ON_GENERATED_COLUMN upon ALTER on versioning column
* | | | MDEV-14820 System versioning is applied incorrectly to CTEsSergei Golubchik2018-05-121-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make sure that SELECT_LEX_UNIT::derived, behaves as documented (points to the "TABLE_LIST representing this union in the embedding select"). For recursive CTE this was not necessarily the case, it could've pointed to the TABLE_LIST inside the CTE, not in the embedding select. To fix: * don't update unit->derived in mysql_derived_prepare(), pass derived as an argument to st_select_lex_unit::prepare() * prefer to set unit->derived in TABLE_LIST::init_derived() to the TABLE_LIST in the embedding select, not to the recursive reference. Fail if there are many TABLE_LISTs in the embedding select with conflicting FOR SYSTEM_TIME clauses. cleanup: * remove redundant THD* argument from st_select_lex_unit::prepare()
* | | | MDEV-16038 Assertion `map->n_bits > 0' failed (my_bitmap.c:386: ↵Igor Babaev2018-04-261-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | bitmap_is_clear_all) Rows with no elements are not allowed in a table value constructor unless it is used in an INSERT statement.
* | | | MDEV-14168 Unconditionally allow ALGORITHM=INPLACE for setting a column NOT NULLThirunarayanan Balathandayuthapani2018-04-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Allow NOT NULL constraint to replace the NULL value in the row with explicit or implicit default value. - If the default value is non-const value then inplace alter won't support it. - ALTER IGNORE will ignore the error if the concurrent DML contains NULL value.
* | | | Merge remote-tracking branch '10.2' into 10.3Vicențiu Ciorbaru2018-04-121-2/+2
|\ \ \ \ | |/ / /
| * | | Merge branch '10.1' into 10.2Vicențiu Ciorbaru2018-04-101-2/+2
| |\ \ \ | | |/ /
| | * | Merge branch '10.0' into 10.1Vicențiu Ciorbaru2018-04-071-2/+2
| | |\ \ | | | |/
| | | * increase upper value of max_prepared_stmt_count to UINT32_MAXDaniel Black2018-04-031-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | The upper 1M limit for max_prepared_stmt_count was set over 10 years ago. It doesn't suite current hardware and a sysbench oltp_read_write test with 512 threads will hit this limit.
* | | | wording: don't prohibitSergei Golubchik2018-04-101-3/+3
| | | |
* | | | MDEV-14790 System versioning for system tables does not work as expectedAleksey Midenkov2018-04-101-2/+2
| | | | | | | | | | | | | | | | disallow system versioning for tables in mysql database
* | | | dead code - related to vtmdSergei Golubchik2018-04-101-6/+6
| | | | | | | | | | | | | | | | (will be added back when it'll be used)
* | | | Merge branch '10.2' into 10.3Sergei Golubchik2018-03-281-2/+2
|\ \ \ \ | |/ / /
| * | | MDEV-9592 - New 'Normal shutdown' log format can be confusingSergey Vojtovich2018-03-131-2/+2
| | | | | | | | | | | | | | | | Elaborate shutdown message.
| * | | Fixed wrong arguments to printf and related functionsMonty2018-01-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Other things, mainly to get create_mysqld_error_find_printf_error tool to work: - Added protection to not include mysqld_error.h twice - Include "unireg.h" instead of "mysqld_error.h" in server - Added protection if ER_XX messages are already defined - Removed wrong calls to my_error(ER_OUTOFMEMORY) as my_malloc() and my_alloc will do this automatically - Added missing %s to ER_DUP_QUERY_NAME - Removed old and wrong calls to my_strerror() when using MY_ERROR_ON_RENAME (wrong merge) - Fixed deadlock error message from Galera. Before the extra information given to ER_LOCK_DEADLOCK was missing because ER_LOCK_DEADLOCK doesn't provide any extra information. I kept #ifdef mysqld_error_find_printf_error_used in sql_acl.h to make it easy to do this kind of check again in the future
* | | | MDEV-11952 Oracle-style packages: stage#5mariadb-10.3.5bb-10.3-compatibilityAlexander Barkov2018-02-251-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - CREATE PACKAGE [BODY] statements are now entirely written to mysql.proc with type='PACKAGE' and type='PACKAGE BODY'. - CREATE PACKAGE BODY now supports IF NOT EXISTS - DROP PACKAGE BODY now supports IF EXISTS - CREATE OR REPLACE PACKAGE [BODY] is now supported - CREATE PACKAGE [BODY] now support the DEFINER clause: CREATE DEFINER user@host PACKAGE pkg ... END; CREATE DEFINER user@host PACKAGE BODY pkg ... END; - CREATE PACKAGE [BODY] now supports SQL SECURITY and COMMENT clauses, e.g.: CREATE PACKAGE p1 SQL SECURITY INVOKER COMMENT "comment" AS ... END; - Package routines are now created from the package CREATE PACKAGE BODY statement and don't produce individual records in mysql.proc. - CREATE PACKAGE BODY now supports package-wide variables. Package variables can be read and set inside package routines. Package variables are stored in a separate sp_rcontext, which is cached in THD on the first packate routine call. - CREATE PACKAGE BODY now supports the initialization section. - All public routines (i.e. declared in CREATE PACKAGE) must have implementations in CREATE PACKAGE BODY - Only public package routines are available outside of the package - {CREATE|DROP} PACKAGE [BODY] now respects CREATE ROUTINE and ALTER ROUTINE privileges - "GRANT EXECUTE ON PACKAGE BODY pkg" is now supported - SHOW CREATE PACKAGE [BODY] is now supported - SHOW PACKAGE [BODY] STATUS is now supported - CREATE and DROP for PACKAGE [BODY] now works for non-current databases - mysqldump now supports packages - "SHOW {PROCEDURE|FUNCTION) CODE pkg.routine" now works for package routines - "SHOW PACKAGE BODY CODE pkg" now works (the package initialization section) - A new package body level MDL was added - Recursive calls for package procedures are now possible - Routine forward declarations in CREATE PACKATE BODY are now supported. - Package body variables now work as SP OUT parameters - Package body variables now work as SELECT INTO targets - Package body variables now support ROW, %ROWTYPE, %TYPE
* | | | unify error messages a bitSergei Golubchik2018-02-241-4/+4
| | | |
* | | | MDEV-15168 Unexpected ER_VERS_ENGINE_UNSUPPORTED upon dropping versioning on ↵Eugene Kosov2018-02-241-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | a partitioned table Vers_parse_info::fix_alter_info(): disallow DROP SYSTEM VERSIONING for system_time partitioned tables.
* | | | PARTITION BY SYSTEM_TIME INTERVAL ...Sergei Golubchik2018-02-231-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Lots of changes: * calculate the current history partition in ::external_lock(), not in ::write_row() or ::update_row() * remove dynamically collected per-partition row_end stats * no full table scan in open_table_from_share to calculate these stats, no manual MDL/thr_locks in open_table_from_share * no shared stats in TABLE_SHARE = no mutexes or condition waits when calculating current history partition * always compare timestamps, don't convert them to MYSQL_TIME (avoid DST ambiguity, and it's faster too) * correct interval handling, 1 month = 1 month, not 30 * 24 * 3600 seconds * save/restore first partition start time, and count intervals from there * only allow to drop first partitions if INTERVAL * when adding new history partitions, split the data in the last history parition, if it was overflowed * show partition boundaries in INFORMATION_SCHEMA.PARTITIONS
* | | | MDEV-14798 Add, drop system versioning semantic and syntaxSergei Golubchik2018-02-231-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SQL: DROP PERIOD FOR SYSTEM_TIME syntax and remove ER_VERS_SYS_FIELD_EXISTS originally by: Eugene Kosov
* | | | MDEV-15146 SQLError[4122]: View is not system versionedSergei Golubchik2018-02-121-1/+1
| | | | | | | | | | | | | | | | | | | | don't expand AS OF in views, and, in particular, don't auto-add AS OF NOW().
* | | | Remove ER_NON_VERSIONED_FIELD_IN_HISTORICAL_QUERYSergei Golubchik2018-02-121-2/+2
| | | |
* | | | MDEV-13417 UPDATE produces wrong values if an updated column is later used ↵Jerome Brauge2018-02-121-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | as an update source Standard compatible behavior for UPDATE: all assignments in SET are executed "simultaneously", not left-to-right. And `SET a=b,b=a` will swap the values.
* | | | Added error message for index file fullMonty2018-02-061-0/+3
| | | |
* | | | Updated error message for wrong foreign key constraintMonty2018-01-301-12/+12
| | | |
* | | | Changed database, tablename and alias to be LEX_CSTRINGMonty2018-01-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was done in, among other things: - thd->db and thd->db_length - TABLE_LIST tablename, db, alias and schema_name - Audit plugin database name - lex->db - All db and table names in Alter_table_ctx - st_select_lex db Other things: - Changed a lot of functions to take const LEX_CSTRING* as argument for db, table_name and alias. See init_one_table() as an example. - Changed some function arguments from LEX_CSTRING to const LEX_CSTRING - Changed some lists from LEX_STRING to LEX_CSTRING - threads_mysql.result changed because process list_db wasn't always correctly updated - New append_identifier() function that takes LEX_CSTRING* as arguments - Added new element tmp_buff to Alter_table_ctx to separate temp name handling from temporary space - Ensure we store the length after my_casedn_str() of table/db names - Removed not used version of rename_table_in_stat_tables() - Changed Natural_join_column::table_name and db_name() to never return NULL (used for print) - thd->get_db() now returns db as a printable string (thd->db.str or "")
* | | | Merge branch '10.3' of https://github.com/mariadb/server into 10.3Vladislav Vaintroub2018-01-291-2/+2
|\ \ \ \
| * | | | MDEV-15061 TRUNCATE must honor InnoDB table locksMarko Mäkelä2018-01-251-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Traditionally, DROP TABLE and TRUNCATE TABLE discarded any locks that may have been held on the table. This feels like an ACID violation. Probably most occurrences of it were prevented by meta-data locks (MDL) which were introduced in MySQL 5.5. dict_table_t::n_foreign_key_checks_running: Reduce the number of non-debug checks. lock_remove_all_on_table(), lock_remove_all_on_table_for_trx(): Remove. ha_innobase::truncate(): Acquire an exclusive InnoDB table lock before proceeding. DROP TABLE and DISCARD/IMPORT were already doing this. row_truncate_table_for_mysql(): Convert the already started transaction into a dictionary operation, and do not invoke lock_remove_all_on_table(). row_mysql_table_id_reassign(): Do not call lock_remove_all_on_table(). This function is only used in ALTER TABLE...DISCARD/IMPORT TABLESPACE, which is already holding an exclusive InnoDB table lock. TODO: Make n_foreign_key_checks running a debug-only variable. This would require two fixes: (1) DROP TABLE: Exclusively lock the table beforehand, to prevent the possibility of concurrently running foreign key checks (which would acquire a table IS lock and then record S locks). (2) RENAME TABLE: Find out if n_foreign_key_checks_running>0 actually constitutes a potential problem.
* | | | | Keep the ER_OUT_OF_RESOURCES message short and OS neutral.Vladislav Vaintroub2018-01-181-8/+8
|/ / / / | | | | | | | | | | | | Remove the tutorial about troubleshooting OOM on Unix from the message.
* | | | remove "Transaction-based system versioning is EXPERIMENTAL" warningSergei Golubchik2018-01-131-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and the system_versioning_transaction_registry variable. The user enables transaction registry by specifying BIGINT for row_start/row_end columns. check mysql.transaction_registry structure on the first open, not on startup. Avoid warnings unless transaction_registry is actually used.
* | | | System Versioning 1.0 pre8Aleksey Midenkov2018-01-101-24/+24
|\ \ \ \ | | | | | | | | | | | | | | | Merge branch '10.3' into trunk
| * \ \ \ Merge bb-10.2-ext into 10.3Marko Mäkelä2018-01-041-24/+24
| |\ \ \ \
| | * \ \ \ Merge remote-tracking branch 'origin/10.2' into bb-10.2-extMonty2018-01-011-24/+24
| | |\ \ \ \ | | | |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: cmake/make_dist.cmake.in mysql-test/r/func_json.result mysql-test/r/ps.result mysql-test/t/func_json.test mysql-test/t/ps.test sql/item_cmpfunc.h
| | | * | | Merge remote-tracking branch 'origin/10.1' into 10.2Vicențiu Ciorbaru2017-12-221-24/+24
| | | |\ \ \ | | | | |/ /
| | | | * | Merge branch '10.0' into 10.1Vicențiu Ciorbaru2017-12-201-23/+23
| | | | |\ \ | | | | | |/
| | | | | * Merge remote-tracking branch '5.5' into 10.0Vicențiu Ciorbaru2017-12-201-23/+23
| | | | | |\
| | | | | | * MDEV-14639: Fix unexpected end of line at 'Normal shutdown'Simon J Mudd2017-12-191-22/+22
| | | | | | |
| | | * | | | MDEV-14293: MyRocks lacks basic functionalitySergei Petrunia2017-12-161-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adjust the fix according to the review input: don't introduce a special error caode, use ER_INTERNAL_ERROR catch-all.