summaryrefslogtreecommitdiff
path: root/sql/table.cc
Commit message (Collapse)AuthorAgeFilesLines
* MDEV-19675 Wrong charset is chosen when opening a pre-4.1 tableAlexander Barkov2019-06-031-2/+3
|
* MDEV-19653 Add class Sql_cmd_create_tableAlexander Barkov2019-05-311-2/+14
|
* 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
* | Merge branch '5.5' into 10.1Sergei Golubchik2019-04-261-1/+2
|\ \ | |/
| * MDEV-15907 ASAN heap-use-after-freeRobert Bindar2019-04-241-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes an invalid read in fill_effective_table_privileges triggered by a grant_version increase between a PREPARE for a statement creating a view from I_S and EXECUTE. A tmp table was created and free'd while preparing the statement, TABLE_LIST::table_name was set to point to the tmp table TABLE_SHARE::table_name which no longer existed after preparing was done. The grant version increase made fill_effective_table_privileges called during EXECUTE to try fetch the updated grant info and this is where the dangling table name was used.
* | MDEV-14605 Changes to "ON UPDATE CURRENT_TIMESTAMP" fields are notAndrei Elkin2019-01-241-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | always logged properly with binlog_row_image=MINIMAL There are two issues fixed in this commit. The first is an observation of a multi-table UPDATE binlogged in row-format in binlog_row_image=MINIMAL mode. While the UPDATE aims at a table with an ON-UPDATE attribute its binlog after-image misses to record also installed default value. The reason for that turns out missed marking of default-capable fields in TABLE::write_set. This is fixed to mark such fields similarly to 10.2's MDEV-10134 patch (db7edfed17efe6) that introduced it. The marking follows up 93d1e5ce0b841bed's idea to exploit TABLE:rpl_write_set introduced there though, and thus does not mess (in 10.1) with the actual MDEV-10134 agenda. The patch makes formerly arg-less TABLE::mark_default_fields_for_write() to accept an argument which would be TABLE:rpl_write_set. The 2nd issue is extra columns in in binlog_row_image=MINIMAL before-image while merely a packed primary key is enough. The test main.mysqlbinlog_row_minimal always had a wrong result recorded. This is fixed to invoke a function that intended for read_set possible filtering and which is called (supposed to) in all type of MDL, UPDATE including; the test results have gotten corrected. At *merging* from 10.1->10.2 the 1st "main" part of the patch is unnecessary since the bug is not observed in 10.2, so only hunks from sql/sql_class.cc are required.
* | Merge branch '10.0' into 10.1Sergei Golubchik2018-12-291-4/+4
|\ \
| * | MDEV-17589: Stack-buffer-overflow with indexed varchar (utf8) fieldbb-10.0-varunVarun Gupta2018-12-191-1/+1
| | | | | | | | | | | | | | | | | | Create a new constant MAX_DATA_LENGTH_FOR_KEY. Replace the value of MAX_KEY_LENGTH to also include the LENGTH and NULL BYTES of a field.
| * | Backported MDEV-11196(e4d10e09cf31) and MDEV-10360(8a8ba1949bf4) to 10.0Varun Gupta2018-12-191-5/+43
| | |
* | | Merge branch '11.0' into 10.1Oleksandr Byelkin2018-09-061-0/+21
|\ \ \ | |/ /
| * | MDEV-16757 Memory leak after adding manually min/max statistical dataSergey Vojtovich2018-09-051-0/+1
| | | | | | | | | | | | | | | | | | for blob column Moved delete_stat_values_for_table_share() call to proper place.
| * | create a reusable function that tells what FK actions can writeSergei Golubchik2018-09-041-0/+6
| | | | | | | | | | | | Backport of 794f71cbc41
| * | cleanup: FOREIGN_KEY_INFOSergei Golubchik2018-09-041-0/+13
| | | | | | | | | | | | | | | | | | | | | instead of returning strings for CASCADE/RESTRICT from every storage engine, use enum values Backport of a3614d33e8a
* | | Fix gcc 7.3 compiler warnings.Oleksandr Byelkin2018-08-031-1/+1
| | |
* | | Merge branch '10.0' into bb-10.1-mergebb-10.1-merge-sanjaOleksandr Byelkin2018-07-191-5/+14
|\ \ \ | |/ /
| * | Merge branch '5.5' into bb-10.0-mergeOleksandr Byelkin2018-07-171-5/+14
| |\ \ | | |/
| | * MDEV-16307: Incorrect results when using BNLH join instead of BNL join with ↵Varun Gupta2018-07-101-2/+11
| | | | | | | | | | | | | | | | | | | | | | | | views In this issue we are using derived_with_keys optimization and we are using these keys to do a hash join which is incorrect. We cannot create keys for dervied tables whose keyparts have types are of BLOB or TEXT type. TEXT or BLOB columns can only be indexed over a specified length.
| | * Fixed MDEV-16512, crashing on re-execution of failing SPMichael Widenius2018-06-271-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MDEV-16512 Server crashes in find_field_in_table_ref on 2nd execution of SP referring to non-existing field Problem was in the natural join code that it changed TABLE_LIST and Item_fields but didn't restore changed things if things goes wrong and was not able to re-execute after failure. Some of the problems could have been avoided if we would have run fix_fields before doing natural join transformations. Fixed by marking functions complete AFTER they had executed, instead at start. I had also to change some tests that checked if Item_fields are usable. This doesn't fix all known problems, but at least avoids some crashes. What should be done in the near future is to mark the statement in the SP as 'not re-executable' and force a reparse of it on next execution. Reviewer: Sergei Petrunia <psergey@askmonty.org>
* | | Merge remote-tracking branch 'origin/10.0' into 10.1Alexander Barkov2018-06-191-1/+2
|\ \ \ | |/ /
| * | Merge remote-tracking branch 'origin/5.5' into 10.0Alexander Barkov2018-06-191-1/+2
| |\ \ | | |/
| | * MDEV-15834 The code in TABLE_SHARE::init_from_binary_frm_image() is not safeAlexander Barkov2018-06-191-1/+5
| | |
* | | fix compilation w/o partitioningSergei Golubchik2018-06-141-0/+2
| | | | | | | | | | | | followup for d8da920264a
* | | Merge branch '10.0' into 10.1Vicențiu Ciorbaru2018-06-121-0/+10
|\ \ \ | |/ /
| * | Merge branch '5.5' into 10.0Vicențiu Ciorbaru2018-06-101-0/+2
| |\ \ | | |/
| | * Catch of OOM situation.Oleksandr Byelkin2018-06-061-0/+2
| | |
| * | MDEV-16374: Filtered shows 0 for materilization scan for a semi join, which ↵Varun Gupta2018-06-091-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | makes optimizer always picks materialization scan over materialization lookup For non-mergeable semi-joins we don't store the estimates of the IN subquery in table->file->stats.records. In the function TABLE_LIST::fetch_number_of_rows, we store the number of rows in the tables (estimates in case of derived table/views). Currently we don't store the estimates for non-mergeable semi-joins, which leads to a problem of selecting materialization scan over materialization lookup. Fixed this by storing these estimated appropriately
* | | MDEV-10679 Crash in performance schema and partitioning with discoveryMonty2018-05-261-0/+1
| | | | | | | | | | | | | | | | | | | | | Crash happened because in discover, table->work_part_info was not properly reset before execution. Fixed by resetting before calling execute alter table, create table or mysql_create_frm_image.
* | | Merge 10.0 into 10.1Marko Mäkelä2018-04-241-3/+13
|\ \ \ | |/ /
| * | Merge branch '5.5' into 10.0Sergei Golubchik2018-04-201-3/+13
| |\ \ | | |/
| | * Merge branch 'mysql/5.5' into 5.5Sergei Golubchik2018-04-191-3/+13
| | |\
| | | * BUG#26881798: SERVER EXITS WHEN PRIMARY KEY IN MYSQL.PROCKarthik Kamath2017-12-051-2/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | IS DROPPED ANALYSIS: ========= It is advised not to tamper with the system tables. When primary key is dropped from a system table, certain operations on the table which tries to access the table key information may lead to server exit. FIX: ==== An appropriate error is now reported in such a case.
| | | * (no commit message)Arun Kuruvila2016-11-281-22/+18
| | | |
* | | | Merge branch 'github/10.0' into 10.1Sergei Golubchik2018-02-021-2/+6
|\ \ \ \ | |/ / /
| * | | Merge remote-tracking branch '5.5' into 10.0Vicențiu Ciorbaru2018-01-241-3/+7
| |\ \ \ | | |/ /
| | * | improve ASAN instrumentation: table->record[0]Sergei Golubchik2018-01-221-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | instrument table->record[0], table->record[1] and share->default_values. One should not access record image beyond share->reclength, even if table->record[0] has some unused space after it (functions that work with records, might get a copy of the record as an argument, and that copy - not being record[0] - might not have this buffer space at the end). See b80fa4000d6 and 444587d8a3c
| | * | Correct TRASH() macro usageSergei Golubchik2018-01-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TRASH was mapped to TRASH_FREE and was supposed to be used for memory that should not be accessed anymore, while TRASH_ALLOC() is to be used for uninitialized but to-be-used memory. But sometimes TRASH() was used in the latter sense. Remove TRASH() macro, always use explicit TRASH_ALLOC() or TRASH_FREE().
* | | | Merge 10.0 into 10.1Marko Mäkelä2018-01-021-0/+3
|\ \ \ \ | |/ / /
| * | | Merge 5.5 into 10.0Marko Mäkelä2018-01-021-0/+3
| |\ \ \ | | |/ /
| | * | MDEV-10657: incorrect result returned with binary protocol (prepared statements)Oleksandr Byelkin2017-12-271-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | If translation table present when we materialize the derived table then change it to point to the materialized table. Added debug info to see really what happens with what derived.
* | | | Merge branch '10.0' into 10.1Vicențiu Ciorbaru2017-12-201-0/+8
|\ \ \ \ | |/ / /
| * | | Merge remote-tracking branch '5.5' into 10.0Vicențiu Ciorbaru2017-12-201-0/+8
| |\ \ \ | | |/ /
| | * | MDEV-10397: Server crashes in key_copy with join_cache_level > 2 and join on ↵Varun Gupta2017-11-301-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | BIT fields For BIT field null_bit is not set to 0 even for a field defined as NOT NULL. So now in the function TABLE::create_key_part_by_field, if the bit field is not nullable then the null_bit is explicitly set to 0
* | | | Merge 10.0 into 10.1Marko Mäkelä2017-10-241-1/+2
|\ \ \ \ | |/ / /
| * | | MDEV-13776 mysqld got signal 11 on delete returningIgor Babaev2017-10-231-1/+2
| | | | | | | | | | | | | | | | | | | | The method Field_iterator_table::create_item() must take into account that it can be called when processing DELETE RETURNING.
* | | | Merge branch '10.0' into 10.1Sergei Golubchik2017-09-211-14/+20
|\ \ \ \ | |/ / /
| * | | cleanup: TABLE_LIST::view_check_optionSergei Golubchik2017-09-211-17/+20
| | | | | | | | | | | | | | | | | | | | don't prepare for checking view's CHECK OPTION, if there is no CHECK OPTION in the first place.
| * | | MDEV-13290: Assertion Assertion `!is_set() || (m_status == DA_OK_BULK && ↵Sergei Golubchik2017-09-201-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | is_bulk_op())' or `! is_set()' failed followup for 97c2a7354b6 - don't use thd->is_error(), the error could've been set before TABLE_LIST::cleanup_items. Use the error handler to count errors. This fixes rpl.rpl_row_binlog_max_cache_size - it was failing when ER_STMT_CACHE_FULL happened duing multi-table update. Because multi_update::abort_result_set() calls do_updates() to update as much as possible, so one cannot rely on thd->is_error() after that.
* | | | Merge branch '10.0' into 10.1Vicențiu Ciorbaru2017-09-201-0/+3
|\ \ \ \ | |/ / /
| * | | MDEV-13290: Assertion Assertion `!is_set() || (m_status == DA_OK_BULK && ↵Oleksandr Byelkin2017-09-191-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | is_bulk_op())' or `! is_set()' failed Check error status which can be set by conversion procedures.