Commit graph

33457 commits

Author SHA1 Message Date
Igor Babaev
96f8058a7c Fixed bug mdev-5204.
Always use the value of table::file->stats.records when checking
whether a table with HA_STATS_RECORDS_IS_EXACT flag contains not
more than 1 record.
2013-11-27 09:06:34 -08:00
Sergey Petrunya
928543ca6c MDEV-5344: LEFT OUTER JOIN table data is lost in ON DUPLICATE KEY UPDATE section
- For INSERT ... SELECT ... ON DUPLICATE KEY UPDATE, table elimination should 
  check which tables are referenced in the ON DUPLICATE KEY UPDATE clause.
2013-11-27 17:43:16 +04:00
Igor Babaev
acc539a2c4 Added the test case for bug mdev-5200.
The bug was fixed by the patch applied to the 5.3 tree in the revision 3727.
2013-11-26 15:04:21 -08:00
unknown
7a1f31866c MDEV-4946: IO thread should expose its current GTID position
Add another column to SHOW SLAVE STATUS, and adjust test suite
to cope.
2013-11-25 15:21:25 +01:00
Sergei Golubchik
c6d30805db 5.5 merge 2013-11-23 00:50:54 +01:00
Alexander Barkov
09c6638b87 A clean-up for the previous commit (mtr mysql_tzinfo_to_sql_symlink) 2013-11-22 12:20:29 +04:00
Alexander Barkov
a082ea78c2 "mtr mysql_tzinfo_to_sql_symlink" failed in out-of-source builds with this error:
mysql-test-run: *** ERROR: Could not find any of
/mariadb-5.5.34/sql/mysql_tzinfo_to_sql
/mariadb-5.5.34/build/client/mysql_tzinfo_to_sql
Fixed the directory list to search mysql_tzinfo_to_sql binary in.
2013-11-22 11:52:19 +04:00
Igor Babaev
d34e46795e Merge 5.3->5.5 2013-11-21 21:40:43 -08:00
Igor Babaev
8224d95524 Merge 2013-11-21 18:28:20 -08:00
Igor Babaev
c0f31dc9f3 Another attempt to fix bug mdev-5103.
The earlier pushed fix for the bug was incomplete. It did not remove
the main cause of the problem: the function remove_eq_conds()
removed always true multiple equalities from any conjunct, but did not
adjust the list of them stored in Item_cond_and::cond_equal.current_level.

Simplified the test case for the bug and moved it to another test file.

The fix triggered changes in EXPLAIN EXTENDED for some queries.
2013-11-21 15:19:25 -08:00
Sergei Golubchik
f5ba8397e2 unreserve GET keyword 2013-11-21 14:25:28 +01:00
Alexander Barkov
1345a75922 MroongaSE: addint thd_autoinc and thd_error_context plugin services 2013-12-12 19:18:49 +04:00
Alexander Barkov
67f514382b MDEV-5431 Test main.ctype_latin2 fails in buildbot
Fixing include/ctype_datetime.inc not to depend on the current time zone.
2013-12-11 16:37:53 +04:00
Sergey Vojtovich
af2129f952 MDEV-5319 - Request for merge of Oqgraph v3 functionality storage/oqgraph
into 10.0
2013-12-11 13:02:12 +04:00
Alexander Barkov
03f6778d61 MDEV-5298 Illegal mix of collations on timestamp
Fixed.
2013-12-10 13:34:59 +04:00
Alexander Barkov
1f4f425a20 MDEV-5297 TIME(0), TIMESTAMP(0) and DATETIME(0) are self-incompatible during replication (upstream)
Fixed.
2013-12-06 19:02:55 +04:00
Alexander Barkov
d240a0418c Merge 10.0-connect -> 10.0 2013-12-03 14:12:53 +04:00
Alexander Barkov
5bb01fa1ac MDEV-5357 REGEXP word boundaries don't work
Applied a patch from Philip Hazel implementing the non-standard
syntax for word boundaries in PCRE, for compatibility with the
old Henry Spencer's regex library.
2013-12-02 14:39:08 +04:00
Alexander Barkov
d25d7ec589 Fixing malformed data in mysql-test/std_data/Index.xml 2013-11-26 10:53:21 +04:00
Sergey Vojtovich
e5a80a307c MDEV-5277 - Ensure that all MySQL 5.6 options are supported by the
MariaDB 10.0 server
2013-11-25 18:49:40 +04:00
Sergey Petrunya
a428199298 Merge 2013-11-21 16:32:03 +04:00
unknown
55a7159f53 MDEV-4982: GTID looses all binlog state after crash if InnoDB is disabled
MDEV-4725: Incorrect binlog state recovery if crash while writing event group

The binlog state was not recovered correctly if XA is not used (eg. InnoDB
disabled), or if server crashed in the middle of writing an event group to the
binlog.

With this patch, we ensure that recovery of binlog state is done even if we do
not do the full XA binlog recovery, and we ensure that we only recover fully
written event groups into the binlog state.
2013-11-21 14:42:25 +01:00
Sergey Petrunya
bcd854fe33 MDEV-5308 Crash when running with slow_query_log=1
- Make log_slow_statement() always call delete_explain_query().
2013-11-21 16:29:46 +04:00
Sergey Petrunya
1926b83977 MDEV-5059: Wrong result (missing row) wih semijoin, join_cache_level > 2, LEFT JOIN, ORDER BY
- Added testcase
2013-11-21 13:35:20 +04:00
Alexander Barkov
146c8a4874 Merge 5.5->10.0-base 2013-11-21 13:16:26 +04:00
Alexander Barkov
2394fa67d4 MDEV-4859 Wrong value and data type of "SELECT MAX(time_column) + 1 FROM t1"
Fixed.
2013-11-21 11:46:36 +04:00
Sergey Petrunya
89ea0fc034 Merge 2013-11-21 11:21:53 +04:00
Alexander Barkov
c7355b1982 Merge 5.3->5.5 2013-11-21 13:09:08 +04:00
Sergey Petrunya
c4defdc8d9 MDEV-5161: Wrong result (missing rows) with semijoin, LEFT JOIN, ORDER BY, constant table
- Don't pull out a table out of a semi-join if it is on the inner side of an outer join.
- Make join->sort_by_table= get_sort_by_table(...) call after const table detection 
  is done. That way, the value of join->sort_by_table will match the actual execution.
  Which will allow the code in setup_semijoin_dups_elimination() (search for 
  "Make sure that possible sorting of rows from the head table is not to be employed." 
  to see that "Using filesort" is going to be used together with Duplicate Elimination (
  and change it to Using temporary + Using filesort)
2013-11-21 11:19:01 +04:00
Andrew McDonnell
ee44bfae6c Fix typo in MTR script that triggered a deprecation warning after 10.0.7 merge 2013-11-20 21:56:51 +10:30
Andrew McDonnell
4ef0fd6725 Merge in latest maria 10.0.7 beta 2013-11-20 21:35:39 +10:30
Alexander Barkov
5a8bd446ad Merge 5.3->5.5
pending merges:
  Alexander Barkov 2013-12-02 MDEV-4857 Wrong result of HOUR('1 00:00:00')
2013-12-02 15:50:35 +04:00
Alexander Barkov
87355a453d Merge 5.3 -> 5.5
pending merges:
  Sergey Petrunya 2013-11-27 MDEV-5344: LEFT OUTER JOIN table data is lost...
2013-12-02 15:17:21 +04:00
Elena Stepanova
253ed701e9 A fix for MySQL#65146 introduced a new warning.
Minor wording changes in skip messages.
2013-11-28 19:54:07 +04:00
unknown
170e9e593d MDEV-5306: Missing locking around rpl_global_gtid_binlog_state
There were some places where insufficient locking between
parallel threads could cause invalid memory accesses and
possibly other grief.

This patch adds the missing locking, and moves the locking
into the struct rpl_binlog_state methods to make it easier
to see that proper locking is in place everywhere.
2013-11-18 15:22:50 +01:00
Sergei Golubchik
45f81d4dcf merge 2013-11-20 09:20:48 +01:00
Sergei Golubchik
fa3f8a18b2 mysql-5.5.34 merge
(some patches reverted, test case added)
2013-11-19 13:16:25 +01:00
Sergey Petrunya
bc956c0046 MDEV-5069: Server crashes in SEL_ARG::increment_use_count with index_merge+index_merge_sort_union, FORCE INDEX
- Don't call incr_refs() is the merged SEL_ARG* is NULL.
2013-11-19 13:47:35 +04:00
Sergey Petrunya
8af289d2b0 MDEV-5293: outer join, join buffering, and order by - invalid query plan
- make_join_readinfo() has the code that forces use of "Using temporary; 
  Using filesort" when join buffering is in use.
  That code didn't handle all cases, in particular it didn't hande the case 
  where ORDER BY originally has tables from multiple columns, but the 
  optimizer eventually figures out that doing filesort() on one table 
  will be sufficient.  Adjusted the code to handle that case.
2013-11-18 12:26:25 +04:00
Jan Lindström
e730c91688 Added test case for new system variable innodb_use_stacktrace and made sure that it can be used only on startup. Fixed compiler problems on solaris and other platforms that do not contain necessary headers and functions. 2013-11-15 15:24:42 +02:00
Sergei Golubchik
718c8c6044 5.3 merge 2013-11-15 10:06:23 +01:00
Igor Babaev
f8a6ee59ac Fixed bug mdev-5288.
This bug was a consequence of the incorrect fix for bug mdev-5091.
2013-11-14 13:25:05 -08:00
unknown
def3c98af4 MDEV-5291: Slave transaction retry on temporary error leaves dangling error in SHOW SLAVE STATUS
Make sure to clear the temporary error before the retry.
2013-11-14 15:08:29 +01:00
Sergey Vojtovich
1da6d6880b MDEV-5220 - [PATCH] MariaDB 10.0.4 doesn't compile without perfschema
Fixed the following compilation errors and test failures:
- maria SE: "stage_waiting_for_a_resource" wasn't declared w/o PFS
- sql_repl.h: PSI_mutex_key is not available in non-PFS builds
- mysqld.cc: pfs_param is not available in non-PFS builds
- mysqld.cc: init_show_explain_psi_keys() is not available in non-PFS builds
- mysqld.cc: call net_before_header_psi, net_after_header_psi even if PFS
  is not available so that thread enters stage_init at proper time. Fixes
  sp-threads and a few tests in funcs_1.
- myisam_file_io.opt: added missing loose prefix
2013-11-14 18:00:00 +04:00
Jan Lindström
67215833df Add new configuration variable 2013-11-14 14:43:24 +02:00
Alexander Barkov
9c3a76c879 Merge 5.3->5.5 2013-11-14 16:26:37 +04:00
Alexander Barkov
41b0545194 Merge 5.2->5.3 2013-11-14 16:14:09 +04:00
Alexander Barkov
94bef7f99f Merge 5.1->5.2 2013-11-14 16:11:43 +04:00
Alexander Barkov
0657f102af MDEV-5290 MTR cannot find mysql_tzinfo_to_sql on Windows
mysql_tzinfo_to_sql is not compiled under Windows in the pre-5.5 versions.
Do not set the MYSQL_TZINFO_TO_SQL variable in the version prior to 5.5
under Windows.
2013-11-14 16:09:32 +04:00
Alexey Botchkov
b69ed7d621 MDEV-4437 ALTER TABLE .. ADD UNIQUE INDEX IF NOT EXISTS causes syntax error.
Added the IF NOT EXISTS option to the CONSTRAINT keyword.
2013-11-14 14:31:30 +04:00
Igor Babaev
222acc635b Merge 2013-11-13 15:31:12 -08:00
Igor Babaev
ae40c72077 Fixed bug mdev-5091.
The function SELECT_LEX::update_used_tables should process all
ORDER BY lists in any subselect of a union.
2013-11-13 14:43:09 -08:00
Sergei Golubchik
4157185f24 10.0-base merge 2013-11-13 23:03:48 +01:00
Sergei Golubchik
c155890af9 MDEV-5248 Serious incompatibility and data corruption of DATETIME and DATE types due to get_innobase_type_from_mysql_type refactor combined with InnoDB Online DDL
restore old innodb get_innobase_type_from_mysql_type() function,
record all mysql_type->innodb_type mapping
(as generated by mysql-5.6).
add safety code to disable online alter when internal types don't match

storage/innobase/dict/dict0stats.cc:
  revert to 5.6 state
2013-11-13 22:58:19 +01:00
Sergei Golubchik
80137baf2f MDEV-5275 Problems upgrading from MySQL 5.1 to MariaDB
correct bugs in mysql_system_tables_fix.sql.
Update system_mysql_db_fix* tests
2013-11-13 22:58:10 +01:00
Elena Stepanova
4f0dabcfba Fixes for storage_engine tests on Windows 2013-11-13 23:03:27 +04:00
Elena Stepanova
972b9f4ee2 Workaround for the delayed InnoDB error messages in the log file 2013-11-13 22:28:26 +04:00
Alexander Barkov
d7463f8e59 Merge 5.3 -> 5.5 2013-11-13 19:16:35 +04:00
Alexander Barkov
e4608eb3c1 Merge 5.2 -> 5.3 2013-11-13 18:34:12 +04:00
Alexander Barkov
1bb3a0e3c8 Merge 5.1 -> 5.2 2013-11-13 18:28:40 +04:00
Alexander Barkov
f2cfcd91f5 MDEV-5226 mysql_tzinfo_to_sql errors with tzdata 2013f and above
Allow only one level of symlink recursion in mysql_tzdata_to_sql,
to avoid infinite loops.
2013-11-13 18:26:03 +04:00
Sergei Golubchik
bdd883ed9a 5.5. merge 2013-11-13 14:07:58 +01:00
Sergei Golubchik
f3a78f392d 5.3 merge 2013-11-13 13:38:37 +01:00
Sergei Golubchik
b468cd4749 MDEV-5284 Assertion `!(*expr)->fixed' fails in replace_where_subcondition with IN suquery 2013-11-13 12:43:39 +01:00
Sergey Petrunya
86b8ed3eab Merge 2013-11-13 08:29:12 +04:00
Sergey Petrunya
229aa1d4bf MDEV-5056: Wrong result (extra rows) with materialization+semijoin, IN subqueries
Apply fix suggested by Igor:
- When eliminate_item_equal() generates pair-wise equalities from a 
  multi-equality,  do generate a "bridge" equality between the first 
  field inside SJM nest and the field that's first in the overall multi-equality.
2013-11-13 07:40:46 +04:00
Sergei Golubchik
441192bfb0 MDEV-5113 Wrong result (extra row) and valgrind warnings in Item_maxmin_subselect::any_value on 2nd execution of PS with SELECT subquery
When setting Item_func_not_all::test_sum_item or Item_func_not_all::test_sub_item,
reset the other one to NULL - they can never be set both. When a PS is reexecuted,
different executions might be optimized differently and a wrong test_su*_item
might stay set from the previous execution.
2013-11-12 15:02:25 +01:00
Sergey Petrunya
88bf8b9c8f MDEV-5257: MIN/MAX Optimization (Select tables optimized away) does not work for DateTime
- MIN/MAX optimizer does a check whether a "field CMP const" comparison uses a constant 
  that's longer than the field it is compared to.  Make this check only for string columns,
  also compare character lengths, not byte lengths.
2013-11-12 17:37:32 +04:00
Alexander Barkov
fad7371191 Merging xxx_unicode_520_ci and xxx_vietnamese_ci from MySQL-5.6. 2013-11-12 16:48:57 +04:00
Igor Babaev
e0d9a25690 Fixed bug mdev-5160.
The used_tables attribute must be recalculated for the HAVING condition
if the condition is applied to the rows read from a temporary table.
2013-11-11 22:21:39 -08:00
Elena Stepanova
55e9bfd4d9 Windows-specific suppression and perl problems 2013-11-12 02:19:27 +04:00
unknown
55de9b0468 merge 10-base->10.0 2013-11-11 23:40:53 +02:00
unknown
3a75900b91 merge 5.5->10.0-base 2013-11-11 22:47:04 +02:00
Elena Stepanova
e0f7f8242d Fixes for Windows and different time zones 2013-11-11 23:40:40 +04:00
Alexander Barkov
383de0fd1f Merge 10.0-monty -> 10.0 2013-11-11 22:46:14 +04:00
unknown
dfed447888 merge 5.3->5.5 2013-11-11 20:38:04 +02:00
Alexey Botchkov
06a91b18d7 MDEV-4436 CHANGE COLUMN IF EXISTS does not work and throws wrong warning.
Use sql_field->change parameter as the name of the field.
2013-11-11 19:45:55 +04:00
unknown
c98a054fde MDEV-5153: Server crashes in Item_ref::fix_fields on 2nd execution of PS with LEFT JOIN and MERGE view or SELECT SQ
1. Transformation of row IN subquery made the same as single value.
2. replace_where_subcondition() made working on several layers of OR/AND because it called on expression before fix_fields().
2013-11-11 17:28:14 +02:00
Sergei Golubchik
f486f49e8d MDEV-4824 userstats - wrong user statistics
(and valgrind warnings)

* move thd userstat initialization to the same function
  that was adding thd userstat to global counters.
* initialize thd->start_bytes_received in THD::init
  (when thd->userstat_running is set)
2013-11-11 16:17:32 +01:00
unknown
c85db2c494 MDEV-5103: server crashed on singular Item_equal
Singular Item_equal support added.

The problem was that during constant table substitution Item_equal become containing only one constant which was not supported internally.
2013-11-11 16:40:46 +02:00
Alexey Botchkov
3cf7e283a6 MDEV-4435 Server crashes in my_strcasecmp_utf8 on ADD KEY IF NOT EXISTS with implicit name when the key exists.
Use field name as a key name if the key name wasn't specified.
2013-11-11 18:23:53 +04:00
Sergei Golubchik
80a523dbfb MDEV-5116 MariaDB upgrade breaks replication
mysql_upgrade should do --skip-write-binlog by default
2013-11-11 09:31:20 +01:00
Sergei Golubchik
e10d42d93b MDEV-5022 Strange message or wrong errno on mismatching versions of plugin and server
1. use an appropriate errno code
2. put a comma between the errno and the error message text
2013-11-11 09:31:09 +01:00
Sergei Golubchik
d042e61f8e MDEV-5054 Failing test(s): main.mysqld--help sys_vars.character_sets_dir_basic
fix tests where a path was used as a regex.
revert changes to sys_vars.character_sets_dir_basic - we don't run it on windows anyway
2013-11-11 09:31:02 +01:00
Sergei Golubchik
e780bd9efa MDEV-4977 ./mysql-test/mysql-test-run.pl not identifying mariadb version
quote the path when using it in a regex - the path might contain wildcards (e.g. +)
2013-11-11 09:30:58 +01:00
Sergei Golubchik
5ffa6904d2 MDEV-4880 Attempt to create a table without columns produces ER_ILLEGAL_HA instead of ER_TABLE_MUST_HAVE_COLUMNS 2013-11-10 17:51:20 +01:00
Sergei Golubchik
1c6394e503 MDEV-4931 Can't use SHUTDOWN in stored programs
keywords that a statement could start from can only be
in the 'keyword' list, never in the 'keyword_sp'
2013-11-10 17:51:06 +01:00
Sergei Golubchik
09b63917be MDEV-5238 Server crashes in find_role_grant_pair on SHOW GRANTS for an anonymous user 2013-11-10 17:50:52 +01:00
Elena Stepanova
700397a8e2 Fix for overlayed include files on Windows and a test case 2013-11-10 14:37:32 +04:00
Michael Widenius
192678e7bf MDEV-5241: Collation incompatibilities with MySQL-5.6
- Character set code & tests from Alexander Barkov
- Integration with ALTER TABLE, REPAIR and open_table from Monty

The problem was that MySQL 5.6 added some croatian and vitanamese character set collations that are incompatible with MariaDB.

The fix is to move the MariaDB conflicting collation numbers out of the region that MySQL is likely to use.
mysql_upgrade, REPAIR TABLE or ALTER TABLE will fix the collations.
If one tries to access and old incompatible table, one will get the error "Table upgrade required...."
After this patch, MariaDB supports all the MySQL character set collations and the old MariaDB croatian collations, which are closer to the latest standard than the MySQL versions.

New character sets:
ucs2_croatian_mysql561_uca_ci
utf8_croatian_mysql561_uca_ci
utf16_croatian_mysql561_uca_ci
utf32_croatian_mysql561_uca_ci
utf8mb4_croatian_mysql561_uca_ci

Other things:
- Fixed some compiler warnings
- mysql_upgrade prints information about repaired tables.
- Increased version number

VERSION:
  Increased VERSION number
client/mysqlcheck.c:
  Print repaired table name when using --verbose
include/m_ctype.h:
  Add new MariaDB collation regions that are not likely to conflict with MySQL
include/my_base.h:
  Added flag to detect if table was opened for ALTER TABLE
mysql-test/r/ctype_ldml.result:
  Updated result
mysql-test/r/ctype_uca.result:
  Updated result
mysql-test/r/ctype_upgrade.result:
  Updated result
mysql-test/r/ctype_utf16_uca.result:
  Updated result
mysql-test/r/ctype_utf32_uca.result:
  Updated result
mysql-test/r/ctype_utf8mb4_uca.result:
  Updated result
mysql-test/std_data/ctype_upgrade:
  Test files for testing upgrading of conflicting collations
mysql-test/suite/engines/funcs/r/db_alter_collate_ascii.result:
  New collations added
mysql-test/suite/engines/funcs/r/db_alter_collate_utf8.result:
  New collations added
mysql-test/suite/innodb/r/innodb_ctype_ldml.result:
  Updated test result
mysql-test/suite/innodb/t/innodb_ctype_ldml.test:
  Updated test result
mysql-test/suite/plugins/r/show_all_plugins.result:
  Updated version number
mysql-test/suite/roles/create_and_drop_role_invalid_user_table.result:
  Updated version number
mysql-test/t/ctype_ldml.test:
  Updated test
mysql-test/t/ctype_uca.test:
  Testing of new collations
mysql-test/t/ctype_upgrade.test:
  Testing of upgrading tables with old collations
  The test ensures that:
  - We will get an error if we try to open a table with old collations.
  - CHECK TABLE will detect that the table needs to be upgraded.
  - ALTER TABLE and REPAIR will fix the table.
  - mysql_upgrade works as expected
mysql-test/t/ctype_utf16_uca.test:
  Testing of new collations
mysql-test/t/ctype_utf32_uca.test:
  Testing of new collations
mysql-test/t/ctype_utf8mb4_uca.test:
  Testing of new collations
mysys/charset-def.c:
  Added new character sets
mysys/charset.c:
  Always give an error, if requested, if a character set didn't exist
sql/handler.cc:
  - Added upgrade_collation() to check if collation is compatible with old version
  - check_collation_compatibility() checks if we are using an old collation from MariaDB 5.5 or MySQL 5.6
  - ha_check_for_upgrade() returns HA_ADMIN_NEEDS_ALTER if we have an incompatible collation
sql/handler.h:
  Added new prototypes
sql/sql_table.cc:
  - Mark that tables are opened for ALTER TABLE
  - If table needs to be upgraded, ensure we are not using online alter table.
sql/table.cc:
  - If we are using an old incompatible collation, change to use the new one and mark table as incompatible.
  - Give an error if we try to open an incompatible table.
sql/table.h:
  Added error that table needs to be rebuild
storage/connect/ha_connect.cc:
  Fixed compiler warning
strings/ctype-uca.c:
  New character sets
2013-11-09 00:20:07 +02:00
Alexander Barkov
e02ad98c63 Merge 5.5 -> 10.0-base 2013-11-08 20:59:08 +04:00
Alexander Barkov
d79d0c4045 merge 5.3 -> 5.5 2013-11-08 14:30:35 +04:00
Alexander Barkov
a33bb00144 MDEV-4842 STR_TO_DATE does not work with UCS2/UTF16/UTF32 2013-11-08 14:18:16 +04:00
Sergei Golubchik
80112232d1 misc fixes for buildbot 2013-11-07 14:30:21 +01:00
Elena Stepanova
ae62e19f27 Various changes coming from 5.6 2013-11-08 23:25:06 +04:00
Elena Stepanova
54b443b9aa Some system tables have InnoDB engine 2013-11-08 23:24:27 +04:00
Elena Stepanova
317efa2a45 Semantics of ALTER ONLINE changed to mirror ALTER .. LOCK=NONE 2013-11-08 23:23:35 +04:00
Elena Stepanova
aefded6302 Duplicate warnings were removed 2013-11-08 23:21:58 +04:00
Elena Stepanova
66ed34d6ed More comprehensive error messages and codes 2013-11-08 23:21:26 +04:00
unknown
273bcb92c1 Merge 10.0-base to 10.0 2013-11-07 07:52:40 +01:00