Commit graph

173161 commits

Author SHA1 Message Date
Monty
7cd2095cde Sage cleanup in heap storage engine
Removed old not needed code withing #if
Changed 0x%lx to %p
2015-11-10 13:46:56 +02:00
Oleksandr Byelkin
7e4da9b370 DEV-8632 Segmentation fault on INSERT
View/derived fields should be taken into account when we build ref_pointer_array constructed.

DBUG_ASSERTs added to avoid memory overrun.
2015-11-09 16:08:06 +01:00
Sergei Petrunia
9f862ce026 MDEV#7383: engine-independent-stats column_stats has limited values for max/min values
Patch from Daniel Black:
- Change the charset of mysql.column_stats.{min_value, max_value} from
  utf8_bin varchar to varbinary
- Adjust the code that saves/reads the data accordingly.
- Also provide upgrade statement in mysql_system_tables_fix.sql
2015-11-09 17:58:35 +03:00
Nirbhay Choubey
7ec6558503 MDEV-9021: MYSQLD SEGFAULTS WHEN BUILT USING --WITH-MAX-INDEXES=128
The bitmap implementation defines two template Bitmap classes. One
optimized for 64-bit (default) wide bitmaps while the other is used for
all other widths.

In order to optimize the computations, Bitmap<64> class has defined its
own member functions for bitmap operations, the other one, however,
relies on mysys' bitmap implementation (mysys/my_bitmap.c).

Issue 1:
In case of non 64-bit Bitmap class, intersect() wrongly reset the
received bitmap while initialising a new local bitmap structure
(bitmap_init() clears the bitmap buffer) thus, the received bitmap was
getting cleared.

Fixed by initializing the local bitmap structure by using a temporary
buffer and later copying the received bitmap to the initialised bitmap
structure.

Issue 2:
The non 64-bit Bitmap class had the Iterator missing which caused
compilation failure.

Also added a cmake variable to hold the MAX_INDEXES value when supplied
from the command prompt. (eg. cmake .. -DMAX_INDEXES=128U). Checks have
been put in place to trigger build failure if MAX_INDEXES value is
greater than 128.

Test modifications:
* Introduced include/have_max_indexes_[64|128].inc to facilitate
skipping of tests for which the output differs with different
MAX_INDEXES.

* Introduced include/max_indexes.inc which would get modified by cmake
to reflect the MAX_INDEXES value used to build the server. This file
simply sets an mtr variable '$max_indexes' to show the MAX_INDEXES
value, which will then be consumed by the above introduced include file.

* Some tests (portions), dependent on MAX_INDEXES value, have been moved
to separate test files.
2015-11-09 09:28:00 -05:00
Vladislav Vaintroub
1694d81399 MDEV-8533 Debug embedded server does not build on Windows
pre/CMakeLists.txt defines CMAKE_DEBUG_POSTFIX which causes a different
library name on Windows debug build (pcred.lib rather than pre.lib)
However MERGE_LIBRARIES macro that is used to create static embedded
library (out of other static libraries), can  not handle per-configuration
library names. Thus the build fails with "pre.lib not found"

Fix is to remove unnecessary CMAKE_DEBUG_POSTFIX
2015-11-09 12:29:26 +01:00
Jan Lindström
5d754fce95 MDEV-8854: New warning messages are unreadable
Improved warning messages by quote marks.
2015-11-09 09:24:52 +02:00
Olivier Bertrand
ad916ef33c Merge branch 'ob-10.1' into 10.1 2015-11-08 14:56:48 +01:00
Olivier Bertrand
0a852591db PATCH-P0-FIX-UPSTREAM: Fix possible buffer overflow (MDEV-8317)
Maintainer: Michal Hrusecky <Michal.Hrusecky@opensuse.org>
(modified by O. Bertrand --> adding and using the XSTR macro)
  modified:   storage/connect/tabxml.cpp
2015-11-08 14:54:56 +01:00
Daniel Black
d6b430c91b MDEV-8995: systemd - 16K open-files-limit by default 2015-11-07 13:40:44 +11:00
Nirbhay Choubey
99283ba455 MDEV-8974: boostrap systemd service for galera is confusing
Fix the conditions for systemd scripts with '@' in path.
2015-11-06 20:02:45 -05:00
Oleksandr Byelkin
c88ca2c227 MDEV-8701 Crash on derived query
MDEV-8938 Server Crash on Update with joins

Make unique table check after setup_fields of update because unique table can materialize table and we do not need field resolving after materialization.
2015-11-06 17:56:56 +01:00
Vladislav Vaintroub
f1daf9ced4 MDEV-9024 Build fails with VS2015
Fix build failures caused by new C runtime library
- isnan, snprintf, struct timespec are now defined, attempt to
redefine them leads
- P_tmpdir, tzname are no more defined
-  lfind() and lsearch() in lf_hash.c had to be renamed,  declaration
conflicts with some C runtime functions with the same name declared in
a header included by stdlib.h

 Also fix couple of annoying warnings :
- remove #define NOMINMAX from config.h to avoid "redefined" compiler
warnings(NOMINMAX is already in compile flags)

- disable incremental linker in Debug as well (feature not used much
and compiler crashes often)


Also simplify package building with Wix, require Wix 3.9 or later
(VS2015 is not compatible with old Wix 3.5/3.6)
2015-11-06 17:27:24 +01:00
Elena Stepanova
125cf485b1 Fixed engine test results in accordance with changes made in scope of
commit 6b20342651
2015-11-06 17:52:57 +02:00
Sergei Petrunia
4e421687c2 Merge pull request #112 from openquery/MDEV-8981
MDEV-8981: Analyze stmt - cycles can overflow
2015-11-06 16:35:00 +03:00
Alexander Barkov
a36048d143 MDEV-7550 TokuDB crashes in build tests on Launchpad
When compiled with "-Wl,-Bsymbolic-functions" flags
(e.g. when building a .deb package on Ubuntu) with TokuDB and jemalloc,
mysqld crashed in toku_get_processor_frequency_cpuinfo() when
free()-ing a buffer returned by getline().
getline() uses libc malloc() internally, while free() is aliased
to jemalloc's free() in this configuration.
Fixing not to use getline(). Using a static buffer instead.
2015-11-06 12:26:03 +04:00
Sergey Vojtovich
b80cc31ab4 MDEV-9082 - Debian: mysql_install_db is called on upgrade
A comment in debian/mariadb-server-10.1.postinst says: "can safely run on
upgrades with existing databases". While this is true there're a few reasons not
to do that:
- it increases installation time (it has to run rather heavy mysqld multiple times)
- as well as it increases mysqld downtime
- it may fail if database has some plugin specific configs (see MDEV-8437)
- there should be no need to run this script on upgrade: they should be handled
  by mysql_upgrade to
- RPM postin doesn't call it if database directory exists

Also postinst is not supposed to create database directories: let
mysql_install_db do that intead.
2015-11-06 12:11:06 +04:00
Sergey Vojtovich
7f5e005d16 MDEV-9080 - Debian: incorrect empty password check in postinst
There was code that was supposed to "catch upgrades from previous versions where
the root password wasn't set". But it is wrong in many regards:
- it is supposed to be executed against running server, but at this point server
  should be down, which makes this code no-op
- if the above is fixed, root password will be requested twice (initial root
  password request + this one)
- it asks for a password only once, while "initial root password request" asks
  twice (password + password verification)
- it may give false positive if unix socket based authentication is in effect

Removed this code since it didn't work for quite a while (at least since
mysql-5.1) and nobody cared about it.
2015-11-06 12:11:06 +04:00
Sergey Vojtovich
60ad339840 MDEV-8437 - plugin variables conflict with bootstrap
There is no strong need to change password column: the only side effect is
that 4.0 -> 10.1 upgrades may get root/debian-sys-maint passwords stored in old
format. This should be perfectly acceptable, since all password at this point
are stored in old format.
2015-11-06 12:11:06 +04:00
Sergey Vojtovich
8e40f9b713 MDEV-8437 - plugin variables conflict with bootstrap
Removed redundant attempt to create mysql.plugin table:
- original code was supposed to INSTALL some plugins:
  INSERT INTO plugin VALUES ('innodb', 'ha_innodb.so'),
    ('federated', 'ha_federated.so'), ('blackhole', 'ha_blackhole.so'),
    ('archive', 'ha_archive.so');
- original code was supposed to fail if mysql.plugin exists:
  The query sequence is supposed to be aborted if the CREATE TABLE fails due
  to an already existent table in which case the admin might already have
  chosen to remove one or more plugins.
- mysql.plugin must've been created by preceeding mysql_install_db anyway
2015-11-06 12:11:05 +04:00
Nirbhay Choubey
5079d69d48 MDEV-8975: 10.1 Fails To Join Existing Galera Cluster
During the process of guessing the IP address, if bind-address
is INADDR_ANY, mysqld should proceed with address specified via
wsrep_node_address or use one from network interfaces.

Patch contributed by darkain (pull#115).
2015-11-05 21:52:19 -05:00
Oleksandr Byelkin
5041de97e1 MDEV-8701 Crash on derived query
Make unique table check after setup_fields of update because unique table can materialize table and we do not need field resolving after materialization.
2015-11-05 17:50:59 +01:00
Vladislav Vaintroub
d9119710c4 MDEV-9041 connect-timeout has no effect on Windows
Replaced my_connect() with cross-plattform, timeout aware
vio_socket_connect() function
2015-11-05 15:32:25 +01:00
Jan Lindström
25f8738112 MDEV-9040: 10.1.8 fails after upgrade from 10.0.21
Analysis: Lengths which are not UNIV_SQL_NULL, but bigger than the following
number indicate that a field contains a reference to an externally
stored part of the field in the tablespace. The length field then
contains the sum of the following flag and the locally stored len.

This was incorrectly set to

define UNIV_EXTERN_STORAGE_FIELD (UNIV_SQL_NULL - UNIV_PAGE_SIZE_MAX)

When it should be

define UNIV_EXTERN_STORAGE_FIELD (UNIV_SQL_NULL - UNIV_PAGE_SIZE_DEF)

Additionally, we need to disable support for > 16K page size for
row compressed tables because a compressed page directory entry
reserves 14 bits for the start offset and 2 bits for flags.
This limits the uncompressed page size to 16k. To support
larger pages page directory entry needs to be larger.
2015-11-05 10:30:48 +02:00
Nirbhay Choubey
e947a52697 Update global_suppressions. 2015-11-04 21:58:07 -05:00
Nirbhay Choubey
2399f1aee7 Fix for build failure. 2015-11-04 21:56:46 -05:00
Nirbhay Choubey
f9e320c82d MDEV-9026: Revert patch for MDEV-6069
Post-fix:
Reverting the patch for MDEV-6069 brought some ALTERs with
ENGINE=MYISAM back into the mysql_system_tables_fix.sql
script. As a result, running mysql_upgrade with global
enforce_storage_engine=INNODB (or any other non-MyISAM
engine, for that matter) would fail.

Fixed by locally unsetting enforce_storage_engine in the
upgrade script.
2015-11-04 15:00:34 -05:00
Vladislav Vaintroub
1216429cfd MDEV-8738 Application Verifier stop during server shutdown
The verifier exception is caused by using thread local storage key
after key was deleted.

my_free() used current_thd within malloc size callback, which does
pthread_get_specific(THR_THD), but THR_THD is already deleted at this
point.

The fix moves pthread_key_delete() to a later point in shutdown.
2015-11-04 17:47:21 +01:00
Nirbhay Choubey
95289e5b66 Revert "MDEV-6069: Remove old logic for 3.23-to-higher upgrades from upgrade SQL scripts"
This reverts commit 5e6f12366a.
2015-11-03 11:55:30 -05:00
Nirbhay Choubey
d68b083672 Revert "MDEV-6069: Remove old logic for 3.23-to-higher upgrades from upgrade SQL scripts"
This reverts commit f8381d9382.
2015-11-03 11:54:37 -05:00
Vladislav Vaintroub
245bfc52fc MDEV-8669 MTR client connections on Windows became much slower.
The regression is caused by change bind-address server parameter
in MDEV-8083, so now server listens on IPv4 only by default.

The problem however is that on Windows, connection to server on localhost
appears to be much faster, if server listens on IPv6/dual stack.
mysql_real_connect() would try to connect to IPv6 loopback  first,
and if this fails, the failing connect() call takes several seconds.

To fix, use bind-address=* on Windows, and 127.0.0.1 elsewhere
2015-11-03 17:41:06 +01:00
Jan Lindström
6189951003 MDEV-9063: encryption.innodb-log-encrypt produces warnings in error logs on builds with bundled SSL
Test used aes_ctr that is not available everywhere when aes_cbc is fine also
for this test.
2015-11-03 16:03:25 +02:00
Nirbhay Choubey
a574407444 MDEV-9007: Bootstrap does not work in CentOS start script
Some modifications in galera_new_cluster :

* Do not use absolute path for systemctl
* Fix parameter substitution syntax
2015-11-02 23:37:04 -05:00
Daniel Black
d8ecc2a011 MDEV-9007: systemd - service mariadb bootstrap
Now this error out and refers to galera_new_cluster.
2015-11-02 23:37:03 -05:00
Daniel Black
a2c3549404 MDEV-427: systemd - use galera_new_cluster instead of bootstrap
Use galera_new_cluster instead. systemctl start mariadb@bootstrap
will generate error message, use_galera_new_cluster.conf is the name
of the file that will generate this error.

Output:

Job for mariadb@bootstrap.service failed. See "systemctl status
mariadb@bootstrap.service" and "journalctl -xe" for details.

● mariadb@bootstrap.service - MariaDB database server
   Loaded: loaded (/usr/lib/systemd/system/mariadb@.service; disabled;
vendor preset: disabled)
  Drop-In: /usr/lib/systemd/system/mariadb@bootstrap.service.d
           └─use_galera_new_cluster.conf
   Active: failed (Result: exit-code) since Thu 2015-10-15 19:27:52
CEST; 5s ago
  Process: 24334 ExecStart=/usr/bin/false (code=exited,
status=1/FAILURE)
  Process: 24330 ExecStart=/usr/bin/echo Please use galera_new_cluster
to start the mariadb service with --wsrep-new-cluster (code=exited,
status=0/SUCCESS)
 Main PID: 24334 (code=exited, status=1/FAILURE)

Oct 15 19:27:52 spaceman systemd[1]: Starting MariaDB database server...
Oct 15 19:27:52 spaceman systemd[1]: mariadb@bootstrap.service: main
process exited, code=exited, status=1/FAILURE
Oct 15 19:27:52 spaceman systemd[1]: Failed to start MariaDB database
server.
Oct 15 19:27:52 spaceman systemd[1]: Unit mariadb@bootstrap.service
entered failed state.
Oct 15 19:27:52 spaceman systemd[1]: mariadb@bootstrap.service failed.
2015-11-02 23:37:03 -05:00
Elena Stepanova
7877438f31 Increased the version number 2015-11-03 03:25:38 +02:00
Alexey Botchkov
641644a862 MDEV-8992 MariaDB crashes when accessing table with GIS features.
we don't test for not-existing gis extra in FRM.
2015-11-01 20:37:23 +04:00
Nirbhay Choubey
4d15112962 Merge tag 'mariadb-10.0.22' into 10.0-galera 2015-10-31 18:07:02 -04:00
Nirbhay Choubey
3e043b30ac MDEV-8991: bind-address appears twice in default my.cnf
Add comment about bind-address mentioned under galera section.
2015-10-30 12:10:54 -04:00
Oleksandr Byelkin
fa1438cbf4 MDEV-8913 Derived queries with same column names as final projection causes issues when using Order By
find_item_in_list() now recognize view fields like a fields even if they rever to an expression.
The problem of schema name do not taken into account for field with it and
derived table fixed.
Duplicating code removed
2015-10-30 14:51:17 +01:00
Sergei Golubchik
bf186312e1 fix compilation with -DENABLED_PROFILING=OFF
(with ENABLED_PROFILING=ON, field.h was included indirectly
from sql_profile.h)
2015-10-30 13:06:02 +01:00
Jan Lindström
81d35841bd MDEV-9011: Redo log encryption does not work
Redo log encryption used too short buffer when getting
encryption keys.
2015-10-30 13:12:30 +02:00
Jan Lindström
3e98383787 Fix test failures seen on buildbot. 2015-10-30 08:39:05 +02:00
Alexander Barkov
59dd58b17e MDEV-8692 prefschema test failures on ARM (on Debian build system)
A few tests assumes that the CYCLE timer is always available,
which is not true on some platforms (e.g. ARM).
Fixing the tests not to reply on the CYCLE availability.
2015-10-30 10:10:43 +04:00
Oleksandr Byelkin
923827e2cc MDEV-7949: Item_field::used_tables() takes 0.29% in OLTP RO
Part 2: removed hack workaround for bug we do not have.
2015-10-29 21:05:00 +01:00
Oleksandr Byelkin
fb4358f432 MDEV-7949: Item_field::used_tables() takes 0.29% in OLTP RO
small sixes of used_tables() usage
2015-10-29 21:05:00 +01:00
Sergei Golubchik
937aa7ad77 MDEV-9010 Encryption preset file contains different configuration preset then documentation
* clarify the comment in the preset file
* make boolean --aria-encrypt-tables option to work without an argument
2015-10-29 10:46:37 +01:00
Sergei Golubchik
239e0c571e MDEV-8551 compilation fails with 10.1.6
Restore changes that were lost in a merge. Originally from

commit 66fd45a
Author: Sergei Golubchik <serg@mariadb.org>
Date:   Mon Jun 8 21:06:56 2015 +0200

    MDEV-7398 mysqld segfaults on FreeBSD 10.1 i386 when built with clang 3.4
2015-10-29 10:46:37 +01:00
Jan Lindström
9164a24311 Test debug_key_management fails sporadically in buildbot.
Problem is that we expect key_version to be increasing so
before we reset debug_key_management plugin key_version
disable encryption.
2015-10-29 10:35:37 +02:00
Jan Lindström
0fe5eb5cae MDEV-9032: MariaDB 10.1.8 crashes at startup
Add diagnostics when externally stored field is freed but
rollback ctx is not what we expect.
2015-10-29 08:21:28 +02:00
Sergei Golubchik
56f04e0dfd MDEV-9014 SHOW TRIGGERS not case sensitive
use table_alias_charset for comparing table names, not files_charset_info
2015-10-28 21:32:07 +01:00