Commit graph

31520 commits

Author SHA1 Message Date
Alexey Botchkov
ca29490102 MDEV-3819 missing constraints for spatial column types.
Checks added to return and error when inappropriate
    geometry type is stored in a field.
2013-02-21 01:03:45 +04:00
Vladislav Vaintroub
2c37ace131 MDEV-4174 - Use kqueue for threadpool implementation on more BSD variants than just FreeBSD
or OSX - i.e NetBSD, OpenBSD, DragonFly, etc.
2013-02-19 23:46:52 +01:00
Sergei Golubchik
99bc6b923e MDEV-4156 Test cases query_cache and query_cache_size_basic fail on 32 bit ppc and s390 2013-02-08 22:24:06 +01:00
Vladislav Vaintroub
1701ee3357 MDEV-4113: Assertion (group->connection_count > 0) fails with Percona server in replication test.
Assertion happens in replication thread during THD destruction, when thread calls my_sync(), which in turn calls  thd_wait_begin() callback. Connection count can be 0, because the counter was decremented before THD destructor. 
This assertion currently reproducible only in Percona server  and not in MariaDB, due to differences in replication code.

Fixed by moving  code to decrement connection counter after the THD destructor.
2013-01-30 17:25:02 +01:00
unknown
f65e5841d7 Fix for MDEV-3948, and backport of the following collection of fixes and backports
from MariaDB 10.0.
  
The bug in mdev-3948 was an instance of the problem fixed by Sergey's patch
in 10.0 - namely that the range optimizer could change table->[read | write]_set,
and not restore it.
  
revno: 3471
committer: Sergey Petrunya <psergey@askmonty.org>
branch nick: 10.0-serg-fix-imerge
timestamp: Sat 2012-11-03 12:24:36 +0400
message:
  # MDEV-3817: Wrong result with index_merge+index_merge_intersection, InnoDB table, join, AND and OR conditions
  Reconcile the fixes from:
  #
  # guilhem.bichot@oracle.com-20110805143029-ywrzuz15uzgontr0
  # Fix for BUG#12698916 - "JOIN QUERY GIVES WRONG RESULT AT 2ND EXEC. OR
  # AFTER FLUSH TABLES [-INT VS NULL]"
  #
  # guilhem.bichot@oracle.com-20111209150650-tzx3ldzxe1yfwji6
  # Fix for BUG#12912171 - ASSERTION FAILED: QUICK->HEAD->READ_SET == SAVE_READ_SET
  # and
  #
  and related fixes from: BUG#1006164, MDEV-376:
  
  Now, ROR-merged QUICK_RANGE_SELECT objects make no assumptions about the values
  of table->read_set and table->write_set.
  Each QUICK_ROR_SELECT has (and had before) its own column bitmap, but now, all 
  QUICK_ROR_SELECT's functions that care: reset(), init_ror_merged_scan(), and 
  get_next()  will set table->read_set when invoked and restore it back to what 
  it was before the call before they return.

  This allows to avoid the mess when somebody else modifies table->read_set for 
  some reason.
2013-01-28 15:13:39 +02:00
Sergei Golubchik
87de27e46b 5.3 merge 2013-01-28 13:36:05 +01:00
Sergei Golubchik
34e84c227f 5.2 merge 2013-01-28 09:12:23 +01:00
Sergei Golubchik
5138bf4238 compilation error with -Wuninitialized -Werror 2013-01-28 09:10:01 +01:00
Sergei Golubchik
0791692bdc MDEV-3875 Wrong result (missing row) on a DISTINCT query with the same subquery in the SELECT list and GROUP BY
fix remove_dup_with_hash_index() and remove_dup_with_compare() to take NULLs into account
2013-01-26 22:33:18 +01:00
Michael Widenius
772bd60a1b Automatic merge 2013-01-26 01:59:27 +02:00
Michael Widenius
ea1d5943c5 Fixed MDEV-3890: Server crash inserting record on a temporary table after truncating it
The problem was that a temporary table was re-created as a non-temporary table.


mysql-test/suite/maria/truncate.result:
  Added test cases
mysql-test/suite/maria/truncate.test:
  Added test cases
sql/sql_truncate.cc:
  Mark that table to be created is a temporary table
storage/maria/ha_maria.cc:
  Ensure that temporary tables are not transactional.
2013-01-25 21:40:42 +02:00
Sergei Golubchik
e400450f2d 5.1 merge 2013-01-25 17:22:21 +01:00
unknown
298008dc4f The problem was that expression with field after transformation (on the first execution)
reached by fix_fields() (via reference) before row which it belongs to (on the second execution)
and fix_field for row did not follow usual protocol for Items with argument
(first check that the item fixed then call fix_fields).

Item_row::fix_field fixed.
2013-01-25 16:56:57 +02:00
Sergei Golubchik
7f208d3c35 MDEV-729 lp:998028 - Server crashes on normal shutdown in closefrm after executing a query from MyISAM table
don't write a key value into the record buffer - a key length can be larger then the record length.
2013-01-25 14:29:46 +01:00
Sergei Golubchik
326d2d56fe MDEV-759 lp:998340 - Valgrind complains on simple selects containing expression DAY(FROM_UNIXTIME(-1))
check item->null_value before using the result of item->val_int()
2013-01-25 12:26:35 +01:00
Sergei Golubchik
672b293860 5.3 merge
client/mysqltest.cc:
  make --error to work for --change_user errors
2013-01-25 11:24:42 +01:00
Sergei Golubchik
de10e21411 5.2 merge 2013-01-25 10:20:45 +01:00
Sergei Golubchik
fa7d0c4fdf MDEV-3909 remote user enumeration
instead of returning Access denied on the incorrect user name,
emulate the complete failed logic procedure, possibly with
the change plugin packet.
2013-01-25 09:41:26 +01:00
Sergei Golubchik
82c022f2d5 report "using password: YES/NO" correctly for the COM_CHANGE_USER failures 2013-01-25 00:20:53 +01:00
Sergei Golubchik
bfc71e63a7 MDEV-3915 COM_CHANGE_USER allows fast password brute-forcing
allow only three failed change_user per connection.
successful change_user do NOT reset the counter

tests/mysql_client_test.c:
  make --error to work for --change_user errors
2013-01-25 00:17:39 +01:00
Igor Babaev
32151409c1 Merge 5.3->5.5 2013-01-23 15:18:05 -08:00
Igor Babaev
746152959a Merge 5.2->5.3 2013-01-21 21:29:19 -08:00
Igor Babaev
8127e631de Merge 5.1->5.2 2013-01-21 15:23:40 -08:00
Igor Babaev
82fe8a4e71 Merge. 2013-01-21 13:48:34 -08:00
Igor Babaev
fade3647ec Fixed bug mdev-4063 (bug #56927).
This bug could result in returning 0 for the expressions of the form 
<aggregate_function>(distinct field) when the system variable  
max_heap_table_size was set to a small enough number.
It happened because the method Unique::walk() did not support
the case when more than one pass was needed to merge the trees
of distinct values saved in an external file.

Backported a fix in grant_lowercase.test from mariadb 5.5.
2013-01-21 11:47:45 -08:00
unknown
82e39cb1e1 Fixed typo in the function name.
test suite added.
2013-01-22 13:29:59 +02:00
unknown
193c6f548b MDEV-3873: fixed functions absend in 5.3. 2013-01-21 14:34:39 +02:00
Sergei Golubchik
43c6953fa1 MDEV-4029 SELECT on information_schema using a subquery locks up the information_schema table due to incorrect mutexes handling
Early evaluation of subqueries in the WHERE conditions on I_S.*_STATUS tables,
otherwise the subquery on this same table will try to acquire LOCK_status twice.
2013-01-21 10:52:39 +01:00
Sergei Golubchik
a0710621bf fix a strict aliasing warning - remove a meaningless cast. 2013-01-20 21:43:11 +01:00
Sergei Golubchik
7caa80c481 MDEV-3934 Assertion `((keypart_map+1) & keypart_map) == 0' failed in _mi_pack_key with an index on a POINT column
sel_arg_range_seq_next(): set keypart map also for GEOM_FLAG keys
2013-01-20 14:06:33 +01:00
Sergei Golubchik
cc74bb3178 MDEV-4029 SELECT on information_schema using a subquery locks up the information_schema table due to incorrect mutexes handling
Early evaluation of subqueries in the WHERE conditions on I_S.*_STATUS tables,
otherwise the subquery on this same table will try to acquire LOCK_status twice.

sql/item.h:
  remove unused method
2013-01-20 00:46:51 +01:00
Sergei Golubchik
103c4c4906 MDEV-633 lp:1024058 - mysqld XA crash in replication slave
initialize cache_mngr and write the Xid into binlog even
if binlog is disabled with SQL_LOG_BIN=0 or no --log-slave-updates
in the slave thread
2013-01-18 19:10:20 +01:00
Sergei Golubchik
381f470936 simplify THD::binlog_setup_trx_data() usage 2013-01-18 19:07:59 +01:00
Sergei Golubchik
d41d43f421 MDEV-4065 thd_kill_statement service 2013-01-18 19:04:23 +01:00
Vladislav Vaintroub
5649377b55 Fix Windows installers' bootstrapper scripts , after mysql_performance_tables.sql was split off mysql_system_tables.sql 2013-01-18 18:49:07 +01:00
Michael Widenius
c65f9a1914 Don't reset maybe_null in update_used_tables(); This breaks ROLLUP
This fixed failing test in group_by.test

mysql-test/r/join_outer.result:
  Updated test case
mysql-test/r/join_outer_jcl6.result:
  Updated test case
sql/item.cc:
  Don't reset maybe_null in update_used_tables(); This breaks ROLLUP
sql/item.h:
  Don't reset maybe_null in update_used_tables(); This breaks ROLLUP
sql/item_cmpfunc.h:
  Don't reset maybe_null in update_used_tables(); This breaks ROLLUP
2013-01-17 02:27:10 +02:00
Igor Babaev
63afbba419 Corrected the fix for bug mdev-3938. 2013-01-16 11:17:58 -08:00
unknown
2255132f20 MDEV-4056 fix.
The problem was that maybe_null of Item_row and its componetes was unsynced after update_used_tables() (and so pushed_cond_guards was not initialized but then requested).

Fix  updates Item_row::maybe_null on update_used_tables().
2013-01-16 21:07:26 +02:00
unknown
d51f96b167 MDEV-3900 Optimizer difference between MySQL and MariaDB with stored functions in WHERE clause of UPDATE or DELETE statements
Analysis
The reason for the less efficient plan was result of a prior design decision -
to limit the eveluation of constant expressions during optimization to only
non-expensive ones. With this approach all stored procedures were considered
expensive, and were not evaluated during optimization. As a result, SPs didn't
participate in range optimization, which resulted in a plan with table scan
rather than index range scan.

Solution
Instead of considering all SPs expensive, consider expensive only those SPs
that are non-deterministic. If an SP is deterministic, the optimizer will
checj if it is constant, and may eventually evaluate it during optimization.
2013-01-17 16:08:05 +02:00
unknown
8a296e6ca2 backport of:
Don't reset maybe_null in update_used_tables(); This breaks ROLLUP
This fixed failing test in group_by.test
2013-01-17 13:53:15 +02:00
unknown
a716b06167 MDEV-3988 fix.
Subquery turned into constant too late to be excluded from grouping list so test for constant added to the create_temp_table().
2013-01-16 15:11:13 +02:00
Igor Babaev
f8f90aa75f Fixed bug mdev-3938.
The original patch with the implementation of virtual columns
did not support INSERT DELAYED into tables with virtual columns.
This patch fixes the problem.
2013-01-15 16:46:27 -08:00
Sergei Golubchik
4ce53556ce Test case and a different fix for MySQL bug#14485479 2013-01-15 19:16:29 +01:00
Sergei Golubchik
9b9c138e2a small cleanups 2013-01-15 19:16:18 +01:00
Sergei Golubchik
d3935adf7a mysql-5.5.29 merge 2013-01-15 19:13:32 +01:00
Sergei Golubchik
aca8e7ed6b 5.3 merge 2013-01-15 19:07:46 +01:00
Sergei Golubchik
750b9147fc remove thd_mark_as_hard_kill()
(because it's conceptually wrong. only the user can decide whether the kill is
allowed to leave tables in the inconsistent state, storage engine has no say in that)
2013-01-15 17:46:46 +01:00
unknown
a87eab6061 Fix for bug MDEV-3992, second attempt
The previous fix for MDEV-3992 was incomplete, because it still computed
incorrectly the number of keyparts of the extended secondary key in the
case when columns of the PK participate in the secondary key.

This patch by Monty corrects the above problem.
2013-01-15 14:33:08 +02:00
unknown
cf79c01cc7 Fix for bug MDEV-3992
Analysis:
  The crash is a result of incorrect analysis of whether a secondary key
  can be extended with a primary in order to compute ORDER BY. The analysis
  is done in test_if_order_by_key(). This function doesn't take into account
  that the primary key may in fact index the same columns as the secondary
  key. For the test query test_if_order_by_key says that there is an extended
  key with total 2 keyparts.
  At the same time, the condition
    if (pkinfo->key_part[i].field->key_start.is_set(nr))
  in test_if_cheaper_oredring() becomes true for (i == 0), which results in
  an invalid access to rec_per_key[-1].
  
Solution:
  The best solution would be to reuse KEY::ext_key_parts that is already computed
  by open_binary_frm(), however after detailed analysis the conclusion is that
  the change would be too intrusive for a GA release.
  The solution for 5.5 is to add a guard for the case when the 0-th key part is
  considered, and to assume that all keys will be scanned in this case.
2013-01-14 15:05:05 +02:00
Igor Babaev
12bf6fe858 Fixed bug mdev-4025.
The bug could lead to a wrong estimate of the number of expected rows
in the output of the EXPLAIN commands for queries with GROUP BY.
This could be observed in the test case for LP bug 934348.
2013-01-11 20:26:34 -08:00