Commit graph

17172 commits

Author SHA1 Message Date
Vicențiu Ciorbaru
f1861297f0 Merge branch 'merge-perfschema-5.6' into 10.0 2017-05-16 14:07:50 +03:00
Vicențiu Ciorbaru
24ff179311 5.6.36 2017-05-16 13:53:15 +03:00
Sergei Golubchik
314f32c8c2 MDEV-5477 sphinxSE GROUP BY on multiple attributes
Translate "multi:" to SPH_GROUPBY_MULTIPLE.
SPH_GROUPBY_ATTRPAIR is still not supported.
2017-05-16 12:42:53 +02:00
Sergei Golubchik
a3cf69e2e5 MDEV-10936 CONNECT engine JDBC type can't find JdbcInterface
Don't use instal_jar() from Use_Java.cmake -
at least in CentOS 7 (cmake 2.8.12.2) it doesn't yet support
the COMPONENT option.
2017-05-15 22:23:11 +02:00
Sergei Golubchik
a65623b3eb MDEV-11883 MariaDB crashes with out-of-memory when query information_schema
CSV engine didn't expect CSM files to be read-only
2017-05-15 22:23:10 +02:00
Sergei Golubchik
71b4503242 MDEV-9998 Fix issues caught by Clang's -Wpointer-bool-conversion warning
remove useless checks
and a couple of others
2017-05-15 22:23:10 +02:00
Sergei Golubchik
f9264280d6 MDEV-12761 Error return from external_lock make the server crash
bunch of bugs when external_lock() fails on unlock:
* mi_lock_database() used mi_mark_crashed() under share->intern_lock,
  but mi_mark_crashed() itself locks this mutex.
* handler::close() required table to be unlocked, but failed
  external_lock didn't count as unlock
* mysql_unlock_tables() ignored all unlock errors, but they still set
  the error status in stmt_da.
2017-05-15 22:23:10 +02:00
Marko Mäkelä
217b8115c8 MDEV-12188 information schema - errors populating fail to free memory, unlock mutexes
Given the OK macro used in innodb does a DBUG_RETURN(1) on expression failure
the innodb implementation has a number of errors in i_s.cc.

We introduce a new macro BREAK_IF that replaces some use of the OK macro.
Also, do some other cleanup detailed below.

When invoking Field::store() on integers, always pass the parameter
is_unsigned=true to avoid an unnecessary conversion to double.

i_s_fts_deleted_generic_fill(), i_s_fts_config_fill():
Use the BREAK_IF macro instead of OK.

i_s_fts_index_cache_fill_one_index(), i_s_fts_index_table_fill_one_index():
Add a parameter for conv_string, and let the caller allocate that buffer.

i_s_fts_index_cache_fill(): Check the return status of
i_s_fts_index_cache_fill_one_index().

i_s_fts_index_table_fill(): Check the return status of
i_s_fts_index_table_fill_one_index().

i_s_fts_index_table_fill_one_fetch(): Always let the caller invoke
i_s_fts_index_table_free_one_fetch().

i_s_innodb_buffer_page_fill(), i_s_innodb_buf_page_lru_fill():
Do release dict_sys->mutex if filling the buffers fails.

i_s_innodb_buf_page_lru_fill(): Also display the value
INFORMATION_SCHEMA.INNODB_BUFFER_PAGE.PAGE_IO_FIX='IO_PIN'
when a block is in that state. Remove the unnecessary variable 'heap'.
2017-05-15 18:02:16 +03:00
Vicențiu Ciorbaru
0af9818240 5.6.36 2017-05-15 17:17:16 +03:00
Marko Mäkelä
8417252b04 Fix the Solaris compilation after MDEV-12674
simple_counter::add(): Add a type cast to the os_atomic_increment_ulint()
call, because GCC would check the type compatibility even when the code
branch is not being instantiated (atomic=false). On Solaris,
os_atomic_increment_ulint() actually needs a compatible parameter type,
and an error would be emitted due to an incompatible 64-bit type,
for srv_stats.n_lock_wait_time.add(diff_time).
2017-05-15 10:26:42 +03:00
Olivier Bertrand
fd0335686b MDEV-12651: change error code to ER_ILLEGAL_HA in rnd_pos (ha_connect.cc) 2017-05-12 11:35:57 +02:00
Marko Mäkelä
ff16609374 MDEV-12674 Innodb_row_lock_current_waits has overflow
There is a race condition related to the variable
srv_stats.n_lock_wait_current_count, which is only
incremented and decremented by the function lock_wait_suspend_thread(),

The incrementing is protected by lock_sys->wait_mutex, but the
decrementing does not appear to be protected by anything.
This mismatch could allow the counter to be corrupted when a
transactional InnoDB table or record lock wait is terminating
roughly at the same time with the start of a wait on a
(possibly different) lock.

ib_counter_t: Remove some unused methods. Prevent instantiation for N=1.
Add an inc() method that takes a slot index as a parameter.

single_indexer_t: Remove.

simple_counter<typename Type, bool atomic=false>: A new counter wrapper.
Optionally use atomic memory operations for modifying the counter.
Aligned to the cache line size.

lsn_ctr_1_t, ulint_ctr_1_t, int64_ctr_1_t: Define as simple_counter<Type>.
These counters are either only incremented (and we do not care about
losing some increment operations), or the increment/decrement operations
are protected by some mutex.

srv_stats_t::os_log_pending_writes: Document that the number is protected
by log_sys->mutex.

srv_stats_t::n_lock_wait_current_count: Use simple_counter<ulint, true>,
that is, atomic inc() and dec() operations.

lock_wait_suspend_thread(): Release the mutexes before incrementing
the counters. Avoid acquiring the lock mutex if the lock wait has
already been resolved. Atomically increment and decrement
srv_stats.n_lock_wait_current_count.

row_insert_for_mysql(), row_update_for_mysql(),
row_update_cascade_for_mysql(): Use the inc() method with the trx->id
as the slot index. This is a non-functional change, just using
inc() instead of add(1).

buf_LRU_get_free_block(): Replace the method add(index, n) with inc().
There is no slot index in the simple_counter.
2017-05-12 12:24:53 +03:00
Nisha Gopalakrishnan
b615c3dff8 BUG#25451091:CREATE TABLE DATA DIRECTORY / INDEX DIRECTORY
SYMLINK CHECK RACE CONDITIONS

ANALYSIS:
=========
A potential defect exists in the handling of CREATE
TABLE .. DATA DIRECTORY/ INDEX DIRECTORY which gives way to
the user to gain access to another user table or a system
table.

FIX:
====
The lstat and fstat output of the target files are now
stored which help in determining the identity of the target
files thus preventing the unauthorized access to other
files.
2017-05-12 09:47:48 +05:30
Olivier Bertrand
436070c6e1 Fix failing test connect.json for MariaDB 10.0
Suppressing Uri and dsn from json tables (was MGO)
  modified:   storage/connect/ha_connect.cc
  modified:   storage/connect/tabdos.cpp
  modified:   storage/connect/tabjson.cpp
  modified:   storage/connect/tabjson.h
2017-05-12 00:33:33 +02:00
Olivier Bertrand
1c88b9a8d3 Fix wrong value of JSON column
When null and the column is NOT NULL the value was not reset.
  modified:   storage/connect/tabjson.cpp

Fix converting bstr_t string to set error message
  modified:   storage/connect/domdoc.cpp

Fix MDEV-12768: -Wformat-overflow compile warnings
  modified:   storage/connect/global.h
  modified:   storage/connect/jsonudf.cpp
  modified:   storage/connect/plugutil.cpp
  modified:   storage/connect/tabvct.cpp

Typo (in external_lock)
  modified:   storage/connect/ha_connect.cc

Remove some warnings
  modified:   storage/connect/odbconn.cpp
  modified:   storage/connect/tabmysql.cpp

Add MEM_RESERVE flag to virtualAlloc
  modified:   storage/connect/plgdbutl.cpp

Fix MDEV-12573:
Accept=1 may show incorrect value for NULL column in CONNECT TBL
  modified:   storage/connect/tabutil.cpp

Fix wrong setting of key size when greater than 2G
 modified:   storage/connect/xindex.cpp

Fixing MDEV-12149: compile errors on Windows with /Zc:strictStrings
Introduce typedef PCSZ and replace PSZ by it where it matters
All done on CONNECT but compile still fails because of an included system file
  modified:   storage/connect/array.cpp
  modified:   storage/connect/catalog.h
  modified:   storage/connect/colblk.cpp
  modified:   storage/connect/colblk.h
  modified:   storage/connect/connect.cc
  modified:   storage/connect/domdoc.cpp
  modified:   storage/connect/domdoc.h
  modified:   storage/connect/filamdbf.cpp
  modified:   storage/connect/filamdbf.h
  modified:   storage/connect/filamfix.cpp
  modified:   storage/connect/filamgz.cpp
  modified:   storage/connect/filamtxt.h
  modified:   storage/connect/filamvct.cpp
  modified:   storage/connect/filamvct.h
  modified:   storage/connect/filamzip.cpp
  modified:   storage/connect/filamzip.h
  modified:   storage/connect/ha_connect.cc
  modified:   storage/connect/ha_connect.h
  modified:   storage/connect/jdbccat.h
  modified:   storage/connect/jdbconn.cpp
  modified:   storage/connect/jdbconn.h
  modified:   storage/connect/json.cpp
  modified:   storage/connect/json.h
  modified:   storage/connect/jsonudf.cpp
  modified:   storage/connect/jsonudf.h
  modified:   storage/connect/libdoc.cpp
  modified:   storage/connect/macutil.cpp
  modified:   storage/connect/myconn.cpp
  modified:   storage/connect/myutil.cpp
  modified:   storage/connect/myutil.h
  modified:   storage/connect/odbccat.h
  modified:   storage/connect/odbconn.cpp
  modified:   storage/connect/odbconn.h
  modified:   storage/connect/os.h
  modified:   storage/connect/plgdbsem.h
  modified:   storage/connect/plgdbutl.cpp
  modified:   storage/connect/plgxml.cpp
  modified:   storage/connect/plgxml.h
  modified:   storage/connect/plugutil.cpp
  modified:   storage/connect/preparse.h
  modified:   storage/connect/reldef.cpp
  modified:   storage/connect/reldef.h
  modified:   storage/connect/tabdos.cpp
  modified:   storage/connect/tabdos.h
  modified:   storage/connect/tabext.cpp
  modified:   storage/connect/tabext.h
  modified:   storage/connect/tabfix.cpp
  modified:   storage/connect/tabfix.h
  modified:   storage/connect/tabfmt.cpp
  modified:   storage/connect/tabfmt.h
  modified:   storage/connect/tabjdbc.cpp
  modified:   storage/connect/tabjdbc.h
  modified:   storage/connect/tabjson.cpp
  modified:   storage/connect/tabjson.h
  modified:   storage/connect/table.cpp
  modified:   storage/connect/tabmac.cpp
  modified:   storage/connect/tabmul.cpp
  modified:   storage/connect/tabmul.h
  modified:   storage/connect/tabmysql.cpp
  modified:   storage/connect/tabmysql.h
  modified:   storage/connect/tabodbc.cpp
  modified:   storage/connect/tabodbc.h
  modified:   storage/connect/tabpivot.cpp
  modified:   storage/connect/tabpivot.h
  modified:   storage/connect/tabsys.cpp
  modified:   storage/connect/tabsys.h
  modified:   storage/connect/tabutil.cpp
  modified:   storage/connect/tabutil.h
  modified:   storage/connect/tabvir.cpp
  modified:   storage/connect/tabvir.h
  modified:   storage/connect/tabwmi.cpp
  modified:   storage/connect/tabwmi.h
  modified:   storage/connect/tabxml.cpp
  modified:   storage/connect/tabxml.h
  modified:   storage/connect/tabzip.cpp
  modified:   storage/connect/tabzip.h
  modified:   storage/connect/valblk.cpp
  modified:   storage/connect/valblk.h
  modified:   storage/connect/value.cpp
  modified:   storage/connect/value.h
  modified:   storage/connect/xindex.cpp
  modified:   storage/connect/xobject.cpp
  modified:   storage/connect/xobject.h
  modified:   storage/connect/xtable.h

Fix MDEV-12603 Insert replaces values in ZIP file
  modified:   storage/connect/filamzip.cpp
  modified:   storage/connect/filamzip.h

Fix MDEV-12686 Handle null in json
Fix MDEV-12688 Insert does not handle type TINYINT
  modified:   storage/connect/json.cpp
  modified:   storage/connect/tabjson.cpp

Fix MDEV-12653 Cannot add index for ZIP CONNECT table
  modified:   storage/connect/filamzip.cpp
  modified:   storage/connect/ha_connect.cc
  modified:   storage/connect/tabdos.cpp
  modified:   storage/connect/tabfmt.cpp
  modified:   storage/connect/tabjson.cpp
  modified:   storage/connect/xindex.cpp
2017-05-11 21:57:21 +02:00
Olivier Bertrand
531698e0da Fix MDEV-12603 Insert replaces values in ZIP file
modified:   storage/connect/filamzip.cpp
  modified:   storage/connect/filamzip.h

Fix MDEV-12686 Handle null in json
Fix MDEV-12688 Insert does not handle type TINYINT
  modified:   storage/connect/json.cpp
  modified:   storage/connect/tabjson.cpp
2017-05-06 00:08:20 +02:00
Monty
fc25437aff MDEV-10104 Table lock race condition with replication
Problem was two race condtion in Aria page cache:
- find_block() didn't inform free_block() that it had released requests
- free_block() didn't handle pinned blocks, which could happen if
  free_block() was called as part of flush. This is fixed by not freeing
  blocks that are pinned.  This is safe as when maria_close() is called
  when last thread is using a table, there can be no pinned blocks. For
  other flush calls it's safe to ignore pinned blocks.
2017-05-05 18:25:35 +03:00
Olivier Bertrand
a2af3c0d44 Fix MDEV-12653 Cannot add index for ZIP CONNECT table
modified:   storage/connect/filamzip.cpp
  modified:   storage/connect/ha_connect.cc
  modified:   storage/connect/tabdos.cpp
  modified:   storage/connect/tabfmt.cpp
  modified:   storage/connect/tabjson.cpp
  modified:   storage/connect/xindex.cpp
2017-05-04 18:51:19 +02:00
Olivier Bertrand
6525dc6336 Disable json tests 2017-05-03 12:05:05 +02:00
Olivier Bertrand
1de6440a2e Fix MDEV-12587 MariaDB CONNECT DIR Type
- Subfolder Option: SELECT Query Never Ends
  modified:   storage/connect/tabmul.cpp
  modified:   storage/connect/tabmul.h

Work on MDEV-12667 Crash when using JSON tables
  modified:   storage/connect/connect.cc
  modified:   storage/connect/ha_connect.cc
  modified:   storage/connect/ha_connect.h
  modified:   storage/connect/plgdbutl.cpp

Change Base offset for DIR tables on Linux
  modified:   storage/connect/reldef.cpp
2017-05-03 10:32:01 +02:00
Olivier Bertrand
63b7d9d158 Fix MDEV-12631 valgrind warning for zipped tables
modified:   storage/connect/filamzip.cpp
2017-04-29 19:20:51 +02:00
Olivier Bertrand
a091314d27 Fix MDEV-12520: Decimal values can be truncated for JDBC tables
modified:   storage/connect/jdbconn.cpp

Fix bug. Date value was null when retrieved from a json expanded array.
  modified:   storage/connect/tabjson.cpp
2017-04-22 14:14:11 +02:00
Sergei Golubchik
8d75a7533e Merge branch '5.5' into 10.0 2017-04-21 18:34:06 +02:00
Marko Mäkelä
e056d1f1ca Fix some InnoDB type mismatch
On 64-bit Windows, sizeof(ulint)!=sizeof(ulong).
2017-04-21 17:39:12 +03:00
Marko Mäkelä
e48ae21b0e Follow-up to MDEV-12534: Fix warnings on 32-bit systems 2017-04-21 16:22:46 +03:00
Marko Mäkelä
87b6df31c4 MDEV-12488 Remove type mismatch in InnoDB printf-like calls
This is a reduced version of an originally much larger patch.
We will keep the definition of the ulint, lint data types unchanged,
and we will not be replacing fprintf() calls with ib_logf().

On Windows, use the standard format strings instead of nonstandard
extensions.

This patch fixes some errors in format strings.
Most notably, an IMPORT TABLESPACE error message in InnoDB was
displaying the number of columns instead of the mismatching flags.
2017-04-21 12:06:29 +03:00
Sergei Golubchik
4fe65ca33a MDEV-12230 include/my_sys.h:600:43: error: unknown type name ‘PSI_file_key’" when -DWITHOUT_SERVER=1
cherry-pick 2c2bd8c155 (MDEV-12261 build failure without P_S) from 10.0
2017-04-20 16:36:23 +02:00
Marko Mäkelä
d34a67b067 MDEV-12534 Use atomic operations whenever available
Allow 64-bit atomic operations on 32-bit systems,
only relying on HAVE_ATOMIC_BUILTINS_64, disregarding
the width of the register file.

Define UNIV_WORD_SIZE correctly on all systems, including Windows.
In MariaDB 10.0 and 10.1, it was incorrectly defined as 4 on
64-bit Windows.

Define HAVE_ATOMIC_BUILTINS_64 on Windows
(64-bit atomics are available on both 32-bit and 64-bit Windows
platforms; the operations were unnecessarily disabled even on
64-bit Windows).

MONITOR_OS_PENDING_READS, MONITOR_OS_PENDING_WRITES: Enable by default.

os_file_n_pending_preads, os_file_n_pending_pwrites,
os_n_pending_reads, os_n_pending_writes: Remove.
Use the monitor counters instead.

os_file_count_mutex: Remove. On a system that does not support
64-bit atomics, monitor_mutex will be used instead.
2017-04-20 16:29:12 +03:00
Sergei Golubchik
663068c6ee Merge remote-tracking branch 'mysql/5.5' into 5.5 2017-04-11 10:18:04 -04:00
Marko Mäkelä
8e36216a06 Import two ALTER TABLE…ALGORITHM=INPLACE tests from MySQL 5.6.
Also, revert part of MDEV-7685 that added an InnoDB abort when
ALTER TABLE…ALGORITHM=INPLACE is reporting that it ran out of
file space.
2017-04-05 14:46:35 +03:00
Vladislav Vaintroub
ff6f4d7db1 Windows : Fix compiling with VS2013
We do not use it now, but there is still no reason to break compilation
for other users.
2017-04-03 15:18:46 +00:00
Olivier Bertrand
3ac35bb059 Fix crash when a line is not ended by \n.
modified:   storage/connect/filamap.cpp

Add specifying a password when reading zipped tables.
  modified:   storage/connect/filamzip.cpp
  modified:   storage/connect/filamzip.h
  modified:   storage/connect/tabdos.cpp
  modified:   storage/connect/tabdos.h

Try Vaintroub suggestion
  modified:   storage/connect/mysql-test/connect/t/jdbc.test
2017-03-28 10:25:21 +02:00
Olivier Bertrand
5de5daa74e Fix MDEV-12220: Crash when doing UPDATE or DELETE on an external
table (ODBC, JDBC, MYSQL) with a WHERE clause on an indexed column.
Also fix a bugs in TDBEXT::MakeCommand (use of uninitialised Quote)
Add in this function the eventual Schema (database) prefixing.
  modified:   storage/connect/connect.cc
  modified:   storage/connect/tabext.cpp

Typo
  modified:   storage/connect/tabjdbc.h
2017-03-18 12:49:14 +01:00
Sergei Golubchik
2c2bd8c155 MDEV-12261 build failure without P_S
restore mysql_file_delete_with_symlink() but let it use
new my_handler_delete_with_symlink() mysys helper.
2017-03-15 17:48:30 +01:00
Kailasnath Nagarkar
d8328690d9 Bug #25447551: HANDLE_FATAL_SIGNAL (SIG=11) IN
FT_BOOLEAN_CHECK_SYNTAX_STRING

ISSUE: my_isalnum macro used for checking if character is
       alphanumeric dereferences uninitialized pointer
       in default character set structure resulting in
       server exiting abnormally.

FIX: Used standard isalnum function instead of macro my_isalnum.
2017-03-15 16:45:21 +05:30
Olivier Bertrand
5bc538dd85 Commit the 2 last commits merged from 10.1 2017-03-11 19:35:03 +01:00
Marko Mäkelä
032678ad18 MDEV-12091 Shutdown fails to wait for rollback of recovered transactions to finish
In the 10.1 InnoDB Plugin, a call os_event_free(buf_flush_event) was
misplaced. The event could be signalled by rollback of resurrected
transactions while shutdown was in progress. This bug was caught
by cmake -DWITH_ASAN testing. This call was only present in the
10.1 InnoDB Plugin, not in other versions, or in XtraDB.

That said, the bug affects all InnoDB versions. Shutdown assumes the
cessation of any page-dirtying activity, including the activity of
the background rollback thread. InnoDB only waited for the background
rollback to finish as part of a slow shutdown (innodb_fast_shutdown=0).
The default is a clean shutdown (innodb_fast_shutdown=1). In a scenario
where InnoDB is killed, restarted, and shut down soon enough, the data
files could become corrupted.

logs_empty_and_mark_files_at_shutdown(): Wait for the
rollback to finish, except if innodb_fast_shutdown=2
(crash-like shutdown) was requested.

trx_rollback_or_clean_recovered(): Before choosing the next
recovered transaction to roll back, terminate early if non-slow
shutdown was initiated. Roll back everything on slow shutdown
(innodb_fast_shutdown=0).

srv_innodb_monitor_mutex: Declare as static, because the mutex
is only used within one module.

After each call to os_event_free(), ensure that the freed event
is not reachable via global variables, by setting the relevant
variables to NULL.
2017-03-10 18:54:29 +02:00
Marko Mäkelä
1b2b209519 Use correct integer format with printf-like functions. 2017-03-09 11:28:07 +02:00
Marko Mäkelä
2158de8865 Remove unused variables. 2017-03-09 11:26:36 +02:00
Marko Mäkelä
74fe0e03d5 Remove unused declarations. 2017-03-08 11:46:34 +02:00
Marko Mäkelä
47396ddea9 Merge 5.5 into 10.0
Also, implement MDEV-11027 a little differently from 5.5:

recv_sys_t::report(ib_time_t): Determine whether progress should
be reported.

recv_apply_hashed_log_recs(): Rename the parameter to last_batch.
2017-03-08 11:40:43 +02:00
Marko Mäkelä
9c47beb8bd MDEV-11027 InnoDB log recovery is too noisy
Provide more useful progress reporting of crash recovery.

recv_sys_t::progress_time: The time of the last report.

recv_scan_print_counter: Remove.

log_group_read_log_seg(): After after each I/O request,
report progress if needed.

recv_apply_hashed_log_recs(): At the start of each batch,
if there are pages to be recovered, issue a message.
2017-03-08 10:07:50 +02:00
Marko Mäkelä
1fd3cc8c1f Fix a compiler warning. 2017-03-08 10:06:34 +02:00
Marko Mäkelä
17a1b194e2 Fix some GCC 6.3.0 warnings in MyISAM and Maria.
The C++ standard does not allow references to be NULL.
Assign the return value of THD::alloc() to a pointer,
not to a reference.
2017-03-08 10:03:35 +02:00
Vicențiu Ciorbaru
c4f3e64c23 Merge branch 'bb-10.0-vicentiu' into 10.0 2017-03-06 21:50:42 +02:00
Vicențiu Ciorbaru
dc1c9e69d0 Make tokudb report ENOENT when renaming table to nonexistant DB 2017-03-06 19:25:22 +02:00
Olivier Bertrand
92d283c026 Fix MDEV-12142 crash when creating CSV table
Was an unprepared longjmp (now throw)
Also fix a wrong calculation of To_Line sometimes causing a crash
because of buffer overflow.
  modified:   storage/connect/tabdos.cpp

Fix a wrong setting of USER for JDBC tables in connect_assisted_discovery.
Update jdbc_new.test after that fix, which changed errors.
  modified:   storage/connect/ha_connect.cc
  modified:   storage/connect/mysql-test/connect/r/jdbc_new.result
  modified:   storage/connect/mysql-test/connect/t/jdbc_new.test

Make using try/catch/throw the default option
  modified:   storage/connect/CMakeLists.txt

Typo
  modified:   storage/connect/xindex.cpp

Replace setjmp-longjmp's by try_catch-throw
  modified:   storage/connect/CMakeLists.txt
  modified:   storage/connect/array.cpp
  modified:   storage/connect/blkfil.cpp
  modified:   storage/connect/colblk.cpp
  modified:   storage/connect/connect.cc
  modified:   storage/connect/filamtxt.cpp
  modified:   storage/connect/filamvct.cpp
  modified:   storage/connect/filter.cpp
  modified:   storage/connect/global.h
  modified:   storage/connect/ha_connect.cc
  modified:   storage/connect/jdbconn.cpp
  modified:   storage/connect/json.cpp
  modified:   storage/connect/jsonudf.cpp
  modified:   storage/connect/odbconn.cpp
  modified:   storage/connect/osutil.c
  modified:   storage/connect/plgdbutl.cpp
  deleted:    storage/connect/plugutil.c
  added:      storage/connect/plugutil.cpp
  modified:   storage/connect/tabdos.cpp
  modified:   storage/connect/tabfix.cpp
  modified:   storage/connect/tabfmt.cpp
  modified:   storage/connect/tabjdbc.cpp
  modified:   storage/connect/tabjdbc.h
  modified:   storage/connect/tabjson.cpp
  modified:   storage/connect/tabmul.cpp
  modified:   storage/connect/tabmul.h
  modified:   storage/connect/tabmysql.cpp
  modified:   storage/connect/tabodbc.cpp
  modified:   storage/connect/tabodbc.h
  modified:   storage/connect/tabpivot.cpp
  modified:   storage/connect/tabsys.cpp
  modified:   storage/connect/tabvct.cpp
  modified:   storage/connect/tabvir.cpp
  modified:   storage/connect/tabxml.cpp
  modified:   storage/connect/valblk.cpp
  modified:   storage/connect/value.cpp
  modified:   storage/connect/xindex.cpp
  modified:   storage/connect/xobject.cpp
2017-03-06 17:23:56 +01:00
Vicențiu Ciorbaru
9741017b1f Disable 2 tokudb tests
dir_per_db_rename_to_nenexisting_schema: mysqltest fails with no output
percona_kill_idle_trx_tokudb: MariaDB doesn't support kill_idle_trx var
for all SE.
2017-03-05 15:18:26 +02:00
Vicențiu Ciorbaru
7bf914e157 rpl_extra_col_slave_tokudb changes result set
Probably the result is due to a bug fixed on their server. Restoring old
behaviour for now.
2017-03-05 15:18:26 +02:00
Vicențiu Ciorbaru
97041acf7f Fix tokudb.gap_lock_error test
TokuDB testsuite makes use of includes not found in our default 10.0.
Cherry pick them from Percona Server's include directory.
2017-03-05 15:18:26 +02:00
Vicențiu Ciorbaru
895b253963 Merge remote-tracking branch 'connect/10.0' into 10.0 2017-03-05 02:22:40 +02:00
Vicențiu Ciorbaru
b7a3bce06e Merge branch 'merge-tokudb-5.6' into 10.0 2017-03-05 02:01:21 +02:00
Vicențiu Ciorbaru
d71df7e1db 5.6.35-80.0 2017-03-05 01:31:32 +02:00
Vicențiu Ciorbaru
5139c4b688 Update xtradb version to match the merged one 2017-03-05 01:06:01 +02:00
Vicențiu Ciorbaru
83da1a1e57 Merge branch 'merge-xtradb-5.6' into 10.0 2017-03-05 00:59:57 +02:00
Vicențiu Ciorbaru
8d69ce7b82 5.6.35-80.0 2017-03-04 20:50:02 +02:00
Vicențiu Ciorbaru
606a4a4847 Post MDEV-11902 Fix test failures in maria and myisam storage engines
my_readline can fail due to missing file. Make my_readline report this
condition separately so that we can catch it and report an appropriate
error message to the user.
2017-03-03 20:12:48 +02:00
Marko Mäkelä
29c776cfd1 MDEV-11520: Retry posix_fallocate() after EINTR.
The function posix_fallocate() as well as the Linux system call
fallocate() can return EINTR when the operation was interrupted
by a signal. In that case, keep retrying the operation, except
if InnoDB shutdown has been initiated.
2017-03-03 12:03:33 +02:00
Marko Mäkelä
6b8173b6e9 MDEV-11520: Retry posix_fallocate() after EINTR.
The function posix_fallocate() as well as the Linux system call
fallocate() can return EINTR when the operation was interrupted
by a signal. In that case, keep retrying the operation, except
if InnoDB shutdown has been initiated.
2017-03-03 11:47:31 +02:00
Vicențiu Ciorbaru
1acfa942ed Merge branch '5.5' into 10.0 2017-03-03 01:37:54 +02:00
Olivier Bertrand
b2956b2ab4 Update version number and date
modified:   storage/connect/ha_connect.cc

Add conditional SE exception support
  modified:   storage/connect/json.cpp
  modified:   storage/connect/plgdbutl.cpp

Change %p in %x in some sprintf functions.
This to avoid some compiler warnings.
  modified:   storage/connect/tabwmi.cpp
  modified:   storage/connect/tabxml.cpp
  modified:   storage/connect/value.h

Add JavaWrappers.jar to the class path
  modified:   storage/connect/jdbconn.cpp

Fix wrong declare (char *buf[256]; --> char  buf[256];)
  modified:   storage/connect/xindex.cpp
2017-03-02 12:12:53 +01:00
Sergei Golubchik
cc413ce9a3 MDEV-11753 Link failure on missing -L${LIBLZ4_LIBRARY_DIR}
On FreeBSD liblz4 is installed in /usr/local/lib.
Groonga uses pkg_check_modules to check for liblz4 (that is, pkg-config),
and then it used to set for libgroonga.a

  link_directories({$LIBLZ4_LIBRARY_DIRS})
  target_link_libraries(... ${LIBLZ4_LIBRARIES})

Now groonga is a static library, linked into ha_mroonga.so. CMake won't
link dynamic liblz4.so into libgroonga.a, instead it'll pass it as a
dependency and will link it into ha_mroonga.so. Fine so far. But it will
not pass link_directories from the static library as a dependency,
so ha_mroonga.so won't find liblz4.so

As suggested on cmake mailing list (e.g.
here: http://public.kitware.com/pipermail/cmake/2011-November/047468.html)
we switch to use the full path to liblz4.so, instead of the -l/-L pair.
2017-02-28 16:19:44 +01:00
Sergei Golubchik
370cf70136 MDEV-11757 KEY_BLOCK_SIZE strangeness when UNCOMPRESSing COMPRESSed InnoDB tables
in ALTER TABLE ... DROP KEY, ADD KEY, don't forget to compare old
and new keys' block sizes. If they differ - the key definition has changed.
2017-02-28 16:19:44 +01:00
Michael Widenius
d7a9aed43f Fixed test failing as myisam table was deleted before oqgraph table. 2017-02-28 16:10:47 +01:00
Monty
d5c54f3990 Fixed compiler warnings
- Removed not used variables
- Added __attribute__()
- Added static to some local functions
  (gcc 5.4 gives a warning for external functions without an external definition)
2017-02-28 16:10:46 +01:00
Marko Mäkelä
fc673a2c12 MDEV-12127 InnoDB: Assertion failure loop_count < 5 in file log0log.cc
As suggested in MySQL Bug#58536, increase the limit in this
debug assertion in order to avoid false positives on heavily
loaded systems.
2017-02-28 09:54:12 +02:00
Sergei Golubchik
d72dbb4122 bugfix: remove my_delete_with_symlink()
it was race condition prone. instead use either a pair of my_delete()
calls with already resolved paths, or a safe high-level function
my_handler_delete_with_symlink(), like MyISAM and Aria already do.
2017-02-27 12:35:10 +01:00
Sergei Golubchik
93cb0246b8 race-condition safe implementation of mi_delete_table/maria_delete_table 2017-02-27 12:35:10 +01:00
Sergei Golubchik
b6862c914f cleanup: remove now-unused argument 2017-02-27 12:35:10 +01:00
Sergei Golubchik
b27fd90ad3 MDEV-11902 mi_open race condition
TOCTOU bug. The path is checked to be valid, symlinks are resolved.
Then the resolved path is opened. Between the check and the open,
there's a window when one can replace some path component with a
symlink, bypassing validity checks.

Fix: after we resolved all symlinks in the path, don't allow open()
to resolve symlinks, there should be none.

Compared to the old MyISAM/Aria code:
* fastpath. Opening of not-symlinked files is just one open(),
  no fn_format() and lstat() anymore.
* opening of symlinked tables doesn't do fn_format() and lstat() either.
  it also doesn't to realpath() (which was lstat-ing every path
  component), instead if opens every path component with O_PATH.
* share->data_file_name stores realpath(path) not readlink(path). So,
  SHOW CREATE TABLE needs to do lstat/readlink() now (see ::info()),
  and certain error messages (cannot open file "XXX") show the real
  file path with all symlinks resolved.
2017-02-27 12:35:10 +01:00
Sergei Golubchik
8722d4b8d2 cleanup: remove 16-year-old "TODO" 2017-02-27 12:35:10 +01:00
Sergei Golubchik
c826ac9d53 cleanup: mysys_test_invalid_symlink
Remove maria_test_invalid_symlink() and myisam_test_invalid_symlink(),
introduce mysys_test_invalid_symlink(). Other engines might need it too
2017-02-27 12:35:10 +01:00
Olivier Bertrand
d75e5e6e26 Fix crashing when joining two JDBC tables..
Was in close (the virtual machine could have been detached.
  modified:   storage/connect/jdbconn.cpp
2017-02-24 23:21:20 +01:00
Elena Stepanova
bdb672fe96 MDEV-12120 tokudb_bugs.xa-N tests fail with timeout on valgrind
The tests are disabled for valgrind in 5.6/10.x (LP:1549196),
so they should be disabled in 5.5 as well
2017-02-23 19:46:10 +02:00
Marko Mäkelä
a0ce92ddc7 MDEV-11520 post-fix
fil_extend_space_to_desired_size(): Use a proper type cast when
computing start_offset for the posix_fallocate() call on 32-bit systems
(where sizeof(ulint) < sizeof(os_offset_t)). This could affect 32-bit
systems when extending files that are at least 4 MiB long.

This bug existed in MariaDB 10.0 before MDEV-11520. In MariaDB 10.1
it had been fixed in MDEV-11556.
2017-02-22 12:32:17 +02:00
Marko Mäkelä
81695ab8b5 MDEV-11520 Extending an InnoDB data file unnecessarily allocates
a large memory buffer on Windows

fil_extend_space_to_desired_size(), os_file_set_size(): Use calloc()
for memory allocation, and handle failures. Properly check the return
status of posix_fallocate(), and pass the correct arguments to
posix_fallocate().

On Windows, instead of extending the file by at most 1 megabyte at a time,
write a zero-filled page at the end of the file.
According to the Microsoft blog post
https://blogs.msdn.microsoft.com/oldnewthing/20110922-00/?p=9573
this will physically extend the file by writing zero bytes.
(InnoDB never uses DeviceIoControl() to set the file sparse.)

I tested that the file extension works properly with a multi-file
system tablespace, both with --innodb-use-fallocate and
--skip-innodb-use-fallocate (the default):

./mtr \
--mysqld=--innodb-use-fallocate \
--mysqld=--innodb-autoextend-increment=1 \
--mysqld=--innodb-data-file-path='ibdata1:5M;ibdata2:5M:autoextend' \
--parallel=auto --force --retry=0 --suite=innodb &

ls -lsh mysql-test/var/*/mysqld.1/data/ibdata2
(several samples while running the test)
2017-02-22 12:21:44 +02:00
Marko Mäkelä
365c4e971a MDEV-11520/MDEV-5746 post-fix: Do not posix_fallocate() too much.
Before the MDEV-11520 fixes, fil_extend_space_to_desired_size()
in MariaDB Server 5.5 incorrectly passed the desired file size as the
third argument to posix_fallocate(), even though the length of the
extension should have been passed. This looks like a regression
that was introduced in the 5.5 version of MDEV-5746.
2017-02-22 10:03:33 +02:00
Marko Mäkelä
6de50b2c7f MDEV-11520 post-fixes
Remove the unused variable desired_size.

Also, correct the expression for the posix_fallocate() start_offset,
and actually test that it works with a multi-file system tablespace.
Before MDEV-11520, the expression was wrong in both innodb_plugin and
xtradb, in different ways.

The start_offset formula was tested with the following:

./mtr --big-test --mysqld=--innodb-use-fallocate \
--mysqld=--innodb-data-file-path='ibdata1:5M;ibdata2:5M:autoextend' \
--parallel=auto --force --retry=0 --suite=innodb &

ls -lsh mysql-test/var/*/mysqld.1/data/ibdata2
2017-02-22 09:44:21 +02:00
Marko Mäkelä
978179a9d4 MDEV-11520 Extending an InnoDB data file unnecessarily allocates
a large memory buffer on Windows

fil_extend_space_to_desired_size(), os_file_set_size(): Use calloc()
for memory allocation, and handle failures. Properly check the return
status of posix_fallocate().

On Windows, instead of extending the file by at most 1 megabyte at a time,
write a zero-filled page at the end of the file.
According to the Microsoft blog post
https://blogs.msdn.microsoft.com/oldnewthing/20110922-00/?p=9573
this will physically extend the file by writing zero bytes.
(InnoDB never uses DeviceIoControl() to set the file sparse.)

For innodb_plugin, port the XtraDB fix for MySQL Bug#56433
(introducing fil_system->file_extend_mutex). The bug was
fixed differently in MySQL 5.6 (and MariaDB Server 10.0).
2017-02-21 16:45:03 +02:00
Marko Mäkelä
2bfe83adec Remove a bogus Valgrind "suppression".
fsp_init_file_page_low() does initialize all pages nowadays,
even those in the InnoDB system tablespace.
2017-02-21 16:45:03 +02:00
Elena Stepanova
6dc00f97b7 MDEV-11774 tokudb.locks-select-update-3 failed in buildbot with lock wait timeout
Increase tokudb_lock_timeout for the test
2017-02-21 15:03:34 +02:00
Marko Mäkelä
13493078e9 MDEV-11802 innodb.innodb_bug14676111 fails
The function trx_purge_stop() was calling os_event_reset(purge_sys->event)
before calling rw_lock_x_lock(&purge_sys->latch). The os_event_set()
call in srv_purge_coordinator_suspend() is protected by that X-latch.

It would seem a good idea to consistently protect both os_event_set()
and os_event_reset() calls with a common mutex or rw-lock in those
cases where os_event_set() and os_event_reset() are used
like condition variables, tied to changes of shared state.

For each os_event_t, we try to document the mutex or rw-lock that is
being used. For some events, frequent calls to os_event_set() seem to
try to avoid hangs. Some events are never waited for infinitely, only
timed waits, and os_event_set() is used for early termination of these
waits.

os_aio_simulated_put_read_threads_to_sleep(): Define as a null macro
on other systems than Windows. TODO: remove this altogether and disable
innodb_use_native_aio on Windows.

os_aio_segment_wait_events[]: Initialize only if innodb_use_native_aio=0.
2017-02-20 12:20:52 +02:00
Olivier Bertrand
6f34d8807c All changes made on 10.1 2017-02-16 18:01:48 +01:00
Jan Lindström
108b211ee2 Fix gcc 6.3.x compiler warnings.
These are caused by fact that functions are declared with
__attribute__((nonnull)) or left shit like ~0 << macro
when ~0U << macro should be used.
2017-02-16 12:02:31 +02:00
Marko Mäkelä
01d5d6db4c Fix GCC 6.3.0 warnings. 2017-02-16 11:16:27 +02:00
Marko Mäkelä
6011fb6daa Post-push fix for MDEV-11947 InnoDB purge workers fail to shut down
Use the ib_int64_t type alias instead of the standard type int64_t,
so that the code will compile on Microsoft Visual Studio 2013.
2017-02-09 08:47:38 +02:00
Marko Mäkelä
d831e4c22a MDEV-12024 InnoDB startup fails to wait for recv_writer_thread to finish
recv_writer_thread(): Do not assign recv_writer_thread_active=true
in order to avoid a race condition with
recv_recovery_from_checkpoint_finish().

recv_init_crash_recovery(): Assign recv_writer_thread_active=true
before creating recv_writer_thread.
2017-02-08 17:23:13 +02:00
Marko Mäkelä
f162704570 Rewrite the innodb.log_file_size test with DBUG_EXECUTE_IF.
Remove the debug parameter innodb_force_recovery_crash that was
introduced into MySQL 5.6 by me in WL#6494 which allowed InnoDB
to resize the redo log on startup.

Let innodb.log_file_size actually start up the server, but ensure
that the InnoDB storage engine refuses to start up in each of the
scenarios.
2017-02-05 17:07:16 +02:00
Marko Mäkelä
20e8347447 MDEV-11985 Make innodb_read_only shutdown more robust
If InnoDB is started in innodb_read_only mode such that
recovered incomplete transactions exist at startup
(but the redo logs are clean), an assertion will fail at shutdown,
because there would exist some non-prepared transactions.

logs_empty_and_mark_files_at_shutdown(): Do not wait for incomplete
transactions to finish if innodb_read_only or innodb_force_recovery>=3.
Wait for purge to finish in only one place.

trx_sys_close(): Relax the assertion that would fail first.

trx_free_prepared(): Also free recovered TRX_STATE_ACTIVE transactions
if innodb_read_only or innodb_force_recovery>=3.
2017-02-04 17:33:19 +02:00
Marko Mäkelä
9f0dbb3120 MDEV-11947 InnoDB purge workers fail to shut down
srv_release_threads(): Actually wait for the threads to resume
from suspension. On CentOS 5 and possibly other platforms,
os_event_set() may be lost.

srv_resume_thread(): A counterpart of srv_suspend_thread().
Optionally wait for the event to be set, optionally with a timeout,
and then release the thread from suspension.

srv_free_slot(): Unconditionally suspend the thread. It is always
in resumed state when this function is entered.

srv_active_wake_master_thread_low(): Only call os_event_set().

srv_purge_coordinator_suspend(): Use srv_resume_thread() instead
of the complicated logic.
2017-02-04 17:33:01 +02:00
Marko Mäkelä
732672c304 MDEV-11233 CREATE FULLTEXT INDEX with a token longer than 127 bytes
crashes server

This bug is the result of merging the Oracle MySQL follow-up fix
BUG#22963169 MYSQL CRASHES ON CREATE FULLTEXT INDEX
without merging the base bug fix:
Bug#79475 Insert a token of 84 4-bytes chars into fts index causes
server crash.

Unlike the above mentioned fixes in MySQL, our fix will not change
the storage format of fulltext indexes in InnoDB or XtraDB
when a character encoding with mbmaxlen=2 or mbmaxlen=3
and the length of a word is between 128 and 84*mbmaxlen bytes.
The Oracle fix would allocate 2 length bytes for these cases.

Compatibility with other MySQL and MariaDB releases is ensured by
persisting the used maximum length in the SYS_COLUMNS table in the
InnoDB data dictionary.

This fix also removes some unnecessary strcmp() calls when checking
for the legacy default collation my_charset_latin1
(my_charset_latin1.name=="latin1_swedish_ci").

fts_create_one_index_table(): Store the actual length in bytes.
This metadata will be written to the SYS_COLUMNS table.

fts_zip_initialize(): Initialize only the first byte of the buffer.
Actually the code should not even care about this first byte, because
the length is set as 0.

FTX_MAX_WORD_LEN: Define as HA_FT_MAXCHARLEN * 4 aka 336 bytes,
not as 254 bytes.

row_merge_create_fts_sort_index(): Set the actual maximum length of the
column in bytes, similar to fts_create_one_index_table().

row_merge_fts_doc_tokenize(): Remove the redundant parameter word_dtype.
Use the actual maximum length of the column. Calculate the extra_size
in the same way as row_merge_buf_encode() does.
2017-01-27 10:19:39 +02:00
Marko Mäkelä
afb461587c MDEV-11915 Detect InnoDB system tablespace size mismatch early
InnoDB would refuse to start up if there is a mismatch on
the size of the system tablespace files. However, before this
check is conducted, the system tablespace may already have been
heavily modified.

InnoDB should perform the size check as early as possible.

recv_recovery_from_checkpoint_finish():
Move the recv_apply_hashed_log_recs() call to
innobase_start_or_create_for_mysql().

innobase_start_or_create_for_mysql(): Test the mutex functionality
before doing anything else. Use a compile_time_assert() for a
sizeof() constraint. Check the size of the system tablespace as
early as possible.
2017-01-26 23:10:36 +02:00
Marko Mäkelä
49fe9bad01 MDEV-11814 Refuse innodb_read_only startup if crash recovery is needed
recv_scan_log_recs(): Remember if redo log apply is needed,
even if starting up in innodb_read_only mode.

recv_recovery_from_checkpoint_start_func(): Refuse
innodb_read_only startup if redo log apply is needed.
2017-01-26 13:58:58 +02:00
Sergei Golubchik
fbcdc3437c connect zip bug fix 2017-01-17 22:08:19 +01:00
Olivier Bertrand
82913b0e90 Commit changes made for version 10.1 2017-01-17 19:39:49 +01:00
Sergei Golubchik
e4e801d478 connect: compilation errors and few obvious bugs 2017-01-17 16:21:53 +01:00
Vicențiu Ciorbaru
4f53384678 Merge branch 'bb-10.0-vicentiu' into 10.0
Extra merge commit due to intermediate commits pushed to 10.0 while
merge was done.
2017-01-12 03:37:35 +02:00
Marko Mäkelä
833fda8f1a InnoDB: Enable UNIV_DEBUG_VALGRIND for cmake -DWITH_VALGRIND
The symbol HAVE_VALGRIND_MEMCHECK_H was never defined.
Instead, the symbol HAVE_VALGRIND should have been used.
2017-01-11 14:13:30 +02:00
Marko Mäkelä
78e6fafcaa Fix an innodb_plugin leak noted in MDEV-11686
buf_flush_init_flush_rbt() was called too early in MariaDB server 10.0,
10.1, MySQL 5.5 and MySQL 5.6. The memory leak has been fixed in
the XtraDB storage engine and in MySQL 5.7.

As a result, when the server is started to initialize new data files,
the buf_pool->flush_rbt will be created unnecessarily and then leaked.
This memory leak was noticed in MariaDB server 10.1 when running the
test encryption.innodb_first_page.
2017-01-10 14:28:05 +02:00
Vicențiu Ciorbaru
4799af0925 Fix unit test after merge from mysql 5.5.35 perfschema
The problem in MariaDB is introduced by this merge commit:
c33db2cdc0

The merge comes from mysql and the original author comes from this
commit from MySQL:
------------------------------------------------
    commit 160b823d146288d66638e4a740d6d2da72f9a689
    Author: Marc Alff <marc.alff@oracle.com>
    Date:   Tue Aug 30 12:14:07 2016 +0200

    Bug#22551677 SIGNAL 11 IN LF_PINBOX_PUT_PINS

    Backport to 5.6
------------------------------------------------

The breaking change is in start_socket_wait_v1 where instead of using
m_thread_owner, we make use of my_pthread_getspecific_ptr to fetch a
thread local storage value. Unfortunately this invalidates the
"m_thread_owner" member when a socket is created. The internals of the
socket structure have m_thread_owner set to NULL, but when checking for
ownership we actually look at the current thread's key store.

This seems incorrect however it is not immediately apparent why.

To not diverge from MySQL's reasoning as it is not described what the
actual problem was that this commit is trying to fix, I have adjusted the
unittest to account for this new behaviour. We destroy the current
thread in the unit test, such that the newly created socket actually has
no thread owner. The m_thread_owner is untouched in all this.
2017-01-10 14:20:43 +02:00
Vicențiu Ciorbaru
ecdb39a9f5 Fix problems from 5.5 merge
* Update mysqld_safe script to remove duplicated parameter --crash-script
* Make --core-file-size accept underscores as well as dashes correctly.
* Add mysqld_safe_helper to Debian and Ubuntu files.
* Update innodb minor version to 35
2017-01-10 12:33:08 +02:00
Vicențiu Ciorbaru
94e18e2987 Merge remote-tracking branch 'merge/merge-perfschema-5.6' into 10.0 2017-01-10 12:32:54 +02:00
vicentiu
682d4849ff Merge remote-tracking branch 'merge/merge-innodb-5.6' into 10.0 2017-01-10 12:20:38 +02:00
Vicențiu Ciorbaru
c33db2cdc0 5.6.35 2017-01-07 15:53:37 +02:00
vicentiu
6ac84d9824 5.6.35 2017-01-07 14:24:42 +02:00
vicentiu
1a55455566 Merge remote-tracking branch 'connect/10.0' into bb-10.0-vicentiu 2017-01-06 20:25:21 +02:00
Thirunarayanan Balathandayuthapani
0acab3cef5 Bug #25167032 CRASH WHEN ASSIGNING MY_ERRNO - MISSING
MY_THREAD_INIT IN BACKGROUND THREAD

Description:
===========
Add my_thread_init() and my_thread_exit() for background threads which
initializes and frees the st_my_thread_var structure.

Reviewed-by: Jimmy Yang<jimmy.yang@oracle.com>
RB: 15003
2017-01-06 19:48:54 +05:30
Elena Stepanova
b2b6cf492e MDEV-10988 Sphinx test suite refuses to run silently
Add diagnostics output if any Sphinx components aren't found
2017-01-06 00:07:43 +02:00
Marko Mäkelä
f0c19b6a57 MDEV-11730 Memory leak in innodb.innodb_corrupt_bit
Memory was leaked when ALTER TABLE is attempted on a table
that contains corrupted indexes.
The memory leak was reported by AddressSanitizer for the test
innodb.innodb_corrupt_bit. The leak was introduced into
MariaDB Server 10.0.26, 10.1.15, 10.2.1 by the following:

commit c081c978a2
Merge: 1d21b22155 a482e76e65
Author: Sergei Golubchik <serg@mariadb.org>
Date:   Tue Jun 21 14:11:02 2016 +0200

   Merge branch '5.5' into bb-10.0
2017-01-05 20:30:51 +02:00
Marko Mäkelä
80d5d1452a MDEV-11694 InnoDB tries to create unused table SYS_ZIP_DICT
MariaDB Server 10.0.28 and 10.1.19 merged code from Percona XtraDB
that introduced support for compressed columns. Much but not all
of this code was disabled by placing #ifdef HAVE_PERCONA_COMPRESSED_COLUMNS
around it.

Among the unused but not disabled code is code to access
some new system tables related to compressed columns.

The creation of these system tables SYS_ZIP_DICT and SYS_ZIP_DICT_COLS
would cause a crash in --innodb-read-only mode when upgrading
from an earlier version to 10.0.28 or 10.1.19.

Let us remove all the dead code related to compressed columns.
Users who already upgraded to 10.0.28 and 10.1.19 will have the two
above mentioned empty tables in their InnoDB system tablespace.
Subsequent versions of MariaDB Server will completely ignore those tables.
2017-01-03 19:32:47 +02:00
Olivier Bertrand
4314768150 Modified version number 2016-12-25 12:32:05 +01:00
Olivier Bertrand
6d2d0a7c37 Merge branch '10.0' of https://github.com/MariaDB/server into ob-10.0 2016-12-24 18:19:21 +01:00
Olivier Bertrand
e6b563f8be Fix some XML table type bugs:
- in DOMNODELIST::DropItem
  if (Listp == NULL || Listp->length <= n)
    return true;
is wrong, should be:
  if (Listp == NULL || Listp->length < n)
    return true;
- Crash in discovery with libxml2 in XMLColumns because:
            if (!tdp->Usedom)    // nl was destroyed
              vp->nl = vp->pn->GetChildElements(g);
is executed with vp->pn uninitialized. Fixed by adding:
          vp->pn = node;
line 264.
-In discovery with libxml2 some columns are not found.
Because list was not recovered properly, nodes being modified and not reallocated.
Fixed lines 214 and 277.
  modified:   storage/connect/domdoc.cpp
  modified:   storage/connect/tabxml.cpp

Add support for zipped table files
  modified:   storage/connect/domdoc.cpp
  modified:   storage/connect/domdoc.h
  modified:   storage/connect/filamap.cpp
  modified:   storage/connect/filamap.h
  modified:   storage/connect/filamzip.cpp
  modified:   storage/connect/filamzip.h
  modified:   storage/connect/ha_connect.cc
  modified:   storage/connect/libdoc.cpp
  modified:   storage/connect/plgdbutl.cpp
  modified:   storage/connect/plgxml.cpp
  modified:   storage/connect/plgxml.h
  modified:   storage/connect/tabdos.cpp
  modified:   storage/connect/tabdos.h
  modified:   storage/connect/tabfmt.cpp
  modified:   storage/connect/tabjson.cpp
  modified:   storage/connect/tabxml.cpp
2016-12-23 16:58:32 +01:00
Sergei Golubchik
cba2ac6ef1 5.5.53-38.5 2016-12-22 13:06:44 +01:00
Sergei Golubchik
9fefe97336 Merge branch 'mysql/5.5' into 5.5 2016-12-22 12:49:06 +01:00
Marko Mäkelä
9f863a15b0 MDEV-11602 InnoDB leaks foreign key metadata on DDL operations
Essentially revert MDEV-6759, which addressed a double free of memory
by removing the freeing altogether, introducing the memory leaks.
No double free was observed when running the test suite -DWITH_ASAN.

Replace some mem_heap_free(foreign->heap) with dict_foreign_free(foreign)
so that the calls can be located and instrumented more easily when needed.
2016-12-19 15:57:41 +02:00
Olivier Bertrand
952306502e - MDEV-11295: developing handling files contained in ZIP file.
Enable using multiple zip files
  modified:   storage/connect/filamzip.cpp
  modified:   storage/connect/ha_connect.cc
  modified:   storage/connect/ha_connect.h
  modified:   storage/connect/mycat.h
  modified:   storage/connect/tabdos.cpp
  modified:   storage/connect/tabdos.h
  modified:   storage/connect/tabfmt.cpp
  modified:   storage/connect/tabjson.cpp
2016-12-14 14:20:23 +01:00
Olivier Bertrand
d44723e621 - MDEV-11295: developing handling files contained in ZIP file.
A first experimental and limited implementation.
  modified:   storage/connect/CMakeLists.txt
  modified:   storage/connect/filamap.cpp
  new file:   storage/connect/filamzip.cpp
  new file:   storage/connect/filamzip.h
  modified:   storage/connect/ha_connect.cc
  new file:   storage/connect/ioapi.c
  new file:   storage/connect/ioapi.h
  modified:   storage/connect/mycat.cc
  modified:   storage/connect/plgdbsem.h
  modified:   storage/connect/plgdbutl.cpp
  modified:   storage/connect/tabdos.cpp
  modified:   storage/connect/tabdos.h
  modified:   storage/connect/tabfmt.cpp
  modified:   storage/connect/tabfmt.h
  modified:   storage/connect/tabjson.cpp
  modified:   storage/connect/tabjson.h
  new file:   storage/connect/tabzip.cpp
  new file:   storage/connect/tabzip.h
  new file:   storage/connect/unzip.c
  new file:   storage/connect/unzip.h
  new file:   storage/connect/zip.c
2016-12-12 10:57:19 +01:00
Sergei Golubchik
3e8155c637 Merge branch '5.5' into 10.0 2016-12-09 16:33:48 +01:00
Sergei Golubchik
02d153c7b9 str2decimal: don't return a negative zero 2016-12-05 10:28:20 +01:00
Sergei Golubchik
7f2fd34500 MDEV-11231 Server crashes in check_duplicate_key on CREATE TABLE ... SELECT
be consistent and don't include the table name into the error message,
no other CREATE TABLE error does it.

(the crash happened, because thd->lex->query_tables was NULL)
2016-12-04 01:59:35 +01:00
Sergei Golubchik
c5ef621599 Merge branch 'merge/merge-tokudb-5.6' into 10.0 2016-12-04 01:59:08 +01:00
Sergei Golubchik
f35b0d8ef8 Merge branch 'merge/merge-xtradb-5.6' into 10.0 2016-12-04 01:37:55 +01:00
Sergei Golubchik
4a3acbcfd0 MDEV-11241 Certain combining marks cause MariaDB to crash when doing Full-Text searches
Don't assume that a word of n bytes can match a word of
at most n * charset->mbmaxlen bytes, always go for the worst.
2016-12-03 22:03:38 +01:00
Olivier Bertrand
599d8cc2de - MDEV-11366 SIGBUS errors in Connect Storage Engine for ArmHF and MIPS.
Fix includes launchpad fix plus more to cover writing BIN tables.
  modified:   storage/connect/tabfix.cpp
  modified:   storage/connect/value.cpp
  modified:   storage/connect/value.h

- Typo: Change the name of filamzip to filamgz to prepare future ZIP tables.
  modified:   storage/connect/CMakeLists.txt
  added:      storage/connect/filamgz.cpp
  added:      storage/connect/filamgz.h
  deleted:    storage/connect/filamzip.cpp
  deleted:    storage/connect/filamzip.h
  modified:   storage/connect/plgdbsem.h
  modified:   storage/connect/reldef.cpp
  modified:   storage/connect/tabdos.cpp
  modified:   storage/connect/tabdos.h
  modified:   storage/connect/tabfix.cpp
  modified:   storage/connect/tabfmt.cpp
  modified:   storage/connect/tabjson.cpp
2016-12-02 23:03:43 +01:00
Sergei Golubchik
d4f0686cd8 5.6.34-79.1 2016-12-02 10:24:00 +01:00
Sergei Golubchik
7436c3d6ab 5.6.34-79.1 2016-12-02 10:22:18 +01:00
Vicențiu Ciorbaru
525e214111 Remove labs() warning from maria and myisam storage engines 2016-12-01 15:01:33 +01:00
Olivier Bertrand
2d78b25c49 - Fix null pointer java error when connecting to jdbc:drill driver.
By setting the context class loader.
  modified:   storage/connect/JavaWrappers.jar
  modified:   storage/connect/JdbcInterface.java
  modified:   storage/connect/mysql-test/connect/std_data/JdbcMariaDB.jar
2016-11-27 14:42:37 +01:00
Jan Lindström
03ddc19ab2 MDEV-6424: MariaDB server crashes with assertion failure in file ha_innodb.c line 11652
This is not a fix, this is instrumentation to find out is MySQL frm dictionary
and InnoDB data dictionary really out-of-sync when this assertion is fired,
or is there some other reason (bug).
2016-11-17 15:15:20 +02:00
Olivier Bertrand
aae67535cc - MDEV-11051 place Java classes ApacheInterface and JdbcInterface into single jar file.
Try to fix the INSTALL command.
  modified:   storage/connect/CMakeLists.txt

- Make some JDBC tests available on Windows
  modified:   storage/connect/mysql-test/connect/t/jdbc.test
  modified:   storage/connect/mysql-test/connect/t/jdbc_new.test
  added:      storage/connect/mysql-test/connect/t/windows.inc
2016-11-14 19:20:40 +01:00
Olivier Bertrand
5884aa15d4 - Fix MDEV-11234. Escape quoting character. Should be doubled.
Now it is also possible to escape it by a backslash.
  modified:   storage/connect/tabfmt.cpp

- Prepare making VEC table type support conditional.
  VEC tables might be unsupported in future versions
  modified:   storage/connect/CMakeLists.txt
  modified:   storage/connect/mycat.cc
  modified:   storage/connect/reldef.cpp
  modified:   storage/connect/xindex.cpp

- MDEV-11067 suggested to add configuration support to the Apache wrapper.
  Was added but commented out until prooved it is really useful.
  modified:   storage/connect/ApacheInterface.java
  modified:   storage/connect/ha_connect.cc
  modified:   storage/connect/jdbccat.h
  modified:   storage/connect/jdbconn.cpp
  modified:   storage/connect/jdbconn.h
  modified:   storage/connect/tabjdbc.cpp
  modified:   storage/connect/tabjdbc.h

- Remove useless members.
  modified:   storage/connect/jdbconn.cpp
  modified:   storage/connect/jdbconn.h

- New UDF countin.
  modified:   storage/connect/jsonudf.cpp
  modified:   storage/connect/jsonudf.h
2016-11-06 14:57:27 +01:00
Jan Lindström
9741e0ea72 Initialize zip_dict_ids table and avoid referencing array items
as currently MariaDB does not support compressed columns.
2016-11-01 07:52:28 +02:00
Jan Lindström
923a7f8675 MDEV-11188: rpl.rpl_parallel_partition fails with valgrind warnings in buildbot and outside 2016-10-31 12:16:53 +02:00
Daniel Black
9155cc7090 MDEV-10292: Tokudb - PerconaFT - compile error in recent gcc
The following directives to ignore warnings where in the PerconaFT build in tokudb.
These generate errors when g++ ... -o xxx.so is used to compile are shared object.

As these don't actually hit any warnings they have been removed.

* -Wno-ignored-attributes
* -Wno-pointer-bool-conversion

Signed-off-by: Daniel Black <daniel.black@au.ibm.com>
2016-10-26 11:51:56 +02:00
Vladislav Vaintroub
ad5b88a892 Fix build error in XtraDB on Windows.
coming from Percona's workaround for glibc bug
http://bugs.mysql.com/bug.php?id=82886
2016-10-26 09:26:34 +00:00
Sergei Golubchik
2cfccbe433 Merge branch 'connect/10.0' into 10.0 2016-10-25 21:59:06 +02:00
Sergei Golubchik
de9ea40f05 Merge branch 'merge/merge-tokudb-5.6' into 10.0 2016-10-25 21:58:59 +02:00
Sergei Golubchik
675f27b382 Merge branch 'merge/merge-xtradb-5.6' into 10.0
commented out the "compressed columns" feature
2016-10-25 18:28:31 +02:00
Sergei Golubchik
d9787aa29a 5.6.33-79.0 2016-10-25 17:03:23 +02:00
Sergei Golubchik
d7dc03a267 5.6.33-79.0 2016-10-25 17:01:37 +02:00
Sergei Golubchik
12c3e16dfa Merge branch '5.5' into 10.0 2016-10-25 16:41:43 +02:00
Vicențiu Ciorbaru
39dceaae60 MDEV-10983: TokuDB does not compile on OS X 10.12
Make use of a different function to get the current tid.

Additionally, librt doesn't exist on OS X. Use System library instead.
2016-10-25 15:12:27 +02:00
Don Lewis
3321f1adc7 MDEV-5944: Compile fix for OQGRAPH with LLVM
Clang/LLVM has more strict schemantics than gcc.

This patch quantifies the namesspace such that it will
compile using clang.
2016-10-25 13:46:28 +03:00
Olivier Bertrand
b7aee7dbe7 - Fix MDEV-10950. Null values not retrieved for numeric types.
Now the null is tested using the result set getObject method.
  modified:   storage/connect/JdbcInterface.java
  modified:   storage/connect/jdbconn.cpp
  modified:   storage/connect/jdbconn.h
2016-10-14 18:29:33 +02:00
Sergei Golubchik
eac8d95ffc compilation warning after xtradb merge 2016-10-14 12:51:53 +02:00
Sergei Golubchik
e4957de4fd Merge branch 'merge-xtradb-5.5' into 5.5 2016-10-13 12:40:24 +02:00
Sergei Golubchik
6010a27c87 5.5.52-38.3 2016-10-13 12:23:16 +02:00
Olivier Bertrand
9b20d606fb - Fix MDEV-10948. Syntax error on quoted JDBC tables.
Was because the quoting character was always '"' instead of being
  retrieve from the JDBC source.
  modified:   storage/connect/JdbcInterface.java
  modified:   storage/connect/jdbconn.cpp
  modified:   storage/connect/tabjdbc.cpp
2016-10-05 23:44:54 +02:00
Vasil Dimov
65febcce97 Fix Bug#24707869 GCC 5 AND 6 MISCOMPILE MACH_PARSE_COMPRESSED
Prevent GCC from moving a mach_read_from_4() before we have checked that
we have 4 bytes to read. The pointer may only point to a 1, 2 or 3
bytes in which case the code should not read 4 bytes. This is a
workaround to a GCC bug:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77673

Patch submitted by: Laurynas Biveinis <laurynas.biveinis@gmail.com>
RB: 14135
Reviewed by: Pawel Olchawa <pawel.olchawa@oracle.com>
2016-10-03 14:43:08 +03:00
Sergei Petrunia
23af6f5942 Merge branch '10.0' of github.com:MariaDB/server into 10.0 2016-09-28 16:19:58 +03:00
Sergei Petrunia
a53f3c6d3c MDEV-10649: Optimizer sometimes use "index" instead of "range" access for UPDATE
(Fixing both InnoDB and XtraDB)

Re-opening a TABLE object (after e.g. FLUSH TABLES or open table cache
eviction) causes ha_innobase to call
dict_stats_update(DICT_STATS_FETCH_ONLY_IF_NOT_IN_MEMORY).

Inside this call, the following is done:
  dict_stats_empty_table(table);
  dict_stats_copy(table, t);

On the other hand, commands like UPDATE make this call to get the "rows in
table" statistics in table->stats.records:

  ha_innobase->info(HA_STATUS_VARIABLE|HA_STATUS_NO_LOCK)

note the HA_STATUS_NO_LOCK parameter. It means, no locks are taken by
::info() If the ::info() call happens between dict_stats_empty_table
and dict_stats_copy calls, the UPDATE's optimizer will get an estimate
of table->stats.records=1, which causes it to pick a full table scan,
which in turn will take a lot of row locks and cause other bad
consequences.
2016-09-28 16:12:58 +03:00
Sergei Golubchik
078e510e0a Merge branch 'merge/merge-tokudb-5.6' into 10.0 2016-09-27 19:03:11 +02:00
Sergei Golubchik
2e914acb78 Merge branch 'merge/merge-perfschema-5.6' into 10.0 2016-09-27 19:00:08 +02:00
Sergei Golubchik
bb8b658954 Merge branch 'merge/merge-xtradb-5.6' into 10.0 2016-09-27 18:58:57 +02:00
Sergei Golubchik
3629f62d29 Merge branch 'merge/merge-innodb-5.6' into 10.0 2016-09-27 18:05:06 +02:00
Sergei Golubchik
93ab3093cb 5.6.32-78.1 2016-09-27 18:00:59 +02:00
Sergei Golubchik
e312e2e636 5.6.32-78.1 2016-09-27 17:59:58 +02:00
Sergei Golubchik
094f140c9a 5.6.33 2016-09-27 17:56:00 +02:00
Vicențiu Ciorbaru
83d5b963bd Fix tokudb jemalloc linking
Linking tokudb with jemalloc privately causes problems on library
load/unload. To prevent dangling destructor pointers, link with the same
library as the server is using.
2016-09-20 12:37:35 +02:00
Olivier Bertrand
7d596c9ff5 - Working on MDEV-10525. Lrecl mismatch on DBF files
modified:   storage/connect/filamdbf.cpp
  modified:   storage/connect/filamdbf.h
  modified:   storage/connect/reldef.cpp
2016-09-16 22:14:14 +02:00
Vicențiu Ciorbaru
6e02d426d5 Fix compilation failure of TokuDB on BSD-like systems
mincore is defined differently in BSD mincore(void *, size_t, char *) vs
linux variant of: mincore(void *, size_t, unsigned char *).
Account for this difference in TokuDB.
2016-09-13 13:37:05 +02:00
Daniel Black
6c74ef8ae9 MDEV-10707: Fix tokudb test rows-32m-rand-insert (#231)
MDEV-10757: Fix tokudb test rows-32m-rand-insert
2016-09-07 02:30:02 +03:00
Olivier Bertrand
2140dcf66d Merge branch '10.0' of https://github.com/MariaDB/server into ob-10.0 2016-09-05 13:19:28 +02:00
Olivier Bertrand
213765cc22 - Fix MDEV-10496. Memory leak in discovery
modified:   storage/connect/ha_connect.cc
  modified:   storage/connect/mycat.cc

- Fix wrong lrecl calculation for virtual columns
  modified:   storage/connect/reldef.cpp

- Typo
  modified:   storage/connect/jdbconn.cpp
  modified:   storage/connect/json.cpp
2016-09-05 13:18:04 +02:00
Vicențiu Ciorbaru
ed99e2cdd3 MDEV-10341: InnoDB: Failing assertion: mutex_own(mutex) - mutex_exit_func
Followup from 5.5 patch. Removing memory barriers on intel is wrong as
this doesn't prevent the compiler and/or processor from reorganizing reads
before the mutex release. Forcing a memory barrier before reading the waiters will
guarantee that no speculative reading takes place.
2016-08-23 21:24:36 +03:00
Monty
6f31dd093a Added new status variables to make it easier to debug certain problems:
- Handler_read_retry
- Update_scan
- Delete_scan
2016-08-21 20:18:39 +03:00
Jon Olav Hauglid
033b119121 Bug#24388746: PRIVILEGE ESCALATION AND RACE CONDITION USING CREATE TABLE
During REPAIR TABLE of a MyISAM table, a temporary data file (.TMD)
is created. When repair finishes, this file is renamed to the original
.MYD file. The problem was that during this rename, we copied the
stats from the old file to the new file with chmod/chown. If a user
managed to replace the temporary file before chmod/chown was executed,
it was possible to get an arbitrary file with the privileges of the
mysql user.

This patch fixes the problem by not copying stats from the old
file to the new file. This is not needed as the new file was
created with the correct stats. This fix only changes server
behavior - external utilities such as myisamchk still does
chmod/chown.

No test case provided since the problem involves synchronization
with file system operations.
2016-08-19 09:09:07 +02:00
Sergei Golubchik
47a1087ff6 Merge branch 'bb-10.0-serg' into 10.0 2016-08-14 09:16:07 +02:00
Jan Lindström
9b23f8054d MDEV-10535: ALTER TABLE causes standalone/wsrep cluster crash
When checking is any of the renamed columns part of the
columns for new indexes we accessed NULL pointer if checked
column used on index was added on same statement. Additionally,
we tried to check too many indexes, added_index_count
is enough here.
2016-08-13 09:27:50 +03:00
Jan Lindström
b3df257cfd MDEV-10469: innodb.innodb-alter-tempfile fails in buildbot: InnoDB: Warning: database page corruption or a failed
Test case intentionally crashes the server and that could lead partially
written pages that are then restored from doublewrite buffer.
2016-08-13 09:27:50 +03:00
Sergei Golubchik
2bd94951c6 Merge branch 'connect/10.0' into 10.0
1.04.0008
2016-08-10 19:58:42 +02:00
Sergei Golubchik
077f29a921 Merge branch 'merge/merge-tokudb-5.6' into 10.0
5.6.31-77.0
2016-08-10 19:57:13 +02:00
Sergei Golubchik
3863e72380 Merge branch 'merge/merge-xtradb-5.6' into 10.0
5.6.31-77.0
2016-08-10 19:55:45 +02:00
Sergei Golubchik
e672d3fb32 Merge branch 'merge/merge-perfschema-5.6' into 10.0
5.6.32
2016-08-10 19:44:28 +02:00
Sergei Golubchik
57fbc603bf Merge branch 'merge/merge-innodb-5.6' into 10.0
5.6.32
2016-08-10 19:43:37 +02:00
Sergei Golubchik
4f2d214359 5.6.31-77.0 2016-08-10 19:30:20 +02:00
Sergei Golubchik
0d8bb019b6 5.6.32 2016-08-10 19:26:54 +02:00
Sergei Golubchik
64752acf72 5.6.31-77.0 2016-08-10 19:24:58 +02:00
Sergei Golubchik
b4f97a1499 5.6.32 2016-08-10 19:23:00 +02:00
Sergei Golubchik
309c08c17c Merge branch '5.5' into 10.0 2016-08-10 19:19:05 +02:00
Olivier Bertrand
a2934d2710 - JdbcInterface: change return type of ...Field function
modified:   storage/connect/JdbcInterface.java

- Change Version number and date
  modified:   storage/connect/ha_connect.cc

- Implement the test on connect_type_conv YES/NO
  modified:   storage/connect/jdbconn.cpp
  modified:   storage/connect/odbconn.cpp

- Fix MDEV-10520. Local schema was confused with remote schema
  modified:   storage/connect/tabjdbc.cpp
  modified:   storage/connect/tabodbc.cpp

- Fix crash when using mapped indices. Was trying to write in a mapped
  file declared as read only.
  modified:   storage/connect/xindex.cpp
2016-08-10 18:27:31 +02:00
Vicențiu Ciorbaru
5ad02062d9 MDEV-10341: InnoDB: Failing assertion: mutex_own(mutex) - mutex_exit_func
Fix memory barrier issues on releasing mutexes. We must have a full
memory barrier between releasing a mutex lock and reading its waiters.
This prevents us from missing to release waiters due to reading the
number of waiters speculatively before releasing the lock. If threads
try and wait between us reading the waiters count and releasing the
lock, those threads might stall indefinitely.

Also, we must use proper ACQUIRE/RELEASE semantics for atomic
operations, not ACQUIRE/ACQUIRE.
2016-08-09 23:34:44 +03:00
Sergei Golubchik
5e23b6344f MDEV-10506 Protocol::end_statement(): Assertion `0' failed upon ALTER TABLE
thd->clear_error() destroyed already existing error status
2016-08-07 11:02:42 +02:00
Sergei Golubchik
5265243cc4 Merge branch 'merge/merge-xtradb-5.5' into 5.5 2016-08-03 20:44:08 +02:00
Sergei Golubchik
e316c46f43 5.5.50-38.0 2016-08-03 20:43:29 +02:00
Jan Lindström
35c9c85634 MDEV-10217: innodb.innodb_bug59641 fails sporadically in buildbot: InnoDB: Failing assertion: current_rec != insert_rec in file page0cur.c line 1052
Added record printout when current_rec == insert_rec with lengths for
debug builds.
2016-08-03 13:46:01 +03:00
Olivier Bertrand
ec725089cf Change jdbc test to reflect girls.txt LF ending 2016-07-15 00:50:18 +02:00
Olivier Bertrand
44012db635 All changes made on 10.1 for last 11 commits 2016-07-14 20:12:22 +02:00
Sergei Golubchik
f12ebed0a4 fixes for tokudb_parts --big suite 2016-07-12 22:20:34 +02:00
Rik Prohaska
865ae5d38e MDEV-10261 fix some tokudb partition test result files since the underlying tests have changed. 2016-07-12 22:20:34 +02:00
Sergei Golubchik
79fc519eed json_udf slowdown
don't call strlen() in the loop
2016-07-12 22:20:20 +02:00
Jan Lindström
406fe77763 Add more diagnostic to find out the problem on
innodb_shutdown_for_mysql in ppc64el on test
case innodb_fts.innodb_fts_stopword_charset.
2016-07-04 17:38:47 +03:00
Sergei Golubchik
6dfe3fb2bb remove incorrect .gitattributes 2016-06-28 10:23:24 +02:00
Sergey Vojtovich
9fc102b37e Fixed testcase check failure after db938.test 2016-06-23 12:44:28 +04:00
Jan Lindström
26de9061e8 Merge following commit from 5.5:
commit ef92aaf9ec
Author: Jan Lindström <jan.lindstrom@mariadb.com>
Date:   Wed Jun 22 22:37:28 2016 +0300

    MDEV-10083: Orphan ibd file when playing with foreign keys

    Analysis: row_drop_table_for_mysql did not allow dropping
    referenced table even in case when actual creating of the
    referenced table was not successfull if foreign_key_checks=1.

    Fix: Allow dropping referenced table even if foreign_key_checks=1
    if actual table create returned error.
2016-06-23 07:42:40 +03:00
Jan Lindström
ef92aaf9ec MDEV-10083: Orphan ibd file when playing with foreign keys
Analysis: row_drop_table_for_mysql did not allow dropping
referenced table even in case when actual creating of the
referenced table was not successfull if foreign_key_checks=1.

Fix: Allow dropping referenced table even if foreign_key_checks=1
if actual table create returned error.
2016-06-23 06:46:05 +03:00
Sergei Golubchik
e167806196 compilation failures
windows: use GetProcAddress() to access internal server data structures
rhel5: CONNECT-JDBC requires at least Java 1.6
2016-06-22 16:12:50 +02:00
Dimitri John Ledkov
26bf066d56 MDEV-9479: Enable OQGRAPH Engine to compile with Boost-1.60+
This used to be a compile failure. The defined structure isn't required
in the later versions of boost.

Signed-off-by: Vicențiu Ciorbaru <vicentiu@mariadb.org>
2016-06-22 16:41:38 +03:00
Sergei Golubchik
f9b5acfb0c Merge branch 'bb-10.0-serg' into 10.0 2016-06-22 10:54:19 +02:00
Sergei Golubchik
87da7670bd Fixed for failures in buildbot: TokuDB
disable unstable tokudb tests,
(old change that was lost in a merge)
2016-06-22 10:41:38 +02:00
Sergei Golubchik
a10fd659aa Fixed for failures in buildbot: Replication
1. remove unnecessary rpl-tokudb combination file.
2. fix rpl_ignore_table to cleanup properly (not leave test
   grants in memory)
3. check_temp_dir() is supposed to set the error in stmt_da - do
   it even when called multiple times, this fixes a crash when
   rpl.rpl_slave_load_tmpdir_not_exist is run twice.
2016-06-22 10:40:43 +02:00
Sergei Golubchik
805703fa8e Fixed for failures in buildbot: Windows
fix constants to stay 64-bit instead of being truncated by VS.
this fixes a hang on startup.
2016-06-22 10:40:28 +02:00
Sergei Golubchik
25f1a7ae69 revert part of 69f1a32
in particular, revert changes to the spider (avoid diverging from
  the upstream if possible)
2016-06-22 10:23:11 +02:00
Vladislav Vaintroub
69f1a3215e Replace dynamic loading of mysqld.exe data for plugins, replace with MYSQL_PLUGIN_IMPORT 2016-06-21 19:20:11 +02:00
Sergei Golubchik
c84a40bf8f Merge branch 'connect/10.0' into 10.0 2016-06-21 15:57:20 +02:00
Sergei Golubchik
a69f4c783d Merge branch 'bb-10.0-serg' into 10.0 2016-06-21 15:55:37 +02:00
Sergei Golubchik
b3f4cf7c13 Merge branch 'merge-xtradb-5.6' into 0.0 2016-06-21 15:27:09 +02:00
Sergey Vojtovich
8255781d9b MDEV-10258 - Valgrind warnings in buildbot after a set of mroonga tests
Fixed memory leak when mroonga fails to open index files.
Memory leak was detected by valgrind when running
mroonga/storage.repair_table_no_index_file.
2016-06-21 17:04:57 +04:00
Sergey Vojtovich
15313216bf MDEV-9993 - connect.json_udf_bin valgrind warnings
"result" may be uninitialized when json_set_item() is called directly.
2016-06-21 17:04:57 +04:00
Sergei Golubchik
a79d46c3a4 Merge branch 'merge-innodb-5.6' into 10.0 2016-06-21 14:58:19 +02:00
Sergei Golubchik
720e04ff67 5.6.31 2016-06-21 14:21:03 +02:00
Sergei Golubchik
b42664e85e 5.6.30-76.3 2016-06-21 14:20:09 +02:00
Sergei Golubchik
c081c978a2 Merge branch '5.5' into bb-10.0 2016-06-21 14:11:02 +02:00
Jan Lindström
fa10a65dc2 MDEV-9356: innodb.innodb_bug53290 fails (crashes) on sol10-64 in buildbot
Analysis: In storage/innobase/row/row0merge.cc InnoDB calls
thd_progress_init, thd_progress_report and thd_progress_end
functions. These seem to cause crash on solaris 10 64-bit.

Fix: Disable progress reporting on UNIV_SOLARIS until the
actual issue causing the crash is fixed. The actual bug
is not on InnoDB code base.
2016-06-21 12:43:46 +03:00
Olivier Bertrand
f2dded9bac Merge branch '10.0' of https://github.com/MariaDB/server into 10.0 2016-06-20 15:26:05 +02:00
Vicențiu Ciorbaru
7ff86b4991 MDEV-10247 TokuDB assertion error when building with DEBUG
Fix the assertion failure by setting the struct to 0. This can not be
done using a macro due to different definitions of mutexes on various
OS-es.
Afterwards we call toku_mutex_init and completely initialize the locks.
2016-06-17 14:59:17 +03:00
Vicențiu Ciorbaru
12ae840375 Fix typo bug that cause myisam repair to fail
We need to return TRUE if got_error == 1, not error, which is
initialized to FALSE.
2016-06-16 22:04:24 +03:00
Vicențiu Ciorbaru
7ab7abdb51 Fix compilation failure when compiling with std=c90
Change variable declaration to be before any other statements.
2016-06-16 18:52:46 +03:00
Vladislav Vaintroub
b644661e5d MDEV-9256 : Crashes on Windows x64 with aria_pagecache_buffer_size > 4GB
Fixed wrong calculation of buffer sizes. ulong datatype was used wrongly,
as were the casts to ulong. Buffer sizes should be of type size_t,
not ulong, or bad things happen on 64 bit Windows.

This patch changes pagecache struct to use size_t/ssize_t
where long/ulong were previously used. Also, removed several casts.
2016-06-14 22:31:39 +02:00
Vicențiu Ciorbaru
34a104ba0c MDEV-10229: TokuDB fails to build with CLang
Structure initialization must feature all members present within the
struct.
2016-06-14 19:17:29 +03:00
Vicențiu Ciorbaru
1bf25092cb MDEV-10162: Update repair testcase 2016-06-14 19:17:29 +03:00
Vicențiu Ciorbaru
2b47832a2d Fixed compilation failure using clang
Both aria and myisam storage engines feature a logic path in
thr_find_all_keys that leads to undefined behaviour by bypassing the
initialization code of variables after my_thread_init().

By refactoring the nested logic into a separate function, this problem
is resolved.
2016-06-14 19:17:29 +03:00
Vicențiu Ciorbaru
6a34ba3130 [Code cleanup] Refactor duplicate code within myisam and maria sort.cc 2016-06-14 19:17:29 +03:00
Sergei Golubchik
260699e91b Merge branch 'merge-xtradb-5.5' into 5.5 2016-06-14 13:59:41 +02:00
Sergei Golubchik
f54dcf1e87 5.5.49-37.9 2016-06-14 12:38:47 +02:00
Olivier Bertrand
0a96c9c4aa - Possibly fix MDEV-10179 Reset remote tables when re-opening
modified:   storage/connect/tabtbl.cpp

- Add trace and make m_Stmt conditional
  modified:   storage/connect/myconn.cpp
  modified:   storage/connect/myconn.h

- Protect trace from null string (for Linux)
  modified:   storage/connect/tabcol.cpp

- Record error changes
  modified:   storage/connect/mysql-test/connect/r/jdbc_new.result

- Typo
  modified:   storage/connect/jdbconn.cpp
  modified:   storage/connect/jsonudf.cpp
2016-06-13 14:28:02 +02:00
Sergei Golubchik
ecdf46daed Merge branch '10.0-tokudb-merge' into 10.0 2016-06-11 22:56:48 +02:00
Sergei Golubchik
02043d7c53 MDEV-9128 Compiling on IBM System Z fails
restore the fix f31a89191f that was lost in a merge
2016-06-11 22:48:41 +02:00
Sergei Golubchik
22d7860d78 fix tokudb tests after the merge 2016-06-11 22:47:30 +02:00
Sergei Golubchik
dde558f262 Merge branch 'merge-tokudb-5.6' into 10.0-tokudb-merge 2016-06-11 01:06:09 +02:00
Sergei Golubchik
ca95cc603b Merge branch 'merge-tokudb-5.6' into 10.0-tokudb-merge
5.6.28-76.1
2016-06-10 20:48:59 +02:00
Sergey Vojtovich
87007dc2f7 MDEV-9994 - Aria service threads are not "joined"
Aria service threads are created "joinable", but they're not "joined" on
completion. This causes memory leaks around thread local storage.

Fixed by joining service thread. Simplified relevant code and cleaned up
relevant valgrind suppressions.
2016-06-10 22:07:49 +04:00
Sergei Golubchik
f853a99a4f 5.6.30-76.3 2016-06-10 19:47:58 +02:00
Jan Lindström
0f252702b1 MDEV-7139: Sporadic failure in innodb.innodb_corrupt_bit on P8
Use direct persistent index corruption set on InnoDB dictionary
for this test. Do not allow creating new indexes if one of the
existing indexes is already marked as corrupted.
2016-06-08 08:40:10 +03:00
Olivier Bertrand
a9ac3506d2 git90.msg + git91.msg 2016-06-02 23:36:19 +02:00
Elena Stepanova
f9d453e893 Follow-up for commit 38b89a61c3
Altering a comment or a default field's value needs "NO_LOCK", not EXCLUSIVE -
storage_engine test result updated
2016-05-28 13:11:09 +03:00
Olivier Bertrand
e905abf91b - New version of the java JdbcInterface
modified:   storage/connect/JdbcInterface.class
  modified:   storage/connect/JdbcInterface.java

- Ignore *.tlog and .res files
  modified:   .gitignore
2016-05-23 15:17:43 +02:00
Olivier Bertrand
9a5c586024 Merge branch '10.0' of https://github.com/MariaDB/server into 10.0 2016-05-22 11:13:10 +02:00
Olivier Bertrand
d25fd437c4 - Fix wrong return from ExecuteQuery
modified:   storage/connect/jdbconn.cpp

- Suppress GCC warning
  modified:   storage/connect/tabjdbc.cpp
2016-05-21 14:56:47 +02:00
Olivier Bertrand
c92f2606ea Commit changes made from 10.1 2016-05-21 12:11:27 +02:00
Olivier Bertrand
4a1ffc3853 Add forgotten changes made on 10.1 2016-05-12 23:26:40 +02:00
Olivier Bertrand
5af076e564 Add all changes made on 10.1 2016-05-12 23:08:22 +02:00
Vladislav Vaintroub
e5810727a9 Fix msxml6 search in Connect engine on Windows,
as it fails on new builders.

msxml6 is found on all Windows we support, thus there is no reason to
search for it.
2016-04-27 18:16:03 +02:00
Sergei Golubchik
cf22514591 after-merge fixes for failures in buildbot 2016-04-27 08:34:35 +02:00
Sergei Golubchik
8b1563eac8 Merge branch 'connect/10.0' into 10.0
1.04.0006
2016-04-26 23:48:18 +02:00
Sergei Golubchik
cfad394776 Merge branch 'merge-xtradb-5.6' into 10.0
5.6.29-76.2
2016-04-26 23:43:48 +02:00
Sergei Golubchik
c4dcfb60e8 Merge branch 'merge-innodb-5.6' into 10.0
5.6.30
2016-04-26 23:20:32 +02:00
Sergei Golubchik
872649c7ba Merge branch '5.5' into 10.0 2016-04-26 23:05:26 +02:00
Sergei Golubchik
4995bcffad MDEV-9610 Trigger on normal table can't insert into CONNECT engine table - Access Denied
in case of prelocking, don't check table->grant.privilege
in handler::external_lock(), do it in
handler::start_stmt().
2016-04-26 21:03:40 +02:00