Commit graph

57877 commits

Author SHA1 Message Date
Georgi Kodinov
bef74a2335 Merge of the fix for bug #40113 to 5.1. 2009-07-13 20:36:54 +03:00
Georgi Kodinov
410e1a72b9 Bug #40113: Embedded SELECT inside UPDATE or DELETE can timeout
without error

When using quick access methods for searching rows in UPDATE or 
DELETE there was no check if a fatal error was not already sent 
to the client while evaluating the quick condition.
As a result a false OK (following the error) was sent to the 
client and the error was thus transformed into a warning.

Fixed by checking for errors sent to the client during 
SQL_SELECT::check_quick() and treating them as real errors.

Fixed a wrong test case in group_min_max.test
Fixed a wrong return code in mysql_update() and mysql_delete()

mysql-test/r/bug40113.result:
  Bug #40013: test case
mysql-test/r/group_min_max.result:
  Bug #40013: fixed a wrong test case
mysql-test/t/bug40113-master.opt:
  Bug #40013: test case
mysql-test/t/bug40113.test:
  Bug #40013: test case
mysql-test/t/group_min_max.test:
  Bug #40013: fixed a wrong test case
sql/sql_delete.cc:
  Bug #40113: check for errors evaluating the quick select
sql/sql_update.cc:
  Bug #40113: check for errors evaluating the quick select
2009-07-13 18:11:16 +03:00
Georgi Kodinov
68228070f8 merge 5.0-bugteam -> 5.1-bugteam 2009-07-13 14:34:23 +03:00
Georgi Kodinov
42cab12a93 Addendum to the fix for bug #46080: fixed the error handling 2009-07-13 14:17:14 +03:00
Alexey Kopytov
5398b3ef2b Automerge. 2009-07-12 20:56:43 +06:00
V Narayanan
5a0a258ec6 Bug#43572 Handle failures from hash_init
This patch is a follow up to http://lists.mysql.com/commits/76678.
When an allocation failure occurs for the buffer in the dynamic
array, an error condition was being set. The dynamic array is
usable even if the memory allocation fails. Since in most cases
the thread can continue to work without any problems the error
condition should not be set here.

This patch adds logic to remove the error condition from being set
when the memory allocation for the buffer in dynamic array fails.

mysys/array.c:
  Bug#43572 Handle failures from hash_init
  
  Remove the MY_WME flag from the call to malloc in order to
  prevent the error status from being set in the init_dynamic_array
  method. Since this memory allocation failure is no longer
  fatal this method has been modified to return FALSE
  (indicate success) irrespective of array->buffer being
  allocated.
2009-07-12 11:18:53 +05:30
Gleb Shchepa
8b2788478b Bug #41156: List of derived tables acts like a chain of
mutually-nested subqueries

Queries of the form

  SELECT * FROM (SELECT 1) AS t1,
                (SELECT 2) AS t2,...
                (SELECT 32) AS t32

caused the "Too high level of nesting for select" error
as if the query has a form

  SELECT * FROM (SELECT 1 FROM (SELECT 2 FROM (SELECT 3 FROM...


The table_factor parser rule has been modified to adjust
the LEX::nest_level variable value after every derived table.


mysql-test/r/derived.result:
  Added test case for bug #41156.
mysql-test/t/derived.test:
  Added test case for bug #41156.
sql/sql_yacc.yy:
  Bug #41156: List of derived tables acts like a chain of
              mutually-nested subqueries
  
  The select_derived2 parser rule calls mysql_new_select()
  calls push_context() and nest_level++, however only
  the pop_context() was called at the end of derived table
  parsing at the table_factor rule.
  
  The table_factor parser rule has been modified to adjust
  the LEX::nest_level variable value after every derived table.
2009-07-11 23:44:29 +05:00
MySQL Build Team
0d8816c6f1 NULL MERGE of mysql-5.1.34sp1-release branch 2009-07-11 01:12:13 +02:00
Staale Smedseng
03793f4c97 Merge from 5.1-bugteam 2009-07-10 17:19:30 +02:00
Georgi Kodinov
9752d4c866 automerge 2009-07-10 17:07:36 +03:00
Georgi Kodinov
e5ecb48125 automerge 2009-07-10 17:04:58 +03:00
Georgi Kodinov
924c8c5bfb Addendum to the fix for bug #46080: fixed the test case 2009-07-10 17:03:09 +03:00
Georgi Kodinov
7c5105599a merge 5.1-main -> 5.1 2009-07-10 16:07:38 +03:00
Georgi Kodinov
2b4ec29274 merged 5.0-bugteam->5.1-bugteam 2009-07-10 16:04:40 +03:00
Georgi Kodinov
55f514ad05 fixed the CPU checking code. 2009-07-10 16:00:17 +03:00
Georgi Kodinov
af7d059586 merge 5.0-main -> 5.0-bugteam 2009-07-10 15:58:38 +03:00
Davi Arnaut
3e642d155e Bug#21704: Renaming column does not update FK definition
Remove commented-out test case. It has been moved to innodb_bug21704.test
2009-07-10 09:19:19 -03:00
Georgi Kodinov
5beae1f8dc Bug #46080: group_concat(... order by) crashes server when
sort_buffer_size cannot allocate

The NULL return from tree_insert() (on low memory) was not
checked for in Item_func_group_concat::add(). As a result
on low memory conditions a crash happens.

Fixed by properly checking the return code.
2009-07-10 15:00:34 +03:00
Satya B
526a42e254 Applying InnoDB snapshot 5.1-ss5488,part 4. Fixes BUG#21704
1. BUG#21704 - Renaming column does not update FK definition

2. Changes in mysql-test/include/mtr_warnings.sql so that the testcase
   for BUG#21704 doesn't fail because of the warnings generated.

Detailed revision comments:

r5488 | vasil | 2009-07-09 19:16:44 +0300 (Thu, 09 Jul 2009) | 13 lines
branches/5.1:

Fix Bug#21704 Renaming column does not update FK definition

by checking whether a column that participates in a FK definition is being
renamed and denying the ALTER in this case.

The patch was originally developed by Davi Arnaut <Davi.Arnaut@Sun.COM>:
http://lists.mysql.com/commits/77714
and was later adjusted to conform to InnoDB coding style by me (Vasil),
I also added some more comments and moved the bug specific mysql-test to
a separate file to make it more manageable and flexible.
2009-07-10 17:05:53 +05:30
Alexey Kopytov
2b26729ece Bug #45796: invalid memory reads and writes when altering merge
and base tables 

myrg_attach_children() could reuse a buffer that was allocated 
previously based on a definition of a child table. The problem 
was that the child's definition might have been changed, so 
reusing the buffer could lead to crashes or valgrind errors 
under some circumstances. 
 
Fixed by changing myrg_attach_children() so that the 
rec_per_key_part buffer is reused only when the child table
have not changed, and reallocated otherwise (the old buffer is 
deallocated if necessary).


include/myisammrg.h:
  Added a pointer to need_compat_check as an argument to
  myrg_attach_children().
mysql-test/r/merge.result:
  Added a test case for bug #45796.
mysql-test/t/merge.test:
  Added a test case for bug #45796.
storage/myisammrg/ha_myisammrg.cc:
  Pass a pointer to need_compat_check to myrg_attach_children().
storage/myisammrg/myrg_open.c:
  Changed myrg_attach_children() so that the 
  rec_per_key_part buffer is reused only when the child table
  have not changed, and reallocated otherwise (the old buffer 
  is deallocated if necessary).
2009-07-10 17:34:03 +06:00
Satya B
38d9fa8912 Applying InnoDB snapshot 5.1-ss5488 part3,Fixes BUG#45814
Detailed revision comments:

r5440 | vasil | 2009-06-30 13:04:29 +0300 (Tue, 30 Jun 2009) | 8 lines
branches/5.1:

Fix Bug#45814 URL reference in InnoDB server errors needs adjusting to match documentation

by changing the URL from
http://dev.mysql.com/doc/refman/5.1/en/innodb-troubleshooting.html to
http://dev.mysql.com/doc/refman/5.1/en/innodb-troubleshooting-datadict.html
2009-07-10 16:10:31 +05:30
Satya B
c64b76edeb Applying InnoDB snapshot 5.1-ss5488,part 2. Fixes BUG#45749
BUG#45749 - Race condition in SET GLOBAL innodb_commit_concurrency=DEFAULT

Detailed revision comments:

r5419 | marko | 2009-06-25 16:11:57 +0300 (Thu, 25 Jun 2009) | 18 lines
branches/5.1: Merge r5418 from branches/zip:

  ------------------------------------------------------------------------
  r5418 | marko | 2009-06-25 15:55:52 +0300 (Thu, 25 Jun 2009) | 5 lines
  Changed paths:
     M /branches/zip/ChangeLog
     M /branches/zip/handler/ha_innodb.cc
     M /branches/zip/mysql-test/innodb_bug42101-nonzero.result
     M /branches/zip/mysql-test/innodb_bug42101-nonzero.test
     M /branches/zip/mysql-test/innodb_bug42101.result
     M /branches/zip/mysql-test/innodb_bug42101.test
  
  branches/zip: Fix a race condition caused by
  SET GLOBAL innodb_commit_concurrency=DEFAULT. (Bug #45749)
  When innodb_commit_concurrency is initially set nonzero,
  DEFAULT would change it back to 0, triggering Bug #42101.
  rb://139 approved by Heikki Tuuri.
  ------------------------------------------------------------------------
2009-07-10 16:06:07 +05:30
Satya B
bb4778b57f Applying InnoDB snashot 5.1-ss5488, part 1
1. Fixes build warnings caused by applying snapshot 5.1-ss5282

2. Fix the Makefile.am in storage/innobase to remove the header file
   'fsp0types.h' which was added twice to fix build warning generated 
   after applying the 5.1-ss5282 snapshot

Detailed revision comments:

r5410 | marko | 2009-06-24 22:26:34 +0300 (Wed, 24 Jun 2009) | 2 lines
branches/5.1: Add missing #include "mtr0log.h" to avoid warnings
when compiling with -DUNIV_MUST_NOT_INLINE.
2009-07-10 15:55:08 +05:30
Staale Smedseng
ab2f3dd2a2 Bug #43397 mysql headers redefine pthread_mutex_init
unnecessarily
      
The problem is that libmysqlclient.so is built with THREAD
undefined, while a client compiling against the same header
files will see THREAD as defined and definitions in
my_pthread.h will be included, possibly resulting in undefined
symbols that cannot be resolved with libmysqlclient.so.
      
The suggested solution is to require that clients wanting to
link with libmysqlclient.so should be built with
MYSQL_CLIENT_NO_THREADS defined. This requires a documentation
change, and more details for this will be supplied if this
patch is approved.
      
The MYSQL_CLIENT_NO_THREADS define was renamed from
UNDEF_THREADS_HACK, to get a more suitable (less suspicious)
name for the define. (The UNDEF_THREADS_HACK is retained for
backwards compatibility, though.)
      
This patch is also in anticipation of WL#4958, which will
remove this problem altogether by dropping the building of
libmysqlclient.
2009-07-08 16:49:45 +02:00
Georgi Kodinov
c80fc3501b fixed check-cpu to correctly recognize mac CPUs 2009-07-08 16:50:17 +03:00
Georgi Kodinov
8843026088 automerge 2009-07-08 16:11:16 +03:00
Georgi Kodinov
ead1ce94e6 Addendum to the fix for bug 45807 : initialize a member needed in
Item_field::fix_fields()
2009-07-08 13:12:27 +03:00
Georgi Kodinov
c2ec53f94a Bug#38998, Bug#46029, Bug#45243, Bug#46030 making tests experimental 2009-07-08 10:31:49 +03:00
Georgi Kodinov
5069a3e9ef automerge 2009-07-07 17:44:19 +03:00
Georgi Kodinov
c8c22c7a98 Bug #40796 : adding the tests to the experimental pb2 set. 2009-07-07 17:41:34 +03:00
Patrick Crews
1eb64fa651 merge 2009-07-07 10:27:42 -04:00
Patrick Crews
61425acb3d Bug#37746: Arithmetic range ("int") is smaller than expected
Added code to the .test file to skip this test on Win64 for PB2 stability.
Please remove this code when the bug is fixed.
2009-07-07 10:19:38 -04:00
Georgi Kodinov
d03714da6b revert of hiding of the error exposed by this suite. 2009-07-07 17:18:44 +03:00
Georgi Kodinov
6a2f91bff4 merge of making bug 45578, 46010 and 45576 experimental in pb2. 2009-07-07 17:15:53 +03:00
Georgi Kodinov
7c681e9001 atuomerge 2009-07-07 17:14:21 +03:00
Georgi Kodinov
abfe915ac9 fixed compilation warnings on macosx 2009-07-07 16:11:46 +03:00
Georgi Kodinov
2275faa00e fixed a failing test ctype_gbk_binlog : Table 't2' already exists 2009-07-07 16:09:06 +03:00
Georgi Kodinov
33380cf0b7 Bug #36259 (Optimizing with ORDER BY) and bug#45828 (Optimizer won't
use partial primary key if another index can prevent filesort

The fix for bug #28404 causes the covering ordering indexes to be 
preferred unconditionally over non-covering and ref indexes.

Fixed by comparing the cost of using a covering index to the cost of
using a ref index even for covering ordering indexes.
Added an assertion to clarify the condition the local variables should
be in.

mysql-test/include/mix1.inc:
  Bug #36259: fixed a non-stable test case
mysql-test/r/innodb_mysql.result:
  Bug #36259 and #45828 : test case
mysql-test/t/innodb_mysql.test:
  Bug #36259 and #45828 : test case
sql/sql_select.cc:
  Bug #36259 and #45828 : don't consider covering indexes supperior to
  ref keys.
2009-07-07 15:52:34 +03:00
V Narayanan
5ff7e35129 merging with mysql-5.1-bugteam 2009-07-09 16:04:06 +05:30
Andrei Elkin
22717a0459 Bug #44115 purge_relay_logs doesn't return an error when count_relay_log_space fails
purge_relay_logs() did not propagate an error happend in count_relay_log_space().

Fixed with the suggestesd setting the error= true.
Note, propagation generally out of purge_relay_logs() was fixed for Bug #44179,
and the issue does not exist in 6.0 thanks to a patch for WL#2775.



sql/rpl_rli.cc:
  the error is set on if count_relay_log_space(rli) fails.
2009-07-09 10:28:38 +03:00
V Narayanan
584fe5d625 merging with mysql-5.1-bugteam 2009-07-09 12:22:56 +05:30
Satya B
584e9f60d2 merge to mysql-5.1-bugteam branch 2009-07-09 12:14:47 +05:30
Davi Arnaut
a56ab623ba Fix warnings generated by SunStudio and GCC.
Based upon patch contributed by Stewart Smith

mysql-test/lib/My/SafeProcess/safe_process.cc:
  Fix style -- remove unneeded spaces.
  Specify C linkage for the signal handling functions.
  Check return value from read()/write().
2009-07-08 09:31:22 -03:00
Satya B
02e70f1691 Bug#35111 - Truncate a MyISAM partitioned table does not reset
the auto_increment value
      
This is an alternative patch that instead of allowing RECREATE TABLE
on TRUNCATE TABLE it implements reset_auto_increment that is called
after delete_all_rows.

Note: this bug was fixed by Mattias Jonsson:
Pusing this patch: http://lists.mysql.com/commits/70370


mysql-test/suite/parts/r/partition_auto_increment_memory.result:
  Bug#35111: Truncate a MyISAM partitioned table does not reset
  the auto_increment value
mysql-test/suite/parts/r/partition_auto_increment_myisam.result:
  Bug#35111: Truncate a MyISAM partitioned table does not reset
  the auto_increment value
sql/ha_partition.cc:
  Bug#35111: Truncate a MyISAM partitioned table does not reset
  the auto_increment value
  
  Added reset_auto_increment, to be used after delete_all_rows
  to simulate truncate.
storage/heap/ha_heap.cc:
  Bug#35111: Truncate a MyISAM partitioned table does not reset
  the auto_increment value
  
  Added reset_auto_increment, to be used after delete_all_rows
  to simulate truncate
storage/heap/ha_heap.h:
  Bug#35111: Truncate a MyISAM partitioned table does not reset
  the auto_increment value
  
  Added reset_auto_increment, to be used after delete_all_rows
  to simulate truncate
storage/myisam/ha_myisam.cc:
  Bug#35111: Truncate a MyISAM partitioned table does not reset
  the auto_increment value
  
  Added reset_auto_increment, to be used after delete_all_rows
  to simulate truncate.
storage/myisam/ha_myisam.h:
  Bug#35111: Truncate a MyISAM partitioned table does not reset
  the auto_increment value
  
  Added reset_auto_increment, to be used after delete_all_rows
  to simulate truncate.
2009-07-08 17:41:34 +05:30
V Narayanan
2e8eb6ce94 Bug#45983 ibmdb2i_create_index_option=1 not working for primary key
With ibmdb2i_create_index_option set to 1, creating an IBMDB2I table
with a primary key should produce an additional index that uses EBCDIC
hexadecimal sorting. However, this does not work. Adding indexes that
are not primary keys does work. The ibmdb2i_create_index_option should
be honoured when creating a table with a primary key.

This patch adds code to the create() function to check for the value
of the ibmdb2i_create_index_option variable and, when appropriate, to 
generate a *HEX-based shadow index in DB2 for the primary key. Previously 
this behavior was limited to secondary indexes.

Additionally, this patch restricts the creation of shadow indexes to
cases in which a non-*HEX sort sequence is used, as the documentation
for ibmdb2i_create_index_option describes. Previously, the shadow index
would in some cases be created even when the MySQL-specific index used
*HEX sorting, leading to redundant indexes.

Finally, the code used to generate the list of fields for indexes 
and the code used to generate the SQL statement for the shadow
indexes has been refactored into individual functions.

mysql-test/suite/ibmdb2i/r/ibmdb2i_bug_45983.result:
  Bug#45983 ibmdb2i_create_index_option=1 not working for primary key
  
  Result file for the test case.
mysql-test/suite/ibmdb2i/t/ibmdb2i_bug_45983.test:
  Bug#45983 ibmdb2i_create_index_option=1 not working for primary key
  
  Add tests to verify that the ibmdb2i_create_index_option is being honoured
  when creating a table with a primary key.
storage/ibmdb2i/ha_ibmdb2i.cc:
  Bug#45983 ibmdb2i_create_index_option=1 not working for primary key
  
  - Add code to the create() function to check for the value of the
    ibmdb2i_create_index_option variable and, when appropriate, to 
    generate a *HEX-based shadow index in DB2 for the primary key.
  
  - Restrict the creation of shadow indexes to cases in which a
    non-*HEX sort sequence is used.
  
  - Refractor code used to generate the list of fields for indexes
    and the code used to generate the SQL statement for the shadow
    indexes into individual functions.
storage/ibmdb2i/ha_ibmdb2i.h:
  Bug#45983 ibmdb2i_create_index_option=1 not working for primary key
  
  Add function prototypes for the functions that.
  
  - Generate the list of fields for indexes
  - Generate the SQL statement for the shadow
    indexes
2009-07-08 14:40:01 +05:30
unknown
006d97dc97 Raise version number after cloning 5.0.84 2009-07-07 11:47:23 +02:00
Georgi Kodinov
2a9da3fac5 tree name change 2009-07-07 10:49:38 +03:00
V Narayanan
6155562ca9 merging with mysql-5.1-bugteam. 2009-07-07 12:06:35 +05:30
Patrick Crews
869e6bd19f Bug#44920: MTR2 is not processing master.opt input properly on Windows.
Had attempted to disable this test on Windows only, but the nature of this bug
does not allow for this.  The master.opt file is processed before anything in 
in the actual test.  As a result, we must use disabled.def files to ensure
these tests are skipped on the problematic platforms.

Removed Windows-only code and updated the proper disabled.def files accordingly.
2009-07-06 18:20:17 -04:00
Georgi Kodinov
05e498ea3d null merged the disablement : problem is not present in 5.1 2009-07-06 20:02:56 +03:00