- 08 Nov, 2018 1 commit
-
-
Alexander Barkov authored
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.
-
- 07 Nov, 2018 1 commit
-
-
Alexander Barkov authored
-
- 06 Nov, 2018 5 commits
-
-
Igor Babaev authored
when using brackets Do not create master unit for select if it has already one.
-
Marko Mäkelä authored
-
Marko Mäkelä authored
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.
-
Marko Mäkelä authored
Remove trailing white space, and use lower case for "eval" and "let". Add an "End of 10.2 tests" marker to ease future merges.
-
Marko Mäkelä authored
-
- 05 Nov, 2018 9 commits
-
-
Sergei Petrunia authored
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.
-
Sergei Petrunia authored
Update .result files after the previous patch
-
Sergei Petrunia authored
Continuation of the fix: Make condition selectivity estimate use the right estimate, too.
-
Sergei Petrunia authored
Reuse the fix for MDEV-17518 here, too.
-
Sergei Petrunia authored
-
Marko Mäkelä authored
-
Marko Mäkelä authored
The relevant InnoDB/XtraDB fixes up to 5.6.42 had already been applied to MariaDB in commit 30c3d6db. Revert some changes that appeared in the merge commit 87d852f1.
-
Marko Mäkelä authored
-
Eugene Kosov authored
Problem affects INPLACE ALTER rename columns. innobase_rename_column_try(): some strcmp() was replaced with my_strcasecmp(), queries to update data dictionary was updated to not match column name case.
-
- 04 Nov, 2018 2 commits
-
-
Sergei Golubchik authored
MDEV-17349 Assertion `!table || (!table->read_set || bitmap_is_set(table->read_set, field_index))' failed on concurrent SELECT and DELETE after RENAME from table with index on virtual column Race condition. field->flags were copied from s->field->flags during field->clone(), early in open_table_from_share(). But s->field->flags were getting their PART_INDIRECT_KEY_FLAG bit much later in TABLE::mark_columns_used_by_virtual_fields() and only once per share. If two threads were executing the code between field->clone() and mark_columns_used_by_virtual_fields() at the same time, only one would get PART_INDIRECT_KEY_FLAG bits in field[].
-
Alexander Barkov authored
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.
-
- 03 Nov, 2018 1 commit
-
-
Alexey Botchkov authored
LOCK view WRITE shouldn't block FLUSH view. So we set the view's mdl_request type to it's tables.
-
- 02 Nov, 2018 4 commits
-
-
Marko Mäkelä authored
thd_rpl_stmt_based(): A new predicate to check if statement-based replication is active. (This can also hold when replication is not in use, but binlog is.) que_thr_stop(), row_ins_duplicate_error_in_clust(), row_ins_sec_index_entry_low(), row_ins(): On a duplicate key error, only lock all index records when statement-based replication is in use.
-
Daniel Bartholomew authored
-
Marko Mäkelä authored
-
Marko Mäkelä authored
-
- 01 Nov, 2018 12 commits
-
-
Vicențiu Ciorbaru authored
Users expect window functions to produce a certain ordering of rows in the final result set. Although the standard does not require this, we already have the filesort result done for when we computed the window function. If there is no ORDER BY attached to the query, just keep it till the SELECT is completely evaluated and use that to print the result. Update test cases as many did not take care to guarantee a stable result.
-
Marko Mäkelä authored
ha_innobase::check_if_supported_inplace_alter(): Remove a redundant condition and defer some computations. If INNOBASE_ALTER_VERSIONED_REBUILD is set, innobase_need_rebuild() will necessarily hold. Therefore, it is not necessary to assign need_rebuild at the start of the function.
-
Daniel Bartholomew authored
-
Sergei Golubchik authored
set both `password` and `authentication_string` columns in `mysql`.`user` table for now. Suppress the "password was ignored" warning if the password is the same as the authentication string
-
Aleksey Midenkov authored
MDEV-17038 ALTER TABLE CHANGE COLUMN c1 c1 bigint NOT NULL - generates error if table uses SYSTEM VERSIONING * Fine-grained inplace skipping by INNOBASE_ALTER_VERSIONED_REBUILD; * Fixed column WITHOUT SYSTEM VERSIONING + ADD COLUMN; * Fixed instant field change (MDEV-16330); * Revisited test versioning.online; * Merged the test versioning.trx_id_versioning_attribute_persistence to versioning.online; * Renamed some versioning functions: ** change_fields_versioning_cache() -> vers_change_fields_cache() ** change_field_versioning_try() -> vers_change_field_try() Skip condition moved out of func. Closes tempesta-tech/mariadb#414 Closes tempesta-tech/mariadb#540 Related to tempesta-tech/mariadb#281
-
Andrei Elkin authored
which did not always correctly simulated io-cache::end_of_file. The error was caused by implicit cast to unsigned of an intemediate term in a formula.
-
Alexander Barkov authored
It seems Item_cache_time::val_datetime_packed() is never caller in the current code. Fixing it to use to_packed() rather than to_longlong() anyway.
-
Marko Mäkelä authored
The parameters bool sync=true, bool read_only=false of mtr_t::start() were added in https://github.com/mysql/mysql-server/commit/eca5b0fc17a5bd6d4833d35a0d08c8549dd3b5ec (MySQL 5.7.3). The parameter read_only was never used anywhere. The parameter sync was only copied around, and would be returned by the unused function mtr_t::is_async(). We do not need this dead code in MariaDB.
-
Marko Mäkelä authored
At the start of the function, we already dereferenced node, so the checks for NULL are unnecessary and redundant.
-
Varun Gupta authored
For index merge union[or sort union], the estimates are not taken into account while calculating the selectivity of a condition. So instead of showing the estimates of the index merge union[or sort union], it shows estimates equal to all the records of the table. The fix for the issue is to include the selectivity of index merge union[or sort union] while calculating the selectivity of a condition.
-
Jan Lindström authored
branch.
-
Jan Lindström authored
-
- 31 Oct, 2018 5 commits
-
-
Elena Stepanova authored
-
Sergei Golubchik authored
-
Vladislav Vaintroub authored
Query INFORMATION_SCHEMA.INNODB_SYS_TABLES only once, and cache results. As a small cleanup, remove mdl_lock_con_mutex, the MDL handling connection is never accessed by multiple threads at the same time.
-
Sergei Golubchik authored
-
Sergei Golubchik authored
sql\sql_acl.cc(3114): error C2220: warning treated as error - no 'object' file generated sql\sql_acl.cc(3114): warning C4390: ';': empty controlled statement found; is this the intent?
-