Commit graph

88 commits

Author SHA1 Message Date
vasil
d2914449ab branches/5.1:
Fix Bug#34300 Tinyblob & tinytext fields currupted after export/import and alter in 5.1

Copy the BLOB fields, that are stored internally, to a safe place
(prebuilt->blob_heap) when converting a row from InnoDB format to
MySQL format in row_sel_store_mysql_rec().

The bug was introduced in:

 ------------------------------------------------------------------------
 r587 | osku | 2006-05-23 15:35:58 +0300 (Tue, 23 May 2006) | 3 lines
 
 Optimize BLOB selects by using prebuilt->blob_heap directly instead of first
 reading BLOB data to a temporary heap and then copying it to
 prebuilt->blob_heap.
 ------------------------------------------------------------------------

Approved by:	Heikki
2008-03-26 16:26:54 +00:00
vasil
7609df7f55 branches/5.1:
Fix Bug#35220 ALTER TABLE too picky on reserved word "foreign".
 
In ALTER TABLE, change the internal parser to search for
``FOREIGN[[:space:]]'' instead of only ``FOREIGN'' when parsing
ALTER TABLE ... DROP FOREIGN KEY ...; otherwise it could be mistaken
with ALTER TABLE ... DROP foreign_col;
 
Approved by:	Heikki
2008-03-18 07:35:30 +00:00
vasil
b7986bd8ca branches/5.1:
Merge changes from MySQL AB.
2008-03-11 16:50:50 +00:00
sunny
394ccdb715 branches/5.1: Checked in the wrong test results in r2353. This commit has
the correct result set.
2008-03-11 14:20:59 +00:00
sunny
b657301e96 branches/5.1: Change the InnoDB autoinc type to ulint64. For this added a
new typedef to univ.i (ib_ulonglong). Added checks for overflow and removed
the assertion where it crashed previously, since the type has now changed
to unsigned, it doesn't make sense to check for < 0. Added new tests, to
check for overflow, for the different INT types supported for both
signed and unsigned.

Fixes Bug# 34335
2008-03-05 20:23:39 +00:00
sunny
1e130ba621 branches/5.1: Fix Bug# 34920. We need to use/inherit the passed in autoinc
counter for ALTER TABLE statements too.
2008-03-03 22:50:15 +00:00
vasil
613bcee7ca branches/5.1:
Fix Bug#34053:
* In CREATE TABLE and DROP TABLE check whether the table in question is one
  of the magic innodb_monitor tables and whether the user has enough rights
  to mess with it before doing anything else.
* Implement a mysql-test testcase.

Approved by:	Heikki
2008-02-07 12:02:06 +00:00
marko
4670ad0ed0 branches/5.1:
innodb.result: Fix results after merging changes from MySQL.  Maybe some
changes were incorrectly merged in the past?
2008-01-28 14:37:09 +00:00
marko
f9539c1736 branches/5.1: Merge a change from MySQL AB:
ChangeSet@2007-11-27 09:25:45+01:00, istruewing@stella.local 
Bug#32754 - InnoDB tests do not prepare or clean up correctly
    
Some test cases were missing preparation to deal with failed
predecessor test cases.
    	  
Added preparation (drop table if exists) to some test cases.

innodb-semi-consistent.test: Added preparation (drop table if exists).
2008-01-28 14:07:57 +00:00
marko
fd352f8be7 branches/5.1: Merge a change from MySQL AB:
ChangeSet@2007-10-13 15:49:42+03:00, aelkin@koti.dsl.inet.fi

Bug #29136 erred multi-delete on trans table does not rollback the statement

innodb.test, innodb.result: trans table specific test added
2008-01-28 14:04:10 +00:00
vasil
a202a27f66 branches/5.1:
Merge change from MySQL AB:

ChangeSet@1.2639, 2007-11-23 12:51:14+01:00, mkindahl@dl145h.mysql.com +7 -0
  Post-merge fixes.

  mysql-test/r/innodb.result@1.206, 2007-11-23 12:51:10+01:00, mkindahl@dl145h.mysql.com +1 -1
    Result change.
2008-01-04 15:38:59 +00:00
vasil
f29940035e branches/5.1:
Merge change from MySQL AB:

ChangeSet@1.2616, 2007-12-01 19:55:06+01:00, tnurnberg@mysql.com +8 -0
  Bug#31177: Server variables can't be set to their current values
 
  5.1+ specific fixes (plugins etc.)

  mysql-test/r/innodb.result@1.204, 2007-12-01 19:55:04+01:00, tnurnberg@mysql.com +2 -2
    we throw warnings to the client, yea, verily
2008-01-04 15:29:32 +00:00
vasil
c03aef45ff branches/5.1:
Merge change from MySQL AB:

ChangeSet@1.2557, 2007-11-28 19:43:50+01:00, tnurnberg@mysql.com +21 -0
  Bug#31177: Server variables can't be set to their current values

  Default values of variables were not subject to upper/lower bounds
  and step, while setting variables was. Bounds and step are also
  applied to defaults now; defaults are corrected quietly, values
  given by the user are corrected, and a correction-warning is thrown
  as needed. Lastly, very large values could wrap around, starting
  from 0 again. They are bounded at the maximum value for the
  respective data-type now if no lower maximum is specified in the
  variable's definition.

  mysql-test/r/innodb.result@1.171, 2007-11-28 19:43:48+01:00, tnurnberg@mysql.com +4 -0
    We throw a warning now when we adjust out of range parameters.
2008-01-04 15:17:59 +00:00
vasil
f7434b3823 branches/5.1:
Merge change from MySQL AB:

ChangeSet@1.2612, 2007-11-07 19:59:58+04:00, ramil@mysql.com +6 -0
  Fix for bug #26447: "ALTER TABLE .. ORDER" does not work with InnoDB
  and auto_increment keys

  Problems:
    1. ALTER TABLE ... ORDER BY... doesn't make sence if there's a
       user-defined clustered index in the table.
    2. using a secondary index is slower than using a clustered one
       for a table scan.

  Fixes:
    1. raise a warning.
    2. use the clustered index.

  mysql-test/r/innodb.result@1.203, 2007-11-07 19:59:56+04:00, ramil@mysql.com +15 -15
    Fix for bug #26447: "ALTER TABLE .. ORDER" does not work with InnoDB
    and auto_increment keys
      - results adjusted.
2008-01-04 14:45:16 +00:00
vasil
c4471eefb5 branches/5.1:
Merge change from MySQL AB:

ChangeSet@1.2541, 2007-10-13 15:49:42+03:00, aelkin@koti.dsl.inet.fi +10 -0
  Bug #29136 erred multi-delete on trans table does not rollback the statement
 
  similar to bug_27716, but it was stressed on in the synopsis on that there is another
  side of the artifact affecting behaviour in transaction.

  Fixed with deploying multi_delete::send_error() - otherwise never called - and refining its logic
  to perform binlogging job if needed.

  The changeset includes the following side effects:
  - added tests to check bug_23333's scenarios on the mixture of tables for multi_update;
  - fixes bug@30763 with two-liner patch and a test coinciding to one added for bug_23333.
  
  mysql-test/r/innodb.result@1.171, 2007-10-13 15:49:36+03:00, aelkin@koti.dsl.inet.fi +15 -2
    results changed

  mysql-test/t/innodb.test@1.145, 2007-10-13 15:49:37+03:00, aelkin@koti.dsl.inet.fi +32 -0
    trans table specific test added
2008-01-04 14:18:29 +00:00
marko
0c1f04e89d branches/5.1: Merge r2154 from trunk:
innodb.result, innodb.test: Revert the changes in r2145.

The tests that were removed by MySQL

ChangeSet@1.2598.2.6  2007-11-06 15:42:58-07:00  tsmith@hindu.god

were moved to a new test, innodb_autoinc_lock_mode_zero, which is
kept in the MySQL BitKeeper tree.
2007-12-04 08:33:27 +00:00
marko
da72864792 Revert the changes that were reverted in r2144 to get a source tree that
is an exact match of a MySQL BitKeeper tree.

Apply r2116:
------------------------------------------------------------------------
r2116 | vasil | 2007-11-23 19:10:17 +0200 (pe, 23 marras 2007) | 6 lines

Set trx->mysql_query_str to NULL at transaction commit.
It could be a problem if someone looks at it after that because MySQL may
have free()d it then.

Approved by:    Heikki (via IM)
------------------------------------------------------------------------

innodb.test, innodb.result:
Add some tests that were apparently accidentally removed in
ChangeSet@1.2598.2.6  2007-11-06 15:42:58-07:00  tsmith@hindu.god
Apply snapshot innodb-5.1-ss1989

ha_innodb.cc: Add a decorative comment.
2007-11-30 12:02:40 +00:00
marko
5f8a93a6e1 Make our 5.1 tree an exact copy of the MySQL source tree.
Revert r2116:
------------------------------------------------------------------------
r2116 | vasil | 2007-11-23 19:10:17 +0200 (pe, 23 marras 2007) | 6 lines

Set trx->mysql_query_str to NULL at transaction commit.
It could be a problem if someone looks at it after that because MySQL may
have free()d it then.

Approved by:    Heikki (via IM)
------------------------------------------------------------------------

innodb.test, innodb.result:
Remove some tests that were apparently accidentally removed in
ChangeSet@1.2598.2.6  2007-11-06 15:42:58-07:00  tsmith@hindu.god
Apply snapshot innodb-5.1-ss1989

ha_innodb.cc: Remove a decorative comment.

This tree should be an exact match of the following MySQL source tree:

bk://mysql.bkbits.net/mysql-5.1
ROOTKEY=3985cf0cwNRCED_XNSCA7RvkLPer2Q
TIPKEY=47447c7cTrSPx22mH8PXNmurrycaaw

bkf changes | head

ChangeSet@1.2634.1.2, 2007-11-21 19:42:50+01:00, df@pippilotta.erinye.com +1 -0
  Merge pippilotta.erinye.com:/shared/home/df/mysql/build/mysql-5.0-build
  into  pippilotta.erinye.com:/shared/home/df/mysql/build/mysql-5.1-build
  MERGE: 1.1810.3425.2

ChangeSet@1.1810.3425.2, 2007-11-21 19:41:13+01:00, df@pippilotta.erinye.com +1 -0
  add wrong warning to suppression file

ChangeSet@1.2634.1.1, 2007-11-21 19:33:27+01:00, df@pippilotta.erinye.com +1 -0
  Merge pippilotta.erinye.com:/shared/home/df/mysql/build/mysql-5.0-build
  into  pippilotta.erinye.com:/shared/home/df/mysql/build/mysql-5.1-build
  MERGE: 1.1810.3425.1

ChangeSet@1.1810.3425.1, 2007-11-21 18:11:08+01:00, df@pippilotta.erinye.com +1 -0
  ignore readline warnings

ChangeSet@1.2635, 2007-11-21 15:06:38+01:00, mleich@five.local.lan +6 -0
  Merge five.local.lan:/work/merge/mysql-5.0-build-30418
  into  five.local.lan:/work/merge/mysql-5.1-build-31610
  MERGE: 1.1810.3284.72
2007-11-30 11:45:26 +00:00
marko
ee2625ac11 Merge a change from MySQL AB:
ChangeSet@1.2528.124.3  2007-08-14 15:35:19-06:00  tsmith@hindu.god

Updates to allow innodb.test to be run with --embedded-server,
including a small change to build_table_filename().

innodb.test, innodb.result:

Updates to allow innodb.test to be run with --embedded-server
2007-11-30 09:59:17 +00:00
sunny
0c04ac8522 Fix for Bug# 31860, in the Bug 16979 fix there was an erroneous assertion that
autoincrement columns can't contain negative values. With the fix, the
autoincrement table counter is set to 0 if the maximum value read from
the autoinc column index is negative.

Add test for the bug fix but the test is not really useful as the server
needs to be restarted half way through the test. It has been added for 
reference only.
2007-10-26 16:51:40 +00:00
marko
6c97d0cd5f Set an error code when a deadlock occurs in semi-consistent read. (Bug #31494)
innodb-semi-consistent: New tests for InnoDB semi-consistent reads.
Unfortunately, these will not trigger Bug #31494, because there merely
occur lock wait timeouts, not deadlocks.
2007-10-17 05:36:42 +00:00
sunny
58cc12cea5 Add test for Bug# 21409, the actual bug was fixed in r1334. 2007-09-12 23:24:49 +00:00
sunny
02d91af9e7 Merge a change from MySQL AB:
ChangeSet@1.2536.50.1  2007-08-02 12:45:56-07:00  igor@mysql.com

Fixed bug#28404.
This patch adds cost estimation for the queries with ORDER BY / GROUP BY
and LIMIT.
If there was a ref/range access to the table whose rows were required
to be ordered in the result set the optimizer always employed this access
though a scan by a different index that was compatible with the required
order could be cheaper to produce the first L rows of the result set.
Now for such queries the optimizer makes a choice between the cheapest
ref/range accesses not compatible with the given order and index scans
compatible with it.

innodb.result: Adjusted results for test cases affected fy the fix for
bug #28404.
2007-09-07 00:04:10 +00:00
marko
e29b7172b7 innodb.result: Revert r1655, which should have been reverted as part of r1781. 2007-09-03 08:32:32 +00:00
sunny
ff83c218a1 Fix a test case that was broken after Bug#16979 fix. See r1645 and r1735.
The variable used in the tests below was introduced in r1735.
2007-08-30 07:06:27 +00:00
marko
31ed35c017 Fix the innodb.test failure mentioned in r1654. 2007-07-31 06:24:44 +00:00
marko
e4d8de77af Merge changes from MySQL AB, as of the following changeset:
ChangeSet@1.2567, 2007-07-27 14:44:31+05:00, svoj@june.mysql.com +3 -0
  Merge mysql.com:/home/svoj/devel/mysql/BUG29957/mysql-5.0-engines
  into  mysql.com:/home/svoj/devel/mysql/BUG29957/mysql-5.1-engines
  MERGE: 1.1810.2871.44

One test case in innodb.test fails because of auto-increment
changes in r1562:1653:

$diff innodb.result innodb.reject
504c504
< 3	test2		this will work
---
> 4	test2		this will work
2007-07-31 05:56:17 +00:00
marko
c903a0fb30 mysql-test/innodb_trx_weight.inc: Add username root to the "connect" statement.
The Unix user running mysql-test-run usually does not have any privileges
on the MySQL test database.
2007-06-06 12:13:59 +00:00
vasil
6f3ea31c69 Fix Bug#21293: Consider transactions that had edited non-transactional
tables heavier than ones that had not. This helps killing the "right"
transaction in case of a deadlock.

Approved by:	Heikki
2007-05-15 14:53:04 +00:00
vasil
6c00736c66 Add a test about the behavior introduced in r1497. 2007-05-14 12:41:47 +00:00
sunny
16847025c5 Fix for bug# 21101 - returns wrong error message when table column
defs exceed the max row size.

The fix returns a more appropriate error message. Add a test case to
innodb.test and expected output to innodb.result.
2007-04-11 01:34:33 +00:00
vasil
f90f55b067 Fix the innodb test by shifting some of the contents of the .result file.
Approved by:	Marko
2007-04-10 19:15:03 +00:00
marko
52438c3572 Report the current value of the AUTO_INCREMENT counter to MySQL.
(Bug #23313, Bug #21404)

ha_innobase::update_create_info(): New function, to report
the auto_increment_value.
2007-04-02 07:20:23 +00:00
marko
fda0510090 Merge a change from MySQL AB:
ChangeSet
  2007/02/14 22:06:41-08:00 igor@olga.mysql.com 
  Fixed bug #25971: indexes on text columns were ignored when ref accesses
  were evaluated.
  According to the new rules for string comparison partial indexes on text
  columns can be used in the same cases when partial indexes on varchar
  columns can be used.

mysql-test/r/innodb.result
  2007/02/14 22:06:39-08:00 igor@olga.mysql.com +1 -1
  Adjusted results after the fix for bug #25971.
2007-03-27 05:49:15 +00:00
marko
07bc65223b Merge a change from MySQL AB:
ChangeSet
  2007/02/15 15:39:03+01:00 guilhem@gbichot3.local 
  Fix for BUG#25507 "multi-row insert delayed + auto increment causes
  duplicate key entries on slave" (two concurrrent connections doing
  multi-row INSERT DELAYED to insert into an auto_increment column,
  caused replication slave to stop with "duplicate key error" (and
  binlog was wrong)), and BUG#26116 "If multi-row INSERT
  DELAYED has errors, statement-based binlogging breaks" (the binlog
  was not accounting for all rows inserted, or slave could stop).
  The fix is that: if (statement-based) binlogging is on, a multi-row
  INSERT DELAYED is silently converted to a non-delayed INSERT.
  Note: it is not possible to test BUG#25507 in 5.0 (requires mysqlslap),
  so it is tested only in the changeset for 5.1. However, BUG#26116
  is tested here, and the fix for BUG#25507 is the same code change.

mysql-test/r/innodb-replace.result
  2007/02/15 15:39:01+01:00 guilhem@gbichot3.local +2 -2
  result update

mysql-test/t/innodb-replace.test
  2007/02/15 15:39:01+01:00 guilhem@gbichot3.local +2 -2
  now that multi-row delayed inserts are converted to normal inserts
  if the statement-based binlog is enabled,
  no error is issued even if this engine does not support INSERT DELAYED,
  as the insert does not go through the INSERT DELAYED code.
  To preserve the goal of this test, we change the statements to single-
  row inserts.
2007-03-27 05:45:32 +00:00
marko
a895ccc20a Port r1372 from branches/5.0: Merge a change from MySQL AB, and remove
the innodb_gis test case.

ChangeSet
  2007/02/19 13:57:06+03:00 kaa@polly.local
  Bug#18743: Several test cases fails if "classic" configuration in 5.0
  The problem happened because those tests were using "cp932" and "ucs2"
  without checking whether these character sets are available.
  This fix moves test parts to make character set specific parts be
  tested only if they are:
  - some parts were moved to "ctype_ucs.test" and "ctype_cp932.test"
  - some parts were moved to the newly added tests "innodb-ucs2.test",
  "mysqlbinglog-cp932.test" and "sp-ucs2.test"

mysql-test/t/innodb.test
  2007/02/19 13:57:02+03:00 kaa@polly.local +0 -222
  Moved ucs2-specific test cases to innodb-ucs2.test
2007-03-27 05:37:36 +00:00
marko
2de9fc6eac innodb.test, innodb.result: Add test case for Bug #26835.
The bug could be reproduced as follows:

Define a table so that the first column of the clustered index is
a VARCHAR or a UTF-8 CHAR in a collation where sequences of bytes
of differing length are considered equivalent.

Insert and delete a record.  Before the delete-marked record is
purged, insert another record whose first column is of different
length but equivalent to the first record.  Under certain conditions,
the insertion can be incorrectly performed as update-in-place.

Likewise, an operation that could be done as update-in-place can
unnecessarily be performed as delete and insert, but that would not
cause corruption but merely degraded performance.
2007-03-05 15:43:58 +00:00
marko
c757f2ab96 Merge changes from MySQL AB to mysql-test directives.
The results are not affected.
2007-03-02 13:23:21 +00:00
marko
1a72a3da1f Add a test case for r1316 (Bug #25927). 2007-03-01 09:59:37 +00:00
marko
213456bf8c Merge changes from MySQL AB:
ChangeSet
  2007/01/24 14:49:36+04:00 holyfoot@mysql.com 
  bug #22682 Test fails --without-geometry
  geometry dependent parts moved to proper .test files

mysql-test/r/innodb.result
  2007/01/24 14:49:34+04:00 holyfoot@mysql.com +0 -2
  result fixed

mysql-test/r/innodb_gis.result
  2007/01/24 14:49:34+04:00 holyfoot@mysql.com +2 -0
  result fixed

mysql-test/t/innodb.test
  2007/01/24 14:49:34+04:00 holyfoot@mysql.com +0 -6
  HAVE_GEOMETRY dependent part moved to innodb_gis.test

mysql-test/t/innodb_gis.test
  2007/01/24 14:49:35+04:00 holyfoot@mysql.com +6 -0
  HAVE_GEOMETRY dependent part moved here from innodb.test
2007-02-07 09:57:17 +00:00
marko
1776e2e961 Merge changes from MySQL AB:
ChangeSet
  2007/01/22 18:42:52+02:00 monty@mysql.com 
  Give warnings for unused objects
  Changed error message to be compatible with old error file
  Added new error message for new DUP_ENTRY syntax

mysql-test/t/innodb.test
  2007/01/22 18:42:49+02:00 monty@mysql.com +14 -14
  Changed to use new error message
2007-02-07 09:48:42 +00:00
osku
32a562e188 Delete innodb_mysql.[test|result], as keeping them in our codebase achieves
nothing but more merge work for us.
2007-01-12 12:18:53 +00:00
marko
311365684f dict_load_foreign(): Use a local variable instead of the 10-bit field
foreign->n_fields in order to preserve ON UPDATE CASCADE and
ON DELETE CASCADE flags.  For some reason, gcc does not warn about
shifting a 10-bit field to right by 24 bits.  (Bug #24741)

This bug was introduced while reducing the memory footprint of the
InnoDB data dictionary (Bug #20877).

innodb.test, innodb.result: Add a test case.
2007-01-09 07:40:40 +00:00
marko
caf26af033 Merge changes from MySQL AB to innodb_mysql.result. 2006-11-09 16:50:10 +00:00
marko
197e6a0723 innodb.result, innodb_mysql.result: Merge changes from MySQL AB:
ChangeSet
  2006/10/09 19:51:41+04:00 gkodinov@macbook.local 
  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-26 11:37:56 +00:00
marko
e8bcfd5ede Merge changes from MySQL AB, and remove two compilation warnings.
ha_innodb.cc: innodb_mutex_show_status(): Add (ulong) casts to
ulonglong expressions being passed to fprintf %lu.  The warnings
were apparently introduced by MySQL AB developers.

mysql_declare_plugin(innobase): Add PLUGIN_LICENSE_GPL.

have_innodb.inc: Merge changes from MySQL AB.
2006-10-09 09:08:50 +00:00
marko
a3a432119d Merge changes to mysql-test from MySQL AB.
innodb_unsafe_binlog, innodb_handler, innodb-big, innodb_cache-master,
innodb-deadlock, innodb_cache: Remove.  These have been renamed in the
MySQL tree.

innodb_mysql: Update.
2006-10-05 09:07:49 +00:00
marko
e8a1b21d25 Merge changes from MySQL AB to the innodb_mysql test. 2006-09-20 10:52:02 +00:00
marko
9d56e60d97 Merge changes to the "innodb_mysql" test from MySQL AB 2006-09-05 19:29:18 +00:00
marko
f91cf1eb30 Merge changes from MySQL AB to the innodb_mysql test files. 2006-09-05 12:18:27 +00:00