Commit graph

55601 commits

Author SHA1 Message Date
Georgi Kodinov
3c02669069 merged 5.0-bugteam -> 5.1-bugteam 2008-10-21 10:55:03 +03:00
Kristofer Pettersson
0e0a7011de Merge changeset 2008-10-21 09:03:12 +02:00
Kristofer Pettersson
8ab6a30095 Auto merge 2008-10-21 09:00:42 +02:00
Patrick Crews
82cdce24c2 merge from bk-internal prior to push. 2008-10-20 19:00:40 -04:00
Patrick Crews
b3e948e54f Bug#37798 main.log_tables fails randomly on powermacg5 and windows
Fixed .test file, re-recorded .result file

Ensured reset of system variables at the end of subtests.
2008-10-20 18:41:19 -04:00
Mats Kindahl
2019f17276 Bug #40004 Replication failure with no PK + no indexes
In certain situations, a scan of the table will return the error
code HA_ERR_RECORD_DELETED, and this error code is not 
correctly caught in the Rows_log_event::find_row() function, which
causes an error to be returned for this case.

This patch fixes the problem by adding code to either ignore the
record and continuing with the next one, the the event of a table
scan, or change the error code to HA_ERR_KEY_NOT_FOUND, in the event
that a key lookup is attempted.
2008-10-20 20:50:08 +02:00
Kristofer Pettersson
fee8a478f7 5.0 -> 5.1 NULL MERGE. 2008-10-20 15:45:18 +02:00
Georgi Kodinov
d501f48757 merge 5.0-bugteam -> bug 38693-5.0-bugteam 2008-10-20 16:26:07 +03:00
Kristofer Pettersson
195db07ff3 Auto commit 2008-10-20 13:39:33 +02:00
Sven Sandberg
3be6d967c5 BUG#39851: race between check_testcase and tests running 'show processlist'
Problem 1: not_embedded_server runs SELECT FROM I_S.PROCESSLIST near the beginning.
check_testcase executes a query to the server before that. There is a race here,
because there is no guarantee that the thread executing check_testcase's query is
finished.
Problem 2: The SELECT FROM I_S.PROCESSLIST doens't seem very useful in the test.
It's at least misplaced.
Fix to both problems: Comment out SELECT FROM I_S.PROCESSLIST.


mysql-test/t/not_embedded_server.test:
  Commented out failing / useless test.
2008-10-18 20:36:34 +02:00
Georgi Kodinov
697b2839db Bug #33811: Call to stored procedure with SELECT * / RIGHT JOIN
fails after the first time
  
Two separate problems : 
  1. When flattening joins the linked list used for name resolution 
  (next_name_resolution_table) was not updated.
  Fixed by updating the pointers when extending the table list
  
  2. The items created by expanding a * (star) as a column reference
  were marked as fixed, but no cached table was assigned to them 
  (unlike what Item_field::fix_fields does).
  Fixed by assigning a cached table (so the re-preparation is done
  faster).
  
Note that the fix for #2 hides the fix for #1 in most cases
(except when a table reference cannot be cached).

mysql-test/r/sp.result:
  Bug #33811: test case
mysql-test/t/sp.test:
  Bug #33811: test case
sql/sql_base.cc:
  Bug #33811: cache the table for Item_fields created by expanding '*'
sql/sql_select.cc:
  Bug #33811: maintain a correct name resolution chain when
  flattening joins.
2008-10-17 17:55:06 +03:00
Ramil Kalimullin
bba814d0b9 Fix for bug #40053: 'check table .. for upgrade' doesn't detect
collation change made in 5.1.24-rc

Problem: 'CHECK TABLE ... FOR UPGRADE' did not check for 
incompatible collation changes made in MySQL 5.1.24-rc.

Fix: add the check.


sql/handler.cc:
    - check for incompatible collation changes made in 5.1.24-rc:
  bug #27877:
    utf8_general_ci
    ucs2_general_ci
2008-10-17 17:45:17 +05:00
Georgi Kodinov
3602a4e7a4 merged 5.0-bugteam -> 5.1-bugteam 2008-10-17 11:49:23 +03:00
Georgi Kodinov
0f678ee60d merged 5.0-bugteam -> bug 39958 2008-10-17 11:47:35 +03:00
Serge Kozlov
172f64911b Bug#39593. Removed test case rpl_row_stop_middle with result file 2008-10-16 22:40:15 +04:00
Gleb Shchepa
39d165dd74 merge 5.0-bugteam --> 5.1-bugteam (bug 39844) 2008-10-16 23:04:31 +05:00
Gleb Shchepa
b591793496 Bug #39844: Query Crash Mysql Server 5.0.67
Server crashed during a sort order optimization
of a dependent subquery:

SELECT
    (SELECT t1.a FROM t1, t2
      WHERE t1.a = t2.b AND t2.a = t3.c
      ORDER BY t1.a)
  FROM t3;


Bitmap of tables, that the reference to outer table
column uses, in addition to the regular table bit
has the OUTER_REF_TABLE_BIT bit set.
The only_eq_ref_tables function traverses this map
bit by bit simultaneously with join->map2table list.
Obviously join->map2table never contains an entry
for the OUTER_REF_TABLE_BIT pseudo-table, so the
server crashed there.


The only_eq_ref_tables function has been modified
to traverse regular table bits only like the
update_depend_map function (resetting of the
OUTER_REF_TABLE_BIT there is enough, but
resetting of the whole set of PSEUDO_TABLE_BITS
is used there for sure).


mysql-test/r/order_by.result:
  Added test case for bug #39844.
mysql-test/t/order_by.test:
  Added test case for bug #39844.
sql/sql_select.cc:
  Bug #39844: Query Crash Mysql Server 5.0.67
  
  The only_eq_ref_tables function has been modified
  to traverse regular table bits only like the
  update_depend_map function (resetting of the
  OUTER_REF_TABLE_BIT there is enough, but
  resetting of the whole set of PSEUDO_TABLE_BITS
  is used there for sure).
2008-10-16 21:37:17 +05:00
Georgi Kodinov
ca6e05765c Bug #39958: Test "windows" lacks a cleanup
Added the missing DROP TABLE

mysql-test/r/windows.result:
  Bug #39958: added the missing DROP TABLE
mysql-test/t/windows.test:
  Bug #39958: added the missing DROP TABLE
2008-10-16 14:16:27 +03:00
Davi Arnaut
6525348368 Merge mysql-5.0-bugteam into mysql-5.1-bugteam. 2008-10-15 22:50:56 -03:00
Davi Arnaut
e6fa9496f5 Bug#38477: my_pthread_setprio can change dispatch class on Solaris, not just priority
The problem is that the function used by the server to increase
the thread's priority (pthread_setschedparam) has the unintended
side-effect of changing the calling thread scheduling policy,
possibly overwriting a scheduling policy set by a sysadmin.

The solution is to rely on the pthread_setschedprio function, if
available, as it only changes the scheduling priority and does not
change the scheduling policy. This function is usually available on
Solaris and Linux, but it use won't work by default on Linux as the
the default scheduling policy only accepts a static priority 0 -- this
is acceptable for now as priority changing on Linux is broken anyway.

configure.in:
  Check for the existence of the pthread_setschedprio function.
include/my_pthread.h:
  Use the pthread_setschedprio function to set the thread priority
  if the function is available.
2008-10-15 19:28:26 -03:00
Davi Arnaut
e405ab1626 Bug#38941: fast mutexes in MySQL 5.1 have mutex contention when calling random()
The problem is that MySQL's 'fast' mutex implementation uses the
random() routine to determine the spin delay. Unfortunately, the
routine interface is not thead-safe and some implementations (eg:
glibc) might use a internal lock to protect the RNG state, causing
excessive locking contention if lots of threads are spinning on
a MySQL's 'fast' mutex. The code was also misusing the value
of the RAND_MAX macro, this macro represents the largest value
that can be returned from the rand() function, not random().

The solution is to use the quite simple Park-Miller random number
generator. The initial seed is set to 1 because the previously used
generator wasn't being seeded -- the initial seed is 1 if srandom()
is not called.

Futhermore, the 'fast' mutex implementation has several shortcomings
and provides no measurable performance benefit. Therefore, its use is
not recommended unless it provides directly measurable results.


include/my_pthread.h:
  Add field to keep the RNG state.
mysys/thr_mutex.c:
  Use a palliative per-mutex rng state to determine the spin delay.
  The RNG is not thread-safe but jumping a few sequences in the RNG
  is harmless.
2008-10-15 19:21:00 -03:00
Davi Arnaut
3ad228d7fb Bug#37075: offset of limit clause might be truncated on 32-bits server w/o big tables
The problem is that the offset argument of the limit clause
might be truncated on a 32-bits server built without big
tables support. The truncation was happening because the
original 64-bits long argument was being cast to a 32-bits
(ha_rows) offset counter.

The solution is to check if the conversing resulted in value
truncation and if so, the offset is set to the maximum possible
value that can fit on the type.

mysql-test/r/limit.result:
  Add test case result for Bug#37075
mysql-test/t/limit.test:
  Add test case for Bug#37075
sql/sql_lex.cc:
  Check for truncation of the offset value. If value was
  truncated, set to the maximum possible value.
2008-10-15 18:34:51 -03:00
Horst Hunger
5ec1c1587f Merge to update the tree before a push. 2008-10-15 21:26:32 +02:00
Horst Hunger
8c0ffd24d3 Final patch for bug#36733 containing all changes. 2008-10-15 20:58:53 +02:00
Georgi Kodinov
747351836c Bug #38693: leaked memory with blobs!
If delayed insert fails to upgrade the lock it was not
freeing the temporary memory storage used to keep
newly constructed blob values in memory.
Fixed by iterating over the remaining rows in the delayed
insert rowset and freeing the blob storage for each row.

No test suite because it involves concurrent delayed inserts 
on a table and cannot easily be made deterministic. 

Added a correct valgrind suppression for Fedora 9.

mysql-test/valgrind.supp:
  Added a vagrind suppression for Fedora 9
sql/sql_insert.cc:
  Bug #38693: free the blobs temp storage on error.
2008-10-15 16:55:52 +03:00
Kristofer Pettersson
7fa3897e8a automerge 2008-10-15 12:06:44 +02:00
Kristofer Pettersson
d0b8dd4555 automerge 2008-10-15 09:55:15 +02:00
Joerg Bruehe
b302850237 Merge Kent's patch to "zlib/gzio.c" from 5.0-build to 5.1-build 2008-10-14 22:34:11 +02:00
Chad MILLER
fb7bbdffda Merge fix for bug 34129. 2008-10-14 15:59:01 -04:00
Chad MILLER
77fec0b219 In mysqldumpslow, consume arbitrary whitespace in the Query_time line. 2008-10-14 15:52:52 -04:00
Davi Arnaut
017307f216 Bug#38823: Invalid memory access when a SP statement does wildcard expansion
The problem is that field names constructed due to wild-card
expansion done inside a stored procedure could point to freed
memory if the expansion was performed after the first call to
the stored procedure.

The problem was solved by patch for Bug#38691. The solution
was to allocate the database, table and field names in the
in the statement memory instead of table memory.

mysql-test/r/sp.result:
  Add test case result for Bug#38823
mysql-test/t/sp.test:
  Add test case for Bug#38823
sql/item.cc:
  Remark that this also impacts wildcard expansion inside SPs.
2008-10-14 11:04:36 -03:00
Sven Sandberg
4e09e915ca BUG#39853: lowercase_table3 fails on powermacg5 in rpl tree
Problem: during a refactoring of mtr, a pattern for suppressing a warning from lowercase_table3 was lost.
Fix: re-introduce the suppression.
Problem 2: suppression was misspelt as supression. Fixed by adding a p.


mysql-test/include/mtr_warnings.sql:
  fixed spelling error
mysql-test/suite/rpl/t/rpl_bug33931.test:
  fixed spelling error
mysql-test/suite/rpl/t/rpl_idempotency.test:
  fixed spelling error
mysql-test/suite/rpl/t/rpl_temporary.test:
  fixed spelling error
mysql-test/suite/rpl/t/rpl_temporary_errors.test:
  fixed spelling error
mysql-test/t/lowercase_table3.test:
  fixed spelling error
2008-10-13 20:33:08 +02:00
Sven Sandberg
906fc6bb95 BUG#38817: please make mtr analyze crashes better
Post-push fixes making it work on pushbuild's valgrind host, and clarifying the output.


mysql-test/lib/My/CoreDump.pm:
  - Improved parsing of mtr output so that it works on pushbuild's "valgrind" host.
  - Added stack trace for the thread that coredumped, to make output more readable when there are many threads.
  - Added explanation of what the output consists of.
  - Added early removal of temp file.
2008-10-13 18:14:30 +02:00
Kent Boortz
12173de37b The header "config.h" needs to be included "early" to control other headers.
This time the inclusion of <stdio.h> before "config.h" enabled legacy large
file support, seek64() and similar, on AIX breaking the compile of "gzio.c"
2008-10-13 14:23:39 +02:00
Georgi Kodinov
71b97ecb88 merged 5.0-bugteam -> 5.1->bugteam 2008-10-13 13:24:04 +03:00
Georgi Kodinov
8bb2eb38f5 merged 5.1-main -> 5.1-bugteam 2008-10-13 13:22:36 +03:00
Joerg Bruehe
e6e0fbfcca Merge a merge changeset - no changes. 2008-10-12 11:36:27 +02:00
unknown
eab7404c8f More portable sh in configure script 2008-10-11 23:51:58 +02:00
unknown
1153d1edad Made dist support script more portable sh 2008-10-11 20:28:13 +02:00
unknown
d93fe58302 Aligned declaration and defintion of ha_change_partitions(), to avoid link
error using SunStudio 12.
2008-10-11 18:35:49 +02:00
Magnus Svensson
27233c23cf Add missing DROP TABLE t1 to reslt file 2008-10-11 17:35:10 +02:00
Magnus Svensson
770ef5c307 WL#4189 Set parallel to 1 if running under vmware on windows 2008-10-11 17:30:26 +02:00
Joerg Bruehe
3e016e651a Merge main 5.1 -> 5.1-build
Merge conflict in the tests "<engine>_storedproc": These tests are deleted.
2008-10-11 17:06:47 +02:00
Magnus Svensson
6a10718848 WL#4189 Add retry logic to mkpath to avoid temporary permission denied problems 2008-10-11 17:06:34 +02:00
Build Team
7f34685963 Added "-rc" to the version
Removed use of __FUNCTION__
2008-10-11 01:12:39 +02:00
Mattias Jonsson
c6115db4c3 Bug#39434: ALTER TABLE CHECK/OPTIMIZE/ANALYZE PARTITION work
on non-partitioned table

Problem was that partitioning specific commands was accepted
for non partitioned tables and treated like
ANALYZE/CHECK/OPTIMIZE/REPAIR TABLE, after bug-20129 was fixed,
which changed the code path from mysql_alter_table to
mysql_admin_table.

Solution was to check if the table was partitioned before
trying to execute the admin command

mysql-test/r/partition_mgm_err.result:
  Bug#39434: ALTER TABLE CHECK/OPTIMIZE/ANALYZE PARTITION work
  on non-partitioned table
  
  Updated test result
mysql-test/t/partition_mgm_err.test:
  Bug#39434: ALTER TABLE CHECK/OPTIMIZE/ANALYZE PARTITION work
  on non-partitioned table
  
  Updated test case
sql/ha_partition.cc:
  Bug#39434: ALTER TABLE CHECK/OPTIMIZE/ANALYZE PARTITION work
  on non-partitioned table
  
  Simplified the code by using ALTER_ADMIN_PARTITION for all
  commands that go through mysql_admin_tables and is set
  for partitioning specific commands that.
sql/ha_partition.h:
  Bug#39434: ALTER TABLE CHECK/OPTIMIZE/ANALYZE PARTITION work
  on non-partitioned table
  
  Simplified the code by using ALTER_ADMIN_PARTITION for all
  commands that go through mysql_admin_tables and is set
  for partitioning specific commands that.
sql/sql_lex.h:
  Bug#39434: ALTER TABLE CHECK/OPTIMIZE/ANALYZE PARTITION work
  on non-partitioned table
  
  Simplified the code by using ALTER_ADMIN_PARTITION for all
  commands that go through mysql_admin_tables and is set
  for partitioning specific commands that.
  
  Removed ALTER_ANALYZE/CHECK/OPTIMIZE/REPAIR_PARTITION and
  added ALTER_ADMIN_PARTITION instead.
sql/sql_partition.cc:
  Bug#39434: ALTER TABLE CHECK/OPTIMIZE/ANALYZE PARTITION work
  on non-partitioned table
  
  Simplified the code by using ALTER_ADMIN_PARTITION for all
  commands that go through mysql_admin_tables and is set
  for partitioning specific commands that.
  
  Removed ALTER_ANALYZE/CHECK/OPTIMIZE/REPAIR_PARTITION and
  added ALTER_ADMIN_PARTITION instead.
sql/sql_table.cc:
  Bug#39434: ALTER TABLE CHECK/OPTIMIZE/ANALYZE PARTITION work
  on non-partitioned table
  
  Give error and return if trying partitioning admin command
  on non partitioned table.
  
  Simplified the code by using ALTER_ADMIN_PARTITION for all
  commands that go through mysql_admin_tables and is set
  for partitioning specific commands that.
  
  Removed ALTER_ANALYZE/CHECK/OPTIMIZE/REPAIR_PARTITION and
  added ALTER_ADMIN_PARTITION instead.
sql/sql_yacc.yy:
  Bug#39434: ALTER TABLE CHECK/OPTIMIZE/ANALYZE PARTITION work
  on non-partitioned table
  
  Simplified the code by using ALTER_ADMIN_PARTITION for all
  commands that go through mysql_admin_tables and is set
  for partitioning specific commands that.
  
  Removed ALTER_ANALYZE/CHECK/OPTIMIZE/REPAIR_PARTITION and
  added ALTER_ADMIN_PARTITION instead.
2008-10-10 20:12:38 +02:00
Joerg Bruehe
8acc0f5537 Merge from main 5.0 branch -> 5.0-build
Merge conflicts in test "create:
- for "create.result", handled correctly by "bzr extmerge" (using "kdiff3"),
- for "create.test", not reported as a conflict, but merged wrong
  (new block at the test end got duplicated), fixed manually.

Test on Linux (Debian, PowerPC) was ok.
2008-10-10 19:20:42 +02:00
Georgi Kodinov
9b6347f0ab merged 5.0-main -> 5.0-bugteam 2008-10-10 17:27:16 +03:00
Magnus Svensson
8873148dbf BUG#39008 Additional fix after review, remove files that could potentially be set to path outside datadir 2008-10-10 16:19:04 +02:00
Georgi Kodinov
b6704027d6 merged 5.1-bugteam -> bug 34773 tree 2008-10-10 16:07:53 +03:00