Commit graph

28654 commits

Author SHA1 Message Date
Dmitry Shulga
4fe2cd10c2 Auto-merge of follow-up for bug#11764334 from mysql-5.1 tree. 2011-06-10 01:08:38 +07:00
Dmitry Shulga
53e4a85204 Follow-up for patch of bug#11764334. 2011-06-10 01:05:10 +07:00
Dmitry Shulga
1be4de546e Auto-merge of patch for bug#11764334 from mysql-5.1 tree. 2011-06-10 00:07:03 +07:00
Dmitry Shulga
fa913a0b98 Fixed bug#11764334 (formerly bug#57156): ALTER EVENT CHANGES
THE EVENT STATUS.

Any ALTER EVENT statement on a disabled event enabled it back
(unless this ALTER EVENT statement explicitly disabled the event).

The problem was that during processing of an ALTER EVENT statement
value of status field was overwritten unconditionally even if new
value was not specified explicitly. As a consequence this field
was set to default value for status which corresponds to ENABLE.

The solution is to check if status field was explicitly specified in
ALTER EVENT statement before assigning new value to status field.

mysql-test/r/events_bugs.result:
  test's result for Bug#11764334 was added.
mysql-test/t/events_bugs.test:
  new test for Bug#11764334 was added.
sql/event_db_repository.cc:
  mysql_event_fill_row() was modified: set value for status field
  in events tables only in case if statement CREATE EVENT
  is being processed or if this value was set in ALTER EVENT
  statement.
  Event_db_repository::create_event was modified: removed redundant
  setting of status field after return from call to mysql_event_fill_row().
sql/event_parse_data.h:
  Event_parse_data structure was modified: added flag
  status_changed that is set to true if status's value
  was changed in ALTER EVENT statement.
sql/sql_yacc.yy:
  Set flag status_changed if status was set in ALTER EVENT
  statement.
2011-06-10 00:03:17 +07:00
Dmitry Lenev
600647c7d8 Fix for bug #11759990 - "52354: 'CREATE TABLE .. LIKE ... '
STATEMENTS FAIL".

Attempt to execute CREATE TABLE LIKE statement on a MyISAM
table with INDEX or DATA DIRECTORY options specified as a
source resulted in "MyISAM table '...' is in use..." error.
According to our documentation such a statement should create
a copy of source table with DATA/INDEX DIRECTORY options
omitted.

The problem was that new implementation of CREATE TABLE LIKE
statement in 5.5 tried to copy value of INDEX and DATA DIRECTORY
parameters from the source table. Since in description of source
table this parameters also included name of this table, attempt
to create target table with these parameter led to file name
conflict and error.

This fix addresses the problem by preserving documented and
backward-compatible behavior. I.e. by ensuring that contents
of DATA/INDEX DIRECTORY clauses for the source table is
ignored when target table is created.

mysql-test/r/symlink.result:
  Added test for bug #11759990 - "52354: 'CREATE TABLE ..
  LIKE ... ' STATEMENTS FAIL".
mysql-test/t/symlink.test:
  Added test for bug #11759990 - "52354: 'CREATE TABLE ..
  LIKE ... ' STATEMENTS FAIL".
sql/sql_table.cc:
  Changed CREATE TABLE LIKE implementation to ignore contents
  of DATA/INDEX DIRECTORY clauses for source table when target
  table is created. This is documented and backward-compatible
  behavior.
2011-06-09 16:54:12 +04:00
Dmitry Shulga
92a017d324 Added regression test for bug#11763757 "56510: ERROR 42000:
FUNCTION DOES NOT EXIST IF NOT-PRIV USER RECONNECTS".

The bug itself was fixed by the same patch as bug@11747137
"30977: CONCURRENT STATEMENT USING STORED FUNCTION AND DROP
FUNCTION BREAKS SBR".
2011-06-08 20:44:50 +07:00
Ramil Kalimullin
ab3cae3dce Auto-merge from mysql-5.1 2011-06-07 19:44:15 +04:00
Ramil Kalimullin
768b9a0ef6 Bug#11764487: myisam corruption with insert ignore and invalid spatial data
Problem: in case of wrong data insert into indexed GEOMETRY fields 
(e.g. NULL value for a not NULL field) MyISAM reported 
"ERROR 126 (HY000): Incorrect key file for table; try to repair it"
due to misuse of the key deletion function.

Fix: always use R-tree key functions for R-tree based indexes
and B-tree key functions for B-tree based indexes.


mysql-test/r/gis-rtree.result:
  Bug#11764487: myisam corruption with insert ignore and invalid spatial data
    - test result.
mysql-test/t/gis-rtree.test:
  Bug#11764487: myisam corruption with insert ignore and invalid spatial data
    - test case.
storage/myisam/mi_update.c:
  Bug#11764487: myisam corruption with insert ignore and invalid spatial data
    - handling update errors check for HA_ERR_NULL_IN_SPATIAL as well to be 
  consistent with mi_write();
    - always use keyinfo->ck_delete()/ck_insert() instead of _mi_ck_delete()/_mi_ck_write()
  to handle index properly, as it may be of B-tree or R-tree type.
storage/myisam/mi_write.c:
  Bug#11764487: myisam corruption with insert ignore and invalid spatial data
    - always use keyinfo->ck_delete() instead of _mi_ck_delete() to handle
  index properly, as it may be of B-tree or R-tree type.
2011-06-07 19:30:43 +04:00
Georgi Kodinov
a87bf5622a merge mysql-5.1->mysql-5.5 2011-06-06 13:24:28 +03:00
Georgi Kodinov
b502a64bba Bug #11749418: 38965: TEST CASES GIS-RTREE, TYPE_FLOAT, TYPE_NEWDECIMAL
FAIL IN EMBEDDED SERVER

FreeBSD 64 bit needs the FP_X_DNML to fpsetmask() to prevent exceptions from
propagating into mysql (as a threaded application).
However fpsetmask() itself is deprecated in favor of fedisableexcept().
1. Fixed the #ifdef to check for FP_X_DNML instead of i386.
2. Added a configure.in check for fedisableexcept() and, if present,
   this function is called insted of the fpsetmask().
No need for new tests, as the existing tests cover this already.
Removed the affected tests from the experimental list.
2011-06-06 13:13:54 +03:00
Anitha Gopi
7c8ce0a636 Merged with tree 2011-06-03 14:39:00 +05:30
Anitha Gopi
2293d28406 Bug#11756699 : Move test to disabled group 2011-06-03 14:14:57 +05:30
Anitha Gopi
6444fa5327 Bug#11756699 : Move test to disabled group 2011-06-03 14:13:10 +05:30
Sergey Vojtovich
819d6b735e Merge. 2011-06-03 11:49:05 +04:00
Sergey Vojtovich
2ab0abd268 Merge. 2011-06-03 11:31:13 +04:00
Vinay Fisrekar
a483b5bfa9 Correcting "innodb_prefix_index_liftedlimit" failure for embedded mode run.
Separating out sub-test.
2011-06-02 15:12:55 +05:30
Jon Olav Hauglid
edcd89ee1e Bug#11853126 RE-ENABLE CONCURRENT READS WHILE CREATING
SECONDARY INDEX IN INNODB

This is a follow-up patch.

This patch moves part of the new test coverage to a test
file that is only run on debug builds since it used debug-
only features and therefore broke the test case on
release builds.
2011-06-01 13:52:20 +02:00
Vinay Fisrekar
46c2089d5e Adding testcases for WL#5743 InnoDB: Lift the limit of index key prefixes
innodb_prefix_index_liftedlimit.test used for functional testing of increase in prefix index limit
2011-06-01 15:25:08 +05:30
Jon Olav Hauglid
9b076952ec Bug#11853126 RE-ENABLE CONCURRENT READS WHILE CREATING
SECONDARY INDEX IN INNODB

The patches for Bug#11751388 and Bug#11784056 enabled concurrent
reads while creating secondary indexes in InnoDB. However, they
introduced a regression. This regression occured if ALTER TABLE
failed after the index had been added, for example during the
lock upgrade needed to update .FRM. If this happened, InnoDB
and the server got out of sync with regards to which indexes
actually existed. Therefore the patch for Bug#11815600 again
disabled concurrent reads.

This patch re-enables concurrent reads. The original regression
is fixed by splitting the ADD INDEX operation into two parts.
First the new index is created but not made active. This is
done while concurrent reads are allowed. The second part of
the operation makes the index active (or reverts the change).
This is done after lock upgrade, which prevents the original
regression.

In order to implement this change, the patch changes the storage
API for in-place index creation. handler::add_index() is split
into two functions, handler_add_index() and
handler::final_add_index(). The former for creating indexes without
making them visible and the latter for commiting (i.e. making
visible) new indexes or reverting the changes.

Large parts of this patch were written by Marko Mäkelä.

Test case added to innodb_mysql_lock.test.
2011-06-01 10:06:55 +02:00
Jimmy Yang
9e2b7fa7d5 Implement worklog #5743 InnoDB: Lift the limit of index key prefixes.
With this change, the index prefix column length lifted from 767 bytes
to 3072 bytes if "innodb_large_prefix" is set to "true".

rb://603 approved by Marko
2011-05-31 02:12:32 -07:00
Davi Arnaut
c7d2ec7dd5 Bug#11766349 - 59443: query_cache_debug.test is occasionally very slow
The test case problem stemmed from the fact that a debug sync
signal is a global variable that persists until overwritten
by a new signal. This means that if two different signals
are raised in sequence, a thread waiting for the first signal
might miss it if the second signal sets the global variable
before the thread wakes up.

The solution is to deliver a subsequent signal only after the
waiting thread has received it.

mysql-test/t/query_cache_debug.test:
  Wait for signal to be delivered.
2011-05-30 12:17:22 -03:00
Bjorn Munch
ec0b030f26 Bug #12604711 MTR SHOULD READ PLUGIN.DEFS FILES FROM IMPORTED FEATURE TREES
Added reading from plugin.defs files under plugins/*
2011-05-30 15:55:44 +02:00
Dmitry Shulga
c34a99b8b9 Manual-merge of patch for bug#12546938 from mysql-5.1->mysql-5.5 2011-05-27 18:42:28 +07:00
Dmitry Shulga
56a735b782 Fixed bug#12546938 (formerly known as 61005) - CREATE IF NOT EXIST EVENT
will create multiple running events.

A CREATE IF NOT EXIST on an event that existed and was enabled caused
multiple instances of the event to run. Disabling the event didn't  help.
If the event was  dropped, the event stopped running, but when created
again, multiple instances of the event were still running. The only way
to get out of this situation was  to restart the server.

The problem was that Event_db_repository::create_event() didn't return
enough information to discriminate between situation when event didn't
exist and was created and when event did exist and was not created
(but a warning was emitted). As result in the latter case event
was added to in-memory queue of events second time. And this led to
unwarranted multiple executions of the same event.

The solution is to add out-parameter to Event_db_repository::create_event()
method which will signal that event was not created because it already
exists and so it should not be added to the in-memory queue.


mysql-test/r/events_bugs.result:
  Added results for test for Bug#12546938.
mysql-test/t/events_bugs.test:
  Added test for Bug#12546938.
sql/event_db_repository.cc:
  Event_db_repository::create_event was modified: set newly added out-parameter
  event_already_exists to true value if event wasn't created because event
  already existed and IF NOT EXIST clause was present.
sql/event_db_repository.h:
  Added out-parameter 'event_already_exists' to create_event() method.
sql/events.cc:
  Events::create_event was modified: insert new element into
  event queue only if event was actually created.
2011-05-27 16:23:08 +07:00
Anitha Gopi
8ae716e9a2 Automerge : Updating local tree 2011-05-27 10:22:00 +05:30
Dmitry Lenev
fecca34356 Fix for bug #11762012 - "54553: INNODB ASSERTS IN
HA_INNOBASE::UPDATE_ROW, TEMPORARY TABLE, TABLE LOCK".

Attempt to update an InnoDB temporary table under LOCK TABLES
led to assertion failure in both debug and production builds
if this temporary table was explicitly locked for READ. The
same scenario works fine for MyISAM temporary tables.

The assertion failure was caused by discrepancy between lock
that was requested on the rows of temporary table at LOCK TABLES
time and by update operation. Since SQL-layer requested a
read-lock at LOCK TABLES time InnoDB engine assumed that upcoming
statements which are going to be executed under LOCK TABLES will
only read table and therefore should acquire only S-lock.
An update operation broken this assumption by requesting X-lock.

Possible approaches to fixing this problem are:

1) Skip locking of temporary tables as locking doesn't make any
   sense for connection-local objects.
2) Prohibit changing of temporary table locked by LOCK TABLES ...
   READ.

Unfortunately both of these approaches have drawbacks which make
them unviable for stable versions of server.

So this patch takes another approach and changes code in such way
that LOCK TABLES for a temporary table will always request write
lock. In 5.5 version of this patch switch from read lock to write
lock is done on SQL-layer.

mysql-test/suite/innodb/r/innodb_mysql.result:
  Added test for bug #11762012 - "54553: INNODB ASSERTS IN
  HA_INNOBASE::UPDATE_ROW, TEMPORARY TABLE, TABLE LOCK".
mysql-test/suite/innodb/t/innodb_mysql.test:
  Added test for bug #11762012 - "54553: INNODB ASSERTS IN
  HA_INNOBASE::UPDATE_ROW, TEMPORARY TABLE, TABLE LOCK".
sql/sql_parse.cc:
  Since a temporary table locked by LOCK TABLES can be updated even
  if it was only locked for read we always request TL_WRITE locks
  for such tables at LOCK TABLES time. This allows to avoid 
  discrepancy between locks acquired at LOCK TABLES time and by
  a statement executed under LOCK TABLES. Such a discrepancy has
  caused problems for InnoDB storage engine.
  
  To support this change a part of code implementing LOCK TABLES 
  has been moved to a helper function.
2011-05-26 19:50:06 +04:00
Dmitry Lenev
861291f1ab Fix for bug #11762012 - "54553: INNODB ASSERTS IN
HA_INNOBASE::UPDATE_ROW, TEMPORARY TABLE, TABLE LOCK".

Attempt to update an InnoDB temporary table under LOCK TABLES
led to assertion failure in both debug and production builds
if this temporary table was explicitly locked for READ. The 
same scenario works fine for MyISAM temporary tables.

The assertion failure was caused by discrepancy between lock 
that was requested on the rows of temporary table at LOCK TABLES
time and by update operation. Since SQL-layer requested a 
read-lock at LOCK TABLES time InnoDB engine assumed that upcoming
statements which are going to be executed under LOCK TABLES will 
only read table and therefore should acquire only S-lock.
An update operation broken this assumption by requesting X-lock.

Possible approaches to fixing this problem are:

1) Skip locking of temporary tables as locking doesn't make any
   sense for connection-local objects.
2) Prohibit changing of temporary table locked by LOCK TABLES ... 
   READ.

Unfortunately both of these approaches have drawbacks which make 
them unviable for stable versions of server.

So this patch takes another approach and changes code in such way
that LOCK TABLES for a temporary table will always request write
lock. In 5.1 version of this patch switch from read lock to write
lock is done inside of InnoDBs handler methods as doing it on 
SQL-layer causes compatibility troubles with FLUSH TABLES WITH
READ LOCK.

mysql-test/suite/innodb/r/innodb_mysql.result:
  Added test for bug #11762012 - "54553: INNODB ASSERTS IN 
  HA_INNOBASE::UPDATE_ROW, TEMPORARY TABLE, TABLE LOCK".
mysql-test/suite/innodb/t/innodb_mysql.test:
  Added test for bug #11762012 - "54553: INNODB ASSERTS IN 
  HA_INNOBASE::UPDATE_ROW, TEMPORARY TABLE, TABLE LOCK".
mysql-test/suite/innodb_plugin/r/innodb_mysql.result:
  Added test for bug #11762012 - "54553: INNODB ASSERTS IN 
  HA_INNOBASE::UPDATE_ROW, TEMPORARY TABLE, TABLE LOCK".
mysql-test/suite/innodb_plugin/t/innodb_mysql.test:
  Added test for bug #11762012 - "54553: INNODB ASSERTS IN 
  HA_INNOBASE::UPDATE_ROW, TEMPORARY TABLE, TABLE LOCK".
storage/innobase/handler/ha_innodb.cc:
  Assume that a temporary table locked by LOCK TABLES can be updated
  even if it was only locked for read and therefore an X-lock should 
  be always requested for such tables.
storage/innodb_plugin/handler/ha_innodb.cc:
  Assume that a temporary table locked by LOCK TABLES can be updated
  even if it was only locked for read and therefore an X-lock should 
  be always requested for such tables.
2011-05-26 17:14:47 +04:00
Tatjana Azundris Nuernberg
e1b79597f6 auto-merge Bug#11745920 2011-05-26 13:33:21 +01:00
Sven Sandberg
add86aaddc Merged BUG#12574820 from 5.1 to 5.5
Two conflicts resolved manually:
Text conflict in sql/log.cc
Text conflict in sql/mysqld.cc
2011-05-26 12:56:17 +02:00
Sven Sandberg
de3776819c BUG#12574820: binlog.binlog_tmp_table timing out in daily and weekly trunk run
Problem: MYSQL_BIN_LOG::reset_logs acquires mutexes in wrong order.
The correct order is first LOCK_thread_count and then LOCK_log. This function
does it the other way around. This leads to deadlock when run in parallel
with a thread that takes the two locks in correct order. For example, a thread
that disconnects will take the locks in the correct order.
Fix: change order of the locks in MYSQL_BIN_LOG::reset_logs:
first LOCK_thread_count and then LOCK_log.


mysql-test/suite/binlog/r/binlog_reset_master.result:
  added result file
mysql-test/suite/binlog/t/binlog_reset_master.test:
  Added test case that demonstrates deadlock because of wrong mutex order.
  The deadlock is between two threads:
   - RESET MASTER acquires mutexes in wrong order.
   - client thread shutdown code acquires mutexes in right order.
  Actually, this test case does not produce deadlock in 5.1, probably
  the client thread shutdown code does not hold both mutexes at the same
  time. However, the bug existed in 5.1 (mutexes are taken in the wrong
  order) so we push the test case to 5.1 too, to prevent future
  regressions.
sql/log.cc:
  Change mutex acquisition to the correct order:
  first LOCK_thread_count, then LOCK_log.
sql/mysqld.cc:
  Add debug code to synchronize test case.
2011-05-26 12:50:43 +02:00
Sergey Glukhov
9d42d36e7e 5.1 -> 5.5 merge 2011-05-26 14:09:25 +04:00
Sergey Glukhov
3efbf30457 Bug#12392636 ASSERTION FAILED: SCALE >= 0 && PRECISION > 0 && SCALE <= PRECISION
Assertion happens due to missing NULL value check in
Item_func_round::fix_length_and_dec() function.
The fix: added NULL value check for second parameter.


mysql-test/r/func_math.result:
  test case
mysql-test/t/func_math.test:
  test case
sql/item_func.cc:
  added NULL value check for second parameter.
2011-05-26 14:06:39 +04:00
Bjorn Munch
b5009ee6be merge from 5.5-mtr 2011-05-26 10:18:21 +02:00
Anitha Gopi
037176b211 Bug#11759877 - Bug closed. Remove test from experimental group 2011-05-26 12:35:46 +05:30
Bjorn Munch
0bb2424f4d Increase test timeout for rpl.rpl_typeconv
Not for test itself but because it procuces large number of warnings,
  and this may take >90s to filter on slow boxes
2011-05-25 16:39:39 +02:00
Anitha Gopi
607c8bfc16 Fixed formatting in disabled.def 2011-05-25 19:39:24 +05:30
Bjorn Munch
7f0b5b70ec Bug #12590770 TEST SPECIFIC TIMEOUT SETTING DOES NOT APPLY TO "CHECK" OR "WARNINGS"
Replace global check_timeout with one that calls testcase_timeout for the test
2011-05-25 16:07:16 +02:00
Anitha Gopi
09d1ca061f Bug#12584161 : Test is failing consistently. Move nack to disabled list 2011-05-25 16:27:48 +05:30
Bjorn Munch
e57de95f41 Bug #11750043 40340: USE GZIPPED CORE FILES TO SAVE SPACE
Use [g]zip on core file if available, ignore if not
Skip if running named test, and print a line saying what it compressed.
2011-05-25 10:58:33 +02:00
Anitha Gopi
7a73cb12eb Autocommit - Updating local tree 2011-05-24 21:57:55 +05:30
Anitha Gopi
3cf30b89ba Automerge from mysql-5.1 2011-05-24 15:47:52 +05:30
Anitha Gopi
cce8a65843 BUG#12371924 # Bug is fixed. Move test out of experimental group 2011-05-24 15:46:14 +05:30
Bjorn Munch
b9937c4018 merge from 5.5 main 2011-05-24 11:18:55 +02:00
Horst.Hunger
41c13fb5c7 Merge of this test from trunk to 5.5 to have a successful weekly test on Windows. 2011-05-24 11:16:34 +02:00
Bjorn Munch
e0cf0819a9 Bug#11831031: MTR SHOULD FIND TEST SUITES FROM FEATURE TREES OUTSIDE MYSQL-TEST
Backported from trunk-mtr
2011-05-24 10:54:34 +02:00
Anitha Gopi
099fbeb93d Changed to Oracle bug numbers 2011-05-24 12:08:13 +05:30
Anitha Gopi
8dc7b927af Upmerge from 5.1 2011-05-24 10:25:56 +05:30
Anitha Gopi
0464f964ad Bug#11756699: Move test from disabled to experimental group 2011-05-24 10:22:00 +05:30
Anitha Gopi
f14b66d489 Bug#12584161 - Up merge from 5.1 2011-05-24 10:03:59 +05:30
Anitha Gopi
faf747bf52 Bug#12584161 - Moved test from disabled to experimental group 2011-05-24 09:56:24 +05:30