Commit graph

77591 commits

Author SHA1 Message Date
unknown
7b6ab5638a MDEV-4483: CHANGE MASTER TO master_use_gtid=xxx looses old-style coordinates.
There was some old code that cleared the position in CHANGE MASTER,
it was forgotten to be removed.

In addition, add code that saves/restores the old-style position
when we nuke the old relay logs as part of GTID slave start.
Normally we will not use these, but it could be useful in case
the GTID connect fails and user wants to go back to the old-style
coordinates.
2013-06-07 08:43:21 +02:00
Sergei Golubchik
4749d40c63 5.5 merge 2013-06-06 17:51:28 +02:00
Vladislav Vaintroub
1ff1cb10fc fix compile error 2013-06-06 17:38:07 +02:00
Michael Widenius
5cf5a9a1e8 Fixed timing failure in myisam-metadata.test
mysql-test/include/wait_show_condition.inc:
  Print failing statement if timeout
mysql-test/r/myisam-metadata.result:
  Updated DBUG_SYNC
mysql-test/t/myisam-metadata.test:
  Updated DBUG_SYNC.
  Removed wait_show_condtion, as this is not needed when we use DBUG_SYNC
  This should fix timing issues with the test
mysys/thr_mutex.c:
  Added comments
sql/sql_acl.cc:
  atoi -> atoll()  (Safety)
storage/myisam/ha_myisam.cc:
  Send signal before mi_repair_by_sort.
2013-06-06 15:51:36 +03:00
unknown
64e53a0f81 Fix two small problems in previous push. 2013-06-05 15:32:44 +02:00
unknown
5cb486d159 MDEV-26: Global transaction ID.
Fix problems related to reconnect. When we need to reconnect (ie. explict
stop/start of just the IO thread by user, or automatic reconnect due to
loosing network connection with the master), it is a bit complex to correctly
resume at the right point without causing duplicate or missing events in the
relay log. The previous code had multiple problems in this regard.

With this patch, the problem is solved as follows. The IO thread keeps track
(in memory) of which GTID was last queued to the relay log. If it needs to
reconnect, it resumes at that GTID position. It also counts number of events
received within the last, possibly partial, event group, and skips the same
number of events after a reconnect, so that events already enqueued before the
reconnect are not duplicated.

(There is no need to keep any persistent state; whenever we restart slave
threads after both of them being stopped (such as after server restart), we
erase the relay logs and start over from the last GTID applied by SQL thread.
But while the SQL thread is running, this patch is needed to get correct relay
log).
2013-06-05 14:32:47 +02:00
unknown
7ad47ab0e0 MDEV-4605: Failing to load GTID slave position from rpl.gtid_slave_pos
There were several cases where the slave GTID position was not loaded
correctly before being used. This caused various failures such as
corrupting the position at slave start and empty values of
@@gtid_slave_pos and @@gtid_current_pos.

Fixed by adding more checks for loaded position, and by always loading
the position at server startup.
2013-06-03 07:41:38 +02:00
Vladislav Vaintroub
33ef993773 Fix a compile warning on NetBSD 2013-06-01 21:33:26 +02:00
Vladislav Vaintroub
689c1b44a9 MDEV-4607 : libreadline-related compilation problems on NetBSD.
Problem : 
libreadline.so was already present on the machine, however the cmake check NEW_READLINE_INTERFACE was unsuccessfull indicating, thus bundled library had to be used instead of  system library.
The problem was that the value for HAVE_HIST_ENTRY cmake variable  was cached with incorrect  value (1 on NetBSD).

The fix is to change HAVE_HIST_ENTRY to 0 with  CACHE FORCE, after switching to bundled readline.
2013-06-01 21:30:33 +02:00
unknown
22b60fa95c MDEV-4520: Assertion `0' fails in Query_cache::end_of_result on concurrent drop event and event executio
Fix for embedded library, where thd->net.vio is not set which efficently switched off QC in emmbedded server for previous patch.
2013-05-30 08:23:49 +03:00
unknown
6feadb1082 MDEV-4485: Incorrect error handling in record_gtid().
Fix the error handling when access to the table mysql.gtid_slave_pos
fails for whatever reason. Add some test cases.
2013-05-29 14:23:40 +02:00
unknown
385780f571 MDEV-4485: Master did not allow slave to connect from the very start (empty GTID pos) if GTIDs from other multi_source master was present
The idea in the code was to protect the user that tries to connect a slave
to a master with completely different domains than what was intended. If
none of the domains in the start position are present at all in the master
binlog, we gave an error.

However, this is a stupid idea. Because when a slave connects to a master
to start replication from the very start of binlogs - such as when setting
up new master->slave servers from scratch - there will be just this
situation, the requested slave position is empty for all the domains in the
master's binlog.

So the code that gives this error is wrong, and the solution is simply to
remove it.
2013-05-29 11:41:25 +02:00
Sergei Golubchik
1db0c42e53 followup for revision 3751 "centos5 gcc 4.1 asm bug"
remove the workaround from cmake/os/FreeBSD.cmake
2013-05-28 21:25:59 +02:00
unknown
3061ca2be5 Fix type-typo which caused windows build failure. 2013-05-28 16:35:05 +02:00
unknown
ee2b7db3f8 MDEV-4478: Implement GTID "strict mode"
When @@GLOBAL.gtid_strict_mode=1, then certain operations result
in error that would otherwise result in out-of-order binlog files
between servers.

GTID sequence numbers are now allocated independently per domain;
this results in less/no holes in GTID sequences, increasing the
likelyhood that diverging binlogs will be caught by the slave when
GTID strict mode is enabled.
2013-05-28 13:28:31 +02:00
unknown
f5319394e3 MDEV-4475 follow-up patch: Add forgotten initialisation of the padding for empty Gtid_List event 2013-05-25 06:32:00 +02:00
unknown
416aed25ed MDEV-4475: Replication from MariaDB 10.0 to 5.5 does not work
The problem was the Gtid_list event which is logged to the binlog in
10.0 and is not understood by the 5.5 server.

This event is supposed to be replaced with a dummy event for 5.5
servers. But the very first event logged in the very first binlog
has an empty list of GTID, which makes the event too short to be
replacable with an empty event.

The fix is to pad the empty Gtid_list event to be big enough to
be replacable by a dummy event.
2013-05-24 22:21:08 +02:00
unknown
b9ce8572d9 MDEV-4520: Assertion `0' fails in Query_cache::end_of_result on concurrent drop event and event execution
If there is no net.vio then query cache cant't get data via net_real_write() so it is better just do not try to cache such query.
2013-05-23 17:05:31 +03:00
unknown
1cd6eb5f94 MDEV-26: Global transaction ID.
Change of user interface to be more logical and more in line with expectations
to work similar to old-style replication.

User can now explicitly choose in CHANGE MASTER whether binlog position is
taken into account (master_gtid_pos=current_pos) or not (master_gtid_pos=
slave_pos) when slave connects to master.

@@gtid_pos is replaced by three separate variables @@gtid_slave_pos (can
be set by user, replicated GTIDs only), @@gtid_binlog_pos (read only), and
@@gtid_current_pos (a combination of the two, most recent GTID within each
domain). mysql.rpl_slave_state is renamed to mysql.gtid_slave_pos to match.

This fixes MDEV-4474.
2013-05-22 17:36:48 +02:00
Vladislav Vaintroub
7ba2ff93ac MDEV-4548 - compile sphinx.so/dll and include into packages
replaced snippets_udf.cc with the latest version (2.0.8 from sphinxsource.com), fixed trivial errors on Windows.
It will be compiled and installed into plugins directory now.
2013-05-22 16:44:44 +02:00
Vladislav Vaintroub
ef1e767ae3 MDEV-4553 - Fixes for compilation under NetBSD. 2013-05-27 16:35:42 +02:00
Sergei Golubchik
9bc4c4183d MDEV-4516 SELECT from I_S.QUERY_CACHE_INFO produces ER_UNKNOWN_ERROR when query cache size is 0
if qc->try_lock() fails, it's not an error
2013-05-24 14:33:04 +02:00
Sergei Golubchik
cb246b20d6 fix for compiled-in FederatedX 2013-05-21 18:56:35 +02:00
Sergei Golubchik
d6315e29c8 MDEV-388 Creating a federated table with a non-existing server returns a random error code
(part 2)
2013-05-21 13:03:37 +02:00
Sergei Golubchik
ec043aced0 5.3 merge 2013-05-21 09:43:34 +02:00
Sergei Golubchik
fce7fc43ba fixes for buildbot 2013-05-21 09:42:10 +02:00
Sergei Golubchik
62ab6982a4 MDEV-388 Creating a federated table with a non-existing server returns a random error code 2013-05-20 23:58:44 +02:00
Sergei Golubchik
7e4150d7cd increase MAX_HA (number of simultaneously installed storage engines) to 64 2013-05-20 13:41:03 +02:00
Sergei Golubchik
d7a6c801ac 5.3 merge.
change maria.distinct to use a function that doesn't require ssl-enabled  builds
2013-05-20 12:36:30 +02:00
Sergei Golubchik
639a766096 5.2 merge 2013-05-20 11:13:07 +02:00
Sergei Golubchik
4ee5ae3e7f 5.1 merge 2013-05-20 10:53:04 +02:00
Vladislav Vaintroub
db7085dfae remove start menu shortcut to upgrade wizard 2013-05-19 17:42:30 +02:00
Vladislav Vaintroub
b67ec975dc MDEV-4544 : Update MSI installer to use latest HeidiSQL 8.0 2013-05-19 17:41:22 +02:00
Vladislav Vaintroub
dc56d56ce5 MDEV-4544 - update MSI to include HeidiSQL 8.0 2013-05-19 16:38:56 +02:00
Vladislav Vaintroub
cbd300e7b0 Fix cpack error - safe_process.pl does not exist anymore. 2013-05-19 16:22:33 +02:00
Alexander Barkov
3ef880cb59 Bug#MDEV-4518 Server crashes in is_white_space when it's run
with query cache, charset ucs2 and collation ucs2_unicode_ci

  @ mysql-test/r/ctype_ucs2_query_cache.result
  @ mysql-test/t/ctype_ucs2_query_cache-master.opt
  @ mysql-test/t/ctype_ucs2_query_cache.test
    Adding tests

  @ sql/sql_cache.cc
    Fixing not to use default_character_set->state_map,
    which can point to a non-ASCII character set (utc2, utf16, utf32)
   and thus have state_map undefined.
2013-05-17 10:16:56 +04:00
unknown
d795bc9ff8 Fix race condition in binlog dump thread during server shutdown.
There was missing a check for THD::killed after THD::enter_cond(). This could
cause the binlog dump thread to miss the kill signal during server shutdown
and hang until it was force-closed.

Also fix a race in a test case that occasionally fails in Buildbot.
2013-05-16 12:41:11 +02:00
unknown
9fae993024 MDEV-26: Global transaction ID.
Implement START SLAVE UNTIL master_gtid_pos = "<GTID position>".

Add test cases, including a test showing how to use this to promote
a new master among a set of slaves.
2013-05-15 19:52:21 +02:00
Michael Widenius
0fa7729954 - Solaris fixes:
- Fixed that wait_timeout_func and wait_timeout tests works on solaris
  - We have to compile without NO_ALARM on Solaris as Solaris doesn't support timeouts on sockets with setsockopt(.. SO_RCVTIMEO).
  - Fixed that compile-solaris-amd64-debug works (before that we got a wrong ELF class: ELFCLASS64 on linkage)
- Fixed some compiler warnings
- Fixed some failing tests

BUILD/compile-solaris-amd64-debug:
  Fixed that compile-solaris-amd64-debug works (before that we got a wrong ELF class: ELFCLASS64 on linkage)
configure.cmake:
  We have to compile without NO_ALARM on Solaris as Solaris doesn't support timeouts on sockets with setsockopt(.. SO_RCVTIMEO)
mysql-test/suite/parts/t/partition_basic_innodb.test:
  Mark test as big test (as otherwise we get timeout on our opensolaris machine in buildbot)
mysql-test/suite/rpl/t/rpl_cant_read_event_incident.test:
  Remove warning
2013-05-15 16:28:12 +03:00
Alexey Botchkov
19cb1c4748 MDEV-4266 Server upgrade via apt-get install does not work.
Now empty 'highlevel' packages strictly depend on the same versions of files.
        These are mariadb-server, mariadb-client, mariadb-test

per-file comments:
  debian/dist/Debian/control
MDEV-4266 Server upgrade via apt-get install does not work.
        dependencies on the current version added.
  debian/dist/Ubuntu/control
MDEV-4266 Server upgrade via apt-get install does not work.
        dependencies on the current version added.
2013-05-15 02:36:37 +05:00
Alexey Botchkov
c2ee0218ba MDEV-4521 MBRContains, MBRWithin no longer work with geometries of different type.
get_mm_leaf function can store all sorts of spatial features in
        one type of field it receives from an Item_field.
        So we just allow that by setting the type of this field to GEOMETRY.

per-file comments:
  mysql-test/r/gis-rtree.result
        result updated
  mysql-test/t/gis-rtree.test
        test case added.
  sql/opt_range.cc
        set geom_type=GEOMETRY if we got Field_geom.
2013-05-15 02:33:29 +05:00
Michael Widenius
d0265a632f When one does 'REPAIR TABLE', update uuid() to the current system
mysql-test/suite/maria/maria-autozerofill.result:
  Updated result
mysql-test/suite/maria/maria-autozerofill.test:
  Added test that zerofilled table should not give any warnings when table is used
mysql-test/suite/maria/maria-recovery2.result:
  More tests to make it easier to find bugs
mysql-test/suite/maria/maria-recovery2.test:
  More tests to make it easier to find bugs
storage/maria/ha_maria.cc:
  Set create_trid after repair (needed if table was moved from another system)
  Set uuid after repair (needed if table was moved from another system)
storage/maria/maria_chk.c:
  Reset share->state.create_trid if we reset share->state.create_rename_lsn.
  Make the table moveable
2013-05-14 18:32:16 +03:00
unknown
97463576ad Fix test failure in plugins.unix_socket when running tests as user root.
(The problem is that if $USER is root, then the authentication will log
in with the mysqld user root. And then CURRENT_USER() returns a valid
user, giving .result file difference).
2013-05-14 14:49:52 +02:00
Sergei Golubchik
66cc619609 MDEV-4514 After increasing user name length mysql.db is reported broken and event scheduler does not start 2013-05-13 16:11:39 +02:00
Sergei Golubchik
3aa50f64bb MDEV-4505 Buffer overrun when processing --log-bin parameter without file name
because --log-bin sets opt_bin_logname to ""
(same for any OPT_ARG GET_STR (or GET_STR_ALLOC) option)
2013-05-13 15:49:48 +02:00
Sergei Golubchik
7642154725 MDEV-4199 Installing postfix on CentOS 5.9 requires MariaDB-server
to match distribution packages better:
  remove "mysql" from server.rpm Provides, add it to the shared.rpm Provides.
  fake provides that "mysql" and "mysql-libs" packages would've had.

cleanup:
  remove auto-generated provides from the manual provides list.
2013-05-13 15:49:27 +02:00
Sergei Golubchik
17b230783f fix test cases 2013-05-13 15:46:58 +02:00
Michael Widenius
668306640e Fixed MDEV-4291: Assertion `trid >= info->s->state.create_trid' failure or data corruption (key points to record
outside datafile) on INSERT into an Aria table.

The isssue was that the check if a table was moved between systems didn't take into account that create_trid could be bigger than the current max trid on the new system.
This could only happen if one tried to move a table that one had just done a 'REPAIR TABLE' on.
Tables that one had run 'aria_chk --zerofill' on worked.

Fixed this by assuming that if create_trid is too big then the table has been moved from one system to another and we have to do an automatic zerofill.

Other fixed:

- Added a check to detect a wrong create_trid in 'check table'.
- aria_chk -dvv will now write out also the create_trid (to make future error finding easier)
- aria_chk --zerofill doesn't anymore require a aria_control_file
- Removed some warnings from safemalloc when using aria_chk, ma_test1 and ma_test2.


include/myisamchk.h:
  Removed wrong 'QQ' flags (the flags are used by myisamchk and aria_chk)
storage/maria/ha_maria.cc:
  maria_chk_status() can now also return an error.
storage/maria/ma_check.c:
  In maria_chk_status() check if create_trid value is too big.
storage/maria/ma_open.c:
  Changed check if table is moved so that we can detect wrong create_trid values.
  Don't set STATE_NOT_MOVABLE flag if we are doing repair/check. This was done so that aria_chk can print out the movable flag.
storage/maria/ma_test1.c:
  Added code to suppress memory leaks from safemalloc
storage/maria/ma_test2.c:
  Added code to suppress memory leaks from safemalloc
storage/maria/maria_chk.c:
  Added code to suppress memory leaks from safemalloc.
  Make help text a bit better for --HELP and --zerofill.
  Incresed version number.
  Don't require a control file if we are only doing --zerofill
  Print out 'create_trid' when doing --describe --verbose
storage/maria/unittest/ma_test_recovery.expected:
  Updated result file
2013-05-13 00:43:46 +03:00
Michael Widenius
3bd6e4b8ee MDEV-3999: Valgrind errors 'invalid write' or assorted server crashes on concurrent flow with partitioned Aria tables
MDEV-3989: Server crashes on import from MariaDB mysqldump export with partitioned Aria table.

Problem was that bulk insert in aria was not properly protected against concurrent selects.


storage/maria/ha_maria.cc:
  Move settings of file->state to _ma_block_start_trans() to ensure that lock_key_trees is not changed by a concurrent bulk_insert.
storage/maria/ma_check.c:
  Added DBUG_ASSERT()
storage/maria/ma_open.c:
  Set start_trans to ma_start_trans for default behaviour.
storage/maria/ma_pagecrc.c:
  Removed test for 'non_transactional' as a now_transactinal could be reset while a flush was happening.
storage/maria/ma_state.c:
  Moved setting of info->state from external_lock to start_trans to protect against concurrent running bulk inserts.
  This works as the other threads will wait in thr_lock() until bulk_insert is done and keys are re-generated.
storage/maria/ma_state.h:
  Added _ma_start_trans()
2013-05-12 11:29:16 +03:00
Michael Widenius
0737932b90 Fixed that SHOW PROCESSLIST and information_schema.processlist uses the right length for user names.
Fixed some failing tests


mysql-test/mysql-test-run.pl:
  Removed warning from mysql-test-run
mysql-test/r/create.result:
  Updated result
mysql-test/r/log_slow.result:
  Fixed failing test
mysql-test/suite/funcs_1/r/is_columns_is.result:
  Updated result
mysql-test/suite/funcs_1/r/processlist_priv_no_prot.result:
  Updated result
mysql-test/suite/funcs_1/r/processlist_val_no_prot.result:
  Updated result
mysql-test/t/log_slow.test:
  Ensure variables are properly reset at end of test
sql/sql_show.cc:
  Fixed max length for user names
2013-05-11 20:31:50 +03:00