summaryrefslogtreecommitdiff
path: root/mysql-test/main
Commit message (Collapse)AuthorAgeFilesLines
* Merge 10.3 into 10.4Marko Mäkelä2018-12-074-5/+57
|\
| * Merge 10.2 into 10.3Marko Mäkelä2018-12-074-5/+57
| |
* | Move deletion of old GTID rows to slave background threadKristian Nielsen2018-12-071-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch changes how old rows in mysql.gtid_slave_pos* tables are deleted. Instead of doing it as part of every replicated transaction in record_gtid(), it is done periodically (every @@gtid_cleanup_batch_size transaction) in the slave background thread. This removes the deletion step from the replication process in SQL or worker threads, which could speed up replication with many small transactions. It also decreases contention on the global mutex LOCK_slave_state. And it simplifies the logic, eg. when a replicated transaction fails after having deleted old rows. With this patch, the deletion of old GTID rows happens asynchroneously and slightly non-deterministic. Thus the number of old rows in mysql.gtid_slave_pos can temporarily exceed @@gtid_cleanup_batch_size. But all old rows will be deleted eventually after sufficiently many new GTIDs have been replicated.
* | Fix windows build : re-record .result fileVladislav Vaintroub2018-12-061-2/+1
| |
* | Windows : create a minimalistic MTR test for mysql_install_db.exeVladislav Vaintroub2018-12-062-0/+32
| | | | | | | | | | | | only --datadir option is tested in this test. Other options (notably --password and --service) would need another, more comprehensive test.
* | MDEV-15649 Speedup search in acl_users and acl_dbs array,Vladislav Vaintroub2018-12-062-12/+12
| | | | | | | | | | | | | | | | sorting them by usernames first, and then by get_sort() value. Search functions now use binary search to find the the first entry with given name. Then, linear search is done, until the first match.
* | Merge 10.3 into 10.4Marko Mäkelä2018-12-042-0/+87
|\ \ | |/
| * Merge 10.2 into 10.3Marko Mäkelä2018-12-042-0/+87
| |
* | Enable main.connect-abstractSergey Vojtovich2018-12-041-1/+0
| |
* | MDEV-17319 Assertion `ts_type != MYSQL_TIMESTAMP_TIME' failed upon inserting ↵Alexander Barkov2018-12-023-6/+27
| | | | | | | | into TIME field
* | Making the test for MDEV-17854 independent from the host time zoneAlexander Barkov2018-11-282-1/+5
| |
* | MDEV-17854 Assertion `decimals <= 6' failed in my_time_fraction_remainder on ↵Alexander Barkov2018-11-282-0/+16
| | | | | | | | SELECT with NULLIF and FROM_UNIXTIME on incorrect time
* | MDEV-15073: Generic UDAF parser code in server for windows functionsOleksandr Byelkin2018-11-272-0/+171
| | | | | | | | | | | | Added support for usual agreggate UDF (UDAF) Added remove() call support for more efficient window function processing Added example of aggregate UDF with efficient windows function support
* | MDEV-16991 Rounding vs truncation for TIME, DATETIME, TIMESTAMPbb-10.4-mdev16991Alexander Barkov2018-11-2618-13/+3240
| |
* | Merge 10.3 into 10.4Marko Mäkelä2018-11-213-0/+8
|\ \ | |/
| * Check that default() do not see invisible field.Oleksandr Byelkin2018-11-202-0/+4
| |
| * Merge 10.2 into 10.3Marko Mäkelä2018-11-201-0/+4
| |
* | MDEV-17776 CAST(x AS INTERVAL DAY_SECOND(N))Alexander Barkov2018-11-204-53/+234
| |
* | Merge 10.3 into 10.4Marko Mäkelä2018-11-1926-17/+807
|\ \ | |/
| * Merge 10.2 into 10.3Marko Mäkelä2018-11-1919-9/+597
| |
| * MDEV-17278 CURSOR FOR LOOP - ERROR: unexpected end of stream, read 0 bytes ↵Alexander Barkov2018-11-142-0/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (SERVER CRASH) sp_instr_cursor_copy_struct::exec_core() created TYPELIBs on a wrong mem_root, the one which is initialized in sp_head::execute(), this code: /* init per-instruction memroot */ init_sql_alloc(&execute_mem_root, "per_instruction_memroot", MEM_ROOT_BLOCK_SIZE, 0, MYF(0)); This memory root cleans up after every sp_instr_xxx executed, so later sp_instr_cfetch::execute() tried to use already freed and trashed memory. Changing sp_instr_cursor_copy_struct::exec_core() to call tmp.export_structure() inside this block (not outside of it): thd->set_n_backup_active_arena(thd->spcont->callers_arena, &current_arena); ... thd->restore_active_arena(thd->spcont->callers_arena, &current_arena); So now TYPELIBs created by sp_instr_cursor_copy_struct::exec_core() are still available and valid when sp_instr_cfetch::execute() is called. They are freed at the end of dispatch_command() corresponding to the "CALL p1" statement.
| * MDEV-17253 Oracle compatibility: The REVERSE key word for FOR loop behaves ↵Alexander Barkov2018-11-133-8/+8
| | | | | | | | incorrectly
| * MDEV-16241 Assertion `inited==RND' failed in handler::ha_rnd_end()Aleksey Midenkov2018-11-132-0/+21
| | | | | | | | | | | | | | Discrepancy in open indexes due to overwritten `read_partitions` upon `ha_open()` in `ha_partition::clone()`. [Fixes tempesta-tech/mariadb#551]
| * MDEV-17693 Shift/reduce conflicts for NAMES,ROLE,PASSWORD in the ↵Alexander Barkov2018-11-132-0/+139
| | | | | | | | option_value_no_option_type grammar
* | MDEV-17740 Extend EXTRACT(x AS DAY*) to understand long time intervalsAlexander Barkov2018-11-174-10/+808
| |
* | Merge 10.3 into 10.4mariadb-10.4.0Marko Mäkelä2018-11-0810-0/+292
|\ \ | |/
| * Merge 10.2 into 10.3Marko Mäkelä2018-11-082-0/+214
| |
| * Merge 10.2 into 10.3Marko Mäkelä2018-11-072-0/+27
| |
| * MDEV-16697: Fix difference between 32bit/windows and 64bit systems in ↵Oleksandr Byelkin2018-11-072-0/+38
| | | | | | | | allowed select nest level
| * MDEV-14429 sql_safe_updates in my.cnf not workSergei Golubchik2018-11-063-0/+8
| | | | | | | | add a test case
| * MDEV-14429 sql_safe_updates in my.cnf not workVladislav Vaintroub2018-11-061-0/+5
| |
* | MDEV-17563 Different results using table or view when comparing values of ↵Alexander Barkov2018-11-0821-138/+256
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | time type MDEV-17625 Different warnings when comparing a garbage to DATETIME vs TIME - Splitting processes of data type conversion (to TIME/DATE,DATETIME) and warning generation. Warning are now only get collected during conversion (in an "int" variable), and are pushed in the very end of conversion (not in parallel). Warnings generated by the low level routines str_to_xxx() and number_to_xxx() can now be changed at the end, when TIME_FUZZY_DATES is applied, from "Invalid value" to "Truncated invalid value". Now "Illegal value" is issued only when the low level routine returned an error and TIME_FUZZY_DATES was not set. Otherwise, if the low level routine returned "false" (success), or if NULL was converted to a zero datetime by TIME_FUZZY_DATES, then "Truncated illegal value" is issued. This gives better warnings. - Methods Type_handler::Item_get_date() and Type_handler::Item_func_hybrid_field_type_get_date() now only convert and collect warning information, but do not push warnings. - Changing the return data type for Type_handler::Item_get_date() and Type_handler::Item_func_hybrid_field_type_get_date() from "bool" to "void". The conversion result (success vs error) can be checked by testing ltime->time_type. MYSQL_TIME_{NONE|ERROR} mean mean error, other values mean success. - Adding new wrapper methods Type_handler::Item_get_date_with_warn() and Type_handler::Item_func_hybrid_field_type_get_date_with_warn() to do conversion followed by raising warnings, and changing the code to call new Type_handler::***_with_warn() methods. - Adding a helper class Temporal::Status, a wrapper for MYSQL_TIME_STATUS with automatic initialization. - Adding a helper class Temporal::Warn, to collect warnings but without actually raising them. Moving a part of ErrConv into a separate class ErrBuff, and deriving both Temporal::Warn and ErrConv from ErrBuff. The ErrBuff part of Temporal::Warn is used to collect textual representation of the input data. - Adding a helper class Temporal::Warn_push. It's used to collect warning information during conversion, and automatically pushes warnings to the diagnostics area on its destructor time (in case of non-zero warning). - Moving more code from various functions inside class Temporal. - Adding more Temporal_hybrid constructors and protected Temporal methods make_from_xxx(), which convert and only collect warning information, but do not actually raise warnings. - Now the low level functions str_to_datetime() and str_to_time() always set status->warning if the return value is "true" (error). - Now the low level functions number_to_time() and number_to_datetime() set the "*was_cut" argument if the return value is "true" (error). - Adding a few DBUG_ASSERTs to make sure that str_to_xxx() and number_to_xxx() always set warnings on error. - Adding new warning flags MYSQL_TIME_WARN_EDOM and MYSQL_TIME_WARN_ZERO_DATE for the code symmetry. Before this change there was a special code path for (rc==true && was_cut==0) which was treated by Field_temporal::store_invalid_with_warning as "zero date violation". Now was_cut==0 always means that there are no any error/warnings/notes to be raised, not matter what rc is. - Using new Temporal_hybrid constructors in combination with Temporal::Warn_push inside str_to_datetime_with_warn(), double_to_datetime_with_warn(), int_to_datetime_with_warn(), Field::get_date(), Item::get_date_from_string(), and a few other places. - Removing methods Dec_ptr::to_datetime_with_warn(), Year::to_time_with_warn(), my_decimal::to_datetime_with_warn(), Dec_ptr::to_datetime_with_warn(). Fixing Sec6::to_time() and Sec6::to_datetime() to convert and only collect warnings, without raising warnings. Now warning raising functionality resides in Temporal::Warn_push. - Adding classes Longlong_hybrid_null and Double_null, to return both value and the "IS NULL" flag. Adding methods Item::to_double_null(), to_longlong_hybrid_null(), Item_func_hybrid_field_type::to_longlong_hybrid_null_op(), Item_func_hybrid_field_type::to_double_null_op(). Removing separate classes VInt and VInt_op, as they have been replaced by a single class Longlong_hybrid_null. - Adding a helper method Temporal::type_name_by_timestamp_type(), moving a part of make_truncated_value_warning() into it, and reusing in Temporal::Warn::push_conversion_warnings(). - Removing Item::make_zero_date() and Item_func_hybrid_field_type::make_zero_mysql_time(). They provided duplicate functionality. Now this code resides in Temporal::make_fuzzy_date(). The latter is now called for all Item types when data type conversion (to DATE/TIME/DATETIME) is involved, including Item_field and Item_direct_view_ref. This fixes MDEV-17563: Item_direct_view_ref now correctly converts NULL to a zero date when TIME_FUZZY_DATES says so.
* | MDEV-17634 Regression: TIME(0)=TIME('z') returns NULL vs 1Alexander Barkov2018-11-072-0/+35
| |
* | MDEV-16357 LIMIT and ORDER BY clause is ignored on a query with UNIONIgor Babaev2018-11-062-0/+42
| | | | | | | | | | | | when using brackets Do not create master unit for select if it has already one.
* | Merge 10.3 into 10.4Marko Mäkelä2018-11-0647-5454/+6360
|\ \ | |/
| * Merge 10.2 into 10.3Marko Mäkelä2018-11-0643-5463/+6110
| | | | | | | | | | | | | | | | | | main.derived_cond_pushdown: Move all 10.3 tests to the end, trim trailing white space, and add an "End of 10.3 tests" marker. Add --sorted_result to tests where the ordering is not deterministic. main.win_percentile: Add --sorted_result to tests where the ordering is no longer deterministic.
| * MDEV-17518: Range optimization doesn't use ON expressions from nested outer ↵Sergei Petrunia2018-11-053-0/+47
| | | | | | | | | | | | | | joins Part#2: take into account that join nest that we are marking as constant might already have constant tables in it. Don't count these tables twice.
| * MDEV-17518: Range optimization doesn't use ON expressions from nested outer ↵Sergei Petrunia2018-11-051-0/+32
| | | | | | | | | | | | joins Update .result files after the previous patch
| * MDEV-17518: Range optimization doesn't use ON expressions from nested outer ↵Sergei Petrunia2018-11-052-0/+55
| | | | | | | | | | | | | | joins Continuation of the fix: Make condition selectivity estimate use the right estimate, too.
| * MDEV-17493: Partition pruning doesn't work for nested outer joinsSergei Petrunia2018-11-052-0/+64
| | | | | | | | Reuse the fix for MDEV-17518 here, too.
| * MDEV-17518: Range optimization doesn't use ON expressions from nested outer ↵Sergei Petrunia2018-11-054-1/+63
| | | | | | | | joins
* | MDEV-17607 DATE(COALESCE(year_column)) returns a wrong resultAlexander Barkov2018-11-042-0/+18
| | | | | | | | | | | | | | | | | | | | C++ does not guarantee the order of parameter evaluation. It was wrong to pass item->val_int() and item->null_value at the same time to any function or constructor. Adding a new helper class Longlong_null, and new methods Item::to_longlong_null() and Item_func_hybrid_field_type::to_longlong_null_op(), which make sure to properly call val_int()/int_op() and test null_value. Reorganizing the rest of the code accordingly.
* | MDEV-12321 authentication plugin: SET PASSWORD supportSergei Golubchik2018-10-3115-43/+199
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | misc cleanupsSergei Golubchik2018-10-312-21/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | * remove dead code (from .yy) * remove redundant commands from the test * extract common code into a reusable function (get_auth_plugin, push_new_user) * rename update_user_table->update_user_table_password * simplify acl_update_user * don't strdup a string that's already in a memroot (in ACL_ROLE::ACL_ROLE(ACL_USER*)) * create parent_grantee and role_grants dynamic arrays with size 0. to avoid any memory allocations when roles aren't used.
* | Use mysql.user.authentication_string for passwordSergei Golubchik2018-10-3122-192/+203
| | | | | | | | | | | | | | | | | | | | | | | | Don't distinguish between a "password hash" and "authentication string" anymore. Now both are stored in mysql.user.authentication_string, both are handled identically internally. A "password hash" is just how some particular plugins interpret authentication string. Set mysql.user.plugin even if there is no password. The server will use mysql_native_password plugin in these cases, let's make it expicit. Remove LEX_USER::pwhash.
* | cleanup: get rid of a SQL warning in a testSergei Golubchik2018-10-312-32/+0
| |
* | my_print_defaults: remove --config-file/extra-fileDaniel Black2018-10-311-1/+1
| | | | | | | | | | | | There have been deprecated since before 5.5 Closes #548
* | MDEV-16294 post-merge cleanupsSergei Golubchik2018-10-312-4/+5
| | | | | | | | Closes #757
* | MDEV-16294: remove INSTALL SONAME IF EXISTS optionDaniel Black2018-10-312-7/+2
| | | | | | | | | | | | | | | | As it isn't used. This leaves a less clustered syntax for a INSTALL IF EXISTS SONAME option which could be added later. This option could be checking the existance of the soname rather than the installed plugin name which the rest of the INSTALL IF NOT EXISTS is focused around.`
* | MDEV-16294: postfix - INSTALL PLUGIN IF NOT EXISTSDaniel Black2018-10-312-24/+63
| | | | | | | | | | | | Fix also UNINSTALL SONAME IF EXISTS Complete test case to INSTALL/UNINSTALL errors are generated