Commit graph

136 commits

Author SHA1 Message Date
vasil
4b325712b3 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
marko
4d1a51bbbe 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
d05c82db6d 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
3b074d7bf5 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
marko
c087e5270e 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
4a814d7081 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
inaam
6b308c0bf5 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
marko
855d39c53d 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
vasil
16a35ea394 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
05cd5bfab5 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
marko
198d55d681 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
a196dc3bce 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
9230d389ff 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
77e0d81d59 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
marko
a031d885a9 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
455e07b6a4 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
bcb68dadb2 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
a9581aee01 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
c8824046f1 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
marko
b04830936f 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
a8db2854f8 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
vasil
0bc5ed331e 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
4cfe26325c Fix typo. 2007-04-12 11:19:36 +00:00
sunny
d6de3007b2 Fixed a missing function decoration that slipped into r1422. 2007-04-11 05:35:12 +00:00
sunny
42d12ae25c 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
f5efdbcf76 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
marko
b9902f7ac5 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
278c29e576 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
4f1615b745 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
0f505f92d1 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
e15454c52a Merge a change from MySQL AB:
ChangeSet@1.2409.1.83  2007-03-06 10:36:15-07:00  tsmith@hindu.god
Bug #26598: Create variable to allow turning off of statistic gathering
on metadata commands

Add innodb_stats_on_metadata option, which enables gathering
index statistics when processing metadata commands such as
SHOW TABLE STATUS.  Default behavior of the server does not
change (this option is enabled by default).
2007-03-26 08:16:35 +00:00
marko
b054fc69b0 Minor cleanup.
innobase_query_caching_of_table_permitted(): Make static.

ha_innobase::register_query_cache_table(): Move the function
definition from ha_innodb.h to ha_innodb.cc.  Add comments.
2007-03-21 10:02:00 +00:00
marko
8ac40ae7a7 class ha_innobase: Replace statistic_increment() with ha_statistic_increment().
ha_innobase::change_active_index(): Do not call current_thd unless
UNIV_DEBUG is defined.
2007-03-19 09:28:49 +00:00
marko
a8b14b8eba Minor cleanup in ha_innodb.cc.
Remove the unused constants HA_INNOBASE_ROWS_IN_TABLE and
HA_INNOBASE_RANGE_COUNT.  Declare innobase_active_counter static.
2007-03-08 07:54:54 +00:00
sunny
b76aeffed9 Fix for Bug# 21409. At low transaction isolation levels we let each
consistent read set its own snapshot
2007-03-05 00:37:57 +00:00
marko
5b7f96f982 Merge changes from MySQL AB:
ChangeSet@1.2452, 2007-02-23 13:13:55+02:00, monty@mysql.com +177 -0
  Fixed compiler warnings
  ...
  Fixed compiler warnings detected on windows64
2007-03-01 15:21:12 +00:00
marko
f74103028f ha_innodb.cc: Remove the unused innobase_repl_ variables. 2007-03-01 13:28:36 +00:00
marko
48d8e9819a ha_innodb.cc: Replace thd->tablespace_op with thd_tablespace_op(thd).
Plugins must treat class THD as an opaque type.
2007-02-15 14:10:41 +00:00
marko
8ea36d5647 ha_innodb.cc: Replace thd->in_lock_tables with thd_in_lock_tables(thd).
Plugins must treat class THD as an opaque type.
2007-02-15 14:09:49 +00:00
marko
6dbc015b33 ha_innodb.cc: Remove all references to thd->ha_data[hton->slot].
thd_to_trx(thd, hton): Accessor for getting the InnoDB trx object
of a MySQL thread object and an InnoDB handlerton.
2007-02-14 20:03:58 +00:00
marko
57990bb42e Remove the declarations of some global functions in ha_innodb.h and declare
them static in ha_innodb.cc.  These functions are invoked via function
pointers in handlerton.
2007-02-12 13:08:02 +00:00
marko
e622cb9325 Merge changes from MySQL AB:
Rename some FIELD_TYPE_ constants to MYSQL_TYPE_.

Change the scope of a type cast of two dividends.
2007-02-02 11:14:02 +00:00
osku
12b80747f2 Change this in ha_innobase:
void*           innobase_prebuilt;

to this:

 row_prebuilt_t* prebuilt;

by introducing the typedef in ha_innodb.h, and remove all the now needless
local variables and casts in ha_innodb.cc.
2007-01-11 14:24:53 +00:00
osku
03b9c45ec3 Apply patch from MySQL:
ChangeSet@1.2353, 2006-12-19 16:57:51-07:00, tsmith@siva.hindu.god +13 -0
   Added innodb_rollback_on_timeout option to restore the 4.1 
   InnoDB timeout behavior (Bug #24200)
2007-01-11 11:45:58 +00:00
marko
79b0e5d2dc Merge a change from MySQL AB:
ChangeSet@1.2372, 2006-12-31 02:29:11+01:00, kent@mysql.com +79 -0
  Many files:
    Removed "MySQL Finland AB & TCX DataKonsult AB" from copyright header
    Adjusted year(s) in copyright header 
    Added GPL copyright text
2007-01-11 09:36:27 +00:00
sunny
cc80a72c2a Fix a potential bug in ha_innodb.cc:innobase_query_is_update() where the
function can be called with "current_thd == NULL". Minor non-functional fix
in log0recv.c
2006-12-15 04:23:43 +00:00
osku
8184675a96 Unify dict_table_get_and_increment_handle_count() with dict_table_get() by
adding a second parameter, adjust callers.
2006-12-12 09:37:18 +00:00
osku
17e67cd556 ha_innodb.cc: Remove unused define MAX_ULONG_BIT. 2006-12-07 12:45:26 +00:00
heikki
0138132c05 Fix bug #24712: SHOW TABLE STATUS for file-per-table showing incorrect
time fields
2006-12-01 15:38:56 +00:00
marko
05a583aab3 Port r1034 from branches/zip: Remove some instrumentation and reduce
the output of SHOW MUTEX STATUS in non-debug builds.  (Bug #24386)
2006-11-21 13:56:18 +00:00