Commit graph

527 commits

Author SHA1 Message Date
inaam
604e23bcdc Undo bad space formatting introduced in earlier commit r1521
spotted by: Marko
2007-05-25 18:00:57 +00:00
marko
06145ee3a3 trx0trx.c: Add missing #include "ha_prototypes.h". 2007-05-23 09:58:05 +00:00
inaam
b1b1002a71 Forward port r1520 from branches/5.0
Patch to allow monitor threads to stop before proceeding with normal shutdown. 
Also have a separate time counter for tablespace monitor.

reviewed by: Heikki
2007-05-23 01:23:34 +00:00
vasil
c10dd8440a Split ut_a(a && b [&& c...]); into separate ut_a(a); ut_a(b); [ut_a(c); ...].
This makes it possible to see which expression was false by looking at the
error message.

Approved by:	Marko
2007-05-21 13:43:36 +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
vasil
4997e9b268 Add the number of locks acquired by a transaction to its weight when
choosing the lightest transaction to kill when a deadlock occurs.
This fixes Bug#21293 partially.

Approved by:	Heikki
2007-05-14 12:40:21 +00:00
marko
a3208f4239 ha_innobase::extra(): Replace references to prebuilt->trx with
thd_to_trx(ha_thd()), in order to avoid potential memory corruption.
2007-05-14 11:25:41 +00:00
marko
a8c23d1423 Introduce the function reset_template() for resetting some fields of
row_prebuilt_t; currently prebuilt->read_just_key and
prebuilt->keep_other_fields_on_keyread.
2007-05-14 11:08:44 +00:00
marko
7b191edf34 ha_innodb.cc: Remove the declarations of some global InnoDB variables
whose name starts with srv_.  These variables are declared in the header
files that are covered by #include directives in ha_innodb.cc.
2007-05-14 07:12:31 +00:00
vasil
6f64bbe8e1 Convert innobase_buffer_pool_size and innobase_log_file_size types from
longlong to long long because MYSQL_SYSVAR_LONGLONG marco expects long long
type.

Also change
((ulint)innobase_buffer_pool_size) / 1024
to
(ulint)(innobase_buffer_pool_size / 1024)
and remove comment which is no longer true.

Provided that innobase_buffer_pool_size is always 64bits these statements
are equivalent if ulint is 64 bit (well it will screw up if
innobase_buffer_pool_size is negative). And if ulint is 32 bit the later
variant gives a little more chance that the value will fit.

Approved by:	Heikki
2007-05-11 15:38:34 +00:00
vasil
6e893730f1 Fix typo in comment. 2007-05-11 11:26:30 +00:00
marko
0188af79a2 Add #include <ctype.h>. Apparently, this header is no longer included by
the common headers.  This may be related to WL#2936
(pluggable storage engines).
2007-05-11 08:43:06 +00:00
marko
9347e855c1 thd_to_trx(), check_trx_exists(): Remove the handlerton parameter. It is a
singleton object whose address is stored into innodb_hton_ptr.
2007-05-10 12:09:03 +00:00
marko
82b81a2987 Make InnoDB pluggable. That is, merge the modifications from MySQL WL#2936
and adapt some things.

Note that ha_innodb.cc depends on mysql_tmpfile() being declared in
<mysql/plugin.h>.  Until the function is declared there, you can
uncomment the buggy definition of mysql_tmpfile in ha_innodb.cc.

Remove storage/innobase/*/Makefile.am.  The whole compilation is driven by
storage/innobase/Makefile.am and storage/innobase/plug.in.

plug.in: Declare InnoDB as a dynamic plugin.

ha_innodb.h: Remove the declarations of many global variables.  The variables
are no longer directly referenced outside of storage/innobase.

trx_t: Add the field trx->duplicates.

trx_create(): Initialize the fields trx->active_trans and trx->duplicates.

innobase_query_is_update(): Remove.  Consult trx->duplicates instead.
2007-05-10 11:31:36 +00:00
vasil
02507a762a Fix typo in comment.
Spotted by:	Marko
2007-05-09 14:09:57 +00:00
vasil
82b74fa33d Improve the comment for trx_struct::undo_no.
Suggested by:	Heikki
2007-05-08 13:34:35 +00:00
marko
4c67c0427f Minor cleanup.
row_ins_check_foreign_constraint(), row_ins_scan_sec_index_for_duplicate():
Make use of the predicates page_rec_is_infimum() and page_rec_is_supremum().
2007-05-08 10:51:03 +00:00
vasil
05c9821a7c Fix Bug#25078 by always letting the replication thread on the slave
server to enter InnoDB. This can be made further customizable by the
user if we introduce a new config parameter. This will wait until
config parameters can be easily added.

Approved by:	Marko
2007-05-08 07:20:02 +00:00
vasil
ea62d3f3bb Fix typo in comment: the exact prototype is in
include/data0type.ic, not in data/data0type.ic
2007-05-03 12:27:08 +00:00
vasil
18e5fe9121 Fix typo in comment. 2007-04-27 09:09:23 +00:00
vasil
f75a4b04a6 Fix typo in the comment. 2007-04-25 04:47:10 +00:00
sunny
b99e00597c Fix Bug#22819, remove assertion. (http://bugs.mysql.com/bug.php?id=22819) 2007-04-23 02:00:46 +00:00
vasil
a909884ad7 Reindent with tabs instead of spaces.
Spotted by:	Marko
2007-04-20 22:51:55 +00:00
vasil
54f780f055 Bugfix: only call innobase_release_temporary_latches() in case of current_thd
is not NULL, otherwise we get NULL pointer dereferencing.

Approved by:	Heikki
2007-04-20 17:51:54 +00:00
vasil
061e01a061 Fix phantom reads (http://bugs.mysql.com/27197) following Heikki's
patch in the bug followup.

Approved by:	Heikki
2007-04-20 14:41:06 +00:00
marko
e2374e8dc7 ha_innodb.cc: Remove ../storage/innobase/include/ prefix from #include
directives.  This could and should have been done when sql/ha_innodb.cc
was renamed to storage/innobase/handler/ha_innodb.cc.
2007-04-19 13:02:21 +00:00
marko
7a1976fd7f Merge a change from MySQL AB:
ChangeSet@2007-04-03 16:13:27+05:00, gluh@mysql.com
  Bug#21432 Database/Table name limited to 64 bytes, not chars,
  problems with multi-byte

==== storage/innobase/handler/ha_innodb.cc ====
2007-04-03 16:13:25+05:00, gluh@mysql.com +2 -2
  removed unnecessary multiplication
2007-04-19 11:44:07 +00:00
marko
35cfa96a67 Merge a change from MySQL AB, to fix a mistake made
in Makefile.am in r1353 by marko (shame on him):

ChangeSet@2007-03-30 06:57:58+02:00, msvensson@pilot.blaudden 
  Add missing \ causing CMakelists.txt etc not to be included in dist
2007-04-19 11:29:38 +00:00
vasil
76e3edbb72 Fix typo which was causing bogus symbolic link *.opt to be created and
make install (in mysql dir) to fail.
2007-04-18 11:35:51 +00:00
vasil
e2f51ed8e6 Potential fix for Bug#25645:
"Move innobase_release_stat_resources(trx) outside the 'if' in
ha_innobase::external_lock(). That would add more safety that whatever
MySQL does at a query end, there would be no risk of a hang on the btr
search latch."

Also call innobase_release_temporary_latches() in the beginning of
ha_innobase::close().

Approved by:	Heikki
2007-04-16 16:27:41 +00:00
vasil
0a0087ed76 Fix typo. 2007-04-12 11:19:36 +00:00
vasil
87f5dfe1cd Fix Bug#9709 by retrying (forever) if ERROR_SHARING_VIOLATION or
ERROR_LOCK_VIOLATION is encountered during file operation.
This is caused by backup software, so InnoDB should retry while the backup
software is done with the file.

Approved by:	Heikki
2007-04-11 17:59:31 +00:00
sunny
5cdc5685d0 Fix code indentation from r1424. 2007-04-11 06:04:11 +00:00
sunny
46f367c1bb Fixed a missing function decoration that slipped into r1422. 2007-04-11 05:35:12 +00:00
sunny
f30895bdfc Bug# 20352. Added variable srv_insert_buffer_batch_size. We want to make
this variable settable. Since the pluggable engine interface currently
doesn't provide a usable mechanism, we will add the latter functionality
once it's available.
2007-04-11 04:12:40 +00:00
sunny
9479a35490 Fix for Bug # 18828. Return DB_TOO_MANY_CONCURRENT_TRXS when we run out
of UNDO slots in the rollback segment. This is a partial fix since the
MySQL error code requested to properly report the error condition back
to the client has not yet materialized. Currently we have #ifdef'd the
error code translation in ha_innodb.cc. This will have to be changed
as and when MySQl add the new requested code or an equivalent code
that we can then use.

Given the above, currently we will get the old behaviour, not the "fixed"
and intended behaviour.
2007-04-11 02:43:56 +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
09fbd1e0cb Output to the error log information about the limitations of
UNIV_IBUF_DEBUG.

innobase_start_or_create_for_mysql(): Note that crash recovery is broken
when UNIV_IBUF_DEBUG is defined.

ibuf_counts[]: Make this a two-dimensional array.  No need to allocate
anything from the heap.  Eliminate ibuf_counts_inited, as the array
will be zero-filled by the runtime environment.

ibuf_count_check(): New function, to print out an explanation before
assertion failure.
2007-04-10 17:58:27 +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
vasil
ba4a168cd0 * Fix Bug#26662 by not open(2)ing with O_DIRECT but rather calling fcntl(2)
to set this flag immediately after open(2)ing. This way an error caused by
O_DIRECT not being supported can easily be ignored.

* Add support for skipping the OS caching on Solaris by calling directio()
instead of fcntl().

Approved by:	Heikki
2007-03-29 19:05:09 +00:00
vasil
3a53d631f4 Merge the bodies of os_file_handle_error() and os_file_handle_error_no_exit()
into a generic function which is called from both os_file_handle_error() and
os_file_handle_error_no_exit()

Approved by:	Marko
2007-03-29 08:37:21 +00:00
marko
05795f53dd innobase_commit(): Correct the comments and formatting that were broken when
innodb_commit_concurrency was implemented.
2007-03-27 17:59:15 +00:00
marko
919b6dcdc6 Remove ha_innobase::last_query_id and references to thd->query_id.
MySQL calls external_lock at the beginning and end of a statement
when it is not calling start_stmt or commit or rollback.  Thus,
statement boundaries can be (and are already) detected without
monitoring thd->query_id.

The function innobase_commit() seemingly lacks the call to
innobase_release_stat_resources(), which should be called at
the end of every SQL statement.  The call was replaced by
equivalent statements by Vadim Tkachenko when he implemented
innodb_commit_concurrency in MySQL 5.0:

http://mysql.bkbits.net:8080/mysql-5.0/?PAGE=patch&REV=1.1886.70.1
2007-03-27 13:17:47 +00:00
marko
49bc0a576c Add static qualifiers to some symbols in ha_innodb.cc that are not
referenced from other modules.
2007-03-27 08:22:27 +00:00
marko
2870d22fc8 Merge a change from MySQL AB:
ChangeSet
  2007/03/20 10:22:15-04:00 iggy@recycle.(none) 
  Post Merge Fix.

storage/innobase/CMakeLists.txt
  2007/03/20 10:22:13-04:00 iggy@recycle.(none) +2 -2
  Post Merge Fix.
2007-03-27 06:03:03 +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