1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-01 03:26:54 +03:00
Commit Graph

32556 Commits

Author SHA1 Message Date
b917fdb9f1 Added test case for bug in replace with replication that existed in MySQL 5.1:
Replace with an auto_increment primary key and another unique key didn't replicate correctly with REPLACE
2013-02-28 16:47:03 +02:00
027e34e13b a simpler fix for
MySQL Bug #12408412: GROUP_CONCAT + ORDER BY + INPUT/OUTPUT SAME USER VARIABLE = CRASH
and
MySQL Bug#14664077 SEVERE PERFORMANCE DEGRADATION IN SOME CASES WHEN USER VARIABLES ARE USED


sql/item_func.cc:
  don't use anything from Item_func_set_user_var::fix_fields()
  in Item_func_set_user_var::save_item_result()
sql/sql_class.cc:
  Call suv->save_item_result(item) *before* doing suv->fix_fields(), because
  the former evaluates the item (and caches its value), while the latter marks
  the user variable as non-const. The problem is that the item was fix_field'ed
  when the user variable was const, and it doesn't expect it to change to non-const
  in the middle of the execution.
2013-02-28 11:46:35 +01:00
6a2d730a7f Fixed BUG#51763 Can't delete rows from MEMORY table with HASH key 2013-02-28 10:00:07 +01:00
08ba257846 mysql-5.1 merge
mysys/errors.c:
  revert upstream's fix. use a much simpler one
mysys/my_write.c:
  revert upstream's fix. use a simpler one
sql/item_xmlfunc.cc:
  useless, but ok
sql/mysqld.cc:
  simplify upstream's fix
storage/heap/hp_delete.c:
  remove upstream's fix.
  we'll use a much less expensive approach.
2013-02-28 09:58:39 +01:00
938d47dcdc Automatic merge 2013-02-27 23:01:33 +02:00
06ffea8c5b MDEV-26: Global Transaction ID
Fix that CHANGE MASTER ... MASTER_GTID_POS="" works to start from the very
beginning of the binary log (with test case).

Fix that not finding the requested GTID position in master binlog results in
fatal error, not endless connect retry.
2013-02-27 21:10:40 +01:00
a7e1860ec0 MDEV-26: Global Transaction ID.
Add test case demonstrating multi-source replication with GTID.

Test that we can move from being slave of two masters to be a slave
deeper down in the hierarchy (of a higher-up multi-source slave),
and vice versa.
2013-02-27 18:38:42 +01:00
f2b8155abb - Result changed since nulls are supported
modified:
  mysql-test/suite/connect/r/odbc_xls.result
2013-02-27 14:59:40 +01:00
3fd1e97a64 Removing the comment about NULLs
modified:
  mysql-test/suite/connect/t/mysql.test
2013-02-27 17:04:36 +04:00
43ecae5ee8 Updating mysql.test, it now supports NULL columns.
modified:
  mysql-test/suite/connect/r/mysql.result
  mysql-test/suite/connect/t/mysql.test
2013-02-27 17:02:38 +04:00
154aac8eb0 MDEV-4208: Test rpl.rpl_rotate_purge_deadlock has incorrect preamble 2013-02-27 10:43:07 +04:00
e3ac306157 [NOT] EXISTS to IN transformation. 2013-02-26 01:20:17 +02:00
d434d79acf Fixed bug mdev-4177
The function remove_eq_cond removes the parts of a disjunction
for which it has been proved that they are always true. In the
result of this removal the disjunction may be converted into a 
formula without OR that must be merged into the the AND formula
that contains the disjunction.
The merging of two AND conditions must take into account the
multiple equalities that may be part of each of them.
These multiple equality must be merged and become part of the
and object built as the result of the merge of the AND conditions.
Erroneously the function remove_eq_cond lacked the code that 
would merge multiple equalities of the merged AND conditions.
This could lead to confusing situations when at the same AND 
level there were two multiple equalities with common members
and the list of equal items contained only some of these 
multiple equalities.
This, in its turn, could lead to an incorrect work of the
function substitute_for_best_equal_field when it tried to optimize
ref accesses. This resulted in forming invalid TABLE_REF objects
that were used to build look-up keys when materialized subqueries
were exploited.
2013-02-24 19:16:11 -08:00
fff47f40f6 MDEV-26: Global Transaction ID
- Fix that binlog_gtid_pos() (and hence slave connect) does not work
   correctly in the very first binlog file (due to not logging empty
   Gtid_list_log_event).

 - Remove one instance of the stupid domain_id-0-is-implicit.

 - Rename the confusing Gtid_Pos_Auto in SHOW SLAVE STATUS to Using_Gtid.

 - Fix memory leak.
2013-02-22 10:23:17 +01:00
7d4df74b71 Adding a test for BIGINT.
modified:
  mysql-test/suite/connect/r/mysql.result
  mysql-test/suite/connect/t/mysql.test
2013-02-22 13:21:26 +04:00
d899840afb - Adding tests for DBNAME=<unknown database name>.
- Fixing a bug that DBNAME value was forgotten when followed by OPTION_LIST.

modified:
  mysql-test/suite/connect/r/mysql.result
  mysql-test/suite/connect/t/mysql.test
  storage/connect/ha_connect.cc
2013-02-22 13:12:09 +04:00
38210b1145 Skip test XML if no XML support is compiled.
modified:
  mysql-test/suite/connect/t/xml.test
  storage/connect/mycat.cc
2013-02-22 12:52:56 +04:00
62fbaf96a0 Skip ODBC test if no ODBC is compiled.
modified:
  mysql-test/suite/connect/t/odbc_xls.test
2013-02-22 12:30:30 +04:00
ed7671d523 Fixed bug mdev-4172.
This bug in the legacy code could manifest itself in queries with
semi-join materialized subqueries.
When a subquery is materialized all conditions that are imposed
only on the columns belonging to the tables from the subquery 
are taken into account.The code responsible for subquery optimizations
that employes subquery materialization  makes sure to remove these
conditions from the WHERE conditions of the query obtained after
it has transformed the original query into a query with a semi-join.
If the condition to be removed is an equality condition it could
be added to ON expressions and/or conditions from disjunctive branches
(parts of OR conditions) in an attempt to generate better access keys
to the tables of the query. Such equalities are supposed to be removed
later from all the formulas where they have been added to.
However, erroneously, this was not done in some cases when an ON
expression and/or a disjunctive part of the OR condition could
be converted into one multiple equality. As a result some equality
predicates over columns belonging to the tables of the materialized
subquery remained in the ON condition and/or the a disjunctive 
part of the OR condition, and the excuter later, when trying to
evaluate them, returned wrong answers as the values of the fields
from these equalities were not valid.  
This happened because any standalone multiple equality (a multiple
equality that are not ANDed with any other predicates) lacked
the information about equality predicates inherited from upper
levels (in particular, inherited from the WHERE condition).
The fix adds a reference to such information to any standalone
multiple equality.
2013-02-21 17:13:12 -08:00
d368a2f662 Suppress additional debug info printed in _DEBUG build
modified:
  mysql-test/suite/connect/t/mysql.test
2013-02-21 17:03:41 +04:00
3db9803cdb Adding forgotten --replace_result for port number
modified:
  mysql-test/suite/connect/r/mysql.result
  mysql-test/suite/connect/t/mysql.test
2013-02-21 16:59:09 +04:00
b0376d1e16 Adding tests for TABLE_TYPE=MySQL
added:
  mysql-test/suite/connect/r/mysql.result
  mysql-test/suite/connect/t/mysql.test
2013-02-21 13:49:47 +04:00
c0f058871f Adding a test for entities
(special characters and characters outside of the file ENCODING)

modified:
  mysql-test/suite/connect/r/xml.result
  mysql-test/suite/connect/t/xml.test
2013-02-21 11:18:57 +04:00
c350177a21 MDEV-26: Global transaction ID
- Add first basic mysql-test-run test case which tests switch to new master
   using MASTER_GTID_POS=AUTO.

 - When we connect with GTID, do not use any old relay logs, as they may
   contain the wrong events or be corrupt after crash.

 - Fix old bug that fails replication if we receive a heartbeat event
   immediately after an event was omitted in the stream from the master.

 - Fix rpl_end to clear Gtid_Pos_Auto, to keep check_testcase happy.
2013-02-21 08:10:55 +01:00
6537b551ca Merge. 2013-02-20 19:22:02 -08:00
c9b63e6a49 Fixed bug mdev-3913.
The wrong result set returned by the left join query  from
the bug test case happened due to several inconsistencies 
and bugs of the legacy mysql code.

The bug test case uses an execution plan that employs a scan
of a materialized IN subquery from the WHERE condition.
When materializing such an IN- subquery the optimizer injects
additional equalities  into the WHERE clause. These equalities
express the constraints imposed by the subquery predicate.
The injected equality of the query in the  test case happens
to belong to the same equality class, and a new equality 
imposing a condition on the rows of the materialized subquery
is inferred from this class. Simultaneously the multiple
equality is added to the ON expression of the LEFT JOIN
used in the main query.
  
The inferred equality of the form f1=f2 is taken into account
when optimizing the scan of  the rows the temporary table 
that is the result of the subquery materialization: only the 
values of the field f1 are read from the table into the record 
buffer. Meanwhile the inferred equality is removed from the
WHERE conditions altogether as a constraint on the fields
of the temporary table that has been used when filling this table. 
This equality is supposed to be removed from the ON expression
when the multiple equalities of the ON expression are converted
into an optimal set of equality predicates. It supposed to be
removed from the ON expression as an equality inferred from only
equalities of the WHERE condition. Yet, it did not happened
due to the following bug in the code.

Erroneously the code tried to build multiple equality for ON
expression twice: the first time, when it called optimize_cond()
for the WHERE condition, the second time, when it called
this function for the HAVING condition. When executing
optimize_con() for the WHERE condition  a reference
to the multiple equality of the WHERE condition is set
in the multiple equality of the  ON expression. This reference
would allow later to convert multiple equalities of the
ON expression into equality predicates. However the 
the second call of build_equal_items() for the ON expression
that happened when optimize_cond() was called for the
HAVING condition reset this reference to NULL.

This bug fix blocks calling build_equal_items() for ON
expressions for the second time. In general, it will be
beneficial for many queries as it removes from ON 
expressions any equalities that are to be checked for the
WHERE condition.
The patch also fixes two bugs in the list manipulation
operations and a bug in the function  
substitute_for_best_equal_field() that resulted
in passing wrong reference to the multiple equalities
of where conditions when processing multiple
equalities  of ON expressions.

The code of substitute_for_best_equal_field() and
the code the helper function eliminate_item_equal()
were also streamlined and cleaned up.
Now the conversion of the multiple equalities into
an optimal set of equality predicates first produces
the sequence of the all equalities processing multiple
equalities one by one, and, only after this, it inserts
the equalities at the beginning of the other conditions.

The multiple changes in the output of EXPLAIN
EXTENDED are mainly the result of this streamlining,
but in some cases is the result of the removal of
unneeded equalities from ON expressions. In
some test cases this removal were reflected in the
output of EXPLAIN resulted in disappearance of 
“Using where” in some rows of the execution plans.
2013-02-20 18:01:36 -08:00
d0145eed7c Fixing test failure due to not strict order of the files.
Adding ORDER BY clause.

modified:
  mysql-test/suite/connect/r/dir.result
  mysql-test/suite/connect/t/dir.test
2013-02-20 18:27:04 +04:00
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
1e13640f4d Fixing problems with running tests caused by the fact that
"mysqld --connect" conflicts with "mysqld --connect-timeout".

(unfortunate design decision in how mysqld handles command line options).

modified:
  mysql-test/mysql-test-run.pl
  mysql-test/suite/connect/suite.opt
2013-02-20 16:34:07 +04:00
1483aebeaa Adding tests for DATA_CHARSET and TABLE_TYPE=CSV.
modified:
  mysql-test/suite/connect/r/csv.result
  mysql-test/suite/connect/t/csv.test
2013-02-19 16:25:59 +04:00
df153bb56b Adding tests to check that TABLE_TYPE=XML creates the XML
file according to the ENCODING option.

modified:
  mysql-test/suite/connect/r/xml.result
  mysql-test/suite/connect/t/xml.test
2013-02-19 13:02:33 +04:00
f41aadfaed Adding DATA_CHARSET table option. 2013-02-18 19:21:52 +04:00
ff8676e0e1 MDEV-26: Global transaction ID.
Fix initial loading of mysql.rpl_slave_state, the code had several
issues.

Some very basic MTR stuff, more to come.
2013-02-18 15:41:17 +01:00
7042dd38c6 Fixed BUG#51763 Can't delete rows from MEMORY table with HASH key
mysql-test/suite/heap/heap.result:
  Added test case
mysql-test/suite/heap/heap.test:
  Added test case
storage/heap/hp_delete.c:
  Fixed that we don't change order of keys for the current key when we delete them from the hash table.
  Fixed that 'current_hash_ptr' is correct after heap_delete_key().
  Don't "reset current_hash_ptr" on delete; This will improve time a lot for delete of rows when not all rows matches the search criteria.
2013-02-15 20:25:27 +02:00
b8746ba916 Updating tests according to the latest Olivier's change
removing extra space characters in TABLE_TYPE=XML with libxml2

modified:
  mysql-test/suite/connect/r/xml.result
2013-02-15 20:07:53 +04:00
35bc8f9f43 Automatic merge 2013-02-15 14:18:09 +02:00
b2f11bf0c4 Adding a new test: creating a TABLE_TYPE=CSV table from a MyISAM table using
CREATE TABLE t2 ... AS SELECT * FROM t1;

modified:
  mysql-test/suite/connect/r/csv.result
  mysql-test/suite/connect/t/csv.test
2013-02-15 12:48:12 +04:00
70e92c855e Recording error messages according to the last change from Olivier.
modified:
  mysql-test/suite/connect/r/bin.result
  mysql-test/suite/connect/r/csv.result
  mysql-test/suite/connect/r/dbf.result
  mysql-test/suite/connect/r/dir.result
  mysql-test/suite/connect/r/fix.result
  mysql-test/suite/connect/r/general.result
  mysql-test/suite/connect/r/ini.result
  mysql-test/suite/connect/r/vec.result
  mysql-test/suite/connect/t/dbf.test
  mysql-test/suite/connect/t/dir.test
  mysql-test/suite/connect/t/general.test
2013-02-15 09:42:10 +04:00
395de7306f MDEV-4169: mysql-test-run doesn't strip expected warnings (setrlimit) 2013-02-14 16:27:55 +04:00
7bc69b7ada Adding forgotten "--replace_result $MYSQLD_DATADIR DATADIR",
so it passed idependently from the source tree location.

modified:
  mysql-test/suite/connect/r/odbc_xls.result
  mysql-test/suite/connect/t/odbc_xls.test
2013-02-14 11:57:38 +04:00
103557d5a3 Adding a test for unknown TABLE_TYPE
added:
  mysql-test/suite/connect/r/general.result
  mysql-test/suite/connect/t/general.test
2013-02-13 17:34:41 +04:00
e93079397f Adding READONLY tests
modified:
  mysql-test/suite/connect/r/bin.result
  mysql-test/suite/connect/r/csv.result
  mysql-test/suite/connect/r/dbf.result
  mysql-test/suite/connect/r/fix.result
  mysql-test/suite/connect/r/fmt.result
  mysql-test/suite/connect/r/ini.result
  mysql-test/suite/connect/r/vec.result
  mysql-test/suite/connect/t/bin.test
  mysql-test/suite/connect/t/csv.test
  mysql-test/suite/connect/t/dbf.test
  mysql-test/suite/connect/t/fix.test
  mysql-test/suite/connect/t/fmt.test
  mysql-test/suite/connect/t/ini.test
  mysql-test/suite/connect/t/vec.test
2013-02-13 16:52:35 +04:00
d4b1e8f31a Fix for MDEV-4140
Analysis:
Range analysis detects that the subquery is expensive and doesn't
build a range access method. Later, the applicability test for loose
scan doesn't take that into account, and builds a loose scan method
without a range scan on the min/max column. As a result loose scan
fetches the first key in each group, rather than the first key that
satisfies the condition on the min/max column.

Solution:
Since there is no SEL_ARG tree to be used for the min/max column,
it is not possible to use loose scan if the min/max column is compared
with an expensive scalar subquery. Make the test for loose scan
applicability to be in sync with the range analysis code by testing if
the min/max argument is compared with an expensive predicate.
2013-02-13 11:58:16 +02:00
3a0b25bb07 Merge. 2013-02-12 11:49:46 -08:00
b91386c2f6 Changing maximum possible column length for DBF tables from 11 to 10.
There is actually one extra byte for the 11th character, however it seems
to be meant for the '\0' terminating byte in the DBF specifications.
Also, the third party software (e.g. OpenOffice) do not correctly open
tables with column length=11.

modified:
  mysql-test/suite/connect/r/dbf.result
  mysql-test/suite/connect/t/dbf.test
  storage/connect/ha_connect.cc
2013-02-12 14:58:58 +04:00
237eda72eb Fixing vec.test failure on Windows.
- The "spath" column does not get replaces with $MYSQLD_DATADIR,
because it does not include the drive letter part, e.g. C:\.
Removing excluding spath from the "SELECT ... FROM dir1" query

- Warnings return slightly different text on Linux and Windows.
  Linux has extra "/./" part:
    DATADIR/./test/t1vec1

"--replace_result $MYSQLD_DATADIR DATADIR/" does not help.

Using --replace_regex instead.

modified:
  mysql-test/suite/connect/r/vec.result
  mysql-test/suite/connect/t/vec.test
2013-02-11 18:19:46 +04:00
4902861155 Adding test for ENGINE=VEC
added:
  mysql-test/suite/connect/r/vec.result
  mysql-test/suite/connect/t/vec.test
modified:
  storage/connect/plgdbutl.cpp
2013-02-11 17:50:01 +04:00
631272334b Adding a test which crashed in ealier versions (dbf01.sql from Bar)
modified:
  mysql-test/suite/connect/r/dbf.result
  mysql-test/suite/connect/t/dbf.test
2013-02-11 14:42:23 +04:00
3f36dfe38c MDEV-4123 fix.
Missed update_used_tables() call for multi-update values.
2013-02-11 10:55:58 +02:00
204086bd0d Fixing test failure cause by recent changes in ODBC catalogue functions.
modified:
  mysql-test/suite/connect/r/odbc_xls.result
  mysql-test/suite/connect/t/odbc_xls.test
2013-02-11 12:05:22 +04:00