Commit graph

75369 commits

Author SHA1 Message Date
unknown
0520825803 Test suite of fixed bug (LP bug#993459). 2012-05-17 10:45:20 +03:00
unknown
5a47413934 fix of LP bug#998321
The problem is that we can't check null_value field of non-basic constant without the item execution.:
2012-05-17 10:13:25 +03:00
Igor Babaev
61b86d004e Merge. 2012-05-16 22:33:22 -07:00
Igor Babaev
4dc963a9f3 Fixed LP bug #999251: Q13 from DBT3 uses table scan instead of covering index scan.
The optimizer chose a less efficient execution plan due to the following
defects of the code:
1. the generic handler function handler::keyread_time did not take into account
   that in clustered primary keys record data is included into each index entry
2. the function make_join_readinfo erroneously decided that index only scan
   could not be used if join cache was empoyed.

Added no additional test case.
Adjusted some of the test results.
2012-05-16 20:39:03 -07:00
Michael Widenius
b1485a4780 More fixes for LOCK TABLE and REPAIR/FLUSH
Changed HA_EXTRA_NORMAL to HA_EXTRA_NOT_USED (more clean)

mysql-test/suite/maria/lock.result:
  More extensive tests of LOCK TABLE with FLUSH and REPAIR
mysql-test/suite/maria/lock.test:
  More extensive tests of LOCK TABLE with FLUSH and REPAIR
sql/sql_admin.cc:
  Fix that REPAIR TABLE ... USE_FRM works with LOCK TABLES
sql/sql_base.cc:
  Ensure that transactions are closed in ARIA when doing flush
  HA_EXTRA_NORMAL -> HA_EXTRA_NOT_USED
  Don't call extra many times for a table in close_all_tables_for_name()
  Added test if table_list->table as this can happen in error situations
sql/sql_partition.cc:
  HA_EXTRA_NORMAL -> HA_EXTRA_NOT_USED
sql/sql_reload.cc:
  Fixed comment
sql/sql_table.cc:
  HA_EXTRA_NORMAL -> HA_EXTRA_NOT_USED
sql/sql_trigger.cc:
  HA_EXTRA_NORMAL -> HA_EXTRA_NOT_USED
sql/sql_truncate.cc:
  HA_EXTRA_FORCE_REOPEN -> HA_EXTRA_PREPARE_FOR_DROP for truncate, as this speeds up truncate by not having to flush the cache to disk.
2012-05-17 01:47:28 +03:00
Michael Widenius
26cc22f3fe Fixed LP:990187 Assertion `share->reopen == 1' failed at maria_extra on ADD PARTITION
mysql-test/suite/maria/maria-partitioning.result:
  New test case
mysql-test/suite/maria/maria-partitioning.test:
  New test case
sql/sql_base.cc:
  Ignore HA_EXTRA_NORMAL for wait_while_table_is_used()
  More DBUG
sql/sql_partition.cc:
  Don't use HA_EXTRA_FORCE_REOPEN for wait_while_table_is_used() as the table is opened multiple times (in prep_alter_part_table)
  This fixes the assert in Aria where we check if table is opened multiple times if HA_EXTRA_FORCE_REOPEN is issued
2012-05-16 22:04:48 +03:00
Michael Widenius
c39da19c4a Moved maria tests to suite/maria 2012-05-16 18:46:02 +03:00
Michael Widenius
6d8e329c9a Fixed bug LP:973039 - Assertion `share->in_trans == 0' failed in maria_close on DROP TABLE under LOCK
- 5.5 was missing calls to ha_extra(HA_PREPARE_FOR_DROP | HA_PREPARE_FOR_RENAME);  Lost in merge 5.3 -> 5.5


sql/sql_admin.cc:
  Updated arguments for close_all_tables_for_name
sql/sql_base.h:
  Updated arguments for close_all_tables_for_name
sql/sql_partition.cc:
  Updated arguments for close_all_tables_for_name
sql/sql_table.cc:
  Updated arguments for close_all_tables_for_name
  Removed test of kill, as we have already called 'ha_extra(HA_PREPARE_FOR_DROP)' and the table may be inconsistent.
sql/sql_trigger.cc:
  Updated arguments for close_all_tables_for_name
sql/sql_truncate.cc:
  For truncate that is done with drop + recreate, signal that the table will be dropped.
2012-05-16 18:44:17 +03:00
Sergei Golubchik
c17bace4f0 Added --continue-on-error to mysqltest and mysql-test-run
This will contune the test case even if there was an error
and makes it easier to run a test that contains many sub tests against one engine.

(originally by Monty)
2012-05-15 19:35:57 +02:00
unknown
3d37b67b2b Fix for LP bug#998516
If we did nothing in resolving unique table conflict we should not retry (it leed to infinite loop).
Now we retry (recheck) unique table check only in case if we materialized a table.
2012-05-15 08:31:07 +03:00
Sergey Petrunya
6d41fa0d54 BUG#998236: Assertion failure or valgrind errors at best_access_path ...
- Let fix_semijoin_strategies_for_picked_join_order() set 
  POSITION::prefix_record_count for POSITION records that it copies from
  SJ_MATERIALIZATION_INFO::tables. 
  (These records do not have prefix_record_count set, because they are optimized
   as joins-inside-semijoin-nests, without full advance_sj_state() processing).
2012-05-13 13:15:17 +04:00
Sergey Petrunya
4dff59a31b Merge 5.2->5.3 2012-05-12 12:27:26 +04:00
Sergey Petrunya
e1b6e1b899 Merge 5.2->5.3 2012-05-12 12:12:35 +04:00
Sergey Petrunya
97ae1682f1 BUG#997747: Assertion `join->best_read < ((double)1.79..5e+308L)' failed
in greedy_search with LEFT JOINs and unique keys
- Backport the fix for BUG#806524 from MariaDB 5.3
2012-05-12 11:53:14 +04:00
unknown
e10fecc02f Merge 5.2->5.3 2012-05-11 11:40:23 +03:00
Sergei Golubchik
329daad2d3 more portable fix for lp:942266 - 5.5 builds fail with systemtap-sdt-dev installed on Ubuntu
include <limits> early, before min/max macros are defined.
2012-05-11 09:18:00 +02:00
Sergei Golubchik
1185420da0 5.3 merge 2012-05-21 20:54:41 +02:00
Sergei Golubchik
431e042b5d c 2012-05-21 15:30:25 +02:00
unknown
f2cbc014d9 fix for LP bug#994392
The not_null_tables() of Item_func_not_all and Item_in_optimizer was inherited from
Item_func by mistake. It made the optimizer think that  subquery
predicates with ALL/ANY/IN were null-rejecting. This could trigger invalid
conversions of outer joins into inner joins.
2012-05-11 09:35:46 +03:00
unknown
6fc863c749 Fixed typo 2012-05-10 09:00:21 +03:00
unknown
fe0a0bdb14 Fix compiler warnings. 2012-05-08 20:58:41 +03:00
unknown
4e2926d927 Addition to the fix to LP bug#994275.
It is problem of constant propagated to ref* access method (the problem was hiden by using debug binaries for testing).
2012-05-08 19:13:26 +03:00
unknown
ddd3e261b2 MDEV-254: Server hang with FLUSH TABLES WITH READ LOCK AND DISABLE CHECKPOINT
The code to re-enable checkpointing after UNLOCK TABLES was lost in the 5.5
merge, so re-add it back in.
2012-05-08 14:27:44 +02:00
Vladislav Vaintroub
54534a6984 MDEV-262 : log_state occationally fails in buildbot.
The failures are  missing entries in the slow query log.  The reason for the failure  are sleep() calls  with short duration 10ms, which is less than the default system timer resolution for various WaitForXXXObject functions  (15.6 ms) and thus can't work reliably.
The fix is to make sleeps tiny bit longer (20ms from 10ms) in the test.
2012-05-08 12:38:22 +02:00
Vladislav Vaintroub
597e98bc83 MDEV-261 : mysqtest crashes when assigning variable to result of select , like
let x = `SELECT <something>`

The fix is to detect the condition "no active connection",  to report error and die.
Note, that the check for no active connection was already in place for ordinary commands, 
and was missing only for assign-variable command.
2012-05-08 00:26:41 +02:00
unknown
ea8314fdd5 LP bug#994275 fix.
In 5.3 we substitute constants in ref access values it can't be null so we do not need add NOT NULL for early NULL filtering.
2012-05-07 21:14:37 +03:00
unknown
0887c6b9d3 MDEV-257: wrong libmysqlclient.so symlink in package libmariadbclient-dev. 2012-05-07 12:47:29 +02:00
unknown
8065143637 Fix for LP bug#993726
Optimization of aggregate functions detected constant under max() and evalueted it, but condition in the WHWRE clause (which is always FALSE) was not taken into account
2012-05-07 13:26:34 +03:00
Vladislav Vaintroub
1133297ae0 merge 2012-05-07 12:21:59 +02:00
unknown
213476ef3e Fix for bug lp:992405
The patch backports two patches from mysql 5.6:
- BUG#12640437: USING SQL_BUFFER_RESULT RESULTS IN A DIFFERENT QUERY OUTPUT
- Bug#12578908: SELECT SQL_BUFFER_RESULT OUTPUTS TOO MANY ROWS WHEN GROUP IS OPTIMIZED AWAY

Original comment:
-----------------
3714 Jorgen Loland	2012-03-01
      BUG#12640437 - USING SQL_BUFFER_RESULT RESULTS IN A DIFFERENT 
                     QUERY OUTPUT
      
      For all but simple grouped queries, temporary tables are used to
      resolve grouping. In these cases, the list of grouping fields is
      stored in the temporary table and grouping is resolved
      there (e.g. by adding a unique constraint on the involved
      fields). Because of this, grouping is already done when the rows
      are read from the temporary table.
      
      In the case where a group clause may be optimized away, grouping
      does not have to be resolved using a temporary table. However, if
      a temporary table is explicitly requested (e.g. because the
      SQL_BUFFER_RESULT hint is used, or the statement is
      INSERT...SELECT), a temporary table is used anyway. In this case,
      the temporary table is created with an empty group list (because
      the group clause was optimized away) and it will therefore not
      create groups. Since the temporary table does not take care of
      grouping, JOIN::group shall not be set to false in 
      make_simple_join(). This was fixed in bug 12578908. 
      
      However, there is an exception where make_simple_join() should
      set JOIN::group to false even if the query uses a temporary table
      that was explicitly requested but is not strictly needed. That
      exception is if the loose index scan access method (explain
      says "Using index for group-by") is used to read into the 
      temporary table. With loose index scan, grouping is resolved 
      by the access method. This is exactly what happens in this bug.
2012-05-07 11:02:58 +03:00
Vladislav Vaintroub
57c2ea188c allow handlersocket on FreeBSD, fix getaddrinfo problem 2012-05-05 16:00:22 +02:00
Sergei Golubchik
867ce618cb merge 2012-05-05 14:59:44 +02:00
Sergei Golubchik
91527014c2 MDEV-207 Install headers required to build external storage plugins
5.5 version. for cmake, not autotools.
2012-05-05 08:27:17 +02:00
Vladislav Vaintroub
aa8f0606e8 MDEV-255: Compile handlersocket plugin in 5.5 2012-05-05 02:36:10 +02:00
Vladislav Vaintroub
2115542294 FreeBSD : Extend CMAKE_REQUIRED_LIBRARIES with ${LIBEXECINFO} , for backtrace_symbols & Co 2012-05-04 17:22:40 +02:00
Vladislav Vaintroub
2cf17b09ed Resolve opt_vardir in MTR with realpath. Server resolves some directory names, thus
mtr should do it as well, to avoid differences in test output. 

This fixes sys_vars.secure_file_priv on FreeBSD9.0 buildbot.
2012-05-04 14:46:18 +02:00
Vladislav Vaintroub
ab58904367 Fix FreeBSD test errors. Also link with libexecinfo on FreeBSD for stacktrace functionality. 2012-05-04 14:02:35 +02:00
Sergei Golubchik
44cf9ee5f7 5.3 merge 2012-05-04 07:16:38 +02:00
Vladislav Vaintroub
e3ffaed147 support same version upgrade for MSI 2012-05-04 03:51:30 +02:00
Vladislav Vaintroub
d231dc8f59 Fix (hopefully) a race condition in a test. Wait until killed connection
is gone.
2012-05-03 18:58:48 +02:00
Michael Widenius
d555878050 automatic merge 2012-05-03 16:00:41 +03:00
unknown
c9a73aa204 Fix bug lp:993745
This is a backport of the fix for MySQL bug #13723054 in 5.6.

Original comment:
      The crash is caused by arbitrary memory area owerwriting in case of
      BLOB fields during attempt to copy BLOB field key image into record
      buffer(record buffer is too small to get BLOB key part image).
      note:
      QUICK_GROUP_MIN_MAX_SELECT can not work with BLOB fields
      because it uses record buffer as temporary buffer for key values
      however this case is filtered out by covering_keys() check
      in get_best_group_min_max() as BLOBs always require key length
      modificator in the key declaration and if the key has a BLOB
      then it can not be covered key.
      The fix is to use 'max_used_key_length' key length instead of 0.

Analysis:
Spcifically the crash in this bug was a result of the call to key_copy()
that copied the whole key, inlcuding the BLOB field which is not used
for index access. Copying the blob field overwrote memory as far as the
function parameter 'key_info'. As a result the contents of key_info was
all 0, which resulted in a crash when this key_info was accessed few
lines below in key_cmp().
2012-05-03 14:49:52 +03:00
Vladislav Vaintroub
550d6871a5 MDEV-246 - Aborted_clients incremented during ordinary connection close
The problem was increment of aborted_threads variable due to thd->killed which was set when threadpool connection was terminated .  The fix is not to set thd->killed anymore, there is no real reason for doing it..

Added a test that checks that status variable aborted_clients does not grow for ordinary disconnects, and that successful KILL increments this variable.
2012-05-03 02:47:06 +02:00
Sergei Golubchik
d335b47191 update the version number 2012-05-02 22:02:17 +02:00
Alexey Botchkov
ef4b9a0e57 Fix for failing gis-precise on Windows. 2012-05-03 13:14:40 +05:00
Sergei Golubchik
99e2ba4848 5.2 merge 2012-05-02 22:02:06 +02:00
Sergei Golubchik
167ad4c4a5 update the result file 2012-05-02 22:00:31 +02:00
Oleksandr Byelkin
8fe40c50db MDEV-214 lp:967242 Wrong result with JOIN, AND in ON condition, multi-part key, GROUP BY, subquery and OR in WHERE
The problem was in the code (update_const_equal_items()) which marked
index parts constant independently of the place where the equality was used.
In the test suite it marked t2_1.c part constant despite the fact that
it connected by OR with other expression.

Solution is to mark constant only top equalities connected with AND.
2012-05-02 18:11:02 +02:00
Sergei Golubchik
b192f7a2e7 5.1 merge 2012-05-02 17:06:30 +02:00
Vladislav Vaintroub
26fcc55017 LP993103: Wrong result with LAST_DAY('0000-00-00 00:00:00')IS NULL in WHERE condition
Fix is to set  maybe_null  flag for Item_func_last_day.
2012-05-02 16:53:02 +02:00