summaryrefslogtreecommitdiff
path: root/sql/sql_db.cc
Commit message (Collapse)AuthorAgeFilesLines
* MDEV-5215 Granted to PUBLICOleksandr Byelkin2022-11-011-7/+4
|
* Revert MDEV-25292 Atomic CREATE OR REPLACE TABLESergei Golubchik2022-10-271-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Specifically: Revert "MDEV-29664 Assertion `!n_mysql_tables_in_use' failed in innobase_close_connection" This reverts commit ba875e939619baefb08936863a889830f595e426. Revert "MDEV-29620 Assertion `next_insert_id == 0' failed in handler::ha_external_lock" This reverts commit aa08a7442a5141750de96353132c7799e10c9302. Revert "MDEV-29628 Memory leak after CREATE OR REPLACE with foreign key" This reverts commit c579d66ba689c8a20a951de5e6be2e1bc255ba7f. Revert "MDEV-29609 create_not_windows test fails with different result" This reverts commit cb583b2f1bf1c910e82c7caee4a53e0f3ff954ba. Revert "MDEV-29544 SIGSEGV in HA_CREATE_INFO::finalize_locked_tables" This reverts commit dcd66c3814991e686615eac2e65d01a7fa80cb66. Revert "MDEV-28933 CREATE OR REPLACE fails to recreate same constraint name" This reverts commit cf6c5176328c8fbfadac80f337ef285732cc8d06. Revert "MDEV-28933 Moved RENAME_CONSTRAINT_IDS to include/sql_funcs.h" This reverts commit f1e1c1335b506905244502ee8584736a17a6ecd0. Revert "MDEV-28956 Locking is broken if CREATE OR REPLACE fails under LOCK TABLES" This reverts commit a228ec80e30cae59c2057b786fd3559171ce794f. Revert "MDEV-25292 gcol.gcol_bugfixes --ps fix" This reverts commit 24fff8267d0722b20ca780cf144ce27560df1394. Revert "MDEV-25292 Disable atomic replace for slave-generated or-replace" This reverts commit 2af15914cb3ae204d3b413995a96c7722ad60d93. Revert "MDEV-25292 backup_log improved" This reverts commit 34398a20b5829f0508c78bc8f765f7bef6e0ad48. Revert "MDEV-25292 Atomic CREATE OR REPLACE TABLE" This reverts commit 93c8252f02faa8ad8dc5f005e52f1990c29d4a0d. Revert "MDEV-25292 Table_name class for (db, table_name, alias)" This reverts commit d145dda9c7b6db394edf7150cc255343a4a7b116. Revert "MDEV-25292 ha_table_exists() cleanup and improvement" This reverts commit 409b8a86de45efc96377c618a99cff1301523150. Revert "MDEV-25292 Cleanups" This reverts commit 595dad83ad3c23879c59deec1173ea16b47871ed. Revert "MDEV-25292 Refactoring: moved select_field_count into Alter_info." This reverts commit f02af1d2295f108d96671b5a4f731ec998002dd5.
* MDEV-25292 ha_table_exists() cleanup and improvementAleksey Midenkov2022-08-311-1/+2
| | | | | Removed default values for arguments, added flags argument to specify filename flags (FN_TO_IS_TMP, FN_FROM_IS_TMP).
* MDEV-25292 Removed thd argument in ddl_log functionsAleksey Midenkov2022-08-311-1/+1
|
* Main patch MDEV-27896 Wrong result upon `COLLATE latin1_bin CHARACTER SET ↵Alexander Barkov2022-05-241-0/+2
| | | | | | | | latin1` on the table or the database level Also fixes MDEV-27782 Wrong columns when using table level `CHARACTER SET utf8mb4 COLLATE DEFAULT` MDEV-28644 Unexpected error on ALTER TABLE t1 CONVERT TO CHARACTER SET utf8mb3, DEFAULT CHARACTER SET utf8mb4
* MDEV-26221: DYNAMIC_ARRAY use size_t for sizesEric Herman2021-10-191-10/+6
| | | | | | | | | | | | | | | | | https://jira.mariadb.org/browse/MDEV-26221 my_sys DYNAMIC_ARRAY and DYNAMIC_STRING inconsistancy The DYNAMIC_STRING uses size_t for sizes, but DYNAMIC_ARRAY used uint. This patch adjusts DYNAMIC_ARRAY to use size_t like DYNAMIC_STRING. As the MY_DIR member number_of_files is copied from a DYNAMIC_ARRAY, this is changed to be size_t. As MY_TMPDIR members 'cur' and 'max' are copied from a DYNAMIC_ARRAY, these are also changed to be size_t. The lists of plugins and stored procedures use DYNAMIC_ARRAY, but their APIs assume a size of 'uint'; these are unchanged.
* MDEV-25602 get rid of __WIN__ in favor of standard _WIN32Vladislav Vaintroub2021-06-061-1/+1
| | | | | | | | | | This fixed the MySQL bug# 20338 about misuse of double underscore prefix __WIN__, which was old MySQL's idea of identifying Windows Replace it by _WIN32 standard symbol for targeting Windows OS (both 32 and 64 bit) Not that connect storage engine is not fixed in this patch (must be fixed in "upstream" branch)
* MDEV-18465 Logging of DDL statements during backupMonty2021-05-191-1/+27
| | | | | Many of the changes was needed to be able to collect and print engine name and table version id's in the ddl log.
* Move debug_crash_here to it's own source filesMonty2021-05-191-1/+1
|
* MDEV-24408 Crash-safe DROP DATABASEMonty2021-05-191-59/+123
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Description of how DROP DATABASE works after this patch - Collect list of tables - DDL log tables as they are dropped - DDL log drop database - Delete db.opt - Delete data directory - Log either DROP TABLE or DROP DATABASE to binary log - De active ddl log entry This is in line of how things where before (minus ddl logging) except that we delete db.opt file last to not loose it if DROP DATABASE fails. On recovery we have to ensure that all dropped tables are logged in binary log and that they are properly dropped (as with atomic drop table). No new tables be dropped as part of recovery. Recovery of active drop database ddl log entry: - If drop database was logged to ddl log but was not found in the binary log: - drop the db.opt file and database directory. - Log DROP DATABASE to binary log - If drop database was not logged to ddl log - Update binary log with DROP TABLE of the dropped tables. If table list is longer than max_allowed_packet, then the query will be split into multiple DROP TABLE/VIEW queries. Other things: - Added DDL_LOG_STATE and 'current database' as arguments to mysql_rm_table_no_locks(). This was needed to be able to combine ddl logging of DROP DATABASE and DROP TABLE and make the generated DROP TABLE statements shorter. - To make the DROP TABLE statement created by ddl log shorter, I changed the binlogged query to use current directory and omit the directory part for all tables in the current directory. - Merged some DROP TABLE and DROP VIEW code in ddl logger. This was done to be able get separate DROP VIEW and DROP TABLE statements in the binary log. - Added a 'recovery_state' variable to remember the state of dropped tables and views. - Moved out code that drops database objects (stored procedures) from mysql_rm_db_internal() to drop_database_objects() for better code reuse. - Made mysql_rm_db_internal() global so that could be used by the ddl recovery code.
* Change CHARSET_INFO character set and collaction names to LEX_CSTRINGMonty2021-05-191-2/+2
| | | | | | | | | | | | | | | | | | | | | | This change removed 68 explict strlen() calls from the code. The following renames was done to ensure we don't use the old names when merging code from earlier releases, as using the new variables for print function could result in crashes: - charset->csname renamed to charset->cs_name - charset->name renamed to charset->coll_name Almost everything where mechanical changes except: - Changed to use the new Protocol::store(LEX_CSTRING..) when possible - Changed to use field->store(LEX_CSTRING*, CHARSET_INFO*) when possible - Changed to use String->append(LEX_CSTRING&) when possible Other things: - There where compiler issues with ensuring that all character set names points to the same string: gcc doesn't allow one to use integer constants when defining global structures (constant char * pointers works fine). To get around this, I declared defines for each character set name length.
* MDEV-8334: Rename utf8 to utf8mb3Rucha Deodhar2021-05-191-4/+4
| | | | | | This patch changes the main name of 3 byte character set from utf8 to utf8mb3. New old_mode UTF8_IS_UTF8MB3 is added and set TRUE by default, so that utf8 would mean utf8mb3. If not set, utf8 would mean utf8mb4.
* Fixed wrong initializations of Dynamic_arrayMonty2021-03-201-1/+1
| | | | | Other things: - Added size() function to Dynamic_array()
* MDEV-23124 Eliminate the overhead of system call access() on every USE(or ↵Vladislav Vaintroub2020-07-141-25/+151
| | | | | | | | | | | connection) Make check_db_dir_existence() use a cache of existing directories clear the cache whenever any directory is removed. With this, the cost of check_db_dir_existence() will usually be a cost of acquiring/releasing a non-contended readwrite lock in shared mode, much less than going to the kernel and filesystem to check for file existence
* Added IF EXISTS to RENAME TABLE and ALTER TABLEMonty2020-03-241-1/+1
|
* cleanup: PSI key is *always* the first argumentSergei Golubchik2020-03-101-6/+5
|
* perfschema mdl related instrumentation changesSergei Golubchik2020-03-101-3/+3
|
* perfschema memory related instrumentation changesSergei Golubchik2020-03-101-5/+5
|
* MDEV-21702 Add a data type for privilegesAlexander Barkov2020-02-111-7/+7
|
* Merge 10.4 into 10.5Marko Mäkelä2019-12-161-2/+2
|\
| * Merge branch '10.3' into 10.4Oleksandr Byelkin2019-12-091-2/+2
| |\
| | * Lintian complains on spelling errorFaustin Lammler2019-12-021-2/+2
| | | | | | | | | | | | | | | The lintian check complains on spelling error: https://salsa.debian.org/mariadb-team/mariadb-10.3/-/jobs/95739
* | | Removed kill_delayed_threads_for_table()Sergey Vojtovich2019-11-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After 7fb9d64 it is used only by ALTER/DROP SERVER, which most probably wasn't intentional as Federated never supported delayed inserts anyway. If delayed inserts will ever become an issue with ALTER/DROP SERVER, we should kill them by acquiring X-lock instead. Part of MDEV-17882 - Cleanup refresh version
* | | Cleanup session trackerSergey Vojtovich2019-09-241-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - call current_schema::mark_as_changed() directly - call state_change::mark_as_changed() directly - replaced SESSION_TRACKER_CHANGED with dummy tracker - replaced Session_tracker::mark_as_changed() with State_tracker::mark_as_changed() - hide and devirtualize original State_tracker::mark_as_changed(), rename it to set_changed() - all implementations of mark_as_changed() now check is_enabled() for consistency - no argument casts anymore
* | | Merge 10.4 into 10.5Marko Mäkelä2019-05-231-12/+12
|\ \ \ | |/ /
| * | Merge branch '10.3' into 10.4Oleksandr Byelkin2019-05-191-12/+12
| |\ \ | | |/
| | * Merge 10.2 into 10.3Marko Mäkelä2019-05-141-1/+1
| | |\
| | | * Merge 10.1 into 10.2Marko Mäkelä2019-05-131-1/+1
| | | |\
| | | | * Merge branch '5.5' into 10.1Vicențiu Ciorbaru2019-05-111-1/+1
| | | | |\
| | | | | * Update FSF AddressVicențiu Ciorbaru2019-05-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | * Update wrong zip-code
| | | | | * MDEV-12230 include/my_sys.h:600:43: error: unknown type name ↵Sergei Golubchik2017-04-201-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ‘PSI_file_key’" when -DWITHOUT_SERVER=1 cherry-pick 2c2bd8c155 (MDEV-12261 build failure without P_S) from 10.0
| | * | | | Merge branch '10.2' into 10.3Oleksandr Byelkin2019-05-121-11/+11
| | |\ \ \ \ | | | |/ / /
| | | * | | Merge branch '10.1' into 10.2Oleksandr Byelkin2019-05-041-10/+10
| | | |\ \ \ | | | | |/ /
| | | | * | MDEV-19276 during connect, write error log warning for ER_DBACCESS_DENIED_ERROR,Vladislav Vaintroub2019-04-281-13/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | if log_warnings > 1. This makes ER_DBACCESS_DENIED_ERROR handling the same as we do for other "access denied"
* | | | | | MDEV-307 review minor edits, add yacc_ora supportRobert Bindar2019-05-211-7/+11
| | | | | |
* | | | | | MDEV-307 Add functionality for database commentsGagan Goel2019-05-211-8/+53
|/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds a new feature to the server to add comments at the database level. 1024 bytes is the maximum comment length allowed. If the comment length exceeds this limit, a new error/warning code 4144 is thrown, based on whether thd->is_strict_mode() is true/false. The database comment is also added to the db.opt file, as well as to the information_schema.schemata table.
* | | | | MDEV-18297 How to reset a forgotten root passwordSergei Golubchik2019-02-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After FLUSH PRIVILEGES remember if the connection started under --skip-grant-tables and keep it all-powerful, not a lowly anonymous. One could use this connection to reset passwords as needed. Also fix a crash in SHOW CREATE USER
* | | | | Merge 10.3 into 10.4Marko Mäkelä2019-02-051-2/+6
|\ \ \ \ \ | |/ / / /
| * | | | Merge 10.2 into 10.3Marko Mäkelä2019-02-041-2/+6
| |\ \ \ \ | | |/ / /
| | * | | MDEV-17148 DROP DATABASE throw "Directory not empty" after changed ↵Alexey Botchkov2019-02-011-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | lower_case_table_names. No need to lowercase table names on case-sensitive file systems, as the cache won't contain the 'lowercased' table anyway. And it prevents the UPPERCASE.frm from being deleted.
* | | | | Execute bootstrap in main threadSergey Vojtovich2019-01-281-1/+1
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bootstrap in a separate thread was introduced in 746f0b3b7 to workaround OS/2 small stack size. OS/2 support was discontinued in 2006 and modern operating systems have default stack size a few times larger than default thread_stack and it is tunable. Aim is to reduce usage of LOCK_thread_count and COND_thread_count. Part of MDEV-15135.
* | | | Merge branch '10.2' into 10.3Sergei Golubchik2019-01-031-2/+7
|\ \ \ \ | |/ / /
| * | | Merge branch '10.1' into 10.2mariadb-10.2.21Sergei Golubchik2018-12-301-2/+7
| |\ \ \ | | |/ /
| | * | Merge branch '10.0' into 10.1Sergei Golubchik2018-12-291-2/+7
| | |\ \
* | | | | cleanup: quoted_stringSergei Golubchik2018-05-121-2/+1
| | | | |
* | | | | Add likely/unlikely to speed up executionMonty2018-05-071-11/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added to: - if (error) - Lex - sql_yacc.yy and sql_yacc_ora.yy - In header files to alloc() calls - Added thd argument to thd_net_is_killed()
* | | | | Merge 10.2 into 10.3Marko Mäkelä2018-04-241-1/+1
|\ \ \ \ \ | |/ / / /
| * | | | Remove most 'register' use in C++Marko Mäkelä2018-04-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Modern compilers (such as GCC 8) emit warnings that the 'register' keyword is deprecated and not valid C++17. Let us remove most use of the 'register' keyword. Code in 'extra/' is not touched.
* | | | | Windows : reenable warning C4805 (unsafe mix of types in bool operations)Vladislav Vaintroub2018-02-071-1/+1
| | | | |
* | | | | MDEV-15091 : Windows, 64bit: reenable and fix warning C4267 (conversion from ↵Vladislav Vaintroub2018-02-061-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 'size_t' to 'type', possible loss of data) Handle string length as size_t, consistently (almost always:)) Change function prototypes to accept size_t, where in the past ulong or uint were used. change local/member variables to size_t when appropriate. This fix excludes rocksdb, spider,spider, sphinx and connect for now.