Commit graph

57136 commits

Author SHA1 Message Date
Gleb Shchepa
24457353c7 auto-upmerge 5.0-bugteam --> 5.1-bugteam (bug 37362) 2009-05-01 00:27:10 +05:00
Gleb Shchepa
f0791b8b6b Bug #37362: Crash in do_field_eq
EXPLAIN EXTENDED of nested query containing a error:

   1054 Unknown column '...' in 'field list'

may cause a server crash.


Parse error like described above forces a call to
JOIN::destroy() on malformed subquery.
That JOIN::destroy function closes and frees temporary
tables. However, temporary fields of these tables
may be listed in st_select_lex::group_list of outer
query, and that st_select_lex may not cleanup them
properly. So, after the JOIN::destroy call that
st_select_lex::group_list may have Item_field
objects with dangling pointers to freed temporary
table Field objects. That caused a crash.


mysql-test/r/subselect3.result:
  Added test case for bug #37362.
mysql-test/t/subselect3.test:
  Added test case for bug #37362.
sql/sql_select.cc:
  Bug #37362: Crash in do_field_eq
  
  The JOIN::destroy function has been modified to
  cleanup temporary table column items.
2009-05-01 00:20:37 +05:00
Georgi Kodinov
20378a2b91 merge 2009-04-30 18:00:51 +03:00
Sergey Vojtovich
6a43ad1d53 Merge to 5.1-bugteam. 2009-04-30 19:41:43 +05:00
Andrei Elkin
75da023da6 merging from 5.0-bt rep to a local branch 2009-04-30 17:32:46 +03:00
Andrei Elkin
91199415a5 merge 5.1-bt rep -> local 5.1-bt 2009-04-30 17:29:57 +03:00
Georgi Kodinov
28b2b34e92 merged 5.0-bugteam -> 5.1-bugteam 2009-04-30 16:44:13 +03:00
Georgi Kodinov
9a50874dba merged 5.1-main to 5.1-bugteam 2009-04-30 16:42:38 +03:00
Georgi Kodinov
abf3efe588 merged 5.0-main to 5.0-bugteam 2009-04-30 16:39:00 +03:00
Andrei Elkin
24bfa85531 moving bug#38694 test files into rpl suite 2009-04-30 16:20:38 +03:00
Andrei Elkin
a152aa32de merging 5.0-bt to 5.1-bt 2009-04-30 16:17:46 +03:00
Narayanan V
bb668b284d merging with mysql-5.1-bugteam 2009-04-30 18:22:48 +05:30
Andrei Elkin
cc491da07f merge bug#44179 fixes to 5.1-bt 2009-04-30 15:47:09 +03:00
Narayanan V
db83fda90d BUG#37631 - Incorrect key file for table after upgrading from 5.0 to 5.1
This patch adds corrections to the original patch
submitted 2009-04-08 (http://lists.mysql.com/commits/71607):

- fixed that the original patch didn't work because of an
  incorrect condition;
- added a test case.

mysql-test/r/upgrade.result:
  Bug#37631 Incorrect key file for table after upgrading from 5.0 to 5.1
  
  Result file for test case
mysql-test/std_data/bug37631.MYD:
  Bug#37631 Incorrect key file for table after upgrading from 5.0 to 5.1
  
  table created in mysql 4.0
mysql-test/std_data/bug37631.MYI:
  Bug#37631 Incorrect key file for table after upgrading from 5.0 to 5.1
  
  table created in mysql 4.0
mysql-test/std_data/bug37631.frm:
  Bug#37631 Incorrect key file for table after upgrading from 5.0 to 5.1
  
  table created in mysql 4.0
mysql-test/t/upgrade.test:
  Bug#37631 Incorrect key file for table after upgrading from 5.0 to 5.1
  
  Adds test for checking that upgrade works
  on a table which is created by a mysql
  server version <= 4.0.
storage/myisam/ha_myisam.cc:
  Bug#37631 Incorrect key file for table after upgrading from 5.0 to 5.1
  
  Fix the conformance checker to relax checking
  for the correct version of the tables (for tables
  created by mysql server version <= 4.0)
2009-04-30 18:16:49 +05:30
Andrei Elkin
9cf91b4cd9 merging from 5.0-bt rep to a local branch 2009-04-30 15:41:47 +03:00
Andrei Elkin
2d20930eee Bug #44179 reset slave crashes in my_error when reset_logs returns non-zero
my_error() was invoked in reset_slave()'s with purge_relay_logs()-failing branch
without passing sql_errno to it.

Fixed with setting sql_errno= ER_RELAY_LOG_FAIL in the purge_relay_logs()-failing branch.




sql/sql_repl.cc:
  set sql_errno= ER_RELAY_LOG_FAIL when purge_relay_logs() fails.
2009-04-30 15:28:07 +03:00
Matthias Leich
e5d859fab7 Merge of fix for Bug#44522 main.not_embedded_server fails with "--check-testcases"
into actual tree
2009-04-30 12:26:11 +02:00
Sergey Glukhov
765cc53c84 automerge 2009-04-30 15:17:56 +05:00
Satya B
f74e3ee505 merget to 5.1-bugteam 2009-04-30 16:44:50 +05:30
Satya B
c6d6e889cd Addition to the fix for BUG#40827 - Killing insert-select to MyISAM can cause
table corruption


Moved the testcase from the file myisam.test to the new testfile 
mysiam_debug.test
 

mysql-test/r/myisam.result:
  Removed result file for BUG#40827
mysql-test/r/myisam_debug.result:
  Result file for BUG#40827
mysql-test/t/myisam.test:
  Removed testcase for BUG#40827
mysql-test/t/myisam_debug.test:
  TestCase for BUG#40827
2009-04-30 16:33:44 +05:30
Matthias Leich
44e619956b Merge 5.0 -> 5.1 of fix for Bug 44522
This is a "null" merge because the fix is
already in 5.1
2009-04-30 12:29:19 +02:00
Sergey Glukhov
5d41d82174 Bug#43962 "Packets out of order" calling a SHOW TABLE STATUS
Error happens because sp_head::MULTI_RESULTS is not set for SP
which has 'show table status' command.
The fix is to add a SQLCOM_SHOW_TABLE_STATUS case into
sp_get_flags_for_command() func.


mysql-test/r/sp.result:
  test result
mysql-test/t/sp.test:
  test case
sql/sp_head.cc:
  Error happens because sp_head::MULTI_RESULTS is not set for SP
  which has 'show table status' command.
  The fix is to add a SQLCOM_SHOW_TABLE_STATUS case into
  sp_get_flags_for_command() func.
2009-04-30 14:37:29 +05:00
Alexey Botchkov
88139cba8e merging 2009-04-30 12:54:45 +05:00
Alexey Botchkov
626a272ed4 mysql_client_test fixed.
per-file comments:
  tests/mysql_client_test.c
the test for bug 37956 isn't relevant anymore.
The query there 'select point(?,?)' doesn't produce an error.
2009-04-30 12:52:27 +05:00
Satya B
a5badbfe6d Fix for BUG#40827 - Killing insert-select to MyISAM can cause table corruption
Killing the insert-select statement corrupts the MyISAM table only
when the destination table is empty and when it has indexes. When 
we bulk insert huge data and if the destination table is empty we 
disable the indexes for fast inserts, data is then inserted and 
indexes are re-enabled after bulk_insert operation
                        
Killing the query, aborts the repair table operation during enable
indexes phase leading to table corruption.
                      
We now truncate the table when we detect that enable indexes is
killed for bulk insert query.As we have an empty table before the 
operation, we can fix by truncating the table.

mysql-test/r/myisam.result:
  Result file for BUG#40827
mysql-test/t/myisam.test:
  Testcase for BUG#40827
storage/myisam/ha_myisam.cc:
  Fixed end_bulk_insert() method to truncate the table when we detect enable 
  index operation is killed.
2009-04-30 12:40:12 +05:30
Martin Hansson
4ba05b50a2 merge 2009-04-29 20:52:37 +02:00
Vladislav Vaintroub
fbc3812022 merge 2009-04-29 14:29:54 +02:00
Martin Hansson
45cbd32697 Bug#43737: Select query return bad result
A bug in the initialization of key segment information made it point
to the wrong bit, since a bit index was used when its int value
was needed. This lead to misinterpretation of bit columns
read from MyISAM record format when a NULL bit pushed them over
a byte boundary.
Fixed by using the int value of the bit instead.


mysql-test/r/myisam.result:
  Bug#43737: Test result.
mysql-test/t/myisam.test:
  Bug#43737: Test case.
storage/myisam/mi_open.c:
  Bug#43737: fix.
2009-04-29 14:00:34 +02:00
Vladislav Vaintroub
73d3be945f Bug#43932 myisam index corruption with large index and large
key_buffer_size.

The cause of corruption was number overflow when multiplying 
two ulong values, number of used keycache blocks with size
of a single block. The result of multiplication exceeded ulong 
range (4G) and this lead to incorrectly calculated  buffer offset
in the key cache.

The fix is to use size_t for multiplication result.

This patch also fixes pointless cast in safemalloc 
(size of allocated block to uint), that creates lot of false
alarm warnings when using big keycache (> 4GB) in debug mode.
2009-04-29 13:51:10 +02:00
Narayanan V
70f53b1a65 Bug#44337 Select query using index merge fails with MCH3601
The storage engine was not correctly handling the case in 
which rnd_pos is executed for a handler without a preceding
rnd_next or index read operation. As a result, an unitialized
file handle was sometimes being passed to the QMY_READ API.

The fix clears the rrnAssocHandle at the beginning of each
read operation and then checks to see whether it has been
set to a valid handle value before attempting to use it
in rnd_pos. If rrnAssocHandle has not been set by a previous
read operation, rnd_pos instead falls back to the use of the
currently active handle.

storage/ibmdb2i/ha_ibmdb2i.cc:
  Bug#44337 Select query using index merge fails with MCH3601
  
  - clear the rrnAssocHandle at the beginning of each
    read operation 
  - checks to see whether it has been set to a valid
    handle value before attempting to use it in rnd_pos
2009-04-29 16:51:14 +05:30
Alexey Botchkov
e7c4b2dfc7 merging 2009-04-29 09:41:36 +05:00
Alexey Botchkov
eed928808e merging 2009-04-29 09:40:50 +05:00
Alexey Botchkov
c471896f69 merging 2009-04-29 09:39:49 +05:00
Alexey Botchkov
0e88c80580 merging 2009-04-29 07:59:10 +05:00
Alfranio Correia
7f4e25644e merge 5.1-bugteam (local) --> 5.1-bugteam 2009-04-28 23:10:29 +01:00
Matthias Leich
2d6d17677c Automatic merge, no conflicts, no changes 2009-04-28 21:50:55 +02:00
Matthias Leich
ae154dca77 Merge latest changes into local GCA tree
no conflicts
2009-04-28 21:48:10 +02:00
Matthias Leich
07748b16d8 Merge of latest changes into local GCA tree
no conflicts
2009-04-28 21:33:18 +02:00
Matthias Leich
14982a702e Merge 5.0 -> 5.1 of fix for Bug 43546
Several 5.0 tests do not pass MTR's --check option (moved from Bug 42308)
2009-04-28 20:42:17 +02:00
Matthias Leich
2328f9b13f Fix for Bug#43546 Several 5.0 tests do not pass MTR's --check option
(moved from Bug 42308)

Details:
- insert_update
  Add DROP TABLE which was missing, error numbers -> names
- varbinary
  Add DROP TABLE which was missing
- sp_trans_log
  Add missing DROP function, improved formatting
2009-04-28 20:12:18 +02:00
Staale Smedseng
90815182f0 Merge from 5.0-bugteam 2009-04-28 18:19:55 +02:00
Staale Smedseng
9f04d27027 Bug#35769 typo in mysqlhotcopy documentation
Fixed a number of typos, and made punctuation and
capitalization more consistent in documentation
and help.
2009-04-28 18:16:17 +02:00
Andrei Elkin
d38e62634f Bug #38694 Race condition in replication thread shutdown
The issue of the current bug is unguarded access to mi->slave_running 
by the shutdown thread calling end_slave() that is bug#29968 
(alas happened not to be cross-linked with the current bug)

Fixed:

with removing the unguarded read of the running status
and perform reading it in terminate_slave_thread()
at time run_lock is taken (mostly bug#29968 backporting, still with some
improvements over that patch - see the error reporting from 
terminate_slave_thread()).
Issue of bug#38716 is fixed here for 5.0 branch as well.

Note:

There has been a separate artifact identified - 
a race condition between init_slave() and  end_slave() - 
reported as  Bug#44467.

mysql-test/r/rpl_bug38694.result:
  a new results file is added.
mysql-test/t/rpl_bug38694-slave.opt:
  simulating delay at slave threads shutdown.
mysql-test/t/rpl_bug38694.test:
  A new test to check if a delay at the termination phase of slave threads
  could cause any issue.
sql/slave.cc:
  The unguarded read of the running status is removed. Its reading is done in
  terminate_slave_thread() at time run_lock is taken;
  Calling terminate_slave_threads(skip_lock := !need_slave_mutex) in the failing branch of start_slave_threads() which is bug#38716 issue.
sql/slave.h:
  removing terminate_slave_thread() out of the global interface scope.
2009-04-28 14:46:07 +03:00
Alexey Botchkov
ddc9a19550 merging 2009-04-28 14:48:54 +05:00
Alexey Botchkov
620fb880d7 Bug#38990 Arbitrary data input plus GIS functions causes mysql server crash
the Point() and Linestring() functions create WKB representation of an
   object instead of an real geometry object.
   That produced bugs when these were inserted into tables.

   GIS tests fixed accordingly.
            
per-file messages:
  mysql-test/r/gis-rtree.result
Bug#38990 Arbitrary data input plus GIS functions causes mysql server crash 
    test result
  mysql-test/r/gis.result
Bug#38990 Arbitrary data input plus GIS functions causes mysql server crash 
    test result
  mysql-test/t/gis-rtree.test
Bug#38990 Arbitrary data input plus GIS functions causes mysql server crash 
    test fixed - GeomFromWKB invocations removed
  mysql-test/t/gis.test
Bug#38990 Arbitrary data input plus GIS functions causes mysql server crash 
    test fixed - AsWKB invocations added
  sql/item_geofunc.cc
Bug#38990 Arbitrary data input plus GIS functions causes mysql server crash 
     Point() and similar functions to create a proper object
2009-04-28 14:47:26 +05:00
Gleb Shchepa
755d312e84 manual merge 5.0-bugteam --> 5.1-bugteam 2009-04-28 05:27:38 +05:00
Gleb Shchepa
def0470598 backport from 6.0:
Bug #40925: Equality propagation takes non indexed attribute

Query execution plans and execution time of queries like

  select a, b, c from t1
    where a > '2008-11-21' and b = a limit 10

depended on the order of equality operator parameters:
"b = a" and "a = b" are not same. 


An equality propagation algorithm has been fixed:
the substitute_for_best_equal_field function should not
substitute a field for an equal field if both fields belong
to the same table.


mysql-test/r/select.result:
  Added test case for bug #40925.
mysql-test/t/select.test:
  Added test case for bug #40925.
sql/item.cc:
  Bug #40925: Equality propagation takes non indexed attribute
  
  An equality propagation algorithm has been fixed:
  the substitute_for_best_equal_field function should not 
  substitute a field for an equal field if both fields belong
  to the same table.
2009-04-28 05:19:13 +05:00
Sergey Glukhov
26cc84d947 ENCRYPT function always returns NULL on windows.
The fix is to disable result log as we need to
test valgrind error only.
2009-04-27 15:05:01 +05:00
Alfranio Correia
6309ce9594 Fixed rpl_innodb_mixed_ddl and rpl_000015.
Respectively, replaced "--exec diff" by "--diff_files" which is a mysqltest command to run a
non-operating system specific diff. Removed the file rpl_000015-slave.sh as it is not
necessary in the new MTR.
2009-04-26 22:21:01 +01:00
Patrick Crews
4c566d1305 merge 5.0-> 5.1 2009-04-24 13:00:17 -04:00