Commit graph

172282 commits

Author SHA1 Message Date
Sergei Golubchik
496cea45e2 update error messages for 10.0 2017-07-27 12:42:40 +02:00
Sergei Golubchik
2804a3fac4 memory leak: add a missing end_relay_log_info() 2017-07-27 12:42:21 +02:00
Vicențiu Ciorbaru
786ad0a158 Merge remote-tracking branch 'origin/5.5' into 10.0 2017-07-25 00:41:54 +03:00
Sergei Golubchik
2ce3f95151 Connect engine is Gamma 2017-07-22 13:10:10 +02:00
Jan Lindström
92cbe388b6 MDEV-13325: InnoDB assert dict_sys->size > 0 during ALTER TABLE
Problem was that dict_sys->size tries to maintain used memory
occupied by the data dictionary table and index objects.
However at least on table objects table->heap size can increase
between when table object is inserted to dict_sys and when
it is removed from dict_sys causing inconsistency on amount
of memory added to and removed from dict_sys->size variable.

Removed unnecessary dict_sys:size variable as it is really
used only for status output.

Introduced dict_sys_get_size function to calculate memory
occupied by the data dictionary table and index objects
that is then used on show engine innodb output.

dict_table_add_to_cache(),
dict_table_rename_in_cache(),
dict_table_remove_from_cache_low(),
dict_index_remove_from_cache_low(),
	Remove size calculation.

srv_printf_innodb_monitor(): Use dict_sys_get_size function to
get dictionary memory allocated.

xtradb_internal_hash_tables_fill_table(): Use dict_sys_get_size
function to get dictionary memory allocated.
2017-07-21 16:05:20 +03:00
Sergei Golubchik
0ec147b617 fix main.func_regexp_pcre on jessie-ppc64le
apparently it uses a smaller per-thread stack
2017-07-20 22:26:08 +02:00
Sergei Golubchik
3ef5596505 MDEV-13175 Adding a new enum value at the end of a list triggers a table rebuild
Backport of 7e29f2d64f from 10.1.

Create_field does not set BINARY_FLAG, so the check didn't work at all.
Also, character sets were already compared, so this check would've been
redundant (if it would've worked).
2017-07-20 20:13:28 +02:00
Sergei Golubchik
7e507f262a MDEV-13274 mysql_upgrade fails if dbname+tablename+partioname > 64 chars
InnoDB fix will come in MDEV-13360.
Here I just fix upgrades from old unfixed InnoDBs - bad data
makes the following copying ALTER TABLE to fail.
2017-07-20 20:13:28 +02:00
Sergei Golubchik
2fcd8c1252 MDEV-13173 An RLIKE that previously worked on 10.0 now returns "Got error 'pcre_exec: recursion limit of 100 exceeded' from regexp"
1. use Regexp_processor_pcre::set_recursion_limit() to set the
   recursion limit depending on the current available stack size
2. make pcre stack frame to be estimated no less than 500 bytes.
   sometimes pcre estimates it too low, even though the manual
   says 500+16 bytes (it was estimated only 188 for me, actual
   frame size was 512).
3. do it for embedded too
2017-07-20 20:13:28 +02:00
Sergei Golubchik
dc8b2fb03a MDEV-11896 thd_get_error_context_description race condition
Change the semantics of thd_get_error_context_description().
It no longer expects the caller to lock LOCK_thread_count
(no caller ever did that anyway), but takes care of it internally.
2017-07-20 20:13:28 +02:00
Sergei Golubchik
da2a838628 MDEV-12824 GCC 7 warning: this statement may fall through [-Wimplicit-fallthrough=] 2017-07-20 20:13:28 +02:00
Daniel Bartholomew
c8a0244e95 bump the VERSION 2017-07-19 11:47:59 -04:00
Sachin Setiya
76f7aac8e0 MDEV-13065 rpl.rpl_mdev-11092 fails sporadically in buildbot
Problem
rpl.rpl_mdev-11092 fails in buildbot because after starting slave in
wait_for_slave_sql_error_and_skip.inc slave is started but there may be
chances that we have not skipped the last error and Last_SQL_Errno is
still not zero untill the end of rpl_end.inc , which will compare
Last_SQL_Errno to 0. So in this this case rpl_mdev-11092 fails.

Solution
After starting slave in wait_for_slave_sql_error_and_skip.inc we will wait for
Last_SQL_Errno to become 0.
2017-07-19 16:42:01 +05:30
Sergei Golubchik
59fca5806a Merge branch 'merge-xtradb-5.5' into 5.5 2017-07-18 19:50:11 +02:00
Sergei Golubchik
46977e0a01 5.5.55-38.8 2017-07-18 19:47:01 +02:00
Sergei Golubchik
58aaae6f2a ensure that filename in COM_BINLOG_DUMP isn't too long 2017-07-18 16:42:40 +02:00
Daniel Black
172e3a1bc6 MDEV-12646: Apply fixes found by Coverity static analysis tool
Inspired by: https://github.com/devexp-db/mariadb/blob/f27/mariadb-covscan-stroverflow.patch
2017-07-18 15:53:31 +02:00
Daniel Black
f9dbfa58a5 MDEV-658: debian debug symbols require compat 9
Signed-off-by: Daniel Black <daniel.black@au.ibm.com>
2017-07-18 15:41:22 +02:00
Sergei Golubchik
7c9d00e0bb Bug #24595639: INCORRECT BEHAVIOR IN QUERY WITH UNION AND GROUP BY
test case
2017-07-18 14:59:34 +02:00
Sergei Golubchik
9b3360ea44 BUG#25250768: WRITING ON A READ_ONLY=ON SERVER WITHOUT SUPER PRIVILEGE
simplify.
add a test case.
2017-07-18 14:59:33 +02:00
Sergei Golubchik
f6bcdb9e3c test case for loadxml and spaces 2017-07-18 14:59:33 +02:00
Sergei Golubchik
9a5fe1f4ea Merge remote-tracking branch 'mysql/5.5' into 5.5 2017-07-18 14:59:10 +02:00
Oleksandr Byelkin
e7fd6ed387 MDEV-11240: Server crashes in check_view_single_update or Assertion `derived->table' failed in mysql_derived_merge_for_insert
Move table pointer for single table view (even if it is view over other view) to make the access universal.
2017-07-18 13:49:58 +02:00
Alexey Botchkov
7e44eabdad MDEV-11205 UDF_ARGS "attribute_lengths" incorrect value.
Set name_length properly in Item_idnet constructors.
2017-07-18 13:19:34 +04:00
Daniel Black
c9883b7591 ma_check/mi_check: maria_repair_parallel initialization for !quick
end_io_call uses uninitialized values from the new_data_cache

As such we the buffer 0 and check this before calling end_io_cache on it.

Thanks Sergey Vojtovich for the review and for this solution.

Found by Coverity (ref 972481).
2017-07-18 10:09:16 +04:00
Elena Stepanova
7d309b5f74 Add storage_engine/parts overlay for MyISAM 2017-07-18 01:38:13 +03:00
Alexander Barkov
d023156782 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.
2017-07-17 12:34:58 +02:00
Daniel Black
2f07709aed MDEV-12436: binlog.binlog_unsafe - assumed len(hostname) <= 50 (#385)
Increased size in tests to allow for 100 character hostname.

Signed-off-by: Daniel Black <daniel.black@au.ibm.com>
2017-07-15 19:45:37 +03:00
Sergei Golubchik
6efee22541 change flags as it was done in MyISAM
in ab785bfe5b
2017-07-15 08:44:14 +02:00
Daniel Black
ec4e39558e ma_recovery: unintentional order of operations
Coverity report this as:
CID 971840 (#1 of 1): Operands don't affect result (CONSTANT_EXPRESSION_RESULT)
result_independent_of_operands: 4 | (flags & 1) is always true regardless of the values of its operands. This occurs as the logical first operand of "?:".

The C order of precidence has | of higher precidence than ?:. The
intenting implies an | of the 3 terms.

Adjust to intented meaning.
2017-07-15 08:44:14 +02:00
Sergei Golubchik
0375f2e273 MDEV-12144 Signal 6 crash corrupts ibd files
Avoid using STDERR_FILENO. The server uses freopen(stderr),
so stderr can be on any file descriptor.
2017-07-15 08:44:14 +02:00
Daniel Black
c8c6a9fdf4 mtr: fix_vs_config doesn't change bindir
Signed-off-by: Daniel Black <daniel.black@au.ibm.com>
2017-07-14 22:38:37 +04:00
Daniel Black
7338d3f221 client: mysql - fix type
field_names[x][y] is a pointer

client/mysql.cc: In function 'void build_completion_hash(bool, bool)':
client/mysql.cc:2855:37: error: invalid conversion from 'char' to 'char*' [-fpermissive]
       field_names[i][num_fields*2]= '\0';

Signed-off-by: Daniel Black <daniel.black@au.ibm.com>
2017-07-14 10:57:57 +04:00
Sergei Golubchik
27bc13b7a2 MDEV-12136 SELECT COUNT(DISTINCT) returns the wrong value when tmp_table_size is limited
Same MDEV, second bug.
Merge buffer must fit at least MERGEBUFF2 (that is, 15) key values.
Because merge_index() can merge that many buffers, and
merge_many_buff() leaves that many buffers unmerged.
2017-07-13 11:23:54 +02:00
Sergei Golubchik
e7f51e5d26 MDEV-12136 SELECT COUNT(DISTINCT) returns the wrong value when tmp_table_size is limited
use the correct value for the merge_buffer size, max_in_memory_size
is too small and merge_walk() fails.

also: remove a cast.
2017-07-12 19:20:52 +02:00
Sergei Golubchik
181d9d2892 MDEV-13180 Unused left join causes server crash
already fixed by be55bbc2b2
just add a test case
2017-07-12 17:46:27 +02:00
Sergei Golubchik
05b678bc8c MDEV-12489 The select stmt may fail due to "having clause is ambiguous" unexpected
only compare field references with an alias (from the SELECT clause)
when this reference doesn't specify an explicit table name part.
2017-07-12 17:46:19 +02:00
Sergei Golubchik
c83d6ff881 compiler warning
remove unused variable
2017-07-12 13:55:04 +02:00
Sergei Golubchik
d2e66a6f19 MDEV-7828 Assertion `key_read == 0' failed in TABLE::enable_keyread with SELECT SQ and WHERE SQ
already fixed by a7ed4644a6.
just add a test case,
2017-07-12 13:46:15 +02:00
Sergei Golubchik
be55bbc2b2 MDEV-7826 Server crashes in Item_subselect::enumerate_field_refs_processor
upper->item can be NULL if we're referring to an aggregate function
2017-07-12 12:49:29 +02:00
Sergei Golubchik
c5975eaea1 MDEV-7339 Server crashes in Item_func_trig_cond::val_int
Item_in_subselect::pushed_cond_guards[] array is allocated only when
left_expr->maybe_null. And it is used (for row expressions) when
left_expr->element_index(i)->maybe_null.

For left_expr being a multi-column subquery, its maybe_null is
always false when the subquery doesn't use tables (see
Item_singlerow_subselect::fix_length_and_dec()
and subselect_single_select_engine::fix_length_and_dec()),
otherwise it's always true.

But row elements can be NULL regardless, so let's always allocate
pushed_cond_guards for multi-column subqueries, no matter whether
its maybe_null was forced to true or false.
2017-07-12 10:39:02 +02:00
Alexey Botchkov
a06f2f430f MDEV-12078 Using spatial index changes type from point to geometry
In get_mm_tree we have to change Field_geom::geom_type to
        GEOMETRY as we have to let storing all types of the spatial features
        in the field. So now we restore the original geom_type as it's
        done.
2017-07-11 23:27:19 +04:00
Sergei Golubchik
6b99859fff after-merge fix for a7ed4644a6
(10.0+ changes, as specified in the MDEV)

and remove unused variable (compiler warning)
2017-07-06 23:47:38 +02:00
Sergei Golubchik
89dc445a55 Merge branch '5.5' into 10.0 2017-07-06 23:47:33 +02:00
Sergei Golubchik
4d21313549 coverity medium warnings 2017-07-06 23:46:28 +02:00
Sergei Golubchik
f305a7ce4b bugfix: long partition names 2017-07-06 19:09:47 +02:00
Oleksandr Byelkin
a7ed4644a6 MDEV-10146: Wrong result (or questionable result and behavior) with aggregate function in uncorrelated SELECT subquery
When outer reference resolved in a VIEW it still should mark aggregate function resolving border.
2017-07-05 09:07:50 +02:00
Daniel Black
23ac2dd2a4 sql_class: incorrect assignment in Security_context::destroy
Found by Coverity (id 971843).

Signed-off-by: Daniel Black <daniel.black@au.ibm.com>
2017-07-04 10:26:29 +04:00
Daniel Black
89b81a9a24 ma_pagecache: release lock in pagecache_read
make_lock_and_pin didn't release the lock so we should.

Found by Coverity (id 972095).
2017-07-03 13:31:09 +04:00
Daniel Black
2328860379 ma_loghandler: translog_set_only_in_buffers failed to release lock
Release the lock for the error path.

Found by Coverity (id 972093).
2017-07-03 13:14:05 +04:00