summaryrefslogtreecommitdiff
path: root/mysql-test/r
Commit message (Collapse)AuthorAgeFilesLines
* MDEV-11227 - mysqlimport -l doesn't issue UNLOCK TABLESSergey Vojtovich2016-12-218-80/+128
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implementation of MDEV-7660 introduced unwanted incompatible change: modifications under LOCK TABLES with autocommit enabled are rolled back on disconnect. Previously everything was committed, because LOCK TABLES didn't adjust autocommit setting. This patch restores original behavior by reverting some changes done in MDEV-7660: - sql/sql_parse.cc: do not reset autocommit on LOCK TABLES - sql/sql_base.cc: do not set autocommit on UNLOCK TABLES - test cases: main.lock_tables_lost_commit, main.partition_explicit_prune, rpl.rpl_switch_stm_row_mixed, tokudb.nested_txn_implicit_commit, tokudb_bugs.db806 But it makes InnoDB tables under LOCK TABLES ... READ [LOCAL] not protected against DML. To restore protection some changes from WL#6671 were merged, specifically MDL_SHARED_READ_ONLY and test cases. WL#6671 merge highlights: - Not all tests merged. - In MySQL LOCK TABLES ... READ acquires MDL_SHARED_READ_ONLY for all engines, in MariaDB MDL_SHARED_READ is always acquired first and then upgraded to MDL_SHARED_READ_ONLY for InnoDB only. - The above allows us to omit MDL_SHARED_WRITE_LOW_PRIO implementation in MariaDB, which is rather useless with InnoDB. In MySQL it is needed to preserve locking behavior between low priority writes and LOCK TABLES ... READ for non-InnoDB engines (covered by sys_vars.sql_low_priority_updates_func). - Omitted HA_NO_READ_LOCAL_LOCK, we rely on lock_count() instead. - Omitted "piglets": in MariaDB stream of DML against InnoDB table may lead to concurrent LOCK TABLES ... READ starvation. - HANDLER ... OPEN acquires MDL_SHARED_READ instead of MDL_SHARED in MariaDB. - Omitted SNRW->X MDL lock upgrade for IMPORT/DISCARD TABLESPAECE under LOCK TABLES. - Omitted strong locks for views, triggers and SP under LOCK TABLES. - Omitted IX schema lock for LOCK TABLES READ. - Omitted deadlock weight juggling for LOCK TABLES. Full WL#6671 merge status: - innodb.innodb-lock: fully merged - main.alter_table: not merged due to different HANDLER solution - main.debug_sync: fully merged - main.handler_innodb: not merged due to different HANDLER solution - main.handler_myisam: not merged due to different HANDLER solution - main.innodb_mysql_lock: fully merged - main.insert_notembedded: fully merged - main.lock: not merged (due to no strong locks for views) - main.lock_multi: not merged - main.lock_sync: fully merged (partially in MDEV-7660) - main.mdl_sync: not merged - main.partition_debug_sync: not merged due to different HANDLER solution - main.status: fully merged - main.view: fully merged - perfschema.mdl_func: not merged (no such test in MariaDB) - perfschema.table_aggregate_global_2u_2t: not merged (didn't fail in MariaDB) - perfschema.table_aggregate_global_2u_3t: not merged (didn't fail in MariaDB) - perfschema.table_aggregate_global_4u_2t: not merged (didn't fail in MariaDB) - perfschema.table_aggregate_global_4u_3t: not merged (didn't fail in MariaDB) - perfschema.table_aggregate_hist_2u_2t: not merged (didn't fail in MariaDB) - perfschema.table_aggregate_hist_2u_3t: not merged (didn't fail in MariaDB) - perfschema.table_aggregate_hist_4u_2t: not merged (didn't fail in MariaDB) - perfschema.table_aggregate_hist_4u_3t: not merged (didn't fail in MariaDB) - perfschema.table_aggregate_thread_2u_2t: not merged (didn't fail in MariaDB) - perfschema.table_aggregate_thread_2u_3t: not merged (didn't fail in MariaDB) - perfschema.table_aggregate_thread_4u_2t: not merged (didn't fail in MariaDB) - perfschema.table_aggregate_thread_4u_3t: not merged (didn't fail in MariaDB) - perfschema.table_lock_aggregate_global_2u_2t: not merged (didn't fail in MariaDB) - perfschema.table_lock_aggregate_global_2u_3t: not merged (didn't fail in MariaDB) - perfschema.table_lock_aggregate_global_4u_2t: not merged (didn't fail in MariaDB) - perfschema.table_lock_aggregate_global_4u_3t: not merged (didn't fail in MariaDB) - perfschema.table_lock_aggregate_hist_2u_2t: not merged (didn't fail in MariaDB) - perfschema.table_lock_aggregate_hist_2u_3t: not merged (didn't fail in MariaDB) - perfschema.table_lock_aggregate_hist_4u_2t: not merged (didn't fail in MariaDB) - perfschema.table_lock_aggregate_hist_4u_3t: not merged (didn't fail in MariaDB) - perfschema.table_lock_aggregate_thread_2u_2t: not merged (didn't fail in MariaDB) - perfschema.table_lock_aggregate_thread_2u_3t: not merged (didn't fail in MariaDB) - perfschema.table_lock_aggregate_thread_4u_2t: not merged (didn't fail in MariaDB) - perfschema.table_lock_aggregate_thread_4u_3t: not merged (didn't fail in MariaDB) - sys_vars.sql_low_priority_updates_func: not merged - include/thr_rwlock.h: not merged, rw_pr_lock_assert_write_owner and rw_pr_lock_assert_not_write_owner are macros in MariaDB - sql/handler.h: not merged (HA_NO_READ_LOCAL_LOCK) - sql/mdl.cc: partially merged (MDL_SHARED_READ_ONLY only) - sql/mdl.h: partially merged (MDL_SHARED_READ_ONLY only) - sql/lock.cc: fully merged - sql/sp_head.cc: not merged - sql/sp_head.h: not merged - sql/sql_base.cc: partially merged (MDL_SHARED_READ_ONLY only) - sql/sql_base.h: not merged - sql/sql_class.cc: fully merged - sql/sql_class.h: fully merged - sql/sql_handler.cc: merged partially (different solution in MariaDB) - sql/sql_parse.cc: partially merged, mostly omitted low priority write part - sql/sql_reload.cc: not merged comment change - sql/sql_table.cc: not merged SNRW->X upgrade for IMPORT/DISCARD TABLESPACE - sql/sql_view.cc: not merged - sql/sql_yacc.yy: not merged (MDL_SHARED_WRITE_LOW_PRIO, MDL_SHARED_READ_ONLY) - sql/table.cc: not merged (MDL_SHARED_WRITE_LOW_PRIO) - sql/table.h: not merged (MDL_SHARED_WRITE_LOW_PRIO) - sql/trigger.cc: not merged - storage/innobase/handler/ha_innodb.cc: merged store_lock()/lock_count() changes (in MDEV-7660), didn't merge HA_NO_READ_LOCAL_LOCK - storage/innobase/handler/ha_innodb.h: fully merged in MDEV-7660 - storage/myisammrg/ha_myisammrg.cc: not merged comment change - storage/perfschema/table_helper.cc: not merged (no MDL support in MariaDB PFS) - unittest/gunit/mdl-t.cc: not merged - unittest/gunit/mdl_sync-t.cc: not merged MariaDB specific changes: - handler.heap: different HANDLER solution, MDEV-7660 - handler.innodb: different HANDLER solution, MDEV-7660 - handler.interface: different HANDLER solution, MDEV-7660 - handler.myisam: different HANDLER solution, MDEV-7660 - main.mdl_sync: MDEV-7660 specific changes - main.partition_debug_sync: removed test due to different HANDLER solution, MDEV-7660 - main.truncate_coverage: removed test due to different HANDLER solution, MDEV-7660 - mysql-test/include/mtr_warnings.sql: additional cleanup, MDEV-7660 - mysql-test/lib/v1/mtr_report.pl: additional cleanup, MDEV-7660 - plugin/metadata_lock_info/metadata_lock_info.cc: not in MySQL - sql/sql_handler.cc: MariaDB specific fix for mysql_ha_read(), MDEV-7660
* Fixed bug mdev-11608.Igor Babaev2016-12-201-0/+63
| | | | | | | | | | | The fix for bug mdev-11488 introduced the virtual method convert_to_basic_const_item for the class Item_cache. The implementation of this method for the class Item_cache_str was not quite correct: the server could crash if the cached item was null. A similar problem could appear for the implementation of this method for the class Item_cache_decimal. Although I could not reproduce the problem I decided to change the code appropriately.
* MDEV-11570 JSON_MERGE returns incorrect result.Alexey Botchkov2016-12-201-0/+3
| | | | JSON merging fixed.
* Corrected a test from func_date_add.testIgor Babaev2016-12-201-0/+1
|
* Fixed bug mdev-11593.Igor Babaev2016-12-201-0/+38
| | | | | | | When a condition containing NULLIF is pushed into a materialized view/derived table the clone of the Item_func_nullif item must be processed in a special way to guarantee that the first argument points to the same item as the third argument.
* MDEV-11572 JSON_DEPTH returns wrong results.Alexey Botchkov2016-12-161-0/+3
| | | | JSON depth calculation fixed.
* MDEV-11569 JSON_ARRAY_INSERT produces an invalid result.Alexey Botchkov2016-12-161-1/+4
| | | | String insertion fixed.
* MDEV-JSON_CONTAINS_PATH returns incorrect results and produces wrong warning.Alexey Botchkov2016-12-161-0/+3
| | | | | The Item_func_json_contains_path was mistakenly set with the no '*' paths limitation.
* MDEV-11562 Assertion `js->state == JST_VALUE' failed in ↵Alexey Botchkov2016-12-161-0/+6
| | | | | | | | check_contains(json_engine_t*, json_engine_t*). check_contains() fixed. When an item of an array is a complex structure, it can be half-read after the end of the recursive check_contains() call. So we just manually get to it's ending.
* Adjusted test results after merge.Igor Babaev2016-12-141-14/+14
|
* Fixed bug mdev-11488.Igor Babaev2016-12-141-0/+374
| | | | | | | | | | | | The patch for bug mdev-10882 tried to fix it by providing an implementation of the virtual method build_clone for the class Item_cache. It's turned out that it is not easy provide a valid implementation for Item_cache::build_clone(). At the same time if the condition that can be pushed into a materialized view contains a cached item this item can be substituted for a basic constant of the same value. In such a way we can avoid building proper clones for Item_cache objects when constructing pushdown conditions.
* MDEV-11470 JSON_KEYS accepts arguments in invalid format.Alexey Botchkov2016-12-131-1/+14
| | | | Now JSON functions return warnings if arguments are invalid.
* bugfix: reset MODE_NO_BACKSLASH_ESCAPES during vcol parsingSergei Golubchik2016-12-121-0/+27
|
* Item_func_like: print a not like b instead of !(a like b)Sergei Golubchik2016-12-129-18/+18
|
* Item::print(): remove redundant parenthesesSergei Golubchik2016-12-12133-2053/+2099
| | | | | by introducing new Item::precedence() method and using it to decide whether parentheses are required
* MDEV-11066 use MySQL terminology for "virtual columns"Sergei Golubchik2016-12-123-10/+10
|
* store/show vcols as item->print()Sergei Golubchik2016-12-1249-679/+715
| | | | | | | | | | otherwise we'd need to store sql_mode *per vcol* (consider CREATE INDEX...) and how SHOW CREATE TABLE would support that? Additionally, get rid of vcol::expr_str, just to make sure the string is always generated and never leaked in the original form.
* bugfix: mark_columns_needed_for_updateSergei Golubchik2016-12-121-2/+2
| | | | | | cannot use TABLE:merge_keys for that, because Field::part_of_key was designed to mark fields for KEY_READ, so a field is not a "part of key", if only prefix of the field is.
* cleanup: remove Item::intro_versionSergei Golubchik2016-12-1221-276/+276
| | | | | and partition_info::set_show_version_string - they were already broken and impossible to maintain
* don't convert WEEK(x) to WEEK(x, @@default_week_format)Sergei Golubchik2016-12-122-2/+2
|
* bugfix: Item_func_spatial_collection::print()Sergei Golubchik2016-12-121-1/+9
|
* bugfix: Item_func_dyncol_add::print()Sergei Golubchik2016-12-121-0/+8
|
* bugfix: Item_func_weight_string::print()Sergei Golubchik2016-12-122-5/+10
|
* bugfix: Item_func_like::print() was losing ESCAPE clauseSergei Golubchik2016-12-121-0/+8
|
* bugfix: Item_func_get_system_var::print()Sergei Golubchik2016-12-121-0/+20
|
* MDEV-11453 JSON_CONTAINS returns incorrect values.Alexey Botchkov2016-12-111-0/+51
| | | | The weird logic of json_contains was implemented.
* MDEV-11469 JSON_SEARCH returns incorrect results.Alexey Botchkov2016-12-091-0/+6
| | | | Support for '**' in json path expressions added.
* MDEV-11489 Assertion `0' failed in json_find_path.Alexey Botchkov2016-12-081-0/+3
| | | | | When the json was just a scalar value, json_extract tried to parse after the value ended.
* MDEV-11447 JSON_MERGE merges valid JSON objects incorrectly.Alexey Botchkov2016-12-061-0/+3
| | | | Test case added.
* MDEV-11446 JSON_MERGE accepts arguments in invalid format.Alexey Botchkov2016-12-061-0/+3
| | | | Test case added.
* MDEV-11433 JSON_MERGE returns a non-NULL result with a NULL argument.Alexey Botchkov2016-12-061-0/+15
| | | | Item_func_json_merge fixed.
* MDEV-11440 JSON has become a reserved word in MariaDB.Alexey Botchkov2016-12-061-0/+7
| | | | 'JSON' made possible identifier.
* MDEV-11468 JSON_UNQUOTE returns incorrect results.Alexey Botchkov2016-12-061-0/+3
| | | | Now return the argument's value when error.
* MDEV-11467 JSON_EXTRACT returns incorrect results.Alexey Botchkov2016-12-051-0/+6
| | | | Item_func_json_extract::val_str fixed.
* MDEV-11465 JSON_LENGTH returns incorrect length.Alexey Botchkov2016-12-051-0/+9
| | | | Item_func_json_length::val_int fixed.
* MDEV-11448 Assertion `*p_cur_step < p->last_step' failed in ↵Alexey Botchkov2016-12-051-0/+3
| | | | | | strings/json_lib.c handle_match. Test case added.
* MDEV-11471 JSON_ARRAY_APPEND returns incorrect results.Alexey Botchkov2016-12-051-0/+3
| | | | Item_func_json_array_append::val_str fixed.
* MDEV-11472 JSON_ARRAY_INSERT returns incorrect results.Alexey Botchkov2016-12-051-8/+11
| | | | Item_func_json_array_insert::val_str fixed.
* MDEV-11473 JSON_REMOVE returns invalid results.Alexey Botchkov2016-12-051-1/+1
| | | | Item_func_json_remove::val_str fixed.
* MDEV-11474 JSON_DEPTH returns incorrect results.Alexey Botchkov2016-12-051-0/+6
| | | | Item_func_json_depth::val_int fixed.
* MDEV-11461 JSON_TYPE does not recognize integer/double types.Alexey Botchkov2016-12-051-1/+4
| | | | Integer/Double recognition added.
* MDEV-11452 JSON_CONTAINS accepts wrong number of arguments.Alexey Botchkov2016-12-051-0/+2
| | | | Create_func_json_contains::create_native fixed.
* MDEV-11445 JSON_MERGE requires at least two arguments in MySQL, but not in ↵Alexey Botchkov2016-12-051-0/+2
| | | | | | MariaDB. Create_func_json_merge::create_native fixed.
* MDEV-11437 JSON_QUOTE function does not quote and uses wrong character set.Alexey Botchkov2016-12-051-1/+11
| | | | json_quote fixed.
* MDEV-11436 CREATE TABLE .. AS SELECT JSON_OBJECT truncates data.Alexey Botchkov2016-12-051-0/+10
| | | | | fix_length_and_dec() didn't calculate the length of the result properly.
* MDEV-11438 Assertion `null_value' failed in Item::send(Protocol*, String*) ↵Alexey Botchkov2016-12-051-0/+3
| | | | | | upon casting NULL as JSON. test added.
* MDEV-11464 Server crashes in mark_object upon JSON_VALID.Alexey Botchkov2016-12-031-0/+3
| | | | Depth of nested objects should be controlled.
* MDEV-11463 Server crashes in mark_array upon JSON_VALID.Alexey Botchkov2016-12-031-0/+3
| | | | The depth of nested arrays should be controlled, as it's limited.
* MDEV-11450 Assertion `!null_value' failed invirtual bool Item::send on ↵Alexey Botchkov2016-12-031-0/+9
| | | | | | | json_search. Item_func_json_search::val_str didn't set the null_value properly. So that affected the next record in the resultset.
* MDEV-11449 Server crashes in Item_func_or_sum::agg_item_collations.Alexey Botchkov2016-12-031-0/+6
| | | | JSON_ARRAY didn't expect 0 arguments.