Commit graph

53 commits

Author SHA1 Message Date
mhansson/martin@linux-st28.site
1da8451d4d bug#28570: handler::index_read() is called with different find_flag when
ORDER BY is used

The range analysis module did not correctly signal to the 
handler that a range represents a ref (EQ_RANGE flag). This causes 
non-range queries like 
SELECT ... FROM ... WHERE keypart_1=const, ..., keypart_n=const 
ORDER BY ... FOR UPDATE
to wait for a lock unneccesarily if another running transaction uses
SELECT ... FOR UPDATE on the same table.

Fixed by setting EQ_RANGE for all range accesses that represent 
an equality predicate.
2007-08-15 09:23:44 +02:00
gkodinov/kgeorge@magare.gmz
33518801fb Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  magare.gmz:/home/kgeorge/mysql/autopush/B29644-5.0-opt
2007-07-23 17:07:29 +03:00
gkodinov/kgeorge@magare.gmz
7402fd6e79 Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  magare.gmz:/home/kgeorge/mysql/autopush/B28951-5.0-opt
2007-07-22 19:23:29 +03:00
gkodinov/kgeorge@magare.gmz
8fc401e21f Bug #28591: MySQL need not sort the records in case of
ORDER BY primary_key on InnoDB table

Queries that use an InnoDB secondary index to retrieve
data don't need to sort in case of ORDER BY primary key
if the secondary index is compared to constant(s).
They can also skip sorting if ORDER BY contains both the
the secondary key parts and the primary key parts (in
that order).
This is because InnoDB returns the rows in order of the
primary key for rows with the same values of the secondary
key columns.
Fixed by preventing temp table sort for the qualifying 
queries.
2007-07-20 21:05:29 +03:00
gkodinov/kgeorge@magare.gmz
174dcb07ab Bug #29644: alter table hangs if records locked in share mode
by long running transaction

On Windows opened files can't be deleted. There was a special
upgraded lock mode (TL_WRITE instead of TL_WRITE_ALLOW_READ) 
in ALTER TABLE to make sure nobody has the table opened
when deleting the old table in ALTER TABLE. This special mode
was causing ALTER TABLE to hang waiting on a lock inside InnoDB.
This special lock is no longer necessary as the server is 
closing the tables it needs to delete in ALTER TABLE.
Fixed by removing the special lock.
Note that this also reverses the fix for bug 17264 that deals with
another consequence of this special lock mode being used.
2007-07-20 14:17:15 +03:00
kostja@bodhi.(none)
7989c712a6 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  bodhi.(none):/opt/local/work/mysql-5.0-runtime
2007-07-16 23:41:28 +04:00
kostja@bodhi.(none)
5466b0df14 Add a teste case for Bug#27296 "Assertion in ALTER TABLE SET DEFAULT in
Linux Debug build (possible deadlock)"

The bug is not repeatable any more.
2007-07-15 13:34:35 +04:00
gshchepa/uchum@gleb.loc
3c918268e7 Merge gleb.loc:/home/uchum/work/bk/5.0
into  gleb.loc:/home/uchum/work/bk/5.0-opt
2007-07-08 00:19:31 +05:00
jani@labbari.dsl.inet.fi
7d7524d94d Merge jamppa@bk-internal.mysql.com:/home/bk/mysql-5.0
into  labbari.dsl.inet.fi:/home/my/bk/mysql-5.0-marvel
2007-07-06 09:51:02 +03:00
sergefp@mysql.com
de0cf5d22f Fix testcase to be platform-independent 2007-07-02 22:18:41 +04:00
igor@olga.mysql.com
f8683bfb44 Fixed bug #25798.
This bug may manifest itself not only with the queries for which
the index-merge access method is chosen. It also may display
itself for queries with DISTINCT.

The bug was in how the Unique::get method used the merge_buffers
function. To compare elements in the the queue employed by
merge_buffers() it must use the buffpek_compare function rather
than the function for binary comparison.
2007-07-01 15:33:28 -07:00
gkodinov/kgeorge@magare.gmz
f93607d2ea Bug #29154: LOCK TABLES is not atomic when >1 InnoDB tables are locked
LOCK TABLES takes a list of tables to lock. It may lock several 
  tables successfully and then encounter a tables that it can't lock, 
  e.g. because it's locked. In such case it needs to undo the locks on
  the already locked tables. And it does that. But it has also notified
  the relevant table storage engine handlers that they should lock.
  The only reliable way to ensure that the table handlers will give up
  their locks is to end the transaction. This is what UNLOCK TABLE 
  does : it ends the transaction if there were locked tables by LOCK 
  tables.
  It is possible to end the transaction when the lock fails in 
  LOCK TABLES because LOCK TABLES ends the transaction at its start 
  already. 
  Fixed by ending (again) the transaction when LOCK TABLES fails to
  lock a table.
2007-06-25 10:44:52 +03:00
monty@narttu.mysql.fi
e5d06603fd Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  mysql.com:/home/my/mysql-5.0
2007-06-20 19:25:44 +03:00
monty@mysql.com/narttu.mysql.fi
9a59083163 Allow multiple calls to mysql_server_end()
(Part of fix for Bug#25621 Error in my_thread_global_end(): 1 threads didn't exit)
Give correct error message if InnoDB table is not found
(This allows us to drop a an innodb table that is not in the InnoDB registery)
2007-06-20 19:22:27 +03:00
holyfoot/hf@hfmain.(none)
8ccc50b303 Merge bk@192.168.21.1:mysql-5.0
into  mysql.com:/d2/hf/mrg/mysql-5.0-opt
2007-06-14 16:41:10 +05:00
gkodinov/kgeorge@magare.gmz
b1e936b9e5 Bug#28878: InnoDB tables with UTF8 character set and indexes cause
wrong result for DML
When making key reference buffers over CHAR fields whitespace (0x20) 
must be used to fill in the remaining space in the field's buffer.
This is what Field_string::store() does.
Fixed Field_string::get_key_image() to do the same.
2007-06-07 10:08:44 +03:00
ramil/ram@mysql.com/ramil.myoffice.izhnet.ru
2b2a80733d Fix for bug #28652: MySQL (with-debug=full) asserts when alter table operations
Problem: we may create a deadlock committing changes in the mysql_alter_table() when 
LOCK_open is set. Moreover, "in some variants of the ALTER TABLE commit
happens earlier, outside of LOCK_open, in other later - inside. It's no good, a storage 
engine code that is called in between could expect a consistency - either there is a 
transaction or there is not".
Fix: move the commit to happen earlier and outside of the LOCK_open.
2007-06-01 22:53:50 +05:00
igor@olga.mysql.com
fea67e6868 Merge olga.mysql.com:/home/igor/dev-opt/mysql-4.1-opt-bug28272
into  olga.mysql.com:/home/igor/dev-opt/mysql-5.0-opt-bug28272
2007-05-15 13:16:10 -07:00
igor@olga.mysql.com
268be06874 Fixed bug #28272: crash that occurs when running an EXPLAIN command
for a query over an empty table right after its creation. 
The crash is the result of an attempt made by JOIN::optimize to evaluate
the WHERE condition when no records have been actually read.
The added test case can reproduce the crash only with InnoDB tables and
only with 5.0.x.
2007-05-14 23:55:18 -07:00
igor@olga.mysql.com
53888b4282 Fixed bug #28189: in some rare cases optimizer preferred a more expensive
ref access to a less expensive range access. 
This occurred only with InnoDB tables.
2007-05-10 00:06:24 -07:00
holyfoot/hf@mysql.com/hfmain.(none)
e2f6bd86b4 Merge bk@192.168.21.1:mysql-5.0
into  mysql.com:/d2/hf/mrg/mysql-5.0-opt
2007-04-29 18:42:50 +05:00
gshchepa/uchum@gshchepa.loc
85d70a9652 Merge gshchepa.loc:/home/uchum/work/bk-trees/mysql-4.1-opt
into  gshchepa.loc:/home/uchum/work/bk-trees/mysql-5.0-opt-13191
2007-04-29 08:51:51 +05:00
gshchepa/uchum@gshchepa.loc
3adcb94ede Fixed bug #13191.
INSERT...ON DUPLICATE KEY UPDATE may cause error 1032: 
"Can't find record in ..." if we are inserting into
InnoDB table unique index of partial key with
underlying UTF-8 string field.

This error occurs because INSERT...ON DUPLICATE uses a wrong
procedure to copy string fields of multi-byte character sets
for index search.
2007-04-29 04:16:17 +05:00
gshchepa/uchum@gshchepa.loc
5983038a66 Fixed bug #27650:
INSERT into InnoDB table may cause "ERROR 1062 (23000): Duplicate entry..."
errors or lost records after multi-row INSERT of the form:
"INSERT INTO t (id...) VALUES (NULL...) ON DUPLICATE KEY UPDATE id=VALUES(id)",
where "id" is an AUTO_INCREMENT column.

It happens because InnoDB handler forgets to save next insert id after
updating of auto_increment column with new values. As result of that
last insert id stored inside InnoDB dictionary tables differs from it's
cached thd->next_insert_id value.
2007-04-26 02:01:23 +05:00
tsmith@quadxeon.mysql.com
2272cad3f4 innodb_mysql.test, innodb_mysql.result:
Fix test case: add drop table
2007-04-20 00:20:57 +02:00
tsmith@quadxeon.mysql.com
be9c660729 innodb_mysql.test, innodb_mysql.result:
Add test case for Bug #27210: INNODB ON DUPLICATE KEY UPDATE
2007-04-19 22:38:12 +02:00
igor@olga.mysql.com
976e747aaf Fixed bug #26159.
A wrong order of statements in QUICK_GROUP_MIN_MAX_SELECT::reset
caused a crash when a query with DISTINCT was executed by a loose scan
for an InnoDB table that had been emptied.
2007-02-10 23:55:56 -08:00
tsmith/tim@siva.hindu.god
0d5dc51438 Added innodb_rollback_on_timeout option to restore the 4.1
InnoDB timeout behavior (Bug #24200)
2006-12-19 16:57:51 -07:00
cmiller@zippy.cornsilk.net
af5acac047 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0-maint
2006-11-02 17:39:52 -05:00
cmiller@zippy.cornsilk.net
c34f3219b3 Merge bk-internal.mysql.com:/home/bk/mysql-4.1
into  zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-4.1-maint
2006-11-02 17:27:42 -05:00
msvensson@shellback.(none)
e8c7f19179 Improve comments around FLUSH STATUS
It's not possible to flush the global status variables in 5.0
Update test case so it works by recording the value of handle_rollback
before and compare it to the value after
2006-10-30 13:35:57 +01:00
kroki/tomash@moonlight.intranet
99baff565e Merge moonlight.intranet:/home/tomash/src/mysql_ab/mysql-5.0
into  moonlight.intranet:/home/tomash/src/mysql_ab/mysql-5.0-bug18819
2006-10-25 20:16:39 +04:00
kroki/tomash@moonlight.intranet
2c03444971 Fix after manual merge. 2006-10-25 20:09:31 +04:00
kroki/tomash@moonlight.intranet
c8bb2f396a Merge moonlight.intranet:/home/tomash/src/mysql_ab/mysql-4.1-bug18819
into  moonlight.intranet:/home/tomash/src/mysql_ab/mysql-5.0-bug18819
2006-10-25 20:00:51 +04:00
kroki/tomash@moonlight.intranet
b7b991cec3 BUG#18819: DELETE IGNORE hangs on foreign key parent delete
If the error happens during DELETE IGNORE, nothing could be send to the
client, thus leaving it frozen expecting the reply.

The problem was that if some error occurred, it wouldn't be reported to
the client because of IGNORE, but neither success would be reported.

MySQL 4.1 would not freeze the client, but will report

  ERROR 1105 (HY000): Unknown error

instead, which is also a bug.

The solution is to report success if we are in DELETE IGNORE and some
non-fatal error has happened.
2006-10-25 19:53:26 +04:00
tsmith/tim@siva.hindu.god
3af2089b13 Merge siva.hindu.god:/usr/home/tim/m/bk/g50
into  siva.hindu.god:/usr/home/tim/m/bk/50
2006-10-24 14:42:08 -06:00
msvensson@neptunus.(none)
179c17adfa Merge neptunus.(none):/home/msvensson/mysql/bug22436/my50-bug22436
into  neptunus.(none):/home/msvensson/mysql/mysql-5.0-maint
2006-10-19 01:01:54 +02:00
msvensson@shellback.(none)
ffc9538bb4 Merge shellback.(none):/home/msvensson/mysql/mysql-4.1-maint
into  shellback.(none):/home/msvensson/mysql/mysql-5.0-maint
2006-10-14 19:55:06 +02:00
kaa@polly.local
8c88bb4eaa Merge polly.local:/tmp/maint/bug22728/my41-bug22728
into  polly.local:/home/kaa/src/maint/m41-maint--07OGk
2006-10-12 13:39:52 +04:00
kaa@polly.local
456fe01d7e Fix for bug #22728 "Handler_rollback value is growing".
The bug is present only in 4.1, will be null-merged to 5.0

For InnoDB, check value of thd->transaction.all.innodb_active_trans instead of thd->transaction.stmt.innobase_tid to see if we really need to rollback.
2006-10-11 12:44:03 +04:00
gkodinov/kgeorge@macbook.local
13633864bb Bug #22781: SQL_BIG_RESULT fails to influence sort plan
Currently SQL_BIG_RESULT is checked only at compile time.
 However, additional optimizations may take place after
 this check that change the sort method from 'filesort'
 to sorting via index. As a result the actual plan
 executed is not the one specified by the SQL_BIG_RESULT
 hint. Similarly, there is no such test when executing
 EXPLAIN, resulting in incorrect output.
 The patch corrects the problem by testing for
 SQL_BIG_RESULT both during the explain and execution
 phases.
2006-10-09 19:51:41 +04:00
msvensson@neptunus.(none)
485772e308 Bug#22436 Four tests require "innodb" to be configured, fail in "classic" build
- Disable warnings when creating the "innodb" tables if it works anyway.
 - Move test that are really innodb dependent to innodb_mysql
2006-09-28 15:13:40 +02:00
gkodinov/kgeorge@macbook.gmz
7eaa08e092 Merge bug #16792 4.1->5.0 2006-09-05 19:07:55 +03:00
sergefp@mysql.com
e3bdd6c6c2 Fix by Georgi Kodinov:
Bug #18744 Test 'join_outer' fails if "classic" configuration in 5.0
 - moved an InnoDB dependent test to the appropriate file
2006-08-21 14:20:03 +04:00
sergefp@mysql.com
f68d8cf994 BUG#21077: 4.1->5.0 merge 2006-08-15 21:16:02 +04:00
sergefp@mysql.com
86c5cad4e0 BUG#21077: Possible crash caused by invalid sequence of handler::* calls:
The crash was caused by invalid sequence of handler::** calls:                                                           
  ha_smth->index_init();                                                                                                 
  ha_smth->index_next_same(); (2)                                                                                        
(2) is an invalid call as it was not preceeded by any 'scan setup' call
like index_first() or index_read(). The cause was that QUICK_SELECT::reset()
didn't "fully reset" the quick select- current QUICK_RANGE wasn't forgotten,
and quick select might attempt to continue reading the range, which would
result in the above mentioned invalid sequence of handler calls.

5.x versions are not affected by the bug - they already have the missing
"range=NULL" clause.
2006-08-15 20:33:14 +04:00
gkodinov/kgeorge@macbook.gmz
a64f67bc4a Merge macbook.gmz:/Users/kgeorge/mysql/work/B17212-4.1-opt
into  macbook.gmz:/Users/kgeorge/mysql/work/B17212-5.0-opt
2006-07-14 11:20:52 +03:00
gkodinov/kgeorge@macbook.gmz
5079d5cf6a Bug #17212 results not sorted correctly by ORDER BY when using index
* don't use join cache when the incoming data set is already ordered
    for ORDER BY
    This choice must be made because join cache will effectively
    reverse the join order and the results will be sorted by the index
    of the table that uses join cache.
2006-07-12 10:57:38 +03:00
gkodinov@mysql.com
d81a8437e4 Bug #18742: Test 'group_min_max' fails if "classic" configuration in 5.0
Moved the InnoDB related tests to innodb_mysql
2006-05-23 16:43:01 +03:00
gkodinov@mysql.com
b357c232fc Bug#18745: Test case 'func_group' fails if "classic" 5.0 configuration
Moved the InnoDB related test from func_group.test to innodb_mysql.test
2006-05-22 16:10:53 +03:00