Commit graph

25871 commits

Author SHA1 Message Date
Alexander Barkov
a7c09ea9f8 Bug#56639 Character Euro (0x88) not converted from cp1251 to utf8
Problem: MySQL cp1251 did not support 'U+20AC EURO SIGN'
which was assigned a few years ago to 0x88.

Fix: adding mapping: 0x88 <-> U+20AC 

  @ mysql-test/include/ctype_8bit.inc
  New shared file to test 8bit character sets.

  @ mysql-test/r/ctype_cp1251.result
  @ mysql-test/t/ctype_cp1251.test
  Adding tests

  @ sql/share/charsets/cp1251.xml
  Adding mapping

  @ strings/ctype-extra.c
  Regenerating ctype-extra.c using strings/conf_to_src
  according to new cp1251.xml
2010-11-26 16:58:54 +03:00
Nirbhay Choubey
e1b773cb53 Bug #54899 : --one-database option cannot handle DROP/CREATE DATABASE commands
After dropping and recreating the database specified along with --one-database
option at command line, mysql client keeps filtering the statements even after
the execution of a 'USE' command on the same database.

--one-database option enables the filtering of statements when the current
database is not the one specified at the command line. However, when the same
database is dropped and recreated the variable (current_db) that holds the
inital database name gets altered. This bug exploits the fact that current_db
initially gets set to null value (0) when a 'use db_name' follows the recreation
of same database db_name (speficied at the command line) and hence skip_updates
gets set to 1, which inturn triggers the further filtering of statements.

Fixed by making get_current_db() a no-op function when one_database is set,
and hence, under that condition current_db will not get altered.
Note, however the value of current_db can change when we execute 'connect'
command with a differnet database to reconnect to the server, in which case,
the behavior of --one-database will be formulated using this new database.


client/mysql.cc:
  Bug #54899 : --one-database option cannot handle DROP/CREATE DATABASE commands
  
  Added an if statement at the beginnning of get_current_db() , which makes it
  a no-op function if one-database option is specified, and hence current_db
  remains unchanged.
  
  Changed the help message for one-database option to a more appropriate message
  as specified in mysql documentation.
mysql-test/r/mysql.result:
  Added a test case for bug#54899 and some more test cases to
  check other one-database option related behaviors.
mysql-test/t/mysql.test:
  Added a test case for bug#54899 and some more test cases to
  check other one-database option related behaviors.
2010-11-26 19:27:59 +05:30
Tatiana A. Nurnberg
7336ac45b7 Assorted post-merge fixes, clean-up, integration, compat with 5.6.
43233/55794.

mysql-test/r/change_user.result:
  Don't use -1 integer wrap around. It used to work, but now we do what's
  actually in the documentation. In tests, we now use DEFAULT or the
  numeral equivalent (as we do in the 5.6 tests).
mysql-test/r/key_cache.result:
  Can't drop default key case is an error now, not a warning, for compatibility
  with 5.6.
mysql-test/r/variables.result:
  Can't drop default key case is an error now, not a warning, for compatibility
  with 5.6.
mysql-test/t/change_user.test:
  Don't use -1 integer wrap around. It used to work, but now we do what's
  actually in the documentation. In tests, we now use DEFAULT or the
  numeral equivalent (as we do in the 5.6 tests).
mysql-test/t/key_cache.test:
  Can't drop default key case is an error now, not a warning, for compatibility
  with 5.6.
mysql-test/t/variables.test:
  Can't drop default key case is an error now, not a warning, for compatibility
  with 5.6.
sql/mysqld.cc:
  0 is a legal (albeit magic) value: "drop key cache."
sql/set_var.cc:
  bound_unsigned() can go now, it was just a kludge until things are done
  The Right Way, which they are now.
  
  Can't drop default key case is an error now, not a warning, for compatibility
  with 5.6.
tests/mysql_client_test.c:
  Don't use -1 integer wrap around. It used to work, but now we do what's
  actually in the documentation. In tests, we now use DEFAULT or the
  numeral equivalent (as we do in the 5.6 tests).
2010-11-25 03:11:05 +00:00
Tatiana A. Nurnberg
161d4eea58 merge 2010-11-24 10:02:46 +00:00
Tatiana A. Nurnberg
af6ceb2544 merge 2010-11-24 08:50:04 +00:00
Sergey Glukhov
cf0cc723aa Bug#56862 Execution of a query that uses index merge returns a wrong result
In case of low memory sort buffer QUICK_INDEX_MERGE_SELECT creates
temporary file where is stores row ids which meet QUICK_SELECT ranges
except of clustered pk range, clustered range is processed separately.
In init_read_record we check if temporary file is used and choose
appropriate record access method. It does not take into account that
temporary file contains partial result in case of QUICK_INDEX_MERGE_SELECT
with clustered pk range.
The fix is always to use rr_quick if QUICK_INDEX_MERGE_SELECT
with clustered pk range is used.


mysql-test/suite/innodb/r/innodb_mysql.result:
  test case
mysql-test/suite/innodb/t/innodb_mysql.test:
  test case
mysql-test/suite/innodb_plugin/r/innodb_mysql.result:
  test case
mysql-test/suite/innodb_plugin/t/innodb_mysql.test:
  test case
sql/opt_range.h:
  added new method
sql/records.cc:
  The fix is always to use rr_quick if QUICK_INDEX_MERGE_SELECT
  with clustered pk range is used.
2010-11-23 13:18:47 +03:00
Guilhem Bichot
96b0404940 Fix for Bug#56138 "valgrind errors about overlapping memory when double-assigning same variable",
and related small fixes.

mysql-test/t/user_var.test:
  test for bug
sql/field_conv.cc:
  From the C standard, memcpy() has undefined behaviour if to->ptr==from->ptr
sql/item_func.cc:
  In the case of BUG#56138, entry->value==ptr in which case memcpy()
  has undefined results per the C standard.
sql/sql_select.cc:
  Work around a bug in old gcc
2010-11-22 09:57:59 +01:00
Bjorn Munch
6580097adc merge from 5.1-mtr 2010-11-19 10:29:08 +01:00
Vasil Dimov
cae834561e Merge mysql-5.1-bugteam from bk-internal into my local repo 2010-11-18 16:04:53 +02:00
Vasil Dimov
dacd97b487 Merge mysql-5.1-innodb -> mysql-5.1-bugteam 2010-11-18 15:45:36 +02:00
Alexander Barkov
8f4af42145 Bug#57279 updatexml dies with: Assertion failed: str_arg[length] == 0
Problem: crash in Item_float constructor on DBUG_ASSERT due
to not null-terminated string parameter.

Fix: making Item_float::Item_float non-null-termintated parameter safe:
- Using temporary buffer when generating error

modified:
  @ mysql-test/r/xml.result
  @ mysql-test/t/xml.test
  @ sql/item.cc
2010-11-18 16:11:18 +03:00
Bjorn Munch
32ea070845 Bug #58257 mysqltest: in if(), ! $var with space is always false
Evaluation would start with the space and thus ignore the $
Added while() to skip past white space
2010-11-17 16:05:52 +01:00
Bjorn Munch
92a1a11203 Bug #58087 mysqltest re-evaluates 'let' expressions infinitely
Results from query is sent for evaluation
Break recursion by asking for ` to be ignored
2010-11-15 14:23:02 +01:00
Bjorn Munch
dbbb506f42 merge from 5.1 up to rev 3471 2010-11-14 12:23:51 +01:00
Tatiana A. Nurnberg
c4fa6a3862 Bug#43233: Some server variables are clipped during "update," not "check" stage
Bug#55794: ulonglong options of mysqld show wrong values.

Port the few remaining system variables to the correct mechanism --
range-check in check-stage (and throw error or warning at that point
as needed and depending on STRICTness), update in update stage.
Fix some signedness errors when retrieving sysvar values for display.

mysql-test/r/variables.result:
  Show that we throw warnings or errors depending on strictness
  even for "special" variables now.
mysql-test/t/variables.test:
  Show that we throw warnings or errors depending on strictness
  even for "special" variables now.
sql/item_func.cc:
  show sys_var_ulonglong_ptr and SHOW_LONGLONG type variables as unsigned.
sql/set_var.cc:
  move range-checking from update stage to check stage for the remaining
  few sys-vars that broke the pattern
sql/set_var.h:
  add check functions.
2010-11-11 11:35:48 +00:00
Tatiana A. Nurnberg
1c37eaaabf Bug #49752: 2469.126.2 unintentionally breaks authentication against
MySQL 5.1 server

Server used to clip overly long user-names. This was presumably lost
when code was made UTF8-clean.

Now we emulate the behaviour for backward compatibility, but UTF8-ly
correct.


mysql-test/r/connect.result:
  Show that user-names that are too long get clipped now.
mysql-test/t/connect.test:
  Show that user-names that are too long get clipped now.
sql/sql_connect.cc:
  Clip user-name to 16 characters (not bytes).
strings/CHARSET_INFO.txt:
  Clarify in docs.
2010-11-11 07:34:14 +00:00
Mattias Jonsson
6780abfce6 merge 2010-11-15 23:57:14 +01:00
Mattias Jonsson
3df98a289c merge 2010-11-15 17:13:53 +01:00
Mattias Jonsson
47b514ffce Bug#58197: main.variables-big fails on windows
The test result differs on windows, since
it writes out 'localhost:<port>' instead of
only 'localhost', since it uses tcp/ip instead
of unix sockets on windows.

Fixed by replacing that column.

Also requires --big-test from some long running tests
and added a weekly run of all test requiring --big-test.

mysql-test/collections/default.weekly:
  Added a run of big-test (already exists in 5.5).
mysql-test/r/variables-big.result:
  Updated results
mysql-test/suite/parts/t/part_supported_sql_func_innodb.test:
  requiring --big-test since the test takes long time
mysql-test/suite/parts/t/partition_alter1_1_2_innodb.test:
  requiring --big-test since the test takes long time
mysql-test/suite/parts/t/partition_alter1_2_innodb.test:
  requiring --big-test since the test takes long time
mysql-test/suite/parts/t/partition_alter4_innodb.test:
  requiring --big-test since the test takes long time
mysql-test/t/disabled.def:
  Disabled two tests since they fail and was already
  reported as bugs (but was never run since they requires
  --big-test flag).
mysql-test/t/variables-big.test:
  Replacing column 3 in process list since it
  is not the same on windows as in unix.
2010-11-15 16:17:38 +01:00
Mattias Jonsson
e0a8c25438 Bug#57890: Assertion failed: next_insert_id == 0
with on duplicate key update

There was a missed corner case in the partitioning
handler, which caused the next_insert_id to be changed
in the second level handlers (i.e the hander of a partition),
which caused this debug assertion.

The solution was to always ensure that only the partitioning
level generates auto_increment values, since if it was done
within a partition, it may fail to match the partition
function.

mysql-test/suite/parts/inc/partition_auto_increment.inc:
  Added tests
mysql-test/suite/parts/r/partition_auto_increment_blackhole.result:
  updated results
mysql-test/suite/parts/r/partition_auto_increment_innodb.result:
  updated results
mysql-test/suite/parts/r/partition_auto_increment_memory.result:
  updated results
mysql-test/suite/parts/r/partition_auto_increment_myisam.result:
  updated results
sql/ha_partition.cc:
  In <engine>::write_row the auto_inc value is generated
  through handler::update_auto_increment (which calls <engine>::get_auto_increment() if needed).
  If:
  * INSERT_ID was set to 0
  * it was updated to 0 by 'INSERT ... ON DUPLICATE KEY UPDATE' and changed partitions for the row
  Then it would try to generate a auto_increment value in the
  <engine for a specific partition>::write_row, which will
  trigger the assert.
  
  So the solution is to prevent this by,
  in ha_partition::write_row set auto_inc_field_not_null and
  add MODE_NO_AUTO_VALUE_ON_ZERO
  in ha_partition::update_row (when changing partition) temporary
  set table->next_number_field to NULL which calling the
  partitions ::write_row().
2010-11-11 11:34:55 +01:00
Sergey Vojtovich
13bc5b3f3d BUG#58079 - Remove the IBM DB2 storage engine 2010-11-11 13:03:17 +03:00
Dmitry Shulga
871f36357e Fixed bug#54375 - Error in stored procedure leaves connection
in different default schema.

In strict mode, when data truncation or conversion happens,
THD::killed is set to THD::KILL_BAD_DATA.

This is abuse of KILL mechanism to guarantee that execution
of statement is aborted.

The stored procedures execution, on the other hand,
upon detection that a connection was killed, would
terminate immediately, without trying to restore the caller's
context, in particular, restore the caller's current schema.

The fix is, when terminating a stored procedure execution,
to only bypass cleanup if the entire connection was killed,
not in case of other forms of KILL.


mysql-test/r/sp-bugs.result:
  Added result for a test case for bug#54375.
mysql-test/t/sp-bugs.test:
  Added test case for bug#54375.
sql/sp_head.cc:
  sp_head::execute modified: restore saved current db if
  connection is not killed.
2010-11-11 10:52:51 +06:00
Vasil Dimov
ce782ee2c2 Merge mysql-5.1-innodb from bk-internal into my local repo 2010-11-10 10:40:22 +02:00
Dmitry Shulga
4b0fe88708 Fixed bug#56619 - Assertion failed during
ALTER TABLE RENAME, DISABLE KEYS.

The code of ALTER TABLE RENAME, DISABLE KEYS could
issue a commit while holding LOCK_open mutex.
This is a regression introduced by the fix for
Bug 54453.
This failed an assert guarding us against a potential
deadlock with connections trying to execute
FLUSH TABLES WITH READ LOCK.

The fix is to move acquisition of LOCK_open outside
the section that issues ha_autocommit_or_rollback().
LOCK_open is taken to protect against concurrent
operations with .frms and the table definition
cache, and doesn't need to cover the call to commit.

A test case added to innodb_mysql.test.

The patch is to be null-merged to 5.5, which
already has 54453 null-merged to it.

mysql-test/suite/innodb/r/innodb_mysql.result:
  Added test results for test for bug#56619.
mysql-test/suite/innodb/t/innodb_mysql.test:
  Added test for bug#56619.
sql/sql_table.cc:
  mysql_alter_table() modified: moved acquisition of LOCK_open
  after call to ha_autocommit_or_rollback.
2010-11-10 14:32:42 +06:00
Bjorn Munch
6eaa3c0750 merge from 5.1-mtr 2010-11-09 11:20:50 +01:00
Horst.Hunger
8e0f8d438b due to merge. 2010-11-08 16:35:46 +01:00
Horst.Hunger
bf10c4a583 Fix for bug#52501 consisting of changes of some sys_vars tests including review results. 2010-11-08 16:30:26 +01:00
Vasil Dimov
cf3433d7f3 Merge mysql-5.1-bugteam -> mysql-5.1-innodb 2010-11-08 16:46:26 +02:00
Anitha Gopi
d7202ef7f8 Bug#58041 : Moved rpl_binlog_row to daily. Run just main suite for ps_row and embedded per push. Other suites run daily 2010-11-08 14:57:05 +05:30
Dmitry Shulga
8f237f5874 A fix and a test case for Bug#47924 -main.log_tables times out
sporadically.

The cause of the sporadic time out was a leaking protection
against the global read lock, taken by the RENAME statement,
and not released in case of an error occurred during RENAME.
The leaking protection counter would lead to the value of
protect_against_global_read never dropping to 0.
Consequently FLUSH TABLES in all connections, including the
one that leaked the protection, could not proceed.
 
The fix is to ensure that all branchesin RENAME code properly
release GRL protection.

mysql-test/r/log_tables.result:
  Added results for test for bug#47924.
mysql-test/t/log_tables.test:
  Added test for bug#47924.
sql/sql_rename.cc:
  mysql_rename_tables() modified: replaced return from function
  to goto to clean up code block in case of error.
2010-11-07 23:42:54 +06:00
Bjorn Munch
866cec611a Bug #57840 MTR: parallel execution breaks with smart ordering of test cases
There were actually more problems in this area:
  Slaves (if any) were unconditionally restarted, this appears unnecessary.
  Sort criteria were suboptimal, included the test name.
Added logic to "reserve" a sequence of tests with same config for one thread
Got rid of sort_criteria hash, put it into the test case itself
Adds little sanity check that expected worker picks up test
Fixed some tests that may fail if starting on running server
Some of these fail only if *same* test is repeated.
Finally, special sorting of tests that do --force-restart
2010-11-05 15:26:38 +01:00
Georgi Kodinov
7b2e07232a merge 2010-11-03 16:09:17 +02:00
unknown
64e476e070 In this patch, existing tests innodb_bug54679.test and innodb_bug56632.test are
removed and replaced by the comprehensive innodb-create-options.test.
It uses the rules listed in the comments at the top of that test.
  
This patch introduces these differences from previous behavior;
1)  KEY_BLOCK_SIZE=0 is allowed by Innodb in both strict and non-strict mode
with no errors or warnings. It was previously used by the server to set 
KEY_BLOCK_SIZE to undefined.  (Bug#56628)
2)  An explicit valid non-DEFAULT ROW_FORMAT always takes priority over a
valid KEY_BLOCK_SIZE. (bug#56632)
3)  Automatic use of COMPRESSED row format is only done if the ROW_FORMAT
is DEFAULT or unspecified.
4)  ROW_FORMAT=FIXED is prevented in strict mode.

This patch also includes various formatting changes for consistency with
InnoDB coding standards.

Related Bugs
Bug#54679: ALTER TABLE causes compressed row_format to revert to compact
Bug#56628: ALTER TABLE .. KEY_BLOCK_SIZE=0 produces untrue warning or unnecessary error
Bug#56632: ALTER TABLE implicitly changes ROW_FORMAT to COMPRESSED
2010-11-02 17:28:34 -05:00
Vasil Dimov
49cbbf6ea4 Fix Bug#53046 dict_update_statistics_low can still be run concurrently on same table
Replace the array of mutexes that used to protect
dict_index_t::stat_n_diff_key_vals[] with an array of rw locks that protects
all the stats related members in dict_table_t and all of its indexes.

Approved by:	Jimmy (rb://503)
2010-11-02 18:57:20 +02:00
Gleb Shchepa
20d704978d Bug #52160: crash and inconsistent results when grouping
by a function and column

The bugreport reveals two different bugs about grouping
on a function:

1) grouping by the TIME_TO_SEC function result caused
   a server crash or wrong results and
2) grouping by the function returning a blob caused
   an unexpected "Duplicate entry" error and wrong
   result.

Details for the 1st bug:

TIME_TO_SEC() returns NULL if its argument is invalid (empty
string for example). Thus its nullability depends not only
on the nullability of its arguments but also on their values.
Fixed by (overoptimistically) setting TIME_TO_SEC() to be
nullable despite the nullability of its arguments.

Details for the 2nd bug:

The server is unable to create indices on blobs without
explicit blob key part length. However, this fact was
ignored for blob function result fields of GROUP BY
intermediate tables.
Fixed by disabling GROUP BY index creation for blob
function result fields like regular blob fields.


mysql-test/r/func_time.result:
  Test case for bug #52160.
mysql-test/r/type_blob.result:
  Test case for bug #52160.
mysql-test/t/func_time.test:
  Test case for bug #52160.
mysql-test/t/type_blob.test:
  Test case for bug #52160.
sql/item_timefunc.h:
  Bug #52160: crash and inconsistent results when grouping
              by a function and column
  
  TIME_TO_SEC() returns NULL if its argument is invalid (empty
  string for example). Thus its nullability depends not only
  Fixed by (overoptimistically) setting TIME_TO_SEC() to be
  nullable despite the nullability of its arguments.
sql/sql_select.cc:
  Bug #52160: crash and inconsistent results when grouping
              by a function and column
  
  The server is unable to create indices on blobs without
  explicit blob key part length. However, this fact was
  ignored for blob function result fields of GROUP BY
  intermediate tables.
  Fixed by disabling GROUP BY index creation for blob
  function result fields like regular blob fields.
2010-10-31 19:04:38 +03:00
Vasil Dimov
4bf273c8f1 Merge mysql-5.1-bugteam -> mysql-5.1-innodb 2010-10-27 16:39:22 +03:00
Anitha Gopi
fcfda43ca3 Fixed bug numbers in disabled.def files 2010-10-27 09:54:04 +05:30
Bjorn Munch
676e012e47 merge from 5.1-mtr 2010-10-25 15:48:41 +02:00
unknown
06c49d571b Bug#27606 GRANT statement should be replicated with DEFINER information
"Grantor" columns' data is lost when replicating mysql.tables_priv.
Slave SQL thread used its default user ''@'' as the grantor of GRANT|REVOKE
statements executing on it.

In this patch, current user is put in query log event for all GRANT and REVOKE
statement, SQL thread uses the user in query log event as grantor.


mysql-test/suite/rpl/r/rpl_do_grant.result:
  Add test for this bug.
mysql-test/suite/rpl/t/rpl_do_grant.test:
  Add test for this bug.
sql/log_event.cc:
  Refactoring THD::current_user_used and related functions.
  current_user_used is used to judge if current user should be
  binlogged in query log event. So it is better to call it m_binlog_invoker.
  The related functions are renamed too.
sql/sql_class.cc:
  Refactoring THD::current_user_used and related functions.
  current_user_used is used to judge if current user should be
  binlogged in query log event. So it is better to call it m_binlog_invoker.
  The related functions are renamed too.
sql/sql_class.h:
  Refactoring THD::current_user_used and related functions.
  current_user_used is used to judge if current user should be
  binlogged in query log event. So it is better to call it m_binlog_invoker.
  The related functions are renamed too.
sql/sql_parse.cc:
  Call binlog_invoker() for GRANT and REVOKE statements.
2010-10-23 20:55:44 +08:00
Bjorn Munch
909f0bf94a Follow-up to Bug #55582 which allows checking strings in if
Simplified cases where a select was used to compare variable against ''
2010-10-21 15:20:50 +02:00
unknown
6646fecc14 Bug#55478 Row events wrongly apply on the temporary table of the same name
Rows events were applied wrongly on the temporary table with the same name.
But rows events are generated only for base tables. As temporary
table's data never be binlogged on row mode. Normally, base table of the
same name cannot be updated if a temporary table has the same name.
But there are two cases which can generate rows events on 
the base table of same name.
      
Case1: 'CREATE TABLE ... SELECT' statement.
In mixed format, it will generate rows events if it is unsafe.
      
Case2: Drop a transactional temporary table in a transaction
       (happens only on 5.5+).
BEGIN;
DROP TEMPORARY TABLE t1;       # t1 is a InnoDB table
INSERT INTO t1 VALUES(rand()); # t1 is a MyISAM table
COMMIT;
'DROP TEMPORARY TABLE' will be put in the transaction cache and
binlogged after the rows events generated by the 'INSERT' statement.
      
After this patch, slave opens only base table when applying a rows event.
2010-10-21 13:43:19 +08:00
Bjorn Munch
05062d579a Bug #56654 pb2 log is very hard to read
Added some more info in a number of fail cases
(re-commit for administrative reasons)
2010-10-19 14:01:14 +02:00
Bjorn Munch
84c57a5e27 Bug #52828 Tests that use perl fail when perl is not in path
main.mysqltest skipped on Windows because a perl intentionally does exit(1)
Use exit(2), as exit(1) on Windows is indistinguishable from failing to
execute perl.
2010-10-19 13:56:30 +02:00
Bjorn Munch
8a67fc8c82 Test wait_timeout: do not fail by SQL syntax error, use die 2010-10-19 13:54:28 +02:00
Magne Mahre
95d91c0f57 Bug #46941 crash with lower_case_table_names=2 and foreign key
data dictionary confusion

On file systems with case insensitive file names, and
lower_case_table_names set to '2', the server could crash
due to a table definition cache inconsistency.  This is 
the default setting on MacOSX, but may also be set and
used on MS Windows.

The bug is caused by using two different strategies for
creating the hash key for the table definition cache, resulting
in failure to look up an entry which is present in the cache,
or failure to delete an existing entry.  One strategy was to
use the real table name (with case preserved), and the other
to use a normalized table name (i.e a lower case version).

This is manifested in two cases.  One is  during 'DROP DATABASE', 
where all known files are removed.  The removal from
the table definition cache is done via a generated list of
TABLE_LIST with keys (wrongly) created using the case preserved 
name.  The other is during CREATE TABLE, where the cache lookup
is also (wrongly) based on the case preserved name.
   
The fix was to use only the normalized table name when
creating hash keys.


sql/sql_db.cc:
  Normalize table name (i.e lower case it)
sql/sql_table.cc:
  table_name contains the normalized name
  alias contains the real table name
2010-10-19 12:27:09 +02:00
Marko Mäkelä
c38071ec18 Bug #56680 wrong InnoDB results from a case-insensitive covering index
row_search_for_mysql(): When a secondary index record might not be
visible in the current transaction's read view and we consult the
clustered index and optionally some undo log records, return the
relevant columns of the clustered index record to MySQL instead of the
secondary index record.

ibuf_insert_to_index_page_low(): New function, refactored from
ibuf_insert_to_index_page().

ibuf_insert_to_index_page(): When we are inserting a record in place
of a delete-marked record and some fields of the record differ, update
that record just like row_ins_sec_index_entry_by_modify() would do.

btr_cur_update_alloc_zip(): Make the function public.

mysql_row_templ_t: Add clust_rec_field_no.

row_sel_store_mysql_rec(), row_sel_push_cache_row_for_mysql(): Add the
flag rec_clust, for returning data at clust_rec_field_no instead of
rec_field_no. Resurrect the debug assertion that the record not be
marked for deletion. (Bug #55626)

[UNIV_DEBUG || UNIV_IBUF_DEBUG] ibuf_debug, buf_page_get_gen(),
buf_flush_page_try():
Implement innodb_change_buffering_debug=1 for evicting pages from the
buffer pool, so that change buffering will be attempted more
frequently.
2010-10-19 09:04:15 +03:00
Marko Mäkelä
a8f2f7af32 Bug #56680 wrong InnoDB results from a case-insensitive covering index
row_search_for_mysql(): When a secondary index record might not be
visible in the current transaction's read view and we consult the
clustered index and optionally some undo log records, return the
relevant columns of the clustered index record to MySQL instead of the
secondary index record.

REC_INFO_DELETED_FLAG: Move the definition from rem0rec.ic to rem0rec.h.

ibuf_insert_to_index_page_low(): New function, refactored from
ibuf_insert_to_index_page().

ibuf_insert_to_index_page(): When we are inserting a record in place
of a delete-marked record and some fields of the record differ, update
that record just like row_ins_sec_index_entry_by_modify() would do.

mysql_row_templ_t: Add clust_rec_field_no.

row_sel_store_mysql_rec(), row_sel_push_cache_row_for_mysql(): Add the
flag rec_clust, for returning data at clust_rec_field_no instead of
rec_field_no. Resurrect the debug assertion that the record not be
marked for deletion. (Bug #55626)

buf_LRU_free_block(): Refactored from
buf_LRU_search_and_free_block(). This is needed for the
innodb_change_buffering_debug diagnostics.

[UNIV_DEBUG || UNIV_IBUF_DEBUG] ibuf_debug, buf_page_get_gen(),
buf_flush_page_try():
Implement innodb_change_buffering_debug=1 for evicting pages from the
buffer pool, so that change buffering will be attempted more
frequently.
2010-10-19 08:58:53 +03:00
Dmitry Shulga
cdddc7bfd5 Follow up for bug#36742. Changed test case for bug#19828
because currently hostname stored in db in lowercase.
2010-10-18 21:03:53 +07:00
Vasil Dimov
78804bc8bd Fix Bug#57252 disabling innobase_stats_on_metadata disables ANALYZE
This is a merge from 5.1/builtin to 5.1/plugin of:

  --------------
  revision-id: vasil.dimov@oracle.com-20101018104811-nwqhg9vav17kl5s1
  committer: Vasil Dimov <vasil.dimov@oracle.com>
  timestamp: Mon 2010-10-18 13:48:11 +0300
  message:
    Fix Bug#57252 disabling innobase_stats_on_metadata disables ANALYZE
    
    In order to fix this bug we need to distinguish whether ha_innobase::info()
    has been called from ::analyze() or not. Rename ::info() to ::info_low()
    and add a boolean parameter that tells whether the call is from ::analyze()
    or not. Create a new simple ::info() that just calls
    ::info_low(false => not called from analyze). From ::analyze() instead of
    ::info() call ::info_low(true => called from analyze).
    
    Approved by:	Jimmy (rb://487)
  --------------
2010-10-18 14:20:16 +03:00
Vasil Dimov
902b13fa57 Fix Bug#57252 disabling innobase_stats_on_metadata disables ANALYZE
In order to fix this bug we need to distinguish whether ha_innobase::info()
has been called from ::analyze() or not. Rename ::info() to ::info_low()
and add a boolean parameter that tells whether the call is from ::analyze()
or not. Create a new simple ::info() that just calls
::info_low(false => not called from analyze). From ::analyze() instead of
::info() call ::info_low(true => called from analyze).

Approved by:	Jimmy (rb://487)
2010-10-18 13:48:11 +03:00