Commit graph

17323 commits

Author SHA1 Message Date
unknown
e2f73f6d6d Merge damien-katzs-computer.local:/Users/dkatz/bug29772/my50-bug29772
into  damien-katzs-computer.local:/Users/dkatz/mysql-5.0-runtime
2007-10-01 12:33:59 -04:00
unknown
7d0c68dd44 Merge damien-katzs-computer.local:/Users/dkatz/bug29589/my50-bug29589
into  damien-katzs-computer.local:/Users/dkatz/mysql-5.0-runtime
2007-10-01 12:32:17 -04:00
unknown
5adfe1b25d Bug #29589 sys_innodb_max_purge_lag is defined twice in sys_variables
Removed duplicate innodb variable from sys_variables array.


sql/set_var.cc:
  Removed duplicate innodb variable from sys_variables array.
2007-09-28 17:13:35 -04:00
unknown
8ded280f3f Bug #29772 Error compiling with option --without-geometry
Added #ifdef HAVE_SPATIAL around geometry related code.


sql/item.cc:
  Added #ifdef HAVE_SPATIAL around geometry related code.
2007-09-28 17:10:14 -04:00
unknown
db50f37ae0 Bug#16918: Aborted_clients > Connections.
The problem was that aborted_threads variable was updated
twice when a client connection had been aborted.

The fix is to refactor a code to have aborted_threads updated
only in one place.


sql/mysql_priv.h:
  Make do_command() a private function.
sql/sql_parse.cc:
  1. Make do_command() a private function;
  2. Update aborted_threads in the only one place.
2007-09-13 17:30:44 +04:00
unknown
5c836d24f6 Fixed whitespace 2007-09-04 16:40:27 -06:00
unknown
3a94137ce0 Merge weblab.(none):/home/marcsql/TREE/mysql-5.0-base
into  weblab.(none):/home/marcsql/TREE/mysql-5.0-rt-merge


mysql-test/r/sp.result:
  Auto merged
mysql-test/t/mysql.test:
  Auto merged
mysql-test/t/sp.test:
  Auto merged
2007-09-04 14:38:26 -06:00
unknown
0f70a032c2 Merge adventure.(none):/home/thek/Development/cpp/bug21074/my50-bug21074
into  adventure.(none):/home/thek/Development/cpp/mysql-5.0-runtime


sql/sql_cache.cc:
  Auto merged
2007-09-03 13:46:10 +02:00
unknown
d2a0a4d53a - Fix cross compatibility issues by exchanging pthread_yield with my_sleep(0) 2007-09-03 13:42:32 +02:00
unknown
11987c913a Merge kpettersson@bk-internal.mysql.com:/home/bk/mysql-5.0-runtime
into  adventure.(none):/home/thek/Development/cpp/mysql-5.0-runtime


sql/sql_cache.cc:
  Auto merged
2007-09-03 10:59:44 +02:00
unknown
37db876e10 Merge adventure.(none):/home/thek/Development/cpp/bug21074/my50-bug21074
into  adventure.(none):/home/thek/Development/cpp/mysql-5.0-runtime


sql/sql_cache.cc:
  Auto merged
2007-09-03 10:54:33 +02:00
unknown
733bd4fe81 Bug #21074 Large query_cache freezes mysql server sporadically under heavy load
Invaldating a subset of a sufficiently large query cache can take a long time.
During this time the server is efficiently frozen and no other operation can
be executed. This patch addresses this problem by setting a time limit on
how long time a dictionary access request can take before giving up on the 
attempt. This patch does not work for query cache invalidations issued by
DROP, ALTER or RENAME TABLE operations.


sql/sql_cache.cc:
  Changed mutex locking to a timed spinn lock. If access to query cache dictionary
  takes "a long time" (currently more than 0.1 seconds) the system fall backs on
  ordinary statement execution.
2007-09-03 10:47:24 +02:00
unknown
3f9be28c41 Merge weblab.(none):/home/marcsql/TREE/mysql-5.0-base
into  weblab.(none):/home/marcsql/TREE/mysql-5.0-runtime


sql/item_cmpfunc.h:
  Auto merged
sql/sql_lex.cc:
  Auto merged
2007-08-30 17:23:40 -06:00
unknown
bccbd5c493 Bug#28587 SELECT is blocked by INSERT waiting on read lock, even with low_priority_updates
The problem is that a SELECT on one thread is blocked by INSERT ... ON
DUPLICATE KEY UPDATE on another thread even when low_priority_updates is
activated.

The solution is to possibly downgrade the lock type to the setting of
low_priority_updates if the INSERT cannot be concurrent.


sql/sql_insert.cc:
  Possibly downgrade lock type to the the setting of low_priority_updates if
  if the INSERT cannot be concurrent.
2007-08-30 16:11:53 -03:00
unknown
b0f899e977 Bug#28779 (mysql_query() allows execution of statements with unbalanced
comments)

Before this fix, the server would accept queries that contained comments,
even when the comments were not properly closed with a '*' '/' marker.

For example,
  select 1 /* + 2 <EOF>
would be accepted as
  select 1 /* + 2 */ <EOF>
and executed as
  select 1

With this fix, the server now rejects queries with unclosed comments
as syntax errors.
Both regular comments ('/' '*') and special comments ('/' '*' '!') must be
closed with '*' '/' to be parsed correctly.


mysql-test/r/comments.result:
  Unbalanced comments are a syntax error.
mysql-test/t/comments.test:
  Unbalanced comments are a syntax error.
sql/sql_lex.cc:
  Unbalanced comments are a syntax error.
2007-08-29 14:50:32 -06:00
unknown
901ead6cb5 Merge bk-internal.mysql.com:/home/bk/mysql-5.0-runtime
into  moksha.local:/Users/davi/mysql/push/mysql-5.0-runtime
2007-08-28 18:47:08 -03:00
unknown
e0e44ad66e Bug#30625 (Performance, reduce depth for expressions)
This is a performance bug, affecting in particular the bison generated code
for the parser.

Prior to this fix, the grammar used a long chain of reduces to parse an
expression, like:
  bit_expr -> bit_term
  bit_term -> bit_factor
  bit_factor -> value_expr
  value_expr -> term
  term -> factor
etc

This chain of reduces cause the internal state automaton in the generated
parser to execute more state transitions and more reduces, so that the
generated MySQLParse() function would spend a lot of time looping to execute
all the grammar reductions.

With this patch, the grammar has been reorganized so that rules are more
"flat", limiting the depth of reduces needed to parse <expr>.

Tests have been written to enforce that relative priorities and properties
of operators have not changed while changing the grammar.

See the bug report for performance data.


mysql-test/r/parser_precedence.result:
  Improved test coverage for operator precedence
mysql-test/t/parser_precedence.test:
  Improved test coverage for operator precedence
sql/sql_yacc.yy:
  Simplified the grammar to improve performances
2007-08-28 11:16:03 -06:00
unknown
d54f42c16c Merge ramayana.hindu.god:/home/tsmith/m/bk/50
into  ramayana.hindu.god:/home/tsmith/m/bk/maint/50


sql/sql_show.cc:
  Auto merged
2007-08-27 18:19:55 -06:00
unknown
34ded62908 Bug#30632 HANDLER read failure causes hang
If, after the tables are locked, one of the conditions to read from a
HANDLER table is not met, the handler code wrongly jumps to a error path
that won't unlock the tables.

The user-visible effect is that after a error in a handler read command,
all subsequent handler operations on the same table will hang.

The fix is simply to correct the code to jump to the (same) error path that
unlocks the tables.


mysql-test/r/handler.result:
  Bug#30632 test case result
mysql-test/t/handler.test:
  Bug#30632 test case
sql/sql_handler.cc:
  Always unlock the internal and external table level locks if any of the conditions
  (including errors) to read from a HANDLER table are not met.
2007-08-27 10:37:12 -03:00
unknown
369a5f1cdc Bug#25164 create table a as select * from A hangs
The problem from a user's perspective: user creates table A, and then tries
to CREATE TABLE a SELECT from A - and this causes a deadlock error, a hang,
or fails with a debug assert, but only if the storage engine is InnoDB.

The origin of the problem: InnoDB uses case-insensitive collation
(system_charset_info) when looking up the internal table share, thus returning
the same share for 'a' and 'A'.

Cause of the user-visible behavior: since the same share is returned to SQL
locking subsystem, it assumes that the same table is first locked (within the
same session) for WRITE, and then for READ, and returns a deadlock error.
However, the code is wrong in not properly cleaning up upon an error, leaving
external locks in place, which leads to assertion failures and hangs.

Fix that has been implemented: the SQL layer should properly propagate the
deadlock error, cleaning up and freeing all resources.

Further work towards a more complete solution: InnoDB should not use case
insensitive collation for table share hash if table names on disk honor the case.


mysql-test/r/innodb-deadlock.result:
  Bug#25164 test case result
mysql-test/t/innodb-deadlock.test:
  Bug#25164 test case. The CREATE TABLE may fail depending on the character set
  of the system and filesystem, but it should never hang.
sql/lock.cc:
  Unlock the storage engine "external" table level locks, if the MySQL thr_lock
  locking subsystem detects a deadlock error.
2007-08-27 10:13:54 -03:00
unknown
6ba1e8a039 Merge pilot.(none):/data/msvensson/mysql/bug30593/my50-bug30593
into  pilot.(none):/data/msvensson/mysql/mysql-5.0-maint
2007-08-24 13:11:14 +02:00
unknown
50911dec3e Bug#30593 No cipher list returned for "SHOW STATUS LIKE 'Ssl_cipher_list'"
- Move increment of "i" to "increment section" of for loop
 - Protect against writing after end of "buff"(backport from 5.1)


sql/sql_show.cc:
  - Move the increment of i to "increment" section of for loop. Since "i"
  was initially 0 the for loop exited immediately
  - Add protection for writing after end of "buff"
2007-08-23 20:24:48 +02:00
unknown
0ff829bb71 Merge pippilotta.erinye.com:/shared/home/df/mysql/build/mysql-5.0-marvel
into  pippilotta.erinye.com:/shared/home/df/mysql/build/mysql-5.0.48


sql/sql_base.cc:
  Auto merged
sql/sql_cache.cc:
  Auto merged
2007-08-23 17:43:47 +02:00
unknown
1032909244 Merge gleb.loc:/home/uchum/work/bk/5.0-opt-30201
into  gleb.loc:/home/uchum/work/bk/5.0-opt
2007-08-22 22:23:03 +05:00
unknown
d4e34c80d6 Merge malff@bk-internal.mysql.com:/home/bk/mysql-5.0-runtime
into  weblab.(none):/home/marcsql/TREE/mysql-5.0-30237


sql/sql_yacc.yy:
  Auto merged
2007-08-22 11:06:42 -06:00
unknown
fb1be0f1e5 Bug#30237 (Performance regression in boolean expressions)
This is a performance bug, related to the parsing or 'OR' and 'AND' boolean
expressions.

Let N be the number of expressions involved in a OR (respectively AND).

When N=1

For example, "select 1" involve only 1 term: there is no OR operator.

In 4.0 and 4.1, parsing expressions not involving OR had no overhead.
In 5.0, parsing adds some overhead, with Select->expr_list.

With this patch, the overhead introduced in 5.0 has been removed,
so that performances for N=1 should be identical to the 4.0 performances,
which are optimal (there is no code executed at all)

The overhead in 5.0 was in fact affecting significantly some operations.
For example, loading 1 Million rows into a table with INSERTs,
for a table that has 100 columns, leads to parsing 100 Millions of
expressions, which means that the overhead related to Select->expr_list
is executed 100 Million times ...

Considering that N=1 is by far the most probable expression,
this case should be optimal.

When N=2

For example, "select a OR b" involves 2 terms in the OR operator.

In 4.0 and 4.1, parsing expressions involving 2 terms created 1 Item_cond_or
node, which is the expected result.
In 5.0, parsing these expression also produced 1 node, but with some extra
overhead related to Select->expr_list : creating 1 list in Select->expr_list
and another in Item_cond::list is inefficient.

With this patch, the overhead introduced in 5.0 has been removed
so that performances for N=2 should be identical to the 4.0 performances.
Note that the memory allocation uses the new (thd->mem_root) syntax
directly.
The cost of "is_cond_or" is estimated to be neglectable: the real problem
of the performance degradation comes from unneeded memory allocations.

When N>=3

For example, "select a OR b OR c ...", which involves 3 or more terms.

In 4.0 and 4.1, the parser had no significant cost overhead, but produced
an Item tree which is difficult to evaluate / optimize during runtime.
In 5.0, the parser produces a better Item tree, using the Item_cond
constructor that accepts a list of children directly, but at an extra cost
related to Select->expr_list.

With this patch, the code is implemented to take the best of the two
implementations:
- there is no overhead with Select->expr_list
- the Item tree generated is optimized and flattened.

This is achieved by adding children nodes into the Item tree directly,
with Item_cond::add(), which avoids the need for temporary lists and memory
allocation

Note that this patch also provide an extra optimization, that the previous
code in 5.0 did not provide: expressions are flattened in the Item tree,
based on what the expression already parsed is, and not based on the order
in which rules are reduced.

For example : "(a OR b) OR c", "a OR (b OR c)" would both be represented
with 2 Item_cond_or nodes before this patch, and with 1 node only with this
patch. The logic used is based on the mathematical properties of the OR
operator (it's associative), and produces a simpler tree.


sql/item_cmpfunc.h:
  Improved performances for parsing boolean expressions
sql/sql_yacc.yy:
  Improved performances for parsing boolean expressions
mysql-test/r/parser_precedence.result:
  Added test cases to cover boolean operator precedence
mysql-test/t/parser_precedence.test:
  Added test cases to cover boolean operator precedence
2007-08-22 11:05:35 -06:00
unknown
3dbffd24c8 Merge hynda.mysql.fi:/home/my/mysql-5.0-main
into  hynda.mysql.fi:/home/my/mysql-5.0-marvel
2007-08-22 16:19:06 +03:00
unknown
891b1659fc Fixed bug #30201.
Killing a SELECT query with KILL QUERY or KILL CONNECTION
causes a server crash if the query cache is enabled.

Normal evaluation of a query may be interrupted by the
KILL QUERY/CONNECTION statement, in this case the mysql_execute_command
function returns TRUE, and the thd->killed flag has true value.
In this case the result of the query may
be cached incompletely (omitting call to query_cache_insert inside
the net_real_write function), and next call to query_cache_end_of_result
may lead to server crash.
Thus, the query_cache_end_of_result function has been modified to abort
query cache in the case of killed thread.



sql/sql_cache.cc:
  Fixed bug #30201.
  The  query_cache_end_of_result function has been modified to abort query
  cache in the case of query execution failure. Also this function has been
  modified to remove incomplete query block.
2007-08-22 18:15:54 +05:00
unknown
25c8c0672b Merge hynda.mysql.fi:/home/my/mysql-5.0-main
into  hynda.mysql.fi:/home/my/mysql-5.0-marvel
2007-08-21 19:06:47 +03:00
unknown
d845108fe7 Merge gshchepa@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  gleb.loc:/home/uchum/work/bk/5.0-opt
2007-08-21 20:56:40 +05:00
unknown
abc02d7e47 Merge adventure.(none):/home/thek/Development/cpp/bug30269/my50-bug30269
into  adventure.(none):/home/thek/Development/cpp/mysql-5.0-runtime


mysql-test/r/query_cache.result:
  Auto merged
mysql-test/t/query_cache.test:
  Auto merged
2007-08-21 17:47:06 +02:00
unknown
792145bae1 Merge gleb.loc:/home/uchum/work/bk/5.0-opt-30287
into  gleb.loc:/home/uchum/work/bk/5.0-opt


sql/sql_select.cc:
  Auto merged
2007-08-21 19:30:32 +05:00
unknown
42aa480b43 compiler warning fix 2007-08-21 18:59:42 +05:00
unknown
521529be29 Merge sgluhov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  mysql.com:/home/gluh/MySQL/Merge/5.0-opt
2007-08-21 17:57:48 +05:00
unknown
3a5a0ea392 Bug#30269 Query cache eats memory
Although the query cache doesn't support retrieval of statements containing
column level access control, it was still possible to cache such statements
thus wasting memory.
  
This patch extends the access control check on the target tables to avoid
caching a statement with column level restrictions. 

Views are excepted and can be cached but only retrieved by super user account.


mysql-test/t/query_cache_with_views.test:
  Rename: mysql-test/t/view_query_cache.test -> mysql-test/t/query_cache_with_views.test
mysql-test/r/query_cache_with_views.result:
  Rename: mysql-test/r/view_query_cache.result -> mysql-test/r/query_cache_with_views.result
mysql-test/r/query_cache.result:
  Modified test case to allow caching of views
mysql-test/t/query_cache.test:
  Modified test case to allow caching of views
sql/sql_cache.cc:
  Allow caching of views
2007-08-21 13:43:09 +02:00
unknown
a9322f2e57 Merge gleb.loc:/home/uchum/work/bk/5.0
into  gleb.loc:/home/uchum/work/bk/5.0-opt


sql/sql_base.cc:
  Auto merged
2007-08-21 16:31:30 +05:00
unknown
63a95f331a Merge gleb.loc:/home/uchum/work/bk/5.0
into  gleb.loc:/home/uchum/work/bk/5.0-opt
2007-08-21 16:14:46 +05:00
unknown
7c3d5bc5c4 Fixed bug #30287.
The server created temporary tables for filesort in the working directory
instead of the specified tmpdir directory.


sql/item.cc:
  Fixed bug #30287.
  The Item_field::set_field method has been modified to reset the any_privileges
  flag to false in case of system temporary table. This modification prevents the
  server from unnecessary checking of user privileges to access system temporary
  tables.
sql/sql_select.cc:
  Fixed bug #30287.
  Bugfix for #29015 has been removed: TABLE_SHARE::table_name of system
  temporary tables contains full path to table file basename again.
sql/sql_view.cc:
  Fixed bug #30287.
  Commentary has been added.
2007-08-21 01:39:39 +05:00
unknown
3c52b2b3a8 Merge weblab.(none):/home/marcsql/TREE/mysql-5.0-base
into  weblab.(none):/home/marcsql/TREE/mysql-5.0-rt-merge


sql/sql_base.cc:
  Auto merged
sql/sql_handler.cc:
  Auto merged
2007-08-20 10:45:16 -06:00
unknown
d48e35b983 Merge sgluhov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  mysql.com:/home/gluh/MySQL/Merge/5.0-opt
2007-08-20 11:25:45 +05:00
unknown
29ee5ed0a0 Bug#27629 Possible security flaw in INFORMATION_SCHEMA and SHOW statements
added SUPER_ACL check for I_S.TRIGGERS


mysql-test/r/information_schema.result:
  result fix
mysql-test/r/information_schema_db.result:
  result fix
mysql-test/t/information_schema.test:
  test case
sql/sql_show.cc:
  added SUPER_ACL check for I_S.TRIGGERS
2007-08-20 11:23:08 +05:00
unknown
c68c271a5f Merge ramayana.hindu.god:/home/tsmith/m/bk/50
into  ramayana.hindu.god:/home/tsmith/m/bk/maint/50
2007-08-18 00:35:41 -06:00
unknown
3ff2699500 Merge adventure.(none):/home/thek/Development/cpp/bug30269/my50-bug30269
into  adventure.(none):/home/thek/Development/cpp/mysql-5.0-runtime


mysql-test/r/query_cache.result:
  Auto merged
mysql-test/t/query_cache.test:
  Auto merged
2007-08-17 17:27:41 +02:00
unknown
bd80048fdb Bug #30269 Query cache eats memory
Although the query cache doesn't support retrieval of statements containing
column level access control, it was still possible to cache such statements
thus wasting memory.

This patch extends the access control check on the target tables to avoid
caching a statement with column level restrictions. 


mysql-test/r/query_cache.result:
  Added test
mysql-test/t/query_cache.test:
  Added test
sql/sql_cache.cc:
  The function check_table_access leaves the artifact
  grant.want_privileges= 1, if a statement refers to tables with column level
  privileges. To avoid the statement from being stored into the query cache,
  it is enough to check this flag and set 'safe_to_cache_query' to zero.
sql/sql_cache.h:
  - Removed 'static' attribute or class methods
  - Added THD parameter to process_and_count_tables
2007-08-17 16:55:20 +02:00
unknown
92abaeee0c Merge olga.mysql.com:/home/igor/mysql-5.0-opt
into  olga.mysql.com:/home/igor/dev-opt/mysql-5.0-opt-bug30396
2007-08-16 21:04:28 -07:00
unknown
409938f22a Bug#29936 (Stored Procedure DML ignores low_priority_updates setting)
This is a follow up for the patch for Bug#26162 "Trigger DML ignores low_priority_updates setting", where the stored procedure ignores the session setting of low_priority_updates.

For every table open operation with default write (TL_WRITE_DEFAULT) lock_type, downgrade the lock type to the session setting of low_priority_updates.


sql/lock.cc:
  Add late lock_type assertion.
sql/sql_base.cc:
  Possibly downgrade lock type to the the session setting of low_priority_updates and also remove early assertion.
2007-08-16 14:51:37 -03:00
unknown
163420d2d7 Bug #29474: 21587 Regression Ever increasing open tables/fd when using HANDLER READ + DELETE
Revert the fix for bug 21587.  That bug will be re-opened, and a new
fix must be created.
2007-08-16 10:56:09 -06:00
unknown
4e5d02e99f Fix for Bug#27970 "Fix for bug 24507 makes mysql_install_db fail"
include/my_pthread.h:
  Fix for Bug#27970 "Fix for bug 24507 makes mysql_install_db fail".
  
  Removed macro NPTL_PTHREAD_EXIT_BUG, because it doesn't work in dynamic
  environment. One can switch between NPTL and LT on the fly on Linux.
  
  Added pthread_dummy(ESRCH) for those platforms that don't have pthread_kill.
  This ensures that there won't be an error in mysqld.cc where the return value 
  is being checked from the function call.
mysys/my_thr_init.c:
  Check for a Linux is enough. There is an additional test if
  NPTL is in use before spwaning the extra thread.
2007-08-16 17:25:48 +03:00
unknown
f4a163c3a5 Merge mhansson@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  dl145s.mysql.com:/data0/mhansson/my50-bug28570


sql/opt_range.cc:
  Auto merged
mysql-test/r/innodb_mysql.result:
  Bug#28570: Manual Merge
mysql-test/t/innodb_mysql.test:
  Bug#28570: Manual Merge
2007-08-16 14:13:07 +02:00
unknown
05dd9e4987 NULL MERGE this ChangeSet to 5.1
Apply innodb-5.0-ss1696 snapshot

Fixes:
- Bug#20090: InnoDB: Error: trying to declare trx to enter InnoDB
- Bug#23710: crash_commit_before fails if innodb_file_per_table=1
  At InnoDB startup consider the case where log scan went beyond
  checkpoint_lsn as a crash and initiate crash recovery code path.
- Bug#28781: InnoDB increments auto-increment value incorrectly with ON DUPLICATE KEY UPDATE
  We need to do some special AUTOINC handling for the following case:
  INSERT INTO t (c1,c2) VALUES(x,y) ON DUPLICATE KEY UPDATE ...
  We need to use the AUTOINC counter that was actually used by
  MySQL in the UPDATE statement, which can be different from the
  value used in the INSERT statement.
- Bug#29097: fsp_get_available_space_in_free_extents() is capped at 4TB
  Fix by typecasting the variables before multiplying them, so that the
  result of the multiplication is of type "unsigned long long".
- Bug#29155: Innodb "Parallel recovery" is not prevented
  Fix 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.


innobase/fsp/fsp0fsp.c:
  Apply innodb-5.0-ss1696 snapshot
  
  Revision r1614:
  branches/5.0:
  
  Merge r1605 from trunk:
  
  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
innobase/include/fsp0fsp.h:
  Apply innodb-5.0-ss1696 snapshot
  
  Revision r1614:
  branches/5.0:
  
  Merge r1605 from trunk:
  
  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
innobase/include/univ.i:
  Apply innodb-5.0-ss1696 snapshot
  
  Revision r1614:
  branches/5.0:
  
  Merge r1605 from trunk:
  
  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
innobase/log/log0recv.c:
  Apply innodb-5.0-ss1696 snapshot
  
  Revision r1608:
  branches/5.0: Bug#23710
  Back port of r1607 from trunk
  
  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
innobase/os/os0file.c:
  Apply innodb-5.0-ss1696 snapshot
  
  Revision r1615:
  branches/5.0:
  
  Merge r1613 from trunk:
  
  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
innobase/srv/srv0srv.c:
  Apply innodb-5.0-ss1696 snapshot
  
  Revision r1552:
  branches/5.0:
  Fix Bug#20090 as suggested in the bug followup by Heikki.
  
  Approved by:	Heikki
innobase/trx/trx0trx.c:
  Apply innodb-5.0-ss1696 snapshot
  
  Revision r1596:
  branches/5.0: Merge r1595 from trunk:
  
  trx_commit_for_mysql(): Avoid acquiring and releasing kernel_mutex when
  trx->sess or trx_dummy_sess is non-NULL.
sql/ha_innodb.cc:
  Apply innodb-5.0-ss1696 snapshot
  
  Revision r1614:
  branches/5.0:
  
  Merge r1605 from trunk:
  
  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
  
  
  Revision r1695:
  branches/5.0: Merge a change from MySQL AB:
  
  ChangeSet@1.2463.166.1  2007-06-20 19:22:27+03:00  monty@mysql.fi
  
  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)
  
  ha_innodb.cc:
    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)
  
  
  Revision r1606:
  branches/5.0: Formatting corrections.
  
  spotted by: Vasil
  
  
  Revision r1691:
  branches/5.0: Merge a change from MySQL AB:
  
  ChangeSet@1.2463.261.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.
  
  sql/ha_innodb.cc: Bug 29644: reverse the (now excessive) fix
  for bug 17264 (but leave the test case).
  
  
  Revision r1601:
  branches/5.0: Fix for bug#28781
  We need to do some special AUTOINC handling for the following case:
  
  INSERT INTO t (c1,c2) VALUES(x,y) ON DUPLICATE KEY UPDATE ...
  
  We need to use the AUTOINC counter that was actually used by
  MySQL in the UPDATE statement, which can be different from the
  value used in the INSERT statement.
  
  approved by: Sunny
  
  
  Revision r1692:
  branches/5.0: Merge a change from MySQL AB:
  
  ChangeSet@1.2463.267.1  2007-07-30 17:14:34+04:00  evgen@local
    Bug 24989: The DEADLOCK error is improperly handled by InnoDB.
    
    When innodb detects a deadlock it calls ha_rollback_trans() to rollback the 
    main transaction. But such action isn't allowed from inside of triggers and
    functions. When it happen the 'Explicit or implicit commit' error is thrown
    even if there is no commit/rollback statements in the trigger/function. This
    leads to the user confusion.
    
    Now the convert_error_code_to_mysql() function doesn't call the 
    ha_rollback_trans() function directly but rather calls the
    mark_transaction_to_rollback function and returns an error.
    The sp_rcontext::find_handler() now doesn't allow errors to be caught by the
    trigger/function error handlers when the thd->is_fatal_sub_stmt_error flag
    is set. Procedures are still allowed to catch such errors.
    The sp_rcontext::find_handler function now accepts a THD handle as a parameter.
    The transaction_rollback_request and the is_fatal_sub_stmt_error flags are 
    added to the THD class. The are initialized by the THD class constructor.
    Now the ha_autocommit_or_rollback function rolls back main transaction
    when not in a sub statement and the thd->transaction_rollback_request
    is set.
    The THD::restore_sub_statement_state function now resets the 
    thd->is_fatal_sub_stmt_error flag on exit from a sub-statement.
  
  innodb-big.test, innodb-big.result:
    Added a test case for the bug 24989: The DEADLOCK error is improperly
    handled by InnoDB.
  
  sql/ha_innodb.cc:
    Bug 24989: The DEADLOCK error is improperly handled by InnoDB.
    Now the convert_error_code_to_mysql() function doesn't call the
    ha_rollback_trans() function directly but rather calls the
    mark_transaction_to_rollback function and returns an error.
  
  
  Revision r1693:
  branches/5.0: Merge a change from MySQL AB:
  
  ChangeSet@1.2489.5.1  2007-07-31 17:42:48+04:00  evgen@local
    ha_innodb.cc:
      Warning fixed.
2007-08-15 17:20:54 -06:00