Commit graph

71697 commits

Author SHA1 Message Date
Pedro Gomes
9054179b25 BUG#13545447: RPL_ROTATE_LOGS FAILS DUE TO CONCURRENCY ISSUES IN REP. CODE
Null merge
2013-02-18 17:06:00 +00:00
Pedro Gomes
e8e63d463f BUG#13545447: RPL_ROTATE_LOGS FAILS DUE TO CONCURRENCY ISSUES IN REP. CODE
Post-push fix, broken build:
sql/rpl_master.cc:1049:70: error: converting ‘false’ to pointer type ‘bool*’ [-Werror=conversion-null]
2013-02-18 17:02:26 +00:00
Anirudh Mangipudi
4061d719ec Bug #12546953 "SHOW VARIABLES LIKE 'DATADIR';" RETURN EMPTY.
Problem:
===========================================================
If mysqld daemon is started without a --datadir option
option, and we issue the SHOW VARIABLES LIKE 'DATADIR';SQL command
at the client it returns an empty path. This is because
mysql_real_data_home_ptr is being reset to NULL by Sys_var_charptr
constructor call when the datadir is not given either through
configuration file (no-defaults) or through mysqld parameters.

Solution:
===========================================================
mysql_real_data_home is an array which stores the path of the datadir
and mysql_real_data_home_ptr is the pointer to it. The pointer is
being set to NULL at the Sys_datadir, which is of type Sys_var_charptr,
constructor call. This is because at Sys_datadir call the def_val 
parameter was being passed with DEFAULT(0) which is now replaced with
DEFAULT(mysql_real_data_home). The patch has been tested manually as it
is not possible to start mtr without a default config file.
2013-02-18 19:13:06 +05:30
Tor Didriksen
f144e0fead BUG#13545447: RPL_ROTATE_LOGS FAILS DUE TO CONCURRENCY ISSUES IN REP. CODE
Post-push fix, broken build:
sql/rpl_master.cc:1049:70: error: converting ‘false’ to pointer type ‘bool*’ [-Werror=conversion-null]
2013-02-18 11:12:24 +01:00
unknown
66eeaad6b8 2013-02-18 11:13:48 +05:30
Shivji Kumar Jha
ae5951d395 BUG#15965353- RPL.RPL_ROW_UNTIL FAILS ON PB2,
PLATFORM= MACOSX10.6 X86_64 MAX

bzr merge 5.1=>5.5
2013-02-17 01:45:10 +05:30
Shivji Kumar Jha
5fcf40a2aa BUG#15965353- RPL.RPL_ROW_UNTIL FAILS ON PB2,
PLATFORM= MACOSX10.6 X86_64 MAX

Problem: The test was failing on pb2's mac machine because
         it was not cleaned up properly. The test checks if
         the command 'start slave until' throws a proper
         error when issued with a wrong number/type of
         parameters. After this,the replication stream was
         stopped using the include file 'rpl_end.inc'.
         The errors thrown earlier left the slave in an
         inconsistent state to be closed by the include
         file which was caught by the mac machine.

Fix: Started slave by invoking start_slave.inc to have a
     working slave before calling rpl_reset.inc

Problem: The test file was not in a good shape. It tested
         start slave until relay log file/pos combination 
         wrongly. A couple of commands were executed at 
         master and replicated at slave. Next, the 
         coordinates in terms of relay log file and pos 
         were noted down followed by reset slave and start
         slave until saved relay log file/pos. Reset slave
         deletes  all relay log files and makes the slave 
         forget its replication position. So, using the 
         saved coordiantes after reset slave is wrong.

Fix: Split the test in two parts:
     a) Test for start slave until master log file/pos and
        checking for correct errors in the failure 
        scenarios.
     b) Test for start slave until relay log file/pos.

Problem: The variables auto_increment_increment and 
         auto_increment_offset were set in the the include
         file rpl_init.inc. This was only configured for 
         some connections that are rarely used by test 
         cases, so likely that it will cause confusion. 
         If replication tests want to setup these variables
         they should do so explicitly.

Fix:
     a) Removed code to set the variables
        auto_increment_increment and auto_increment_offset
        in the include file.
     b) Updated tests files using the same.
2013-02-17 01:42:28 +05:30
Pedro Gomes
91e043c304 BUG#13545447: RPL_ROTATE_LOGS FAILS DUE TO CONCURRENCY ISSUES IN REP. CODE
Merge from mysql 5.1 to mysql 5.5
2013-02-15 22:18:37 +00:00
Pedro Gomes
7e8c887786 BUG#13545447: RPL_ROTATE_LOGS FAILS DUE TO CONCURRENCY ISSUES IN REP. CODE
In method mysql_binlog_send, right after detecting a EOF in the
read event loop, and before deciding if we should change to a new
binlog file there is a execution window where new events can be
written to the binlog and a rotation can happen. When reaching
the test, the function will then change to a new binlog file
ignoring all the events written in this window. This will result
in events not being replicated.

Only when the binlog is detected as deactivated in the event loop
of the dump thread, can we really know that no more events
remain. For this reason, this test is now made under the log lock
in the beginning of the event loop when reading the events.
2013-02-15 21:57:35 +00:00
Alexander Nozdrin
776b569795 Bug#16056537: MYSQLD CRASHES IN ITEM_FUNC_GET_USER_VAR::FIX_LENGTH_AND_DEC()
The technical problem was that THD::user_var_events_alloc was reset to NULL
from a valid value when a stored program is executed during the PREPARE statement.

The user visible problem was that the server crashed if user issued a PREPARE
statement using some combination of stored functions and user variables.

The fix is to restore THD::user_var_events_alloc to the original value.
This is a minimal fix for 5.5.

More proper patch has been already implemented for 5.6+. It avoids
evaluation of stored functions for the PREPARE phase.

From the user point of view, this bug is a regression, introduced by the patch for WL2649
(Number-to-string conversions), revid: bar@mysql.com-20100211041725-ijbox021olab82nv
However, the code resetting THD::user_var_events_alloc exists even in 5.1.
The WL just changed the way arguments are converted to strings and the bug became visible.
2013-02-15 16:01:37 +04:00
Harin Vadodaria
f824defb36 Bug#16218104: MYSQL YASSL - LUCKY THIRTEEN: BREAKING THE
TLS AND DTLS RECORD PROTOCOLS

Description: Merge from 5.1.
2013-02-15 12:37:21 +05:30
Harin Vadodaria
795b8acc2a Bug#16218104: MYSQL YASSL - LUCKY THIRTEEN: BREAKING THE
TLS AND DTLS RECORD PROTOCOLS

Description: In yassl, decryption phase in TLS protocol
             depends on type of padding. This patch
             removes this dependancy and makes error
             generation/decryption process independent
             of padding type.
2013-02-15 12:35:54 +05:30
Shivji Kumar Jha
a6a86f8880 BUG#12359942- REPLICATION TEST FROM ENGINE SUITE RPL_ROW_UNTIL TIMES OUT
post push fix: 
rpl_stm_until.test was disabled because of
this bug. Enabled and fixed it.

Removed a part of the test that was obsolete.
It tested replication from 4.0 master to 5.0
slave.
2013-02-15 00:40:32 +05:30
Shivji Kumar Jha
eb3814b0b3 BUG#12359942- REPLICATION TEST FROM ENGINE SUITE RPL_ROW_UNTIL TIMES OUT
post push fix: 
rpl_stm_until.test was disabled because of
this bug. Enabled and fixed it.

Removed a part of the test that was obsolete.
It tested replication from 4.0 master to 5.0
slave.
2013-02-15 00:38:42 +05:30
Mattias Jonsson
e96182824d Bug#16274455: CAN NOT ACESS PARTITIONED TABLES WHEN
DOWNGRADED FROM 5.6.11 TO 5.6.10

Problem was new syntax not accepted by previous version.

Fixed by adding version comment of /*!50531 around the
new syntax.

Like this in the .frm file:
'PARTITION BY KEY /*!50611 ALGORITHM = 2 */ () PARTITIONS 3'
and also changing the output from SHOW CREATE TABLE to:
CREATE TABLE t1 (a INT)
/*!50100 PARTITION BY KEY */ /*!50611 ALGORITHM = 1 */ /*!50100 ()
PARTITIONS 3 */

It will always add the ALGORITHM into the .frm for KEY [sub]partitioned
tables, but for SHOW CREATE TABLE it will only add it in case it is the non
default ALGORITHM = 1.

Also notice that for 5.5, it will say /*!50531 instead of /*!50611, which
will make upgrade from 5.5 > 5.5.31 to 5.6 < 5.6.11 fail!
If one downgrades an fixed version to the same major version (5.5 or 5.6) the
bug 14521864 will be visible again, but unless the .frm is updated, it will
work again when upgrading again.

Also fixed so that the .frm does not get updated version
if a single partition check passes.
2013-02-14 17:03:49 +01:00
Annamalai Gurusami
84ef847056 Merge from mysql-5.1 to mysql-5.5 2013-02-14 16:35:40 +05:30
Annamalai Gurusami
5d47242dde For the error code ER_TOO_LONG_IDENT, the identifier is expected in the my_error call. So removing this line from here. 2013-02-14 16:33:31 +05:30
Annamalai Gurusami
b2e8e0de4f Merge from mysql-5.1 to mysql-5.5. 2013-02-12 15:35:56 +05:30
Annamalai Gurusami
8aecb30cdd Bug #11753153 INNODB GENERATES SYMBOLS THAT ARE TOO LONG, INVALID DDL
FROM SHOW CREATE

Problem: The length of the internally generated foreign key name 
is not checked. 

Solution: The length of the internally generated foreign key name is
checked.  If it is greater than the allowed limit, an error message
is reported. Also, the constraint name is printed in the same manner
as the table name, using the system charset information.

rb://1969 approved by Marko.
2013-02-12 14:52:48 +05:30
Venkatesh Duggirala
b0f78ea278 BUG#16247322-MTR NOT RUNNING SYS_VARS TEST SUITE FOR 5.1
Reverting back the previous changes as they are causing
issues in PB2.
2013-02-08 16:34:32 +05:30
Venkatesh Duggirala
7557fc6c0f BUG#16247322-MTR NOT RUNNING SYS_VARS TEST SUITE FOR 5.1
Problem: Sys_vars suite is disabled in mysql-5.1 branch.
Fix: To enable sys_vars suite in mysql-5.1, add it in
mysql-test-run.pl file and also sys_vars suite should be
added to Makefile.am inorder to get that test directory
2013-02-08 15:41:18 +05:30
Marko Mäkelä
c65dabaf8e Add missing linkage specifiers, so that ha_innodb_plugin.so
will not export internal symbols.
2013-02-08 09:23:12 +02:00
Marko Mäkelä
a6fb71e249 Bug#16292043 RACE CONDITION IN SRV_EXPORT_INNODB_STATUS() WHEN ACCESSING PURGE_SYS->VIEW
srv_export_innodb_status(): Read the purge_sys fields while holding
purge_sys->latch.

Approved by Sunny Bains
2013-02-08 09:22:46 +02:00
Igor Solodovnikov
b7cfe73fa5 bug#14163155 COM_CHANGE_USER DOESN'T WORK WITH CHARACTER-SET-SERVER=UCS2 IN
5.1 SERVER

Problem was caused by the COM_CHANGE_USER parsing code. That code ignored
character set number passed in COM_CHANGE_USER packet. Instead
character_set_client values was used. User name was not converted at all.

Fixed by using passed character set number to convert both db and user names.
If COM_CHANGE_USER does not contain character set number then
character_set_client is used to convert both names.
2013-02-07 19:46:08 +02:00
Tor Didriksen
e908e9bc7e Bug#16192219 CRASH IN TEST_IF_SKIP_SORT_ORDER ON SELECT DISTINCT WITH ORDER BY
This is a backport of the fix for:

Bug#13633549 HANDLE_FATAL_SIGNAL IN TEST_IF_SKIP_SORT_ORDER/CREATE_SORT_INDEX
Don't invoke the range optimizer for a NULL select.
2013-02-07 17:05:07 +01:00
Venkatesh Duggirala
06400b63e7 Bug#16247322- MTR NOT RUNNING SYS_VARS TEST
SUITE FOR 5.1

SYS_VARS suite is not enabled in MTR by default
run. Enabling it with this check-in.

mysql-test/suite/sys_vars/t/disabled.def:
  Till the bugs are fixed, disabling the failed test scripts
2013-02-07 17:23:37 +05:30
unknown
3d7f52255b BUG #13625278 - PB2 SHOULD PROVIDE MORE USEFUL INFORMATION FOR TIMEOUTS 2013-02-06 13:02:14 +05:30
unknown
1e4aaba5ed Merge from mysql-5.1.68-release 2013-02-05 20:47:45 +01:00
unknown
a2be7d26a8 BUG #13625278 - PB2 SHOULD PROVIDE MORE USEFUL INFORMATION FOR TIMEOUTS 2013-02-05 11:58:21 +05:30
unknown
ddb60a719b Bug #16190704: MTR STILL LOSES THE FAILED RUN LOGS AT RETRY-FAIL 2013-02-04 20:25:30 +05:30
Mattias Jonsson
2df2e2617c post-push test result update for bug#14521864. 2013-02-04 14:09:48 +01:00
Venkatesh Duggirala
c179355f5d BUG#16247322-MTR NOT RUNNING SYS_VARS TEST SUITE FOR 5.1
Null merge from mysql-5.1
2013-02-08 16:36:47 +05:30
Venkatesh Duggirala
ae04fc7c5d BUG#16247322-MTR NOT RUNNING SYS_VARS TEST SUITE FOR 5.1
Null merge from mysql-5.1
2013-02-08 15:42:36 +05:30
Marko Mäkelä
bf4c0a1a46 Merge mysql-5.1 to mysql-5.5. 2013-02-08 09:33:21 +02:00
Igor Solodovnikov
39025d2a61 Null-merge from mysql-5.1 2013-02-07 19:46:45 +02:00
Tor Didriksen
b13d0a093d merge 5.1 => 5.5 2013-02-07 17:08:59 +01:00
Venkatesh Duggirala
506b40cd56 Bug #16247322 MTR NOT RUNNING SYS_VARS TEST SUITE FOR 5.1
Null-Merge from mysql-5.5
2013-02-07 17:27:32 +05:30
unknown
6f83811d25 Bug#16263506 - INNODB; USE ABORT() ON ALL PLATFORMS INSTEAD OF
DEREFERENCING UT_DBG_NULL_PTR
The abort() call is standard C but InnoDB only uses it in GCC
environments.  UT_DBG_USE_ABORT is not defined the code crashed
by dereferencing a null pointer instead of calling abort().
Other code throughout MySQL including ndb, sql, mysys and other
places call abort() directly.

This bug also affects innodb.innodb_bug14147491.test which fails
randomly on windows because of this issue. 

Approved by marko in http://rb.no.oracle.com/rb/r/1936/
2013-02-06 13:49:56 -06:00
Ravinder Thakur
6823ac913e Bug#14711808 MSI INSTALLATION / UPGRADE CAN CORRUPT EXISTING INSTALLATION
Currently MySQL MSI installer on Windows installs MySQL in 
"per user" mode. It means that if a Windows machine has 
multiple users, they each can install MySQL independently. 
However the default path of MySQL is "C:\Program Files (x86)\MySQL\"
and when two users install MySQL on same machine, the installation
by second user just overwrites the MySQL files. This default shared 
location leads to the issue where if the second user uninstalls MySQL,
the installation files are removed for the first user as well.

In this fix, we are now making the default installation "per machine".
It means that when MySQL is installed with defaults options, all
users can see the shortcuts for MySQL in start menu(since installations 
is for all users). Also when any user relaunches the installer, it will 
consider that action uninstallation rather than installation for that user.

There are command line options in installer that can be used to undo the
"per machine" installation but will not consider that scenario.MySQL 
is a server product and it does not make a lot of sense to install it
differently for each user.
2013-02-06 13:52:32 +05:30
unknown
5948623ed3 13625278 5.1 => 5.5 2013-02-06 13:04:41 +05:30
Hery Ramilison
67a697b7d8 Upmerge of the 5.1.68 build 2013-02-05 21:29:49 +01:00
unknown
a6a20c11dc Merge from mysql-5.5.30-release 2013-02-05 10:50:02 +01:00
unknown
c8738c1f71 13625278 5.1=> 5.5 2013-02-05 13:42:56 +05:30
Thayumanavar
e15a51363d BUG#16196591 - CLIENTS CANNOT CONNECT TO MYSQL
PROBLEM:
When large number of connections are continuously made
with wait_timeout of 600 seconds for  some hours, some
connections remain after wait_timeout expired and also
new connections get struck under the configuration and
the scenario reported in bug#16196591.
FIX:
The cause of this bug is the issue identified  and fixed in
the BUG#16088658 in 5.6.Also LOCK_thread_count contention 
issue fixed in BUG#15921866 in 5.6 need to be in 5.5 as 
well. Since the issue is not reproducible, it has been
verified at customer configuration the issue could not
be reproduced after a 48-hour test with a non-debug build               
which includes the above two fixes backported.
2013-02-05 11:06:38 +05:30
unknown
f8eea3b3c4 16190704 5.1 => 5.5 nullmerge 2013-02-04 20:41:25 +05:30
Inaam Rana
50c27a1492 Bug#16249505 INNODB REPORTS THAT IT'S GOING TO WAIT FOR I/O BUT THE
I/O IS ASYNC

rb://1934
approved by: Mikael Ronstrom (over email)
    
When submitting AIO read request don't signal that the thread is
about to wait on DISKIO
2013-02-01 09:47:16 -05:00
unknown
49e4ed1fde BUG #16190704 - MTR STILL LOSES THE FAILED RUN LOGS AT RETRY-FAIL 2013-02-01 19:53:20 +05:30
Nisha Gopalakrishnan
8500944765 BUG#16207679: MISSING ERROR WHEN RESIGNAL TO MYSQL_ERROR=5
Analysis:
--------

As part of the fix for Bug#11757464, the 'out of memory' error
condition was not pushed to the diagnostic area as it requires
memory allocation. However in cases of SIGNAL/RESIGNAL 'out of
memory' error, the server may not be out of memory. Hence it
would be good to report the error in such cases.

Fix:
---

Push only non fatal 'out of memory' errors to the diagnostic area.
Since SIGNAL/RESIGNAL of 'out of memory' error may not be fatal,
the error is reported.
2013-02-01 09:49:27 +05:30
Gleb Shchepa
dff10afb20 Bug #11827369: ASSERTION FAILED: !THD->LEX->CONTEXT_ANALYSIS_ONLY
Manual up-merge from 5.1 to 5.5.
2013-01-31 09:13:42 +04:00
Gleb Shchepa
7ebfe30b53 Bug #11827369: ASSERTION FAILED: !THD->LEX->CONTEXT_ANALYSIS_ONLY
Some queries with the "SELECT ... FROM DUAL" nested subqueries
failed with an assertion on debug builds.
Non-debug builds were not affected.

There were a few different issues with similar assertion
failures on different queries:

1. The first problem was related to the incomplete propagation
of the "non-constant" item status from underlying subquery
items to the outer item tree: in some cases non-constants were
interpreted as constants and evaluated at the preparation stage
(val_int() calls withing fix_fields() etc).

Thus, the default implementation of Item_ref::const_item() from
the Item parent class didn't take into account the "const_item"
status of the referenced item tree -- it used the insufficient
"used_tables() == 0" check instead. This worked in most cases
since our "non-constant" functions like RAND() and SLEEP() set
the RAND_TABLE_BIT in the used table map, so they aren't
non-constant from Item_ref's "point of view". However, the
"SELECT ... FROM DUAL" subquery may have an empty map of used
tables, but at the same time subqueries are never "constant" at
the context analysis stage (preparation, view creation etc).
So, the non-contantness of such subqueries was missed.

Fix: the Item_ref::const_item() function has been overloaded to
take into account both (*ref)->const_item() status and tricky
Item_ref::used_tables() return values, since the only
(*ref)->const_item() call is not enough there.

2. In some cases instead of the const_item() call we check a
value of the Item::with_subselect field to recognize items
with nested subqueries. However, the Item_ref class didn't
propagate this value from the referenced item tree.

Fix: Item::has_subquery() and Item_ref::has_subquery()
functions have been backported from 5.6. All direct
references to the with_subselect fields of nested items have
been replaced with the has_subquery() function call.

3. The Item_func_regex class didn't propagate with_subselect
as well, since it overloads the Item_func::fix_fields()
function with insufficient fix_fields() implementation.

Fix: the Item_func_regex::fix_fields() function has been
modified to gather "constant" statuses from inner items.

4. The Item_func_isnull::update_used_tables() function has
a special branch for the underlying item where the maybe_null
value is false: in this case it marks the Item_func_isnull
as a "const_item" and sets the cached_value to false.
However, the Item_func_isnull::val_int() was not in sync with
update_used_tables(): it didn't take into account neither
const_item_cache nor cached_value for the case of
"args[0]->maybe_null == false optimization".
As far as such an Item_func_isnull has "const_item() == true",
it's ok to call Item_func_isnull::val_int() etc from outer
items on preparation stage. In this case the server tried to
call Item_func_isnull::args[0]->isnull(), and if the args[0]
item contained a nested not-nullable subquery, it failed
with an assertion.

Fix: take the value of Item_func_isnull::const_item_cache into
account in the val_int() function.

5. The auxiliary Item_is_not_null_test class has a similar
optimization in the update_used_tables() function as the
Item_func_isnull class has, and the same issue in the val_int()
function.
In addition to that the Item_is_not_null_test::update_used_tables()
doesn't update the const_item_cache value, so the "maybe_null"
optimization is useless there. Thus, we missed some optimizations
of cases like these (before and after the fix):
  <  <is_not_null_test>(a),
  ---
  >  <cache>(<is_not_null_test>(a)),
or
  < having (<is_not_null_test>(a) and <is_not_null_test>(a))
  ---
  > having 1
etc.

Fix: update Item_is_not_null_test::const_item_cache in
update_used_tables() and take in into account in val_int().
2013-01-31 08:46:30 +04:00