summaryrefslogtreecommitdiff
path: root/mysql-test/main
Commit message (Collapse)AuthorAgeFilesLines
* MDEV-24274 ALTER TABLE with CHECK CONSTRAINTS gives "Out of Memory" errorSergei Golubchik2021-02-072-0/+20
| | | | | | | | | | | partially revert 76063c2a13. Item::clone() is not an all-purpose Item copying machine, it was specifically created for pushdown of predicates into derived tables and views and it does not copy everything. In particular, it does not copy Item_func_regex. Fix the bug differently by preserving the old constraint name. But keep setting automatic_name=true to have it regenerated for cases like ALTER TABLE ... ADD CONSTRAINT.
* Merge 10.3 into 10.4Marko Mäkelä2021-01-2514-20/+266
|\
| * MDEV-24593 Signal 11 when group by primary key of table joined to ↵Sergei Golubchik2021-01-222-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | information_schema.columns I_S tables were materialized too late, an attempt to use table statistics before the table was created caused a crash. Let's move table creation up. it only needs read_set to be calculated properly, this happens in JOIN::optimize_inner(), after semijoin transformation. Note that tables are not populated at that point, so most of the statistics would make no sense anyway. But at least field sizes will be correct. And it won't crash.
| * remove now-unused rdiff fileSergei Golubchik2021-01-221-11/+0
| |
| * MDEV-23666: Assertion `m_cpp_buf <= ptr && ptr <= m_cpp_buf + m_buf_length' ↵Dmitry Shulga2021-01-142-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | failed in Lex_input_stream::body_utf8_append On parsing statements for which a starting backtick (`) delimiter doesn't have a corresponding ending backtick, a current pointer to a position inside a pre-processed buffer could go beyond the end of the buffer. This bug report caused by the commit d4967659032b18a5504198b41dd3d0a1813d79ef "MDEV-22022 Various mangled SQL statements will crash 10.3 to 10.5 debug builds". In order to fix the issue both pointers m_ptr and m_cpp_ptr must be rolled back to previous position in raw input and pre-processed input streams correspondingly in case end of query reached during parsing.
| * MDEV-24387: Wrong number of decimal digits in certain UNION/SubqeryRucha Deodhar2021-01-132-0/+52
| | | | | | | | | | | | | | | | | | | | | | | | constellation Analysis: The decimals is set to NOT_FIXED_DEC for Field_str even if it is NULL. Unsigned has decimals=0. So Type_std_attributes::decimals is set to 39 (maximum between 0 and 39). This results in incorrect number of decimals when we have union of unsigned and NULL type. Fix: Check if the field is created from NULL value. If yes, set decimals to 0 otherwise set it to NOT_FIXED_DEC.
| * MDEV-20763 Table corruption or Assertion `btr_validate_index(index, 0, ↵Sergei Golubchik2021-01-122-0/+48
| | | | | | | | | | | | | | false)' failed in row_upd_sec_index_entry with virtual column and EMPTY_STRING_IS_NULL SQL mode unset empty_string_is_null mode when parsing generated columns in a table, this mode affects pasring.
| * fix sporadic failures of main.processlist_notembeddedSergei Golubchik2021-01-122-16/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the test was doing --replace_result $con_id con_id eval SHOW EXPLAIN FOR $con_id; with the intention of replacing the variable part of the statement in the result log. But actually replace_result replaces everything that matches. In particular, when $con_id is 100, the warning Note 1003 select sleep(100000) becomes Note con_id3 select sleep(con_id000)
| * failing to parse an SP should not abort information_schema.routinesSergei Golubchik2021-01-122-4/+6
| |
| * MDEV-24524 Assertion `ls->length < 0xFFFFFFFFL && ((ls->length == 0 && ↵Sergei Golubchik2021-01-122-4/+18
| | | | | | | | | | | | | | | | !ls->str) || ls->length == strlen(ls->str))' failed in String::append on SELECT from I_S don't expect return type of a stored function to be valid. it's read from a table, so can be messed with. it even can contain \0 bytes in the middle of the type name
| * Added the test case for MDEV-23804Varun Gupta2021-01-122-0/+83
| |
* | Merge branch '10.3' into 10.4Oleksandr Byelkin2020-12-291-2/+2
|\ \ | |/
| * Correction of the merge 10.2 into 10.3 for MDEV-23619Igor Babaev2020-12-281-2/+2
| | | | | | | | (correction for commit 6fed6de93f120b5e311b79892e7865639e9613a4)
* | Merge branch '10.3' into 10.4bb-10.4-MDEV-23468Oleksandr Byelkin2020-12-2539-89/+1003
|\ \ | |/
| * Merge branch '10.2' into 10.3Oleksandr Byelkin2020-12-2338-73/+994
| |
| * remove the test for MDEV-22485 that doesn't test MDEV-22485Sergei Golubchik2020-12-123-152/+0
| | | | | | | | This reverts commit bc2dc83cb56851144a8c15e73a83c7817dc705a2.
| * MDEV-22485: add the test casebb-10.3-anel-MDEV-22485-mysqlslapAnel Husakovic2020-12-073-0/+152
| | | | | | | | Closes PR #1649
* | MDEV-24207: recognise mysql forms of invalid password for mysql_native_passwordDaniel Black2020-12-152-2/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The main goal of this patch is to prevent MariaDB's native_password_plugin from "parsing" the hex (or non hex) authentication_string. Due to how the current code is written, we convert any string (within native_password_get_salt) that has the appropriate length to a "binary" representation, that can potentially match a real password. More specifically, "*THISISNOTAVALIDPASSWORDTHATCANBEUSEDHERE" produces the same results as "*d13c3c78dafa52d9bce09bdd1adcb7befced1ebe". The length indicator is the main indicator of an invalid password. We use use same trick with "invalid" to change its internal representation. The "parsing" mentioned is by get_salt_from_password down to char_val() and because if where it is, its effectively a static plugin API that cannot change. In supporting these, we support the SHOW CREATE USER from MySQL may have the hashed password string: *THISISNOTAVALIDPASSWORDTHATCANBEUSEDHERE. Obviously this isn't a hash because it contains non-hex characters. After this patch we do however recognise the pattern; [any char, notionally *]{40 chars not all are hex} as a pattern for an invalid password. This was determined to be the general pattern that MySQL used. Reviewers: Sergei G, Vicentiu
* | MDEV-21958: Query having many NOT-IN clauses running forever, part 3Sergei Petrunia2020-12-112-0/+64
| | | | | | | | Add the new file
* | MDEV-21958: Query having many NOT-IN clauses running forever, part 2Sergei Petrunia2020-12-113-84/+0
| | | | | | | | | | Move the testcase into a separate file: embedded server doesn't have optimizer trace.
* | MDEV-21958: Query having many NOT-IN clauses running foreverSergei Petrunia2020-12-113-0/+84
| | | | | | | | | | | | | | | | | | | | Basic variant of the fix: do not consider conditions in form unique_key NOT IN (c1,c2...) to be sargable. If there are only a few constants, the condition is not selective. If there are a lot constants, the overhead of processing such a huge range list is not worth it.
* | Merge 10.3 into 10.4Marko Mäkelä2020-12-0115-10/+376
|\ \ | |/
| * Merge 10.2 into 10.3Marko Mäkelä2020-12-018-5/+183
| |
| * MDEV-21265: IN predicate conversion to IN subquery should be allowed for a ↵Varun Gupta2020-11-302-0/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | broader set of datatype comparison Allow materialization strategy when collations on the inner and outer sides of an IN subquery are the same and the character set of the inner side is a proper subset of the character set on the outer side. This allows conversion from utf8mb3 to utf8mb4 as the former is a subset of the later. This is only allowed when IN predicate is converted to an IN subquery Backported part of the patch (d6a00d9b18f) of MDEV-17905.
| * MDEV-24230 subquery on information_schema fails with error messageSergei Golubchik2020-11-252-4/+15
| | | | | | | | | | | | | | | | | | disable thd->count_cuted_fields when populating internal temporary tables for I_S, because this is how SELECT works standalone. And if the SELECT is a part of INSERT or UPDATE or RETURN or SET or anything else that enables thd->count_cuted_fields, this counting should only apply when storing the result of the SELECT in a field or a variable, not when populating internal temporary tables for I_S.
| * MDEV-21842 auto_increment does not increment with compound primary key on ↵Alexey Botchkov2020-11-233-1/+108
| | | | | | | | | | | | | | | | | | partitioned table. The idea of this fix is that it's enough to prevent the next_auto_inc_val from incrementing if an error, to fix this problem and also the MDEV-17333. So this patch basically reverts the existing fix to the MDEV-17333.
* | MDEV-23619: Merge 10.3 into 10.4Marko Mäkelä2020-11-132-0/+279
|\ \ | |/
| * MDEV-23619: Merge 10.2 into 10.3Marko Mäkelä2020-11-132-0/+279
| |
| * Merge mariadb-10.3.27 into 10.3Marko Mäkelä2020-11-113-2/+114
| |\
* | \ Merge mariadb-10.4.17 into 10.4Marko Mäkelä2020-11-113-4/+116
|\ \ \
| * \ \ Merge branch '10.3' into 10.4mariadb-10.4.17Sergei Golubchik2020-11-103-4/+116
| |\ \ \ | | | |/ | | |/|
| | * | MDEV-24117: Memory management problem (in range optimizer)mariadb-10.3.27Sergei Petrunia2020-11-103-3/+3
| | | | | | | | | | | | | | | | | | | | Adjust the testcase for MariaDB 10.3+ : prevent IN-to-subquery conversion optimization from working.
| | * | Merge branch '10.2' into 10.3Sergei Golubchik2020-11-093-2/+114
| | | |
| * | | Merge branch '10.3' into 10.4Oleksandr Byelkin2020-10-3122-27/+463
| |\ \ \ | | |/ /
* | | | MDEV-24098 CREATE USER/ALTER USER PASSWORD EXPIRE/LOCK in either orderDaniel Black2020-11-042-0/+48
| | | | | | | | | | | | | | | | Reviewed-by: vicentiu@mariadb.org
* | | | MDEV-24098: SHOW CREATE USER invalid for both PASSWORD and LOCKEDDaniel Black2020-11-042-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The parser of CREATE USER accepts ACCOUNT LOCK before PASSWORD EXPIRE but not the other way around. This just changes the SHOW CREATE USER to output a sql syntax that is valid. Thanks to Robert Bindar for analysis.
* | | | Merge 10.3 into 10.4Marko Mäkelä2020-11-0326-29/+1139
|\ \ \ \ | | |_|/ | |/| |
| * | | Merge 10.2 into 10.3Marko Mäkelä2020-11-024-2/+740
| | |/ | |/|
| * | Merge branch '10.2' into 10.3Oleksandr Byelkin2020-10-3022-27/+462
| | |
* | | MDEV-22974: mysql_native_password make "invalid" validDaniel Black2020-10-314-0/+46
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Per b9f3f06857ac, mysql_system_tables_data.sql creates a mysql_native_password with a salted hash of "invalid" so that `set password` will detect a native password can be applied:. SHOW CREATE USER; diligently uses this value in its output generating the SQL: MariaDB [(none)]> show create user; +---------------------------------------------------------------------------------------------------+ | CREATE USER for dan@localhost | +---------------------------------------------------------------------------------------------------+ | CREATE USER `dan`@`localhost` IDENTIFIED VIA mysql_native_password USING 'invalid' OR unix_socket | +---------------------------------------------------------------------------------------------------+ Attempting to execute this before this patch results in: MariaDB [(none)]> CREATE USER `dan2`@`localhost` IDENTIFIED VIA mysql_native_password USING 'invalid' OR unix_socket; ERROR 1372 (HY000): Password hash should be a 41-digit hexadecimal number As such, deep the implementation of mysql_native_password we make "invalid" valid (pun intended) such that the above create user will succeed. We do this by storing "*THISISNOTAVALIDPASSWORDTHATCANBEUSEDHERE" (credit: Oracle MySQL), that is of an INCORRECT length for a scramble. In native_password_authenticate we check the length of this cached value and immediately fail if it is anything other than the scramble length. native_password_get_salt is only called in the context of set_user_salt, so all setting of native passwords to hashed content of 'invalid', quite literally create an invalid password. So other forms of "invalid" are valid SQL in creating invalid passwords: MariaDB [(none)]> set password = 'invalid'; Query OK, 0 rows affected (0.001 sec) MariaDB [(none)]> alter user dan@localhost IDENTIFIED BY PASSWORD 'invalid'; Query OK, 0 rows affected (0.000 sec) closes #1628 Reviewer: serg@mariadb.com
* | Try to stabilize main.innodb_ext_key,offMarko Mäkelä2020-10-303-5/+8
| | | | | | | | | | Thanks to Varun Gupta for suggesting this. This seems to make main.innodb_ext_key,off more stable.
* | MDEV-23991 fixup: Initialize the memoryMarko Mäkelä2020-10-303-5/+20
| | | | | | | | | | | | | | | | | | | | | | | | Also, revert the work-around for the test that was attempted in commit 85613a32477ef4b8fb9aefba5f61689028f3ff87. This issue was caught by MemorySanitizer as well as on the Microsoft Windows debug builds, thanks to /MD being used starting with 10.4. The code fix will also be applied to 10.2 because the regression was introduced in commit afc9d00c66db946c8240fe1fa6b345a3a8b6fec1.
* | MDEV-22879 SIGSEGV (or hang) in free/my_freeMonty2020-10-292-0/+42
| | | | | | | | | | This bug was already fixed in a previous commit. Added test case from the MDEV to prove it's fixed.
* | After-merge fix: main,innodb_ext_key,offMarko Mäkelä2020-10-293-20/+5
| | | | | | | | | | | | | | For some reason, in the test main,innodb_ext_key,off we frequently get unexpected EXPLAIN output, in particular on Microsoft Windows debug builders. Let us comment out that EXPLAIN statement for now.
* | Merge 10.3 into 10.4Marko Mäkelä2020-10-2932-1241/+13288
|\ \ | |/
| * Merge 10.2 into 10.3Marko Mäkelä2020-10-2820-1164/+13008
| |
| * MDEV-21786 mysqldump will forget sequence definition details on --no-data dumpAnel Husakovic2020-10-232-0/+201
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Original patch was contributed by Jani Tolonen <jani.k.tolonen@gmail.com> https://github.com/an3l/server/commits/bb-10.3-anel-MDEV-21786-dump-sequence which distinguishes data structure (linked list) of sequences from tables. - Added standard sql output to prevent future changes of sequences and disabled locks for sequences. - Added test case for `MDEV-20070: mysqldump won't work correct on sequences` where table column depends on sequence value. - Restore sequence last value in the following way: - Find `next_not_cached_value` and use it to `setval()` - We just need for logical restore, so don't execute `setval()` - `setval()` should be showed also in case of `--no-data` option. Reviewed-by: daniel@mariadb.org
* | Merge 10.3 into 10.4Marko Mäkelä2020-10-2223-95/+550
|\ \ | |/
| * Merge 10.2 into 10.3Marko Mäkelä2020-10-2229-89/+692
| |
| * MDEV-23445: LIMIT ROWS EXAMINED throws error in Debug build onlyRucha Deodhar2020-10-201-7/+0
| | | | | | | | | | | | | | | | Analysis: When we reach the maximum limit to examine rows killed_state is set as ABORT. But this isn't an actual error and we still return TRUE. This eventually sets error as UNKNOWN ERROR. Fix: Check if need to stop execution by checking the killed state. If we have to abort it, return false because this isn't an actual error.