Commit graph

3014 commits

Author SHA1 Message Date
Nirbhay Choubey
ee8b5c305a Merge tag 'mariadb-10.0.29' into 10.0-galera 2017-01-13 13:53:59 -05:00
Sergei Golubchik
3e8155c637 Merge branch '5.5' into 10.0 2016-12-09 16:33:48 +01:00
Sergei Golubchik
03dabfa84d MDEV-10713: signal 11 error on multi-table update - crash in handler::increment_statistics or in make_select or assertion failure pfs_thread == ((PFS_thread*) pthread_getspecific((THR_PFS)))
Different fix. Don't allow Item_func_sp to be evaluated unless
all tables are prelocked.

Extend the test case to make sure Item_func_sp::val_str is called
(the table must have at least one row for that).
2016-12-08 23:19:55 +01:00
Nirbhay Choubey
c309e99ff9 Merge branch '10.0' into 10.0-galera 2016-08-24 19:30:32 -04:00
Vicențiu Ciorbaru
4eb898bb16 MDEV-10563 Crash during shutdown in Master_info_index::any_slave_sql_running
In well defined C code, the "this" pointer is never NULL. Currently, we
were potentially dereferencing a NULL pointer (master_info_index). GCC v6
removes any "if (!this)" conditions as it assumes this is always a
non-null pointer. In order to prevent undefined behaviour, check the
pointer before dereferencing and remove the check within member
functions.
2016-08-23 21:24:36 +03:00
Alexander Barkov
ecb7ce7844 MDEV-10467 Assertion `nr >= 0.0' failed in Item_sum_std::val_real()
Backporting MDEV-5781 from 10.0.
2016-08-03 15:55:48 +04:00
Nirbhay Choubey
14d62505d9 Merge tag 'mariadb-10.0.26' into 10.0-galera 2016-06-24 12:01:22 -04:00
Sergei Golubchik
c081c978a2 Merge branch '5.5' into bb-10.0 2016-06-21 14:11:02 +02:00
Alexander Barkov
a4848e975d MDEV-9972 Least function retuns date in date time format 2016-06-08 19:04:12 +04:00
Nirbhay Choubey
8a1efa1bdd Merge branch '10.0' into 10.0-galera 2016-04-29 16:50:58 -04:00
Sergei Golubchik
872649c7ba Merge branch '5.5' into 10.0 2016-04-26 23:05:26 +02:00
Sergei Golubchik
29868de2ff MDEV-9986 Full-text search of the utf8mb4 column causes crash
take into account that agg_arg_charsets_for_comparison()
can replace Item_field's with Item_func_conv_charset
2016-04-26 12:58:14 +02:00
Alexander Barkov
9a987142f9 MDEV-9745 Crash with CASE WHEN TRUE THEN COALESCE(CAST(NULL AS UNSIGNED)) ELSE 4 END
This is a backport of the patch for MDEV-9653 (fixed earlier in 10.1.13).

The code in Item_func_case::fix_length_and_dec() did not
calculate max_length and decimals properly.

In case of any numeric result (DECIMAL, REAL, INT) a generic method
Item_func_case::agg_num_lengths() was called, which could erroneously result
into a DECIMAL item with max_length==0 and decimals==0, so the constructor of
Field_new_decimals tried to create a field of DECIMAL(0,0) type,
which caused a crash.

Unlike Item_func_case, the code responsible for merging attributes in
Item_func_coalesce::fix_length_and_dec() works fine: it has specific execution
branches for all distinct numeric types and correctly creates a DECIMAL(1,0)
column instead of DECIMAL(0,0) for the same set of arguments.

The fix does the following:
- Moves the attribute merging code from Item_func_coalesce::fix_length_and_dec()
  to a new method Item_func_hybrid_result_type::fix_attributes()
- Removes the wrong code from Item_func_case::fix_length_and_dec()
  and reuses fix_attributes() in both Item_func_coalesce::fix_length_and_dec()
  and Item_func_case::fix_length_and_dec()
- Fixes count_real_length() and count_decimal_length() to get an array
  of Items as an argument, instead of using Item::args directly.
  This is needed for Item_func_case::fix_length_and_dec().
- Moves methods Item_func::count_xxx_length() from "public" to "protected".
- Removes Item_func_case::agg_num_length(), as it's not used any more.
- Additionally removes Item_func_case::agg_str_length(),
  as it also was not used (dead code).
2016-04-20 08:53:30 +04:00
Otto Kekäläinen
1777fd5f55 Fix spelling: occurred, execute, which etc 2016-03-04 02:09:37 +02:00
Nirbhay Choubey
dad555a09c Merge tag 'mariadb-10.0.23' into 10.0-galera 2015-12-19 14:24:38 -05:00
Sergei Golubchik
1623995158 Merge branch '5.5' into 10.0 2015-12-13 00:10:40 +01:00
Sergei Golubchik
abf9d35213 Merge branch 'mysql/5.5' into 5.5 2015-12-09 10:00:49 +01:00
Alexander Barkov
d87bc55b05 MDEV-8630 Datetime value dropped in "INSERT ... SELECT ... ON DUPLICATE KEY"
Item_func_coalesce::fix_length_and_dec() calls
Item_func::count_string_result_length()) which called agg_arg_charsets()
with wrong flags, so the collation derivation of the COALESCE result was
not properly set to DERIVATION_COERCIBLE. It erroneously stayed
DERIVATION_NUMERIC. So GREATEST() misinterpreted the argument as
a number rather that a string and did not calculate its own length properly.
2015-12-03 20:43:54 +04:00
Nirbhay Choubey
4d15112962 Merge tag 'mariadb-10.0.22' into 10.0-galera 2015-10-31 18:07:02 -04:00
Mithun C Y
f92dd6ae6f Bug #20007383: HANDLE_FATAL_SIGNAL (SIG=11) IN UPDATE_REF_AND_KEYS.
Issue:
======
The fulltext predicate is inside a subquery and involves
an outer reference; it thus cannot be used for FT index look-up,
but MySQL does not see it, which causes a illegal access.

Solution:
=========
Solution is backported from bug#21140088. Outer reference can
not be used as argument of the MATCH function. Added check for
outer reference.
2015-10-12 12:56:36 +05:30
Sergei Golubchik
cfeedbfd3e Merge branch '5.5' into 10.0 2015-10-09 17:12:26 +02:00
Oleksandr Byelkin
102a85f9f3 MDEV-8663: IF Statement returns multiple values erroneously (or Assertion `!null_value' failed in Item::send(Protocol*, String*))
Postreview addons by Bar

Fix: keeping contract: NULL value mean NULL pointer in val_str and val_deciman.
2015-09-04 15:56:58 +02:00
Nirbhay Choubey
91acc8b16f Merge tag 'mariadb-10.0.21' into 10.0-galera 2015-08-08 14:21:22 -04:00
Sergei Golubchik
006ffca56e after-merge fixes 2015-08-04 23:40:25 +02:00
Jan Lindström
9a5787db51 Merge commit '96badb16afcf' into 10.0
Conflicts:
	client/mysql_upgrade.c
	mysql-test/r/func_misc.result
	mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result
	mysql-test/suite/innodb/r/innodb-fk.result
	mysql-test/t/subselect_sj_mat.test
	sql/item.cc
	sql/item_func.cc
	sql/log.cc
	sql/log_event.cc
	sql/rpl_utility.cc
	sql/slave.cc
	sql/sql_class.cc
	sql/sql_class.h
	sql/sql_select.cc
	storage/innobase/dict/dict0crea.c
	storage/innobase/dict/dict0dict.c
	storage/innobase/handler/ha_innodb.cc
	storage/xtradb/dict/dict0crea.c
	storage/xtradb/dict/dict0dict.c
	storage/xtradb/handler/ha_innodb.cc
	vio/viosslfactories.c
2015-08-03 23:09:43 +03:00
Sergey Vojtovich
392df76bc3 MDEV-4017 - GET_LOCK() with negative timeouts has strange behavior
GET_LOCK() silently accepted negative values and NULL for timeout.
Fixed GET_LOCK() to issue a warning and return NULL in such cases.
2015-07-29 15:59:56 +04:00
Nirbhay Choubey
e11cad9e9d Merge tag 'mariadb-10.0.19' into 10.0-galera 2015-05-09 17:09:21 -04:00
f4rnham
060ec5b6b9 MDEV-7130: MASTER_POS_WAIT(log_name,log_pos,timeout,"connection_name") hangs, does not respect the timeout
Changed also arg_count check for connection_name to prevent same bug
if fifth argument is introduced in future
2015-04-24 13:08:27 +02:00
Nirbhay Choubey
860576f416 Merge branch '10.0' into 10.0-galera
Merge branch 10.0 till revision:
f37bdd9 - Merge remote-tracking branch 'github/10.0' into 10.0

Conflicts:
	.bzrignore
	storage/xtradb/CMakeLists.txt
2015-02-18 18:07:45 -05:00
Sergei Golubchik
d7e7862364 Merge branch '5.5' into 10.0 2015-02-18 15:16:27 +01:00
Sergei Golubchik
8e80f91fa3 Merge remote-tracking branch 'mysql/5.5' into bb-5.5-merge @ mysql-5.5.42 2015-02-11 23:50:40 +01:00
Nirbhay Choubey
7cda4bee0e maria-10.0.16 merge
bzr merge -r4588 maria/10.0
2015-01-26 22:54:27 -05:00
Sergei Golubchik
d9c01e4b4a 5.5 merge 2015-01-21 12:03:02 +01:00
Sergei Golubchik
73ebabd2ee MDEV-7299 Assertion `m_status == DA_ERROR || m_status == DA_OK' fails on concurrent execution of DDL, queries from I_S, and KILL QUERY
Fix MDL to report an error when a wait was killed, but preserve
the old documented behavior of GET_LOCK() where killing it is not an error.

Also remove race conditions in main.create_or_replace test
2015-01-19 14:19:14 +01:00
Kristian Nielsen
00649525ee MDEV-7189: main.processlist fails sporadically in buildbot
The test case tried to trigger a DEBUG_SYNC point at the end of a SELECT
SLEEP(5) statement. It did this by using EXECUTE 2, intending to trigger first
at the end of SET DEBUG_SYNC, and second at the end of the SELECT SLEEP(5).

However, in --ps-protocol mode, this does not work, because the SELECT is
executed in two steps (Prepare followed by Execute). Thus, the DEBUG_SYNC got
triggered too early, during the Prepare stage rather than Execute, and the
test case could race and information_schema.processlist see the thread in the
wrong state.

This patch fixes by changing the way the DEBUG_SYNC point is triggered. Now we
add a DBUG injection inside the code for SLEEP(5). This ensures that the
DEBUG_SYNC point is not activated until the SLEEP(5) is running, ensuring
that the following wait for completion will be effective.
2015-01-06 16:32:41 +01:00
Sergei Golubchik
a978bdda1e mysql-5.5.41 merge 2014-12-19 11:35:44 +01:00
Vamsikrishna Bhagi
cb9d0deb71 Bug #19688008 CREATE_ASYMMETRIC_PUB_KEY: CRASHES IN OPENSSL
CODE

Problem: UDF doesn't handle the arguments properly when they
         are of string type due to a misplaced break.
         The length of arguments is also not set properly
         when the argument is NULL.

Solution: Fixed the code by putting the break at right place
          and setting the argument length to zero when the
          argument is NULL.
2014-12-03 14:46:39 +05:30
mithun
73b99f055e Bug #19372926 : 5.5.38 FAILS FUNC_MATH MTR TEST.
Issue :
-------
This seems for some platform -(LONGLONG_MIN) is
not flagged as out of range.

Fix:
----
Fix is backported from mysql-5.6 bug 14314156.
Fixed by adding an explicit test for this value in
Item_func_neg::int_op().

sql/item_func.cc:
  For some platforms we need special handling of
  LONGLONG_MIN to guarantee overflow.
2014-11-03 18:10:28 +05:30
mithun
c5dfdec568 Bug #19372926 : 5.5.38 FAILS FUNC_MATH MTR TEST.
Issue :
-------
This seems for some platform -(LONGLONG_MIN) is
not flagged as out of range.

Fix:
----
Fix is backported from mysql-5.6 bug 14314156.
Fixed by adding an explicit test for this value in
Item_func_neg::int_op().
2014-11-03 18:10:28 +05:30
Nirbhay Choubey
c916085e27 bzr merge -rtag:mariadb-10.0.14 maria/10.0/ 2014-09-28 20:43:56 -04:00
Praveenkumar Hulakund
43d880b7e9 Bug#19070633 - POSSIBLE ACCESS TO FREED MEMORY IN IS_FREE_LOCK()
AND IS_USED_LOCK().

Analysis:
-----------
In functions Item_func_is_free_lock::val_int() and 
Item_func_is_used_lock::val_int(), for the specified user lock
name, pointer to its "User_level_lock" object is obtained from hash
"hash_user_locks". Mutex "LOCK_user_locks" is acquired for this
and released immediately. And we are accessing members of
User_level_lock after releasing the mutex. If same user lock is
deleted(released) from concurrent thread then accessing members
results in invalid(freed) memory access issue.

Deleting of user lock is also protected from the mutex
"LOCK_user_locks". Since this mutex is released in "val_int" 
functions mentioned above, delete operation proceeds while concurrent
thread tries to access its members.

With the test case, valgrind reports invalid read issues in val_int
functions.

Fix:
-----------
To fix this issue, in "val_int" function of classes
"Item_func_is_free_lock" and "Item_func_is_used_lock", now releasing
mutex "LOCK_user_locks" after accessing User_level_lock members.
2014-09-16 11:28:46 +05:30
Praveenkumar Hulakund
508c74ac25 Bug#19070633 - POSSIBLE ACCESS TO FREED MEMORY IN IS_FREE_LOCK()
AND IS_USED_LOCK().

Analysis:
-----------
In functions Item_func_is_free_lock::val_int() and 
Item_func_is_used_lock::val_int(), for the specified user lock
name, pointer to its "User_level_lock" object is obtained from hash
"hash_user_locks". Mutex "LOCK_user_locks" is acquired for this
and released immediately. And we are accessing members of
User_level_lock after releasing the mutex. If same user lock is
deleted(released) from concurrent thread then accessing members
results in invalid(freed) memory access issue.

Deleting of user lock is also protected from the mutex
"LOCK_user_locks". Since this mutex is released in "val_int" 
functions mentioned above, delete operation proceeds while concurrent
thread tries to access its members.

With the test case, valgrind reports invalid read issues in val_int
functions.

Fix:
-----------
To fix this issue, in "val_int" function of classes
"Item_func_is_free_lock" and "Item_func_is_used_lock", now releasing
mutex "LOCK_user_locks" after accessing User_level_lock members.
2014-09-16 11:28:46 +05:30
Sergei Golubchik
3da761912a MDEV-6616 Server crashes in my_hash_first if shutdown is performed when FLUSH LOGS is running
master_info_index becomes zero during shutdown.
check that it's valid (under a mutex) before dereferencing.
2014-09-06 08:33:56 +02:00
Nirbhay Choubey
8358dd53b7 bzr merge -r4346 maria/10.0 (maria-10.0.13) 2014-08-11 23:55:41 -04:00
Sergei Golubchik
6fb17a0601 5.5.39 merge 2014-08-07 18:06:56 +02:00
Sergei Golubchik
4b4de01fae 5.3 merge 2014-08-01 16:51:12 +02:00
Alexander Barkov
5b452ae027 MDEV-4511 Assertion `scale <= precision' fails on GROUP BY TIMEDIFF with incorrect types
MDEV-6302 Wrong result set when using GROUP BY FROM_UNIXTIME(...)+0
Fixed.
2014-07-28 13:47:55 +04:00
Alexander Barkov
07cb53c58b Merge 5.3->5.5 2014-07-23 14:59:23 +04:00
Alexander Barkov
80708da138 MDEV-5750 Assertion `ltime->year == 0' fails on a query with EXTRACT DAY_MINUTE and TIME column
Item_func_min_max::get_date() did not clear ltime->year when returning a TIME value.
2014-07-23 13:38:48 +04:00
Nirbhay Choubey
a76a6601ec bzr merge -rtag:mariadb-10.0.12 maria/10.0 2014-06-19 13:12:38 -04:00