Commit graph

527 commits

Author SHA1 Message Date
marko
f3a8c1a641 Replace mysql_byte with uchar and remove the #define mysql_byte from
ha_innodb.cc.  This cleanup was made possible as of r1550:

Merge changes from MySQL AB:

ChangeSet@2007-05-10 12:59:39+03:00, monty@mysql.com 
  WL#3817: Simplify string / memory area types and make things more consistent
  (first part)
  
  The following type conversions was done:
  
  - Changed byte to uchar
...
2007-08-15 12:29:46 +00:00
marko
5e267bd9fd ibuf0ibuf.c: Remove the unused prototype for dict_index_print_low()
that was inadvertently added in r832.
2007-08-15 06:06:52 +00:00
vasil
4df8f3bbd9 Fix typo in comment. 2007-08-14 08:32:12 +00:00
marko
b44eab8eea lock_number_of_rows_locked(): Fix a typo in comment, and make the comments
in lock0lock.c and lock0lock.h identical.  The typo was incorrectly fixed in
r1623.
2007-08-01 10:35:06 +00:00
marko
1646ac7555 check_trx_exists(): Remove a redundant function call and assignment that
was added by someone at MySQL.
2007-07-31 18:46:55 +00:00
marko
f51a14a1ab recv_init_crash_recovery(): remove trailing white space 2007-07-31 07:55:06 +00:00
marko
645f111017 Merge a change from MySQL AB:
ChangeSet@1.1810.3176.1  2007-07-20 14:17:15+03:00  gkodinov@magare.gmz

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.

ha_innodb.cc@1.202.46.1  2007-07-20 14:17:14+03:00  gkodinov@magare.gmz

Bug #29644: reverse the (now excessive) fix
for bug 17264 (but leave the test case).
2007-07-31 06:45:39 +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
e711ed4fc0 lock_queue_iterator_get_prev(): Remove the unused local variable bit_no. 2007-07-30 18:51:59 +00:00
vasil
1a49f127c3 * Use START_REV instead of $(($1 + 1)) and END_REV instead of $2
* Use standard while-loop instead of the seq command
2007-07-24 06:45:26 +00:00
sunny
08a1857151 Fix for bug# 16979, this is a major change in InnoDB auto-inc handling. There
is one test that fails as of this commit. The updated test case should be
part of the snapshot from MySQL shortly.

Fix for bug# 27950 - Init AUTOINC from delete_row().

Fix for bug# 28781 - Use value specified by MySQL, in update_row().

Summary of structural changes:
==============================
InnoDB needs to hold a table level lock for AUTOINC allocations to overcome
the non-determinism inherent in MySQL SBR for INSERT ... SELECT. In this fix 
for simple INSERT statements (including multi-value inserts), we try and avoid
acquiring the special AUTOINC table level lock unless another transaction has
already reserved the AUTOINC table level lock, in which case we fall back
to the old behavior of acquiring the AUTOINC table level lock.

The max AUTOINC value is now read directly using the low level interface
of InnoDB.
2007-07-24 01:42:16 +00:00
vasil
c5025f7adc Introduce a lock queue iterator for easy (and opaque) traversing of lock
queues. Supports table and record lock queues via the same interface.

There is only "get previous" method because currently there is no need
for "get next" - it would be unused. Feel free to add one if needed.

Approved by:	Heikki
2007-07-17 15:08:04 +00:00
vasil
8e563df08b Convert date to an unambiguous format. 2007-07-17 13:58:16 +00:00
vasil
1c154d4c6b Move lock_get_type() from lock/lock0lock.c to include/lock0priv.ic:
* lock0lock.c: remove lock_get_type() and include include/lock0priv.ic
* lock0priv.h: include lock0priv.ic and add lock_get_type() prototype
* Makefile.am: add lock0priv.ic to noinst_HEADERS
* lock0priv.ic: introduce this new file containing the body of
  lock_get_type()

This move is necessary in order to use lock_get_type() from other lock/
source files (it's going to be used in lock/lock0iter.c).

Approved by:	Heikki
2007-07-17 13:41:51 +00:00
vasil
8cd3c96e09 Convert date to an unambiguous format. 2007-07-17 12:43:09 +00:00
vasil
9131869da0 Add include/lock0priv.h to noinst_HEADERS in Makefile.am. 2007-07-17 07:42:43 +00:00
vasil
5b8c862e1e Move lock_rec_find_set_bit() and lock_rec_get_prev() from
lock/lock0lock.c to include/lock0priv.h and make them non-static.
They will be used in lock/lock0iter.c.

Approved by:	Heikki
2007-07-16 13:49:20 +00:00
vasil
bf4eca4dab Wrap to 72 chars. 2007-07-16 12:48:45 +00:00
vasil
a3aed4bd2d Add "const" qualifiers to lock_get_type() and lock_get_mode().
Approved by:	Sunny
2007-07-16 11:36:01 +00:00
vasil
147b4d43b2 lock_has_to_wait() is needed in the INFORMATION_SCHEMA implementation
in order to determine which lock is blocking which. Make it non-static
and put its definition in include/lock0lock.h.

Approved by:	Heikki (via IM)
2007-07-13 12:15:14 +00:00
vasil
2af39365d6 Cosmetic: indent comments so all of them start on one column.
Suggested by:	Sunny
2007-07-13 11:09:57 +00:00
vasil
1af2dbed12 Move lock_*struct structures from lock/lock0lock.c to include/lock0priv.h.
This is needed in order to add more code to lock/ that uses members of
these structures (internal to the lock module) but in a separate file,
rather than lock0lock.c. lock0lock.c is a way too big already.

Approved by:	Sunny
2007-07-13 11:04:53 +00:00
sunny
cc454ad4fb Fix change missed as part of Bug# 15815. Use a function to check if a block
needs to be made younger.
2007-07-10 21:29:56 +00:00
vasil
dafdda2f14 Fix typo in comment. 2007-07-09 13:19:51 +00:00
vasil
3213282718 Fix Bug#29155 by enabling file locking on FreeBSD.
It has been disabled because InnoDB has refused to start on
FreeBSD & LinuxThreads, but now it starts just fine.

Approved by:	Heikki
2007-06-27 13:56:34 +00:00
inaam
d5ffc8ea1e Bug#23710
At InnoDB startup consider the case where log scan went beyond checkpoint_lsn as a crash and initiate crash recovery code path.

reviewed by: Heikki
2007-06-26 16:54:07 +00:00
vasil
88662a2da4 Fix Bug#29097 "fsp_get_available_space_in_free_extents() is capped at 4TB"
by typecasting the variables before multiplying them, so that the result of
the multiplication is of type "unsigned long long".

I verified this fix by creating a sparse file of 6TB and forcing InnoDB to
use it without overwriting it with zeroes (by commenting the code that
overwrites :newraw files).

New type ullint is introduced with the sole purpose of shortening
"unsigned long long", please do not define it to something else than
"unsigned long long".

Approved by:	Heikki
2007-06-26 13:08:11 +00:00
vasil
19ffb74a9c Add some comments.
Approved by:	Heikki (via IM)
2007-06-21 12:29:42 +00:00
marko
52658b5bea trx_commit_for_mysql(): Avoid acquiring and releasing kernel_mutex when
trx->sess or trx_dummy_sess is non-NULL.
2007-06-21 12:14:04 +00:00
marko
0e5d8e855c Port extra Valgrind instrumentation (UNIV_DEBUG_VALGRIND) from branches/zip. 2007-06-14 08:34:23 +00:00
marko
db26a7e13f innodb_check_for_record_too_big_error(): Divide the return value of
page_get_free_space_of_empty_noninline() by 2.  Until r1571, that function
did not return the same value as page_get_free_space_of_empty().
2007-06-13 10:18:12 +00:00
marko
a3a3d6cda4 create_table_def(): Eliminate the inline function call to dict_table_is_comp()
that was introduced in r1571.  Inlining is disabled in ha_innodb.cc.
2007-06-13 09:02:58 +00:00
marko
640246e6a0 Fix a severe bug that was introduced in r1422 when fixing Bug #21101.
When creating an index containing a too long record, InnoDB would
dereference a NULL pointer when trying to determine the maximum row length.

innodb_check_for_record_too_big_error(): Replace the dict_table_t*
parameter with a Boolean flag.  There is not always a dict_table_t object
when this function is called.

page_get_free_space_of_empty_noninline(): Move the definition and
declaration from row0mysql (!) to page0page.  Make the signature
identical with page_get_free_space_of_empty().

create_clustered_index_when_no_primary(): Add the parameter "comp".
Remove unnecessary casts.
2007-06-12 09:51:03 +00:00
vasil
5ce26f77b8 Fix some in:/out: comments.
Approved by:	Marko
2007-06-12 06:53:29 +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
marko
1c74a62860 rec_get_converted_size_new(): The total size of the infimum and supremum
records in ROW_FORMAT=COMPACT is REC_N_NEW_EXTRA_BYTES + 8.  The
REC_N_NEW_EXTRA_BYTES was accidentally omitted in r1546.  This function
should never be called on those records, though.
2007-06-06 11:18:33 +00:00
vasil
00255d962b Fix Bug#20090 as suggested in the bug followup by Heikki.
Approved by:	Heikki
2007-06-04 14:00:44 +00:00
marko
a837a4df1e ha_innobase::innobase_read_and_init_auto_inc(): Remember and restore
prebuilt->sql_stat_start.  In an ALTER TABLE statement in the innodb_gis
test, an ut_ad() assertion failed, because no IX lock had been acquired
on the table, because prebuilt->sql_stat_start was inadvertently reset
to FALSE, by this function.  This function was called via
ha_innobase::info() and mysql_prepare_alter_table().
2007-06-04 12:25:32 +00:00
marko
935ac4c285 Merge changes from MySQL AB:
ChangeSet@2007-05-10 12:59:39+03:00, monty@mysql.com 
  WL#3817: Simplify string / memory area types and make things more consistent
  (first part)
  
  The following type conversions was done:
  
  - Changed byte to uchar
  - Changed gptr to uchar*
  - Change my_string to char *
  - Change my_size_t to size_t
  - Change size_s to size_t
  
  Removed declaration of byte, gptr, my_string, my_size_t and size_s. 
[...]
ha_innodb.cc:
  Removed some old types
  Updated hash-get-key function arguments
  Added missing casts for alloc() and printf()
  Removed some not needed casts

ha_innodb.h:
  Removed some old types
2007-06-04 08:45:27 +00:00
marko
3b705b44e4 When buffering an insert to a prefix index of a variable-length column,
do not incorrectly mark the column as fixed-length.  (Bug #28138)

ibuf_entry_build(): Instead of prefix_len, pass fixed_len to
dtype_new_store_for_order_and_null_size().  Add debug assertions.

btr_index_rec_validate(): Correct a comment about prefix indexes.

rec_get_converted_size_new(), rec_convert_dtuple_to_rec_new(): Add
debug assertions and comments.

dict_col_type_assert_equal(): New debug function.
2007-06-01 06:01:15 +00:00
inaam
3b74dd4a61 Do not return error in ha_innobase::info if srv_force_recovery >= 4. This is to allow for
normal processing of the query by MySQL instead of generating an error.

Reviewed by: Heikki
2007-05-29 13:16:47 +00:00
vasil
1fa6587e76 Change the comment to a more appropriate one. Discussed with Heikki on IM.
Approved by:	Heikki
2007-05-29 12:38:20 +00:00
marko
253091ec2c Document that DICT_MAX_INDEX_COL_LEN must not be changed. 2007-05-29 12:10:44 +00:00
marko
36067bedd6 logs_empty_and_mark_files_at_shutdown(): Remove trailing whitespace that
was added in r1521.
2007-05-29 08:45:31 +00:00
marko
a808cafee8 srv_lock_timeout_and_monitor_thread(): Correct the indentation that was
broken in r1521.
2007-05-29 08:41:59 +00:00
marko
7b3e53b444 rec_get_converted_size_new(): Simplify and move a debug assertion. 2007-05-29 07:25:16 +00:00
marko
7fd3f2e45e Revert r799, which was supposed to prevent similar cases as Bug #21638.
In reality, the patch breaks the handling of prefix indexes of
variable-length columns in ROW_FORMAT=COMPACT.  Reverting the patch
is only a partial fix of Bug #28138.
2007-05-28 11:29:45 +00:00
marko
1168959c78 Define an auxiliary macro UT_BITS_IN_BYTES() and use it where possible. 2007-05-28 11:10:41 +00:00
marko
aa2ef7454a Cleanup in ha_innodb.cc:
thd_is_replication_slave_thread(), thd_has_edited_nontrans_tables():
Remove blank line between the function comment and the function
definition.  There should be exactly one line between the return
type and the function comment, and this line should be one of
'', 'static', 'UNIV_INLINE', and 'extern "C"'.
2007-05-28 11:07:03 +00:00