Commit graph

64254 commits

Author SHA1 Message Date
Nirbhay Choubey
38f3b99d46 MDEV-8831 : enforce_storage_engine doesn't block table creation on other nodes
Check if the engine is supported/allowed before replicating the
statement.
2015-10-01 20:36:25 -04:00
Alexander Barkov
accf9b5675 MDEV-5694 GREATEST(date, time) returns a wrong data type 2015-10-01 20:01:35 +04:00
Sergey Vojtovich
a84fae27d9 MDEV-8836 - Server crashed in my_copy_8bit on querying I_S.PROCESSLIST
Fixed race condition in code filling INFORMATION_SCHEMA.PROCESSLIST.INFO_BINARY.
When loading query string/length of another connection one must have
LOCK_thd_data locked.
2015-10-01 17:39:09 +04:00
Alexander Barkov
b50c607056 MDEV-4848 Wrong metadata or column type for LEAST(1.0,'10')
MDEV-8873 Wrong field type or metadata for LEAST(int_column,string_column)
2015-10-01 14:07:42 +04:00
Alexander Barkov
cb2c799bd0 MDEV-8860 Wrong result for WHERE 2016 < SOME (SELECT CAST(time_column AS DATETIME) FROM t1)
MDEV-8875 Wrong metadata for MAX(CAST(time_column AS DATETIME))
2015-09-30 16:04:24 +04:00
Alexander Barkov
cc9cfecab7 MDEV-8865 Wrong field type or metadata for COALESCE(signed_int_column, unsigned_int_column)
Item_func_hybrid_field_type did not return correct field_type(), cmp_type()
and result_type() in some cases, because cached_result_type and
cached_field_type were set in independent pieces of the code and
did not properly match to each other.
Fix:
- Removing Item_func_hybrid_result_type
- Deriving Item_func_hybrid_field_type directly from Item_func
- Introducing a new class Type_handler which guarantees that
  field_type(), cmp_type() and result_type() are always properly synchronized
  and using the new class in Item_func_hybrid_field_type.
2015-09-30 12:37:34 +04:00
Alexander Barkov
09b87d6293 MDEV-8871 Wrong result for CREATE TABLE .. SELECT LEAST(unsigned_column,unsigned_column) 2015-09-30 10:05:16 +04:00
Alexander Barkov
a4e5902039 MDEV-8862 Wrong field type for MAX(COALESCE(datetime_column)) 2015-09-28 19:12:05 +04:00
Alexander Barkov
3cc6e5b7f2 MDEV-8852 Implicit or explicit CAST from MAX(string) to INT,DOUBLE,DECIMAL does not produce warnings 2015-09-28 12:51:02 +04:00
Nirbhay Choubey
6927459e5b MDEV-8208: Sporadic SEGFAULT on startup
Addendum:
* Before calling THD::init_for_queries(), flip the current_thd to wsrep
thread so that memory gets allocated for the right THD.
* Use wsrep_creating_startup_threads instead of plugins_are_initialized
as the condition for the execution of THD::init_for_queries() within
start_wsrep_THD(), as use of latter could still leave some room for
race.
2015-09-25 18:50:57 -04:00
Nirbhay Choubey
59037d9629 MDEV-8208: Sporadic SEGFAULT on startup
Problem:
When mysqld starts as a galera node, it creates 2 system threads
(applier & rollbacker) using start_wsrep_THD(). These threads are
created before plugin initialization (plugin_init()) for SST methods
like rsync and xtrabackup.

The threads' initialization itself can proceed in parallel to mysqld's
main thread of execution. As a result, the thread initialization code
(start_wsrep_THD()) can end up accessing some un/partially initialized
structures (like maria_hton, in this particular case) resulting in
segfault.

Solution:
Fixed by calling THD::init_for_queries() (which accesses maria_hton)
only after the plugins have been initialized.
2015-09-25 18:24:39 -04:00
Alexander Barkov
30711c6650 MDEV-8806 Numeric CAST produce different warnings for strings literals vs functions 2015-09-25 21:33:50 +04:00
Sergei Golubchik
9554342d16 Merge branch '10.1' into pull-request-97
Merge downstream Debian packaging (MDEV-6284)
2015-09-25 10:24:14 +02:00
Sergei Petrunia
125001881d Fix typos in JSON MRR output 2015-09-24 16:31:45 +03:00
Sergei Petrunia
7016621596 MDEV-8829: Assertion `0' failed in Explain_table_access::tag_to_json
- Add EXPLAIN/ANALYZE FORMAT=JSON handling for a few special cases.
2015-09-24 15:45:54 +03:00
Alexander Barkov
428f03c0b5 MDEV-8839 COLUMN_GET() produces warnings with no data 2015-09-24 15:48:02 +04:00
Alexander Barkov
3ad035f66b MDEV-8658 DATE(zerofill_column) and DATE(COALESCE(zerofill_column)) return different results
MDEV-8660 TIME(int_zerofill_column) returns a wrong result
2015-09-23 20:42:28 +04:00
Alexander Barkov
212698b152 MDEV-8253 EXPLAIN SELECT prints unexpected characters
Item_string::clone_item() creates a new Item_string that
points exactly to the same buffer that the original one does.
Later, Item_string::print() uses c_ptr() for the original Item_string,
which reallocs the original buffer, and the clone remain with
the old freed buffer.
Refactoring the code not to use c_ptr() in Item_string::print().
2015-09-23 13:04:28 +04:00
Alexander Barkov
5c9c8ef1ea MDEV-3929 Add system variable explicit_defaults_for_timestamp for compatibility with MySQL 2015-09-22 14:01:54 +04:00
Sergei Petrunia
e96f3c79b9 MDEV-8779: mysqld got signal 11 in sql/opt_range_mrr.cc:100(step_down_to)
Post fix: initialize a variable
2015-09-22 00:57:29 +03:00
Alexander Barkov
22cc8f990b Changing a number of functions to aggregate argument character sets
and collations from the global name space into private and protected
methods in Item_func_or_sum.
2015-09-21 19:04:32 +04:00
Sergei Petrunia
9b9e36ed49 MDEV-8779: mysqld got signal 11 in sql/opt_range_mrr.cc:100(step_down_to)
The crash was caused by range optimizer using RANGE_OPT_PARAM::min_key
(and max_key) to store keys. Buffer size was a good upper bound for
range analysis and partition pruning, but not for EITS selectivity
calculations.

Fixed by making these buffers variable-size. The sizes are calculated
from [pseudo]indexes used for range analysis.
2015-09-21 17:08:27 +03:00
Alexander Barkov
c8db0df2da Removing "DTCollation Arg_comparator::cmp_collation".
Using a CHARSET_INFO pointer instead.
2015-09-21 16:18:20 +04:00
Alexander Barkov
2dc32c02ab Removing "DTCollation user_var_entry::collation", using a CHARSET_INFO
pointer instread, as the "derivation" and "repertoire" parts of
DTCollation were not really used by user_var_entry.
2015-09-21 15:52:50 +04:00
Alexander Barkov
afa1773439 Moving Item_args::arg_count from "public" to "protected". 2015-09-21 12:40:07 +04:00
Alexander Barkov
1956340247 Removing global function agg_item_charsets_for_string_result().
Moving agg_arg_charsets_for_string_result() and
agg_arg_charsets_for_string_result_with_comparison() inside
"protected" section in Item_func_or_sum.
2015-09-21 12:21:46 +04:00
Oleksandr Byelkin
f727fb45d4 Fix to make os_thread_id it compiled on windows. 2015-09-20 20:23:16 +02:00
Alexander Barkov
b75c003372 MDEV-8816 Equal field propagation is not applied for WHERE varbinary_column>=_utf8'a' COLLATE utf8_general_ci AND varbinary_column='A';
1. Removing the legacy code that disabled equal field propagation in cases
   when comparison is done as VARBINARY. This is now correctly handled by
   the new propagation code in Item_xxx::propagate_equal_fields() and
   Field_str::can_be_substituted_to_equal_item (the bug fix).
2. Also, removing legacy (pre-MySQL-4.1) Arg_comparator methods
   compare_binary_string() and compare_e_binary_string(), as VARBINARY
   comparison is correcty handled in compare_string() and compare_e_string() by
   the corresponding VARBINARY collation handler implemented in my_charset_bin.
   (not really a part of the bug fix)
2015-09-18 23:03:35 +04:00
Oleksandr Byelkin
da3ec3d421 MDEV-7970: EXPLAIN FORMAT=JSON does not print HAVING
Printing non-trivial HAVING added.
2015-09-18 16:08:13 +02:00
Alexander Barkov
79140b0383 MDEV-8793 Wrong result set for SELECT ...
WHERE COALESCE(time_column)=TIME('00:00:00')
            AND COALESCE(time_column)=DATE('2015-09-11')
MDEV-8814 Wrong result for WHERE datetime_column > TIME('00:00:00')
2015-09-18 13:30:44 +04:00
Alexander Barkov
f789158ddf The patch for MDEV-8466 revealed a bug in str2my_decimal,
which did not return a correct "end_of_num" pointer in case
of character sets with mbminlen>1 (ucs2, utf16, utf16le, utf32).
The bug caused sporadic test failures on BuildBot,
as well "uninitialized memory read" errors in valgrind builds.
2015-09-17 19:49:49 +04:00
Oleksandr Byelkin
7dd137c4ac MDEV-6756: map a linux pid (child pid) to a connection id shown in the output of SHOW PROCESSLIST
Added tid (thread ID) for system where it is present.

 ps -eL -o tid,pid,command

shows the thread on Linux
2015-09-17 14:30:58 +02:00
Alexander Barkov
d9b25ae3db MDEV-8466 CAST works differently for DECIMAL/INT vs DOUBLE for empty strings
MDEV-8468 CAST and INSERT work differently for DECIMAL/INT vs DOUBLE for a string with trailing spaces
2015-09-17 11:05:07 +04:00
Jan Lindström
173e486950 MDEV-8576: Bootstrap should ignore --enforce-storage-engine option
Allow enforce-storage-engine="" option and use that on mysql_install_db
when doing bootstrap.
2015-09-16 13:14:19 +03:00
Nirbhay Choubey
bb52905432 MDEV-8034 : wsrep_node_address can't be IPV6
Updated address parsing logic to include IPv6 format.
2015-09-15 18:58:08 -04:00
Alexander Barkov
3a0df3cf3c MDEV-8372 Use helper methods introduced in MDEV-7824 all around the code 2015-09-15 10:11:52 +04:00
Sergei Golubchik
e3e2bbe5e0 MDEV-6284 Merge downstream Debian/Ubuntu packaging into upstream MariaDB
Merge branch 'ottok-ok-debpkg-10.1' into 10.1
2015-09-14 10:58:38 +02:00
Alexander Barkov
6cc2e7ea5d MDEV-8795 Equal expression propagation does not work for temporal literals 2015-09-13 23:32:10 +04:00
Jan Lindström
9b577edd50 MDEV-8577: With enforce-storage-engine mysql_upgrade corrupts the schema:
ALTER TABLE should either bypass enforce-storage-engine, or mysql_upgrade
should refuse to run

Allow user to alter contents of existing table without enforcing
storage engine. However, enforce storage engine on ALTER TABLE
x ENGINE=y;
2015-09-12 13:16:05 +03:00
Alexander Barkov
96f4a906ce MDEV-8675 Different results of GIS functions on NULL vs NOT NULL columns 2015-09-11 23:26:02 +04:00
Alexander Barkov
9158212a27 MDEV-8369 Unexpected impossible WHERE for a condition on a ZEROFILL field
Disable IDENTITY_SUBST propagation for ZEROFILL columns,
as discussed with Sergei.
2015-09-11 15:41:53 +04:00
Kristian Nielsen
df9b8aee58 Merge MDEV-8193 into 10.1
Conflicts:
	sql/rpl_rli.cc
2015-09-11 12:01:48 +02:00
Kristian Nielsen
51eaa7fe53 MDEV-8193: UNTIL clause in START SLAVE is sporadically disobeyed by parallel replication
The code was using the wrong variable when comparing the binlog name
for the UNTIL position. This could cause the comparison to fail after
binlog rotation, in turn causing the UNTIL clause to not trigger slave
stop.
2015-09-11 10:51:56 +02:00
Alexander Barkov
6f302d9f6c MDEV-8755 Equal field propagation is not performed any longer for the IN list when multiple comparison types 2015-09-11 11:35:15 +04:00
Alexander Barkov
0302efca7f MDEV-8705 Wrong result for SELECT..WHERE latin1_bin_column='a' AND latin1_bin_column='A'
MDEV-8712 Wrong result for SELECT..WHERE latin1_bin_column=_latin1'a' AND latin1_bin_column='A'
2015-09-11 09:20:40 +04:00
Alexander Barkov
4aebba3aeb MDEV-8740 Wrong result for SELECT..WHERE year_field=10 AND NULLIF(year_field,2011.1)='2011'
MDEV-8754 Wrong result for SELECT..WHERE year_field=2020 AND NULLIF(year_field,2010)='2020'
Problems:
1. Item_func_nullif stored a copy of args[0] in a private member m_args0_copy,
   which was invisible for the inherited Item_func menthods, like
   update_used_tables(). As a result, after equal field propagation
   things like Item_func_nullif::const_item() could return wrong result
   and a non-constant NULLIF() was erroneously treated as a constant
   at optimize_cond() time.
   Solution: removing m_args0_copy and storing the return value item
   in args[2] instead.
2. Equal field propagation did not work well for Item_fun_nullif.
   Solution: using ANY_SUBST for args[0] and args[1], as they are in
   comparison, and IDENTITY_SUBST for args[2], as it's not in comparison.
2015-09-10 17:13:35 +04:00
Alexander Barkov
8e553c455c MDEV-8785 Wrong results for EXPLAIN EXTENDED...WHERE NULLIF(latin1_col, _utf8'a' COLLATE utf8_bin) IS NOT NULL 2015-09-10 15:01:44 +04:00
Alexander Barkov
4278d6d402 MDEV-8786 Wrong result for SELECT FORMAT=JSON * FROM t1 WHERE a=_latin1 0xDF 2015-09-10 14:04:52 +04:00
Sergei Golubchik
7bd2f20e88 make encrypt-binlog and encrypt-tmp-files to fail if no encryption
--encrypt-binlog and --encrypt-tmp-files used to mean
"encrypt XXX if encryption is available, otherwise don't encrypt",
now they mean "encrypt or fail with an error".
2015-09-09 14:22:22 +02:00
Alexander Barkov
39b46ae934 MDEV-8706 Wrong result for SELECT..WHERE time_column=TIMESTAMP'2015-08-30 00:00:00' AND time_column='00:00:00' 2015-09-09 15:39:09 +04:00