Commit graph

22376 commits

Author SHA1 Message Date
Georgi Kodinov
dd9db3233c merged 5.0-bugteam to 5.1-bugteam 2008-08-19 15:21:18 +03:00
Georgi Kodinov
40bd9a4218 merged 5.0-main to 5.0-bugteam 2008-08-19 14:55:36 +03:00
Georgi Kodinov
6387cac94b Bug#38195: Incorrect handling of aggregate functions when loose index scan
is used causes server crash.
  Revert the fix : unstable test case revealed by pushbuild
2008-08-19 13:36:24 +03:00
Mattias Jonsson
55bf4addb6 merge 2008-08-19 12:26:30 +02:00
Mattias Jonsson
ad15cd6882 Post push fix for valgrind warning in ha_partition.cc
Bug#35161
Fixed memory leak when failing to open a partition.

Bug#20129
Added tests for verifying REPAIR PARTITION.

mysql-test/std_data/parts/t1_will_crash#P#p1_first_1024.MYD:
  Bug#20129: ALTER TABLE ... REPAIR PARTITION ... not working
  
  (see mysql-test/suite/parts/t/partition_repair_myisam.test
  Created by:
  CREATE TABLE t1_will_crash (
    a VARCHAR(255),
    b INT,
    c LONGTEXT,
    PRIMARY KEY (a, b))ENGINE=MyISAM
  PARTITION BY HASH (b)
  PARTITIONS 7;
  INSERT INTO t1_will_crash VALUES ...
  and then
  head -c 1024 var/master-data/test/t1_will_crash#P#p1.MYD
  into this file.
mysql-test/std_data/parts/t1_will_crash#P#p2.MYD:
  Bug#20129: ALTER TABLE ... REPAIR PARTITION ... not working
  
  (see mysql-test/suite/parts/t/partition_repair_myisam.test)
  copy of file right after _mi_mark_file_changed in mi_write
  was done.
mysql-test/std_data/parts/t1_will_crash#P#p2.MYI:
  Bug#20129: ALTER TABLE ... REPAIR PARTITION ... not working
  
  (see mysql-test/suite/parts/t/partition_repair_myisam.test)
  copy of file right after _mi_mark_file_changed in mi_write
  was done.
mysql-test/std_data/parts/t1_will_crash#P#p3.MYI:
  Bug#20129: ALTER TABLE ... REPAIR PARTITION ... not working
  
  (see mysql-test/suite/parts/t/partition_repair_myisam.test)
  copy of file right after *share->write_record was done.
mysql-test/std_data/parts/t1_will_crash#P#p4.MYI:
  Bug#20129: ALTER TABLE ... REPAIR PARTITION ... not working
  
  (see mysql-test/suite/parts/t/partition_repair_myisam.test)
  copy of file right after flush_cached_blocks
mysql-test/std_data/parts/t1_will_crash#P#p6.MYD:
  Bug#20129: ALTER TABLE ... REPAIR PARTITION ... not working
  
  (see mysql-test/suite/parts/t/partition_repair_myisam.test)
  copy of file right after _mi_write_part_record in
  write_dynamic_record returned for the first time.
mysql-test/std_data/parts/t1_will_crash#P#p6_2.MYD:
  Bug#20129: ALTER TABLE ... REPAIR PARTITION ... not working
  
  (see mysql-test/suite/parts/t/partition_repair_myisam.test)
  copy of file right after _mi_write_part_record in
  write_dynamic_record returned for the second time.
mysql-test/std_data/parts/t1_will_crash#P#p6_3.MYD:
  Bug#20129: ALTER TABLE ... REPAIR PARTITION ... not working
  
  (see mysql-test/suite/parts/t/partition_repair_myisam.test)
  copy of file right after _mi_write_part_record in
  write_dynamic_record returned for the third time.
  (data file fully updated).
mysql-test/suite/parts/r/partition_recover_myisam.result:
  Bug#35161
  
  Renamed since it was a test of recover
  and to make repair free for use without
  --myisam-recover
mysql-test/suite/parts/r/partition_repair_myisam.result:
  Bug#20129: ALTER TABLE ... REPAIR PARTITION ... not working
  
  New result file for testing CHECK/REPAIR of partitioned tables
mysql-test/suite/parts/t/partition_recover_myisam-master.opt:
  Bug#35161
  
  Renamed since it was a test of recover
  and to make repair free for use without
  --myisam-recover
mysql-test/suite/parts/t/partition_recover_myisam.test:
  Bug#35161
  
  Renamed since it was a test of recover
  and to make repair free for use without
  --myisam-recover
mysql-test/suite/parts/t/partition_repair_myisam.test:
  Bug#20129: ALTER TABLE ... REPAIR PARTITION ... not working
  
  New test file for testing CHECK/REPAIR of partitioned tables
sql/ha_partition.cc:
  Bug#35161
  
  Fix of memory leak when open of partition failed.
2008-08-19 11:44:22 +02:00
Tatiana A. Nurnberg
02f305516f Bug#35981: ALTER EVENT causes the server to change the PRESERVE option.
If [NOT] PRESERVE was not given, parser always defaulted to NOT
PRESERVE, making it impossible for the "not given = no change"
rule to work in ALTER EVENT. Leaving out the PRESERVE-clause
defaults to NOT PRESERVE on CREATE now, and to "no change" in
ALTER.

mysql-test/r/events_2.result:
  show that giving no PRESERVE-clause to ALTER EVENT
  results in no change. show that giving no PRESERVE-clause
  to CREATE EVENT defaults to NOT PRESERVE as per the docs.
  Show specifically that this is also handled correctly when
  trying to ALTER EVENTs into the past.
mysql-test/t/events_2.test:
  show that giving no PRESERVE-clause to ALTER EVENT
  results in no change. show that giving no PRESERVE-clause
  to CREATE EVENT defaults to NOT PRESERVE as per the docs.
  Show specifically that this is also handled correctly when
  trying to ALTER EVENTs into the past.
sql/event_db_repository.cc:
  If ALTER EVENT was given no PRESERVE-clause (meaning "no change"),
  we don't know the previous PRESERVE-setting by the time we check
  the parse-data. If ALTER EVENT was given dates that are in the past,
  we don't know how to react, lacking the PRESERVE-setting. Heal this
  by running the check later when we have actually read the previous
  EVENT-data.
sql/event_parse_data.cc:
  Change default for ON COMPLETION to indicate, "not specified."
  Also defer throwing errors when ALTER EVENT is given dates in
  the past but not PRESERVE-clause until we know the previous
  PRESERVE-value.
sql/event_parse_data.h:
  Add third state for ON COMPLETION [NOT] PRESERVE (preserve,
  don't, not specified).
  
  Make check_dates() public so we can defer this check until
  deeper in the callstack where we have all the required data.
sql/sql_yacc.yy:
  If CREATE EVENT is not given ON COMPLETION [NOT] PRESERVE,
  we default to NOT, as per the docs.
2008-08-18 13:05:51 +02:00
Chad MILLER
3758804c69 Fix failing test case, re: bug 38195. 2008-08-15 17:52:41 -04:00
Chad MILLER
86fd86ed98 Merge from 5.0-bugteam. 2008-08-15 16:42:29 -04:00
Chad MILLER
21598ea0e6 Bug#37301 Length and Max_length differ with no obvious reason(2nd version)
Length value is the length of the field,
Max_length is the length of the field value.
So Max_length can not be more than Length.
The fix: fixed calculation of the Item_empty_string item length

(Patch applied and queued on demand of Trudy/Davi.)

sql/item.h:
  fixed calculation of the item length
sql/sql_show.cc:
  removed unnecessary code
2008-08-15 16:13:27 -04:00
Chad MILLER
535a183964 Merge from 5.0-bugteam. 2008-08-15 15:49:43 -04:00
Chad MILLER
65c3870cfc Bug#36270: incorrect calculation result - works in 4.1 but not in 5.0 or 5.1
When the fractional part in a multiplication of DECIMALs
overflowed, we truncated the first operand rather than the
longest. Now truncating least significant places instead
for more precise multiplications.

(Queuing at demand of Trudy/Davi.)

mysql-test/r/type_newdecimal.result:
  show that if we need to truncate the scale of an operand, we pick the
  right one (that is, we discard the least significant decimal places)
mysql-test/t/type_newdecimal.test:
  show that if we need to truncate the scale of an operand, we pick the
  right one (that is, we discard the least significant decimal places)
strings/decimal.c:
  when needing to disregard fractional parts, pick the least
  significant ones
2008-08-15 15:46:21 -04:00
Chad MILLER
0156ccdc50 Merge from 5.0-bugteam. 2008-08-15 15:30:17 -04:00
Chad MILLER
2dcc449fab Bug#21579 - innodb_concurrent random failures with varying differences
Due to unknown changes the test failed in some ways.

Fixed by checking the test case in detail, commenting the expected behavior,
and fixing error directives.

In the course of the analyze unneeded get_lock()/release_lock() use,
unneeded send/reap use, and unneeded sleeps were removed. The lock wait
timeout was reduced to 1 second, so that this is no big-test any more.

The test was split into two parts, one running the tests with
--innodb_locks_unsafe_for_binlog, the other part without.
The main part (include/concurrent.inc) conditionally expects
lock wait timeouts based on the value of the system variable
innodb_locks_unsafe_for_binlog.

The major part of the patch comes from Kristofer Pettersson.

(Chad queues this patch on demand by Trudy/Davi.)
2008-08-15 14:48:14 -04:00
Chad MILLER
35c8b4c5e7 Bug#38272: timestamps fields incorrectly defaulted on \
update accross partitions.
      
It's not Innodb-specific bug.
ha_partition::update_row() didn't set
table->timestamp_field_type= TIMESTAMP_NO_AUTO_SET when
orig_timestamp_type == TIMESTAMP_AUTO_SET_ON_INSERT.

So that a partition sets the timestamp field when a record
is moved to a different partition.

Fixed by doing '= TIMESTAMP_NO_AUTO_SET' unconditionally.
Also ha_partition::write_row() is fixed in same way as now
Field_timestamp::set() is called twice in SET_ON_INSERT case.

(Chad queues this patch on demand by Trudy/Davi.)

mysql-test/r/partition.result:
  Bug#38272 timestamps fields incorrectly defaulted on update accross partitions.
  test result
mysql-test/t/partition.test:
  Bug#38272 timestamps fields incorrectly defaulted on update accross partitions.
  test case
sql/ha_partition.cc:
  Bug#38272 timestamps fields incorrectly defaulted on update accross partitions.
  Do table->timestamp_field_type= TIMESTAMP_NO_AUTO_SET unconditionally
  in ha_partition::update_row and ::write_row()
2008-08-15 14:26:25 -04:00
Davi Arnaut
986a27fb03 Merge from mysql-5.1 main. 2008-08-15 12:58:19 -03:00
Sergey Glukhov
02aaff1b34 Bug#36638 mysqld crashes when open file limit is passed and general query log enabled
The problem:
CSV storage engine open function returns success even
thought it failed to open the data file
The fix:
return error
Additional fixes:
added MY_WME to my_open to avoid mysterious error message
free share struct if open the file was unsuccessful


mysql-test/r/csv.result:
  test result
mysql-test/t/csv.test:
  test case
storage/csv/ha_tina.cc:
  The problem:
  CSV storage engine open function returns success even
  thought it failed to open the data file
  The fix:
  return error
  Additional fixes:
  added MY_WME to my_open to avoid mysterious error message
  free share struct if open the file was unsuccessful
2008-08-15 11:53:54 +05:00
Ramil Kalimullin
2b179caf9a Fix for bug #34779: crash in checksum table on federated tables
with blobs containing nulls

Problem: FEDERATED SE improperly stores NULL fields in the record buffer.

Fix: store them properly.


mysql-test/r/federated.result:
  Fix for bug #34779: crash in checksum table on federated tables 
  with blobs containing nulls
    - test result.
mysql-test/t/federated.test:
  Fix for bug #34779: crash in checksum table on federated tables 
  with blobs containing nulls
    - test case.
sql/ha_federated.cc:
  Fix for bug #34779: crash in checksum table on federated tables 
  with blobs containing nulls
    - storing a NULL field in the record buffer
      we must initialize its data as other code
      may rely on it.
2008-08-15 11:40:05 +05:00
Ramil Kalimullin
67a3d9e4d0 Fix for bug#37337: Function returns different results
Problem: REGEXP in functions/PSs may return wrong results
due to improper initialization.

Fix: initialize required REGEXP params.


sql/item_cmpfunc.cc:
  Fix for bug#37337: Function returns different results
  
  prev_regexp is used in the Item_func_regex::regcomp()
  to store previous regex and to avoid re-initialization 
  if given the same pattern.
  Shoud be deleted in the Item_func_regex::cleanup() where we
  clean up the regexp structure.
2008-08-15 10:53:25 +05:00
Evgeny Potemkin
368f7f63b2 Fixed failing test case for the bug#38195. 2008-08-14 23:55:18 +04:00
He Zhenxing
193a8f9735 fix after merge
mysql-test/extra/rpl_tests/rpl_row_basic.test:
  remove extra sync_slave_with_master
2008-08-14 16:27:28 +08:00
He Zhenxing
7bf8e29b99 Auto merge from mysql-5.1 main 2008-08-14 14:27:18 +08:00
Matthias Leich
d23e8e06a1 Fix for Bug#37853
Test "funcs_1.processlist_val_ps" fails in various ways
+ corrections of logic in poll routines
+ minor improvements
2008-08-13 21:44:54 +02:00
Matthias Leich
632cf8ef43 Improve the testcases for Bug 12093 in ps_ddl.test
Details:
- add subtest with drop unrelated view
- rearrange existing tests so that a distinction
  between drop procedure and drop function effects
  is possible
2008-08-13 21:42:21 +02:00
Serge Kozlov
f2188dc323 Bug#18817, removing --binlog-format option from .opt files 2008-08-13 23:12:51 +04:00
Evgeny Potemkin
b789b4f33c Bug#38195: Incorrect handling of aggregate functions when loose index scan is
used causes server crash.

When the loose index scan access method is used values of aggregated functions
are precomputed by it. Aggregation of such functions shouldn't be performed
in this case and functions should be treated as normal ones.
The create_tmp_table function wasn't taking this into account and this led to
a crash if a query has MIN/MAX aggregate functions and employs temporary table
and loose index scan.
Now the JOIN::exec and the create_tmp_table functions treat MIN/MAX aggregate
functions as normal ones when the loose index scan is used.


mysql-test/r/group_min_max.result:
  Added a test case for the bug#38195.
mysql-test/t/group_min_max.test:
  Added a test case for the bug#38195.
sql/sql_select.cc:
  Bug#38195: Incorrect handling of aggregate functions when loose index scan is
  used causes server crash.
  Now the JOIN::exec and the create_tmp_table functions treat MIN/MAX aggregate
  functions as normal ones when the loose index scan is used.
2008-08-13 22:24:55 +04:00
Timothy Smith
88329eafd9 Up-merge from 5.0; adds test for innodb bug 34286 (but no code changes). 2008-08-13 01:27:22 -06:00
Mattias Jonsson
642bf9022a manual merge of bug#37402 2008-08-12 12:26:23 +02:00
He Zhenxing
44d0fcddf1 Apply tomas's patch to fix rpl_row_basic.test, this can fix BUG#37884,
BUG#38369, enable rpl_row_basic_7ndb test
2008-08-12 17:09:36 +08:00
Mattias Jonsson
bdab488391 Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
partition is corrupt

Updated result files after merge

mysql-test/suite/parts/r/partition_alter1_1_2_innodb.result:
  Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
  partition is corrupt
  
  Updated result file after merge
mysql-test/suite/parts/t/disabled.def:
  Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
  partition is corrupt
  
  Enabled two tests after fixing the bug.
2008-08-12 10:02:30 +02:00
Mattias Jonsson
1c06de1fd6 manual merge of Bug#20129 into 5.1-bugteam 2008-08-11 20:06:08 +02:00
Mattias Jonsson
f50c4207f2 Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
partition is corrupt

The main problem was that ALTER TABLE t ANALYZE/CHECK/OPTIMIZE/REPAIR
PARTITION took another code path (over mysql_alter_table instead of
mysql_admin_table) which differs in two ways:
1) alter table opens the tables in a different way than admin tables do
   resulting in returning with error before it tried the command
2) alter table does not start to send any diagnostic rows to the client
   which the lower admin functions continue to use -> resulting in
   assertion crash

The fix:
Remapped ALTER TABLE t ANALYZE/CHECK/OPTIMIZE/REPAIR PARTITION to use
the same code path as ANALYZE/CHECK/OPTIMIZE/REPAIR TABLE t.
Adding check in mysql_admin_table to setup the partition list for
which partitions that should be used.


Partitioned tables will still not work with
REPAIR TABLE/PARTITION USE_FRM, since that requires moving partitions
to tables, REPAIR TABLE t USE_FRM, and check that the data still
fulfills the partitioning function and then move the table back to
being a partition.

NOTE: I have removed the following functions from the handler
interface:
analyze_partitions, check_partitions, optimize_partitions,
repair_partitions
Since they are not longer needed.
THIS ALTERS THE STORAGE ENGINE API

mysql-test/r/handler_innodb.result:
  Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
  partition is corrupt
  
  Added a note result row.
mysql-test/r/innodb.result:
  Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
  partition is corrupt
  
  Added a note result row.
mysql-test/r/innodb_mysql.result:
  Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
  partition is corrupt
  
  Added a note result row.
mysql-test/r/partition.result:
  Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
  partition is corrupt
  
  Updated after fixing ANALYZE/CHECK/OPTIMIZE/REPAIR partitioned
  tables.
mysql-test/r/trigger-trans.result:
  Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
  partition is corrupt
  
  Added a note result row.
mysql-test/suite/ndb/r/ndb_partition_key.result:
  Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
  partition is corrupt
  
  Updated after fixing ANALYZE/CHECK/OPTIMIZE/REPAIR partitioned
  tables.
mysql-test/suite/ndb/t/ndb_partition_key.test:
  Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
  partition is corrupt
  
  Updated after fixing ANALYZE/CHECK/OPTIMIZE/REPAIR partitioned
  tables.
mysql-test/suite/parts/inc/partition_alter4.inc:
  Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
  partition is corrupt
  
  Updated after fixing ANALYZE/CHECK/OPTIMIZE/REPAIR partitioned
  tables.
mysql-test/suite/parts/r/partition_alter4_innodb.result:
  Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
  partition is corrupt
  
  Updated after fixing ANALYZE/CHECK/OPTIMIZE/REPAIR partitioned
  tables.
mysql-test/suite/parts/r/partition_alter4_myisam.result:
  Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
  partition is corrupt
  
  Updated after fixing ANALYZE/CHECK/OPTIMIZE/REPAIR partitioned
  tables.
mysql-test/suite/rpl/r/rpl_failed_optimize.result:
  Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
  partition is corrupt
  
  Added a note result row.
mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result:
  Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
  partition is corrupt
  
  Added a note result row.
mysql-test/t/partition.test:
  Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
  partition is corrupt
  
  Updated after fixing ANALYZE/CHECK/OPTIMIZE/REPAIR partitioned
  tables.
sql/ha_partition.cc:
  Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
  partition is corrupt
  
  Added a function for returning admin commands result rows
  Updated handle_opt_partitions to handle admin commands result rows,
  and some error filtering (as mysql_admin_table do).
  
  Removed the functions analyze/check/optimize/repair_partitions
  since they have no longer any use.
sql/ha_partition.h:
  Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
  partition is corrupt
  
  Removed analyze/check/optimize/repair_partitions since they
  are no longer are needed.
sql/handler.cc:
  Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
  partition is corrupt
  
  Removed analyze/check/optimize/repair_partitions since they
  are no longer are needed.
sql/handler.h:
  Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
  partition is corrupt
  
  Removed analyze/check/optimize/repair_partitions since they
  are no longer are needed.
sql/mysql_priv.h:
  Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
  partition is corrupt
  
  Added set_part_state for reuse of code in mysql_admin_table.
  (Originally fond in sql/sql_partition.cc:prep_alter_part_table)
sql/protocol.cc:
  Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
  partition is corrupt
  
  Added one assert and a debug print.
sql/sql_partition.cc:
  Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
  partition is corrupt
  
  Refactored code for setting up partition state, set_part_state,
  now used in both prep_alter_part_table and
  sql_table.cc:mysql_admin_table.
  Removed code for handling ANALYZE/CHECK/OPTIMIZE/REPAIR partitions,
  since it is now handled by mysql_admin_table.
sql/sql_table.cc:
  Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
  partition is corrupt
  
  Added functionality in mysql_admin_table to work with partitioned
  tables.
  Fixed a possible assertion bug for HA_ADMIN_TRY_ALTER
  (If analyze would output a row, it fails since the row was already
  started).
sql/sql_yacc.yy:
  Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
  partition is corrupt
  
  Remapped ALTER TABLE t ANALYZE/CHECK/OPTIMIZE/REPAIR PARTITION
  to use the same code path as ANALYZE/CHECK/OPTIMIZE/REPAIR TABLE
  instead of taking the ALTER TABLE path.
  Added reset of alter_info for ANALYZE/CHECK/OPTIMIZE/REPAIR TABLE
  since it is now used by partitioned tables.
storage/myisam/mi_check.c:
  Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
  partition is corrupt
  
  Changed warning message from "Found X parts  Should be: Y parts"
  to "Found X key parts. Should be Y", since it could be confusing
  with partitioned tables.
2008-08-11 20:02:03 +02:00
Mattias Jonsson
2ace7dc939 merge into an updated 5.1-bugteam tree 2008-08-11 16:15:39 +02:00
Timothy Smith
5d036ff311 Up-merge test case for bug 35220 from 5.0 (no real code changes). 2008-08-07 18:33:12 -06:00
Timothy Smith
9d9fa39b97 Cherry-pick fix for Bug#35220 from innodb-5.0-ss2475 snapshot.
Bug#35220: ALTER TABLE too picky on reserved word "foreign"

In ALTER TABLE, change the internal parser to search for
``FOREIGN[[:space:]]'' instead of only ``FOREIGN'' when parsing
ALTER TABLE ... DROP FOREIGN KEY ...; otherwise it could be mistaken
with ALTER TABLE ... DROP foreign_col;

(This fix is already present in MySQL 5.1 and higher.)
2008-08-07 18:25:24 -06:00
Timothy Smith
dc593c3ec4 Cherry-pick InnoDB fixes for Bug#34286, Bug#35352, and Bug#36600 from snapshot
innodb-5.0-ss2475.

Bug #34286  Assertion failure in thread 2816 in file .\row\row0sel.c line 3500
Since autoinc init performs a MySQL SELECT query to determine the auto-inc
value, set prebuilt->sql_stat_start = TRUE so that it is performed like any
normal SELECT, regardless of the context in which it was invoked.


Bug #35352  If InnoDB crashes with UNDO slots full error the error persists on restart
We've added a heuristic that checks the size of the UNDO slots cache lists
(insert and upate). If either of cached lists has more than 500 entries then we
add any UNDO slots that are freed, to the common free list instead of the cache
list, this is to avoid the case where all the free slots end up in only one of
the lists on startup after a crash.

Tested with test case for 26590 and passes all mysql-test(s).

Bug #36600  SHOW STATUS takes a lot of CPU in buf_get_latched_pages_number
Fixed by removing the Innodb_buffer_pool_pages_latched variable from SHOW
STATUS output in non-UNIV_DEBUG compilation.
2008-07-31 15:47:57 -06:00
Georgi Kodinov
a3cd2e2dab merged 34159 and 37662 5.0-bugteam->5.1-bugteam 2008-07-31 12:50:24 +03:00
Georgi Kodinov
ae4a35fd5c Bug#37662 nested if() inside sum() is parsed in exponential time
min() and max() functions are implemented in MySQL as macros.
This means that max(a,b) is expanded to: ((a) > (b) ? (a) : (b))
Note how 'a' is quoted two times.
Now imagine 'a' is a recursive function call that's several 10s of levels deep.
And the recursive function does max() with a function arg as well to dive into
recursion.
This means that simple function call can take most of the clock time.
Identified and fixed several such calls to max()/min() : including the IF() 
sql function implementation.

mysql-test/r/func_if.result:
  Bug#37662 test case
mysql-test/t/func_if.test:
  Bug#37662 test case
sql/item.cc:
  Bug#37662 don't call expensive functions as arguments to min/max
sql/item_cmpfunc.cc:
  Bug#37662 don't call expensive functions as arguments to min/max
sql/item_func.cc:
  Bug#37662 don't call expensive functions as arguments to min/max
2008-07-30 14:07:37 +03:00
Sven Sandberg
5101f124e8 merge 5.1 main -> 5.1-rpl-testfixes
all changes automerged without conflicts
2008-07-29 19:55:46 +02:00
Sven Sandberg
c6bf7ead8f BUG#38068: binlog_stm_binlog fails sporadically in pushbuild
Post-push fix: updated some result files that were affected
by the previous fix to this bug.


mysql-test/suite/binlog/r/binlog_killed_simulate.result:
  Updated result file.
mysql-test/suite/binlog/r/binlog_row_binlog.result:
  Updated result file.
mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result:
  Updated result file.
mysql-test/suite/binlog/r/binlog_statement_insert_delayed.result:
  Updated result file.
mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result:
  Updated result file.
mysql-test/suite/rpl/r/rpl_stm_log.result:
  Updated result file.
2008-07-29 17:36:13 +02:00
Alexander Barkov
480554a76a Bug#36597 Testsuite "jp": Suspicious results for some tests using sjis
Problem: Extra new line appeared in jisx0208_sjis2.dat in a mistake, which
broke jp_convert_sjis and jp_select_sjis tests.
Fix: removing extra line

  mysql-test/suite/jp/std_data/jisx0208_sjis2.dat:
      removing wrong extra new line

  mysql-test/suite/jp/t/disabled.def:     
      activating disabled tests
2008-07-29 10:43:57 +05:00
Igor Babaev
7f615b2c14 Merge 2008-07-28 01:24:56 -07:00
Igor Babaev
b6e3a9e28c Fixed bug #38191.
Calling List<Cached_item>::delete_elements for the same list twice
caused a crash of the server in the function JOIN::cleaunup.
Ensured that delete_elements() in JOIN::cleanup would be called only once.


mysql-test/r/subselect.result:
  Added a test case for bug #38191.
mysql-test/t/subselect.test:
  Added a test case for bug #38191.
sql/sql_select.cc:
  Fixed bug #38191.
  Ensured that delete_elements() in JOIN::cleanup would be called only once.
2008-07-26 13:44:07 -07:00
Patrick Crews
e195149b43 Bug#38383 - Certain funcs_1 trig tests are failing on Pushbuild.
Removing duplicate 'setup' portions of these include files.  Likely an editor error created dupe lines.
This is causing many Pushbuild errors
2008-07-25 13:14:52 -04:00
Georgi Kodinov
c7fc78c3b2 merge of 5.1-main to 5.1-bugteam 2008-07-25 18:06:47 +03:00
Georgi Kodinov
e113042588 Disabled 5.1 tests (and reported bugs)
mysql-test/suite/ndb/t/disabled.def:
  disabled failing test in 5.1-bzr
mysql-test/suite/rpl_ndb/t/disabled.def:
  disabled failing test in 5.1-bzr
2008-07-25 13:32:05 +03:00
Davi Arnaut
14887bb2ab Cherry-pick Bug#33362 from mysql-5.1 2008-07-24 11:14:34 -03:00
Horst Hunger
94ba5b8914 Merge from parent. 2008-07-24 09:49:29 +02:00
Sven Sandberg
159505f82b BUG#38068: binlog_stm_binlog fails sporadically in pushbuild
Problem: binlog_stm_binlog runs INSERT DELAYED queries, and
then prints the contents of the binlog. Before checking the
contents of the binlog, the test waits until the rows have
appeared in the table. However, this is not enough, since
INSERT DELAYED does not write rows to the binlog at the same
time as it writes them to the table. So there is a race.
Fix: Add a FLUSH TABLES before SHOW BINLOG EVENTS. That
waits until the insert_delayed thread is done.


mysql-test/extra/binlog_tests/binlog_insert_delayed.test:
  - Added FLUSH TABLES, so that SHOW BINLOG EVENTS becomes
  deterministic.
  - Added comments.
  - Removed unnecessary 'set @@session.auto_increment_increment'
  statements.
  - Removed unnecessary check that the number of rows inserted
  to the table is 11.
mysql-test/suite/binlog/r/binlog_stm_binlog.result:
  updated result file
2008-07-23 18:56:39 +02:00
Sven Sandberg
d8c838c27a BUG#37733: rpl.rpl_flushlog_loop 'row' fails sporadically on pushbuild
BUG#37884: rpl_row_basic_2myisam and rpl_row_basic_3innodb fail sporadically in pushbuild
These have been fixed in 5.1-rpl. Re-applying fix for BUG#37884
in 5.1-bugteam, and disabling rpl_flushlog_loop for BUG#37733 in
5.1-bugteam.


mysql-test/extra/rpl_tests/rpl_row_basic.test:
  Missing sync_slave_with_master added.
mysql-test/suite/rpl/t/disabled.def:
  Disabling rpl_flushlog_loop until the fixed version gets
  merged from 5.1-rpl
2008-07-23 16:34:02 +02:00
Horst Hunger
ea4b396303 Final fix for bug#36522 in 5.1. This new fix was necessary due to fix of bug 37708. 2008-07-23 16:06:44 +02:00
Georgi Kodinov
dd85aa78ba Bug#37830 : ORDER BY ASC/DESC - no difference
Range scan in descending order for c <= <col> <= c type of
ranges was ignoring the DESC flag.
However some engines like InnoDB have the primary key parts 
as a suffix for every secondary key.
When such primary key suffix is used for ordering ignoring 
the DESC is not valid.
But we generally would like to do this because it's faster.
            
Fixed by performing only reverse scan if the primary key is used.
Removed some dead code in the process.

mysql-test/r/innodb_mysql.result:
  Bug#37830 : test case
mysql-test/t/innodb_mysql.test:
  Bug#37830 : test case
sql/opt_range.cc:
  Bug#37830 : 
  - preserve and use used_key_parts to
    distinguish when a primary key suffix is used
  - removed some dead code
sql/opt_range.h:
  Bug#37830 : 
  - preserve used_key_parts
  - dead code removed
sql/sql_select.cc:
  Bug#37830 : Do only reverse order traversal
  if the primary key suffix is used.
2008-07-23 14:25:00 +03:00
Sven Sandberg
7978905c5c BUG#37493: rpl_trunc_temp.test nondeterministic
Problem: the test waits for a 'DROP TEMPORARY TABLE' event to
appear in the master's binlog, then checks on the slave whether
the number of temporary tables has decreased. The slave does
not sync, causing a race.
Fix: check for the 'DROP TEMPORARY TABLE' event on slave
instead of on master.


mysql-test/suite/rpl/t/rpl_trunc_temp.test:
  - Fixed BUG#37493 by waiting for the event on the slave
  instead of on the master.
  - Added comments.
2008-07-23 12:13:55 +02:00
Horst Hunger
cbbe2afdda fix of bug#37708: removed a forgotten include file. 2008-07-23 08:51:04 +02:00
Horst Hunger
2017e5f944 Fix for bug#37708:
Deleted the removed tests.
2008-07-22 19:00:27 +02:00
Horst Hunger
56729a758c 2008-07-22 18:56:50 +02:00
Horst Hunger
ec7b92d7a0 Fix for bug#37708:The result files of the removed 64 bit tests. 2008-07-22 18:50:36 +02:00
Horst Hunger
5d938a8dbe Fix for bug#37708: Result files of removed 32 bit tests. 2008-07-22 18:48:47 +02:00
Horst Hunger
235f9bb6c2 Fix for bug#37708:The allocation of very large buffer must not be done in the pushbuild.
hhunger.
2008-07-22 18:45:55 +02:00
Horst Hunger
7200c5bad0 merge from parent. 2008-07-22 18:39:56 +02:00
Horst Hunger
2d83978f13 Fix for bug#37708:The allocation of very large buffer must not be done in the pushbuild. 2008-07-22 15:58:21 +02:00
Kristofer Pettersson
3a3894d2ca Disabled two test cases in 5.1 because of random failures. 2008-07-22 13:04:32 +02:00
Kristofer Pettersson
14afcb436f merge 5.1->5.1-bugteam 2008-07-22 12:56:36 +02:00
Tatiana A. Nurnberg
d78158f471 auto-merge 2008-07-22 08:54:07 +02:00
Sven Sandberg
6334196bd7 BUG#38269: pushbuild gives valgrind error in ha_statistic_increment for rpl_temporary
This does not fix the bug. It only disables the failing test.


mysql-test/suite/rpl/t/disabled.def:
  disable rpl_temporary
2008-07-21 21:05:06 +02:00
Tatiana A. Nurnberg
bb827398ab auto-merge + post-merge fixies 2008-07-21 11:20:03 +02:00
Timothy Smith
9e6621b861 Up-merge of merges, some criss-cross resolved with --weave. 2008-07-19 02:31:33 -06:00
Andrei Elkin
5ec6659e1e merge 2008-07-18 17:02:42 +03:00
Sven Sandberg
b51c2eb3aa BUG#38077: rpl_incident At line 22: query 'SELECT * ...' Table 'test.t1' doesn't exist
This is not a fix to the bug. It only adds debug info, so
that we can analyze the bug better next time it happens.
Please revert the patch after the bug is fixed.


mysql-test/suite/rpl/t/rpl_incident.test:
  Added debug info. This will only be printed if the
  test fails.
2008-07-18 15:07:14 +02:00
Georgi Kodinov
5f5a3cf1aa merge of 38158 to 5.1-bugteam 2008-07-18 15:00:45 +03:00
Andrei Elkin
7d1bc0a4f9 Bug #36818 rpl_server_id1 fails expecting slave has stopped
the reason for the failure is that io thread passes through a sequence of state
changes before it eventually got stuck at the expect running state as NO.
It's unreasonble to wait for the running status while the whole idea of the test is
to get to the IO thread error.

Fixed with changing the waiting condition.

mysql-test/suite/rpl/r/rpl_server_id1.result:
  results changed
mysql-test/suite/rpl/t/disabled.def:
  re-enabling rpl_server_id1
mysql-test/suite/rpl/t/rpl_server_id1.test:
  deploying the exact waiting condition i.e to wait for the slave io error.
2008-07-18 14:53:16 +03:00
Sven Sandberg
620c4878b3 BUG#38178: rpl_loaddata_map fails sporadically in pushbuild
Problem: master binlog has 'create table t1'. Master binlog
was removed before slave could replicate it. In test's cleanup
code, master did 'drop table t1', which caused slave sql
thread to stop with an error since slave sql thread did not
know about t1.
Fix: t1 is just an auxiliary construction, only needed on
master. Hence, we turn off binlogging before t1 is created,
drop t1 as soon as we don't need it anymore, and then turn
on binlogging again.


mysql-test/include/show_binlog_events.inc:
  Filter out directories and block_len from
  LOAD DATA INFILE events.
mysql-test/suite/rpl/r/rpl_loaddata_map.result:
  updated result file
mysql-test/suite/rpl/t/rpl_loaddata_map.test:
  Turn off binlogging while t1 is used, drop t1 as soon
  as we don't need it anymore, and turn on binlogging again.
  Also added some comments and replaced 'show binlog events'
  by 'source include/show_binlog_events.inc'.
2008-07-18 13:34:19 +02:00
Georgi Kodinov
88d66418c8 Bug 38158: mysql client regression, can't read dump files
- Revert the fix for bug 33812
- fixed a win32 warning

client/mysql.cc:
  revert the fix for bug 33812
mysql-test/r/mysql.result:
  revert the fix for bug 33812
mysql-test/t/mysql_delimiter.sql:
  revert the fix for bug 33812
mysys/default.c:
  fixed a win32 warning
2008-07-18 13:24:59 +03:00
Alexander Barkov
6a42c35fa7 Bug#27934 test client_xml misssing initialization
Problem: missing initialization, if the previous test
fails leaving table t1, client_xml fails as well.
Fix: adding initialization.
2008-07-18 14:07:16 +05:00
Andrei Elkin
f8e8332100 Bug #34647 rpl_temporary discovers more than one dump thread and fails to select
Many dump threads can exist due to a way the new version of mtr governs suites.

For this immediate problem the test is refined not to use I_S but rather to reconnect
explicitly with preserving logics of a an old target bug fixes verification.

mysql-test/suite/rpl/r/rpl_temporary.result:
  results changed
mysql-test/suite/rpl/t/rpl_temporary.test:
  refining the bug#17284 test to avoid counting dump threads in favor to reconnect
  explicitly with preserving the orig logics.
2008-07-18 11:20:55 +03:00
Sven Sandberg
ca505ca2bd BUG#38170: rpl_variables failed on pushbuild: could not sync with master
Problem: the test set @@global.init_slave to garbage at a time
which was not guaranteed to be after the time when the slave's
SQL thread used it. That would cause the slave's SQL thread to
stop in rare cases.
Fix: The test does not care about the value of
@@global.init_slave, except that it should be different on
master and slave. Hence, we set @@global.init_slave to
something that is valid SQL.


mysql-test/suite/rpl/r/rpl_variables.result:
  updated result file.
mysql-test/suite/rpl/t/rpl_variables.test:
  Set @@global.init_slave to something that is valid SQL.
2008-07-17 18:26:59 +02:00
Georgi Kodinov
804277fdbe merge of bug #37830 to 5.1 2008-07-17 18:51:24 +03:00
Georgi Kodinov
99cc894f91 auto merged 5.0-bugteam to /Users/kgeorge/B37830-5.0-bugteam 2008-07-17 15:14:35 +03:00
Kristofer Pettersson
53b49c6c1c Automerge 2008-07-17 12:16:53 +02:00
Kristofer Pettersson
451363afda Reverting patch for bug30087 2008-07-17 11:31:22 +02:00
Horst Hunger
48981e9547 Fix for bug#38164. Removed test of values larger than max int for 32 bits. 2008-07-17 11:03:17 +02:00
Marc Alff
95ca2c6d96 Bug#30087 Set query_cache_size, if the value is too small, get a unclear warning
Reverting the previous patch
2008-07-16 16:29:22 -06:00
Kristofer Pettersson
51ef885ce0 merge 2008-07-16 14:34:54 +02:00
Georgi Kodinov
340134ac2f Bug#37830 : ORDER BY ASC/DESC - no difference
Range scan in descending order for c <= <col> <= c type of
ranges was ignoring the DESC flag.
However some engines like InnoDB have the primary key parts 
as a suffix for every secondary key.
When such primary key suffix is used for ordering ignoring 
the DESC is not valid.
But we generally would like to do this because it's faster.
      
Fixed by performing only reverse scan if the primary key is used.
Removed some dead code in the process.

mysql-test/r/innodb_mysql.result:
  Bug#37830 : test case
mysql-test/t/innodb_mysql.test:
  Bug#37830 : test case
sql/opt_range.cc:
  Bug#37830 : 
   - preserve and use used_key_parts to
     distinguish when a primary key suffix is used
   - removed some dead code
sql/opt_range.h:
  Bug#37830 : 
    - preserve used_key_parts
    - dead code removed
sql/sql_select.cc:
  Bug#37830 : Do only reverse order traversal
      if the primary key suffix is used.
2008-07-16 12:31:50 +03:00
Daniel Fischer
207c2cc243 test case fix 2008-07-15 18:43:25 +02:00
Kristofer Pettersson
f81c2f070b auto merge 2008-07-15 17:29:26 +02:00
Tatiana A. Nurnberg
6b584b80da Bug#23921: random failure of user_limits.test
mysqltest disconnect/connect-combo could be so
quick that connect would hit the server before
it had processed the disconnect. Since that
resulted in one more concurrent connection than
we meant to have, global or per-user
max-user-connections could be exceeded.
This could lead to "random" failures in tests
that set those limits.


client/mysqltest.c:
  Retry max-connect-retries times if connect in
  connect_n_handle_errors() unexpectedly fails
  on connection-limit as this could be a race.
  Break out code that checks for expected --errors
  into its own function.
mysql-test/r/mysqltest.result:
  show that we throw a warning if test expects a SQL-state from
  a command (diff_files, ...) that clearly can't produce one.
mysql-test/t/disabled.def:
  re-enable user_limits
mysql-test/t/mysqltest.test:
  show that we throw a warning if test expects a SQL-state from
  a command (diff_files, ...) that clearly can't produce one.
2008-07-15 13:42:21 +02:00
Marc Alff
f34c99b4d8 Bug#35577, manual merge mysql-5.0-bugteam -> mysql-5.1-bugteam 2008-07-14 19:43:12 -06:00
Marc Alff
e73e7bb9ae Bug#35577 (CREATE PROCEDURE causes either crash or syntax error depending on
build)

The crash was caused by freeing the internal parser stack during the parser
execution.
This occured only for complex stored procedures, after reallocating the parser
stack using my_yyoverflow(), with the following C call stack:
- MYSQLparse()
- any rule calling sp_head::restore_lex()
- lex_end()
- x_free(lex->yacc_yyss), xfree(lex->yacc_yyvs)

The root cause is the implementation of stored procedures, which breaks the
assumption from 4.1 that there is only one LEX structure per parser call.

The solution is to separate the LEX structure into:
- attributes that represent a statement (the current LEX structure),
- attributes that relate to the syntax parser itself (Yacc_state),
so that parsing multiple statements in stored programs can create multiple
LEX structures while not changing the unique Yacc_state.

Now, Yacc_state and the existing Lex_input_stream are aggregated into
Parser_state, a structure that represent the complete state of the (Lexical +
Syntax) parser.


mysql-test/r/parser_stack.result:
  Bug#35577 (CREATE PROCEDURE causes either crash or syntax error depending on
  build)
mysql-test/t/parser_stack.test:
  Bug#35577 (CREATE PROCEDURE causes either crash or syntax error depending on
  build)
sql/sp.cc:
  Bug#35577 (CREATE PROCEDURE causes either crash or syntax error depending on
  build)
sql/sp_head.cc:
  Bug#35577 (CREATE PROCEDURE causes either crash or syntax error depending on
  build)
sql/sql_class.cc:
  Bug#35577 (CREATE PROCEDURE causes either crash or syntax error depending on
  build)
sql/sql_class.h:
  Bug#35577 (CREATE PROCEDURE causes either crash or syntax error depending on
  build)
sql/sql_lex.cc:
  Bug#35577 (CREATE PROCEDURE causes either crash or syntax error depending on
  build)
sql/sql_lex.h:
  Bug#35577 (CREATE PROCEDURE causes either crash or syntax error depending on
  build)
sql/sql_parse.cc:
  Bug#35577 (CREATE PROCEDURE causes either crash or syntax error depending on
  build)
sql/sql_prepare.cc:
  Bug#35577 (CREATE PROCEDURE causes either crash or syntax error depending on
  build)
sql/sql_trigger.cc:
  Bug#35577 (CREATE PROCEDURE causes either crash or syntax error depending on
  build)
sql/sql_view.cc:
  Bug#35577 (CREATE PROCEDURE causes either crash or syntax error depending on
  build)
sql/sql_yacc.yy:
  Bug#35577 (CREATE PROCEDURE causes either crash or syntax error depending on
  build)
2008-07-14 15:41:30 -06:00
Joerg Bruehe
1c3f323ac7 Merge main 5.1 to 5.1-build 2008-07-14 12:50:31 +02:00
Gleb Shchepa
e000e4a2a2 Bug #37761: IN handles NULL differently for table-subquery
and value-list

The server returns unexpected results if a right side of the 
NOT IN clause consists of NULL value and some constants of
the same type, for example:

  SELECT * FROM t WHERE NOT t.id IN (NULL, 1, 2) 
  
may return 3, 4, 5 etc if a table contains these values.


The Item_func_in::val_int method has been modified:
unnecessary resets of an Item_func_case::has_null field 
value has been moved outside of an argument comparison
loop. (Also unnecessary re-initialization of the null_value
field has been moved).


mysql-test/r/func_in.result:
  Added test case for bug #37761.
mysql-test/t/func_in.test:
  Added test case for bug #37761.
sql/item_cmpfunc.cc:
  Bug #37761: IN handles NULL differently for table-subquery 
              and value-list
  
  The Item_func_in::val_int method has been modified:
  unnecessary resets of an Item_func_case::has_null field 
  value has been moved outside of an argument comparison
  loop. (Also unnecessary re-initialization of the null_value
  field has been moved).
2008-07-14 14:06:49 +05:00
Joerg Bruehe
b69b20b2d6 Merge 5.1.26-rc to 5.1-build for further pushing it to the main tree. 2008-07-11 20:51:10 +02:00
Horst Hunger
75518d0137 Fix of Bug#37997. Polling until disconnect is not more in the processlist 2008-07-11 14:05:54 +02:00
Mattias Jonsson
c1e54765da Bug#37402: Mysql cant read partitioned table with capital letter in the name
Problem was that ha_partition had HA_FILE_BASED flag set
(since it uses a .par file), but after open it uses the first partitions
flags, which results in different case handling for create and for
open.

Solution was to change the underlying partition name so it was consistent.
(Only happens when lower_case_table_names = 2, i.e. Mac OS X and storage
engines without HA_FILE_BASED, like InnoDB and Memory.)

(Recommit after adding rename of check_lowercase_names to
get_canonical_filename, and moved it from handler.h to mysql_priv.h)

NOTE: if a mixed case name for a partitioned table was created when
lower_case_table_name = 2 it should be renamed or dropped before using
the updated version (See bug#37402 for more info)

mysql-test/include/have_case_insensitive_file_system.inc:
  Bug#37402: Mysql cant read partitioned table with capital letter in the name
  
  Added include file.
mysql-test/include/have_lowercase0.inc:
  Bug#37402: Mysql cant read partitioned table with capital letter in the name
  
  moved case insensitive file system to a new file, leaving only
  lower_case_table_names.
mysql-test/include/have_lowercase2.inc:
  Bug#37402: Mysql cant read partitioned table with capital letter in the name
  
  Added include file.
mysql-test/lib/mtr_report.pl:
  Bug#37402: Mysql cant read partitioned table with capital letter in the name
  
  Removed a duplicate row and suppressed warning about setting
  lower_case_table_names to 2 on case sensitive file systems.
mysql-test/r/case_insensitive_file_system.require:
  Bug#37402: Mysql cant read partitioned table with capital letter in the name
  
  Added requirement file.
mysql-test/r/lowercase0.require:
  Bug#37402: Mysql cant read partitioned table with capital letter in the name
  
  moved case insensitive file system to a new file, leaving only
  lower_case_table_names.
mysql-test/suite/parts/inc/partition_mgm.inc:
  Bug#37402: Mysql cant read partitioned table with capital letter in the name
  
  New include file for testing partitioning management functions for different
  settings of lower_case_table_names.
mysql-test/suite/parts/r/partition_mgm_lc0_archive.result:
  Bug#37402: Mysql cant read partitioned table with capital letter in the name
  
  New result file.
mysql-test/suite/parts/r/partition_mgm_lc0_innodb.result:
  Bug#37402: Mysql cant read partitioned table with capital letter in the name
  
  New result file.
mysql-test/suite/parts/r/partition_mgm_lc0_memory.result:
  Bug#37402: Mysql cant read partitioned table with capital letter in the name
  
  New result file.
mysql-test/suite/parts/r/partition_mgm_lc0_myisam.result:
  Bug#37402: Mysql cant read partitioned table with capital letter in the name
  
  New result file.
mysql-test/suite/parts/r/partition_mgm_lc0_ndb.result:
  Bug#37402: Mysql cant read partitioned table with capital letter in the name
  
  New result file.
mysql-test/suite/parts/r/partition_mgm_lc1_archive.result:
  Bug#37402: Mysql cant read partitioned table with capital letter in the name
  
  New result file.
mysql-test/suite/parts/r/partition_mgm_lc1_innodb.result:
  Bug#37402: Mysql cant read partitioned table with capital letter in the name
  
  New result file.
mysql-test/suite/parts/r/partition_mgm_lc1_memory.result:
  Bug#37402: Mysql cant read partitioned table with capital letter in the name
  
  New result file.
mysql-test/suite/parts/r/partition_mgm_lc1_myisam.result:
  Bug#37402: Mysql cant read partitioned table with capital letter in the name
  
  New result file.
mysql-test/suite/parts/r/partition_mgm_lc1_ndb.result:
  Bug#37402: Mysql cant read partitioned table with capital letter in the name
  
  New result file.
mysql-test/suite/parts/r/partition_mgm_lc2_archive.result:
  Bug#37402: Mysql cant read partitioned table with capital letter in the name
  
  New result file.
mysql-test/suite/parts/r/partition_mgm_lc2_innodb.result:
  Bug#37402: Mysql cant read partitioned table with capital letter in the name
  
  New result file.
mysql-test/suite/parts/r/partition_mgm_lc2_memory.result:
  Bug#37402: Mysql cant read partitioned table with capital letter in the name
  
  New result file.
mysql-test/suite/parts/r/partition_mgm_lc2_myisam.result:
  Bug#37402: Mysql cant read partitioned table with capital letter in the name
  
  New result file.
mysql-test/suite/parts/r/partition_mgm_lc2_ndb.result:
  Bug#37402: Mysql cant read partitioned table with capital letter in the name
  
  New result file.
mysql-test/suite/parts/t/partition_mgm_lc0_archive.test:
  Bug#37402: Mysql cant read partitioned table with capital letter in the name
  
  New test file.
mysql-test/suite/parts/t/partition_mgm_lc0_innodb.test:
  Bug#37402: Mysql cant read partitioned table with capital letter in the name
  
  New test file.
mysql-test/suite/parts/t/partition_mgm_lc0_memory.test:
  Bug#37402: Mysql cant read partitioned table with capital letter in the name
  
  New test file.
mysql-test/suite/parts/t/partition_mgm_lc0_myisam.test:
  Bug#37402: Mysql cant read partitioned table with capital letter in the name
  
  New test file.
mysql-test/suite/parts/t/partition_mgm_lc0_ndb.test:
  Bug#37402: Mysql cant read partitioned table with capital letter in the name
  
  New test file.
mysql-test/suite/parts/t/partition_mgm_lc1_archive-master.opt:
  Bug#37402: Mysql cant read partitioned table with capital letter in the name
  
  New opt file.
mysql-test/suite/parts/t/partition_mgm_lc1_archive.test:
  Bug#37402: Mysql cant read partitioned table with capital letter in the name
  
  New test file.
mysql-test/suite/parts/t/partition_mgm_lc1_innodb-master.opt:
  Bug#37402: Mysql cant read partitioned table with capital letter in the name
  
  New opt file.
mysql-test/suite/parts/t/partition_mgm_lc1_innodb.test:
  Bug#37402: Mysql cant read partitioned table with capital letter in the name
  
  New test file.
mysql-test/suite/parts/t/partition_mgm_lc1_memory-master.opt:
  Bug#37402: Mysql cant read partitioned table with capital letter in the name
  
  New opt file.
mysql-test/suite/parts/t/partition_mgm_lc1_memory.test:
  Bug#37402: Mysql cant read partitioned table with capital letter in the name
  
  New test file.
mysql-test/suite/parts/t/partition_mgm_lc1_myisam-master.opt:
  Bug#37402: Mysql cant read partitioned table with capital letter in the name
  
  New opt file.
mysql-test/suite/parts/t/partition_mgm_lc1_myisam.test:
  Bug#37402: Mysql cant read partitioned table with capital letter in the name
  
  New test file.
mysql-test/suite/parts/t/partition_mgm_lc1_ndb-master.opt:
  Bug#37402: Mysql cant read partitioned table with capital letter in the name
  
  New opt file.
mysql-test/suite/parts/t/partition_mgm_lc1_ndb.test:
  Bug#37402: Mysql cant read partitioned table with capital letter in the name
  
  New test file.
mysql-test/suite/parts/t/partition_mgm_lc2_archive-master.opt:
  Bug#37402: Mysql cant read partitioned table with capital letter in the name
  
  New opt file.
mysql-test/suite/parts/t/partition_mgm_lc2_archive.test:
  Bug#37402: Mysql cant read partitioned table with capital letter in the name
  
  New test file.
mysql-test/suite/parts/t/partition_mgm_lc2_innodb-master.opt:
  Bug#37402: Mysql cant read partitioned table with capital letter in the name
  
  New opt file.
mysql-test/suite/parts/t/partition_mgm_lc2_innodb.test:
  Bug#37402: Mysql cant read partitioned table with capital letter in the name
  
  New test file.
mysql-test/suite/parts/t/partition_mgm_lc2_memory-master.opt:
  Bug#37402: Mysql cant read partitioned table with capital letter in the name
  
  New opt file.
mysql-test/suite/parts/t/partition_mgm_lc2_memory.test:
  Bug#37402: Mysql cant read partitioned table with capital letter in the name
  
  New test file.
mysql-test/suite/parts/t/partition_mgm_lc2_myisam-master.opt:
  Bug#37402: Mysql cant read partitioned table with capital letter in the name
  
  New opt file.
mysql-test/suite/parts/t/partition_mgm_lc2_myisam.test:
  Bug#37402: Mysql cant read partitioned table with capital letter in the name
  
  New test file.
mysql-test/suite/parts/t/partition_mgm_lc2_ndb-master.opt:
  Bug#37402: Mysql cant read partitioned table with capital letter in the name
  
  New opt file.
mysql-test/suite/parts/t/partition_mgm_lc2_ndb.test:
  Bug#37402: Mysql cant read partitioned table with capital letter in the name
  
  New test file.
mysql-test/t/lowercase_table3.test:
  Bug#37402: Mysql cant read partitioned table with capital letter in the name
  
  Moved case sensitive file system to a specific inc-file instead of
  included in lowercase0.inc
sql/ha_partition.cc:
  Bug#37402: Mysql cant read partitioned table with capital letter in the name
  
  Problem was that ha_partition had HA_FILE_BASED set
  (since it uses a .par file), but after open it uses the first partitions
  table_flags(), which results in different case handling for create and for
  open.
  
  Solution was to change the underlying partition name so it was consistent.
  (Only happens when lower_case_table_names = 2, i.e. Mac OS X)
sql/handler.cc:
  Bug#37402: Mysql cant read partitioned table with capital letter in the name
  
  Renamed check_lowercase_names to get_canonical_filename, and exported it
  so that ha_partition.cc can use the function.
sql/mysql_priv.h:
  Bug#37402: Mysql cant read partitioned table with capital letter in the name
  
  Renamed check_lowercase_names to get_canonical_filename, and exported it
  so that ha_partition.cc can use the function.
2008-07-11 01:14:13 +02:00
Tatiana A. Nurnberg
7c5d30473b auto-merge 2008-07-10 15:28:37 +02:00
Tatiana A. Nurnberg
0617cf0f78 auto-merge 2008-07-10 15:25:20 +02:00
Tatiana A. Nurnberg
730f53f0d2 Bug#35848: UUID() returns UUIDs with the wrong time
offset for time part in UUIDs was 1/1000 of what it
should be. In other words, offset was off.

Also handle the case where we count into the future
when several UUIDs are generated in one "tick", and
then the next call is late enough for us to unwind
some but not all of those borrowed ticks.

Lastly, handle the case where we keep borrowing and
borrowing until the tick-counter overflows by also
changing into a new "numberspace" by creating a new
random suffix.

mysql-test/r/func_misc.result:
  Show that time-part of UUIDs is correct now.
mysql-test/t/func_misc.test:
  Show that time-part of UUIDs is correct now
  by replicating the C-code's resultin SQL.
  Results also decode to expect date-data on
  command-line (external validation).
  
  No test for unwinding of borrowed ticks as
  this a) is a race and b) depends on what timer
  we get.
sql/item_strfunc.cc:
  correct offset for date/time-part of UUID.
  also make sure that when we counted into
  the future earlier (several UUIDs generated
  in same tick), we only give back as many
  "borrowed" ticks as we can without duplicating
  past timestamps. If our tick-counter overflows
  before we can give back, or if the system-clock
  is set back (by user or Daylight Saving Time),
  we create a new random suffix to avoid
  collisions and clear the tick-counter.
2008-07-10 05:24:46 +02:00
Tatiana A. Nurnberg
0833d66847 Bug#35848: UUID() returns UUIDs with the wrong time
offset for time part in UUIDs was 1/1000 of what it
should be. In other words, offset was off.

Also handle the case where we count into the future
when several UUIDs are generated in one "tick", and
then the next call is late enough for us to unwind
some but not all of those borrowed ticks.

Lastly, handle the case where we keep borrowing and
borrowing until the tick-counter overflows by also
changing into a new "numberspace" by creating a new
random suffix.


mysql-test/r/func_misc.result:
  Show that time-part of UUIDs is correct now.
mysql-test/t/func_misc.test:
  Show that time-part of UUIDs is correct now
  by replicating the C-code's resultin SQL.
  Results also decode to expect date-data on
  command-line (external validation).
  
  No test for unwinding of borrowed ticks as
  this a) is a race and b) depends on what timer
  we get.
sql/item_strfunc.cc:
  correct offset for date/time-part of UUID.
  also make sure that when we counted into
  the future earlier (several UUIDs generated
  in same tick), we only give back as many
  "borrowed" ticks as we can without duplicating
  past timestamps. If our tick-counter overflows
  before we can give back, or if the system-clock
  is set back (by user or Daylight Saving Time),
  we create a new random suffix to avoid
  collisions and clear the tick-counter.
2008-07-10 03:58:30 +02:00
Gleb Shchepa
2334691f87 merge 5.1-main --> 5.1-bugteam 2008-07-10 03:01:41 +05:00
Gleb Shchepa
fa00dfe6b9 merge 5.0-main --> 5.0-bugteam 2008-07-10 00:54:20 +05:00
Matthias Leich
1d9fab7f4d Upmerge 5.0 -> 5.1 2008-07-09 20:55:23 +02:00
Mattias Jonsson
c4b408f96d merge 2008-07-09 15:15:11 +02:00
Joerg Bruehe
267917a4e6 Merge main 5.1 into 5.1-build 2008-07-09 13:25:31 +02:00
Matthias Leich
a81572bc42 1. Fix for Bug#37160
"funcs_2: The tests do not check if optional character
               sets exist."
2. Minor cleanup
2008-07-09 13:22:07 +02:00
Mattias Jonsson
d4b0fcc90a Bug#35736 Test 'parts.partition_basic_symlink_myisam' depends on output of 'ls'
The problem is that relying on the output of the 'ls' command is not
portable as its behavior is not the same between systems and it might
even not be available at all in (Windows).

So I added list_files that relies on the portable mysys library instead.
(and also list_files_write_file and list_files_append_file,
since the test was using '--exec ls' in that way.)

client/mysqltest.c:
  Bug#35736 Test 'parts.partition_basic_symlink_myisam' depends on output of 'ls'
  
  To be able to replace the use of '--exec ls' I have added
  list_files, list_files_write_file and list_files_append_file.
  
  list_files <dirname> [<filename incl. wild-cards>]
  is equivalent to 'ls <dirname>/[<filename incl. wild-cards>]'
  
  list_files_write_file creates/overwrites a file with the content
  list_files_append_file creates/appends a file with the content
  list_files* return a sorted output.
mysql-test/r/mysqltest.result:
  Bug#35736 Test 'parts.partition_basic_symlink_myisam' depends on output of 'ls'
  
  result file change, due to added test of the new list_files command.
mysql-test/suite/parts/inc/partition_check_drop.inc:
  Bug#35736 Test 'parts.partition_basic_symlink_myisam' depends on output of 'ls'
  
  Using the new list_files instead of 'ls'.
  
  Changed the use of local variables (ls_file, file_list)
  and server variable (@aux).
mysql-test/suite/parts/inc/partition_layout.inc:
  Bug#35736 Test 'parts.partition_basic_symlink_myisam' depends on output of 'ls'
  
  Using the new list_files instead of 'ls'.
mysql-test/suite/parts/inc/partition_layout_check1.inc:
  Bug#35736 Test 'parts.partition_basic_symlink_myisam' depends on output of 'ls'
  
  Using the new list_files instead of 'ls'.
mysql-test/suite/parts/inc/partition_layout_check2.inc:
  Bug#35736 Test 'parts.partition_basic_symlink_myisam' depends on output of 'ls'
  
  Replaces '--exec ls' with list_files.
  Removal of the directory part of file listing.
mysql-test/suite/parts/r/partition_alter1_1_2_myisam.result:
  Bug#35736 Test 'parts.partition_basic_symlink_myisam' depends on output of 'ls'
  
  Replaces '--exec ls' with list_files.
  Removal of the directory part of file listing.
mysql-test/suite/parts/r/partition_alter1_1_myisam.result:
  Bug#35736 Test 'parts.partition_basic_symlink_myisam' depends on output of 'ls'
  
  Replaces '--exec ls' with list_files.
  Removal of the directory part of file listing.
mysql-test/suite/parts/r/partition_alter1_2_myisam.result:
  Bug#35736 Test 'parts.partition_basic_symlink_myisam' depends on output of 'ls'
  
  Replaces '--exec ls' with list_files.
  Removal of the directory part of file listing.
mysql-test/suite/parts/r/partition_alter2_myisam.result:
  Bug#35736 Test 'parts.partition_basic_symlink_myisam' depends on output of 'ls'
  
  Replaces '--exec ls' with list_files.
  Removal of the directory part of file listing.
mysql-test/suite/parts/r/partition_alter3_innodb.result:
  Bug#35736 Test 'parts.partition_basic_symlink_myisam' depends on output of 'ls'
  
  Replaces '--exec ls' with list_files.
  Removal of the directory part of file listing.
mysql-test/suite/parts/r/partition_alter3_myisam.result:
  Bug#35736 Test 'parts.partition_basic_symlink_myisam' depends on output of 'ls'
  
  Replaces '--exec ls' with list_files.
  Removal of the directory part of file listing.
mysql-test/suite/parts/r/partition_basic_innodb.result:
  Bug#35736 Test 'parts.partition_basic_symlink_myisam' depends on output of 'ls'
  
  Replaces '--exec ls' with list_files.
  Removal of the directory part of file listing.
mysql-test/suite/parts/r/partition_basic_myisam.result:
  Bug#35736 Test 'parts.partition_basic_symlink_myisam' depends on output of 'ls'
  
  Replaces '--exec ls' with list_files.
  Removal of the directory part of file listing.
mysql-test/suite/parts/r/partition_basic_symlink_myisam.result:
  Bug#35736 Test 'parts.partition_basic_symlink_myisam' depends on output of 'ls'
  
  Replaces '--exec ls' with list_files.
  Removal of the directory part of file listing.
mysql-test/suite/parts/r/partition_engine_myisam.result:
  Bug#35736 Test 'parts.partition_basic_symlink_myisam' depends on output of 'ls'
  
  Replaces '--exec ls' with list_files.
  Removal of the directory part of file listing.
mysql-test/suite/parts/r/partition_syntax_myisam.result:
  Bug#35736 Test 'parts.partition_basic_symlink_myisam' depends on output of 'ls'
  
  Replaces '--exec ls' with list_files.
  Removal of the directory part of file listing.
mysql-test/t/mysqltest.test:
  Bug#35736 Test 'parts.partition_basic_symlink_myisam' depends on output of 'ls'
  
  Adding test for the new mysqltest commands list_files,
  list_files_write_file and list_files_append_file.
2008-07-09 13:19:04 +02:00
Marc Alff
5cf61bd344 Fixed remaining test failure 2008-07-08 13:17:28 -06:00
Daniel Fischer
1ee9ca9e46 let's make a real honest attempt at finding the daemons in libexec 2008-07-08 19:17:06 +02:00
Marc Alff
445ac78967 Cleanup merge issues in mysql-test/t/parser.test 2008-07-08 10:33:09 -06:00
Marc Alff
1c9cf4b06c Bug#37525 funcs_1: <engine>_storedproc.test fail
Fixed the test to expect the correct result.
The previous test script was in fact affected by 26030,
and wrongly expected a ER_PARSE_ERROR error.
2008-07-08 10:32:02 -06:00
Mats Kindahl
40e095e7de Manual merge of mysql-5.0-bugteam -> mysql-5.1-bugteam 2008-07-08 13:18:34 +02:00
Mattias Jonsson
df95b663b7 merge (update of 51-bugteam, during testing for pushing...) 2008-07-08 01:05:16 +02:00
Marc Alff
8aaccbfc21 Manual merge of bug#26030 in mysql-5.1-bugteam 2008-07-07 15:53:20 -06:00
Mattias Jonsson
c2c4cd1e28 merge 2008-07-07 23:08:29 +02:00
Mattias Jonsson
d11d5cfca8 Bug#35745: SELECT COUNT(*) is not correct for some partitioned tables.
problem was that ha_partition::records was not implemented, thus
using the default handler::records, which is not correct if the engine
does not support HA_STATS_RECORDS_IS_EXACT.
Solution was to implement ha_partition::records as a wrapper around
the underlying partitions records.

The rows column in explain partitions will now include the total
number of records in the partitioned table.

(recommit after removing out-commented code)
2008-07-07 22:42:19 +02:00
Marc Alff
a8a986bd66 Merge 2008-07-07 13:59:07 -06:00
Marc Alff
c7724872d8 Bug#26030 (Parsing fails for stored routine w/multi-statement execution
enabled)

Before this fix, the lexer and parser would treat the ';' character as a
different token (either ';' or END_OF_INPUT), based on convoluted logic,
which failed in simple cases where a stored procedure is implemented as a
single statement, and used in a multi query.

With this fix:
- the character ';' is always parsed as a ';' token in the lexer,
- parsing multi queries is implemented in the parser, in the 'query:' rules,
- the value of thd->client_capabilities, which is the capabilities
  negotiated between the client and the server during bootstrap,
  is immutable and not arbitrarily modified during parsing (which was the
  root cause of the bug)
2008-07-07 10:00:08 -06:00
Mattias Jonsson
ce30b928b7 Bug#35161: --myisam-recover does not work for partitioned MyISAM tables
Problem was that auto_repair, is_crashed and check_and_repair was not
implemented in ha_partition.

Solution, implemented them as loop over all partitions for is_crashed and
check_and_repair, and using the first partition for auto_repair.

(Recommit after fixing review comments)

mysql-test/lib/mtr_report.pl:
  Bug#35161: --myisam-recover does not work for partitioned MyISAM tables
  
  Added filter for crashed tables, when testing auto repair
mysql-test/std_data/corrupt_t1#P#p1.MYI:
  Bug#35161: --myisam-recover does not work for partitioned MyISAM tables
  
  Corrupt MYI file for testing auto repair
mysql-test/std_data/corrupt_t1.MYI:
  Bug#35161: --myisam-recover does not work for partitioned MyISAM tables
  
  Corrupt MYI file for testing auto repair
mysql-test/suite/parts/r/partition_repair_myisam.result:
  Bug#35161: --myisam-recover does not work for partitioned MyISAM tables
  
  Result file for testing auto repair of crashed myisam partitions
mysql-test/suite/parts/t/partition_repair_myisam-master.opt:
  Bug#35161: --myisam-recover does not work for partitioned MyISAM tables
  
  opt file for testing auto repair of crashed myisam partitions
mysql-test/suite/parts/t/partition_repair_myisam.test:
  Bug#35161: --myisam-recover does not work for partitioned MyISAM tables
  
  Test file for testing auto repair of crashed myisam partitions
sql/ha_partition.cc:
  Bug#35161: --myisam-recover does not work for partitioned MyISAM tables
  
  Added auto_repair as returning the first partitions auto_repair
  Added is_crashed and check_and_repair as loop over all partitions
sql/ha_partition.h:
  Bug#35161: --myisam-recover does not work for partitioned MyISAM tables
  
  Activating check_and_repair, auto_repair and is_crashed
2008-07-07 17:54:42 +02:00
Georgi Kodinov
50853ac31a Bug#37627: addendum :
- moved the test into a separate file to check for presence of the test variable

mysql-test/r/subselect.result:
  Bug#37627: moved the test to a separate file
mysql-test/r/subselect_debug.result:
  Bug#37627: moved the test to a separate file
mysql-test/t/subselect.test:
  Bug#37627: moved the test to a separate file
mysql-test/t/subselect_debug.test:
  Bug#37627: moved the test to a separate file
2008-07-07 11:43:56 +03:00
Chad MILLER
205a946267 Merge from 5.0. Add new 5.1 files. Drop bdb. 2008-07-04 14:48:25 -04:00
Chad MILLER
c6f9477bda Merge bug. 2008-07-04 13:30:26 -04:00
Chad MILLER
ac2a037ff9 Bug#30563: Is not possible to create rpl_ or innodb test if needed \
to use ANSI_QUOTES

Make all have_* tests universally safe by using ANSI quotes.
2008-07-04 12:41:27 -04:00
Georgi Kodinov
644d920a51 atutomatic merge of 5.1-bugteam into bug37627 2008-07-04 18:15:15 +03:00
Georgi Kodinov
0e1709bde6 Bug#37627: Killing query with sum(exists()) or avg(exists()) reproducibly crashes server
When there is an error executing EXISTS predicates they return NULL as their string
or decimal value but don't set the NULL value flag.
Fixed by returning 0 (as a decimal or a string) on error exectuting the subquery.
Note that we can't return NULL as EXISTS is not supposed to return NULL.

mysql-test/r/subselect.result:
  Bug#37627: test case
mysql-test/t/subselect.test:
  Bug#37627: test case
sql/item_subselect.cc:
  Bug#37627: return decimal (or string) 0 isntead of a NULL pointer on
  error calculating an EXISTS predicate.
2008-07-04 17:02:17 +03:00
Konstantin Osipov
7b8bfb2a93 A fix for
Bug#12093 "SP not found on second PS execution if another thread 
drops other SP in between" and
Bug#21294 "executing a prepared statement that executes a stored 
function which was recreat"

Stored functions are resolved at prepared statement prepare only.
If someone flushes the stored functions cache between prepare and
execute, execution fails.

The fix is to detect the situation of the cache flush and automatically
reprepare the prepared statement after it.

mysql-test/r/ps_ddl.result:
  Update results (Bug#12093 and Bug#21294, the test cases are already
  in the source tree).
mysql-test/r/ps_ddl1.result:
  Update results (Bug#12093 and Bug#21294, the test cases are already
  in the source tree).
mysql-test/r/sp-error.result:
  Update results (Bug#12093 and Bug#21294, the test cases are already
  in the source tree).
mysql-test/t/ps_ddl.test:
  Modify the test to not expect an error where there is no error
  any more (Bug#12093, Bug#21294).
mysql-test/t/ps_ddl1.test:
  Modify the test to not expect an error where there is no error
  any more (Bug#12093, Bug#21294).
mysql-test/t/sp-error.test:
  Modify the test to not expect an error where there is no error
  any more (Bug#12093, Bug#21294).
sql/sp_cache.cc:
  Implement sp_cache_version() -- returns the current version of 
  a stored routines cache.
sql/sp_cache.h:
  Declare sp_cache_version().
sql/sql_prepare.cc:
  Keep track of stored functions cache version, and invalidate
  the statement if it changed between prepared statement
  prepare and execute (and the statement actually uses stored routines).
2008-07-03 23:41:22 +04:00
Sven Sandberg
25b6b026a7 BUG#37200: rpl_switch_stm_row_mixed fails sporadically in pushbuild
This bug has been fixed in two slightly different ways in
6.0-rpl and {5.1,6.0}-bugteam. To avoid future merge
problems, I'm now copying the 6.0-rpl fix to 5.1-bugteam.
2008-07-03 10:27:25 +02:00
Sven Sandberg
ec73d940b1 BUG#37200: rpl_switch_stm_row_mixed fails sporadically in pushbuild
The previous fix for the bug was incomplete. The test failed
because t2 did not exist on the slave (since the slave was
lagging) when the
wait_condition was executed. Fixed by inserting
sync_slave_with_master just after t2 was created.
2008-07-02 17:04:45 +02:00
Patrick Crews
12607d4b66 upmerge into 5.1 2008-07-01 15:07:34 -04:00
Patrick Crews
9393ae3dff Bug#37380 - Test funcs_1.is_columns_myisam_embedded fails on OS X
Test was failing due to the addition of a '\x05' character in result sets
Latest builds of the server have shown this problem to have disappeared.
Removing code within the test that disables the test on Mac OS X.

Recommit due to tree error on earlier, approved patch.
2008-07-01 14:44:47 -04:00
Mattias Jonsson
67174b712b Bug#36732: many disabled ndb tests in test suite parts
REORGANIZE TEST parts WHERE ENGINE='NDB' ;)

Updated tests for better matching NDB's limitations.

Removed some duplicate tests.

mysql-test/suite/parts/inc/part_supported_sql_funcs_delete.inc:
  Bug#36732: many disabled ndb tests in test suite parts
  
  Added variable for NDB (since it does not support
  DROP PARTITION)
mysql-test/suite/parts/inc/partition_alter_11.inc:
  Bug#36732: many disabled ndb tests in test suite parts
  
  Assigning directly to variable without going
  through the server.
mysql-test/suite/parts/inc/partition_bigint.inc:
  Bug#36732: many disabled ndb tests in test suite parts
  
  Added --sorted_result for consistency
  lowered number of partitions for use with NDB
  (NDB can only do maximum of 8 partitions)
mysql-test/suite/parts/inc/partition_int.inc:
  Bug#36732: many disabled ndb tests in test suite parts
  
  Added --sorted_result for consistency
  lowered number of partitions for use with NDB
  (NDB can only do maximum of 8 partitions)
mysql-test/suite/parts/inc/partition_mediumint.inc:
  Bug#36732: many disabled ndb tests in test suite parts
  
  Added --sorted_result for consistency
  lowered number of partitions for use with NDB
  (NDB can only do maximum of 8 partitions)
mysql-test/suite/parts/inc/partition_smallint.inc:
  Bug#36732: many disabled ndb tests in test suite parts
  
  Added --sorted_result for consistency
  lowered number of partitions for use with NDB
  (NDB can only do maximum of 8 partitions)
mysql-test/suite/parts/inc/partition_supported_sql_funcs.inc:
  Bug#36732: many disabled ndb tests in test suite parts
  
  Made it work better with NDB
mysql-test/suite/parts/inc/partition_tinyint.inc:
  Bug#36732: many disabled ndb tests in test suite parts
  
  Added --sorted_result for consistency
  lowered number of partitions for use with NDB
  (NDB can only do maximum of 8 partitions)
mysql-test/suite/parts/r/ndb_blob_partition.result:
  Bug#36732: many disabled ndb tests in test suite parts
  
  Removing this duplicate test since it already
  exists (and updated) in suite/ndb
mysql-test/suite/parts/r/ndb_dd_backuprestore.result:
  Bug#36732: many disabled ndb tests in test suite parts
  
  Updated result file
mysql-test/suite/parts/r/ndb_partition_error.result:
  Bug#36732: many disabled ndb tests in test suite parts
  
  Removing this duplicate test since it already
  exists (and updated) in suite/ndb
mysql-test/suite/parts/r/ndb_partition_key.result:
  Bug#36732: many disabled ndb tests in test suite parts
  
  Removing this duplicate test since it already
  exists (and updated) in suite/ndb
mysql-test/suite/parts/r/ndb_partition_list.result:
  Bug#36732: many disabled ndb tests in test suite parts
  
  Removing this duplicate test since it already
  exists (and updated) in suite/ndb
mysql-test/suite/parts/r/ndb_partition_range.result:
  Bug#36732: many disabled ndb tests in test suite parts
  
  Removing this duplicate test since it already
  exists (and updated) in suite/ndb
mysql-test/suite/parts/r/part_supported_sql_func_ndb.result:
  Bug#36732: many disabled ndb tests in test suite parts
  
  Updated result file
mysql-test/suite/parts/r/partition_alter1_1_innodb.result:
  Bug#36732: many disabled ndb tests in test suite parts
  
  Updated result file
mysql-test/suite/parts/r/partition_alter1_1_myisam.result:
  Bug#36732: many disabled ndb tests in test suite parts
  
  Updated result file
mysql-test/suite/parts/r/partition_alter1_2_innodb.result:
  Bug#36732: many disabled ndb tests in test suite parts
  
  Updated result file.
  Diff bigger than necessary, due to bzr diff bug.
mysql-test/suite/parts/r/partition_alter1_2_myisam.result:
  Bug#36732: many disabled ndb tests in test suite parts
  
  Updated result file
mysql-test/suite/parts/r/partition_alter2_innodb.result:
  Bug#36732: many disabled ndb tests in test suite parts
  
  Updated result file
mysql-test/suite/parts/r/partition_alter2_myisam.result:
  Bug#36732: many disabled ndb tests in test suite parts
  
  Updated result file
mysql-test/suite/parts/r/partition_engine_ndb.result:
  Bug#36732: many disabled ndb tests in test suite parts
  
  Updated result file
mysql-test/suite/parts/r/partition_int_innodb.result:
  Bug#36732: many disabled ndb tests in test suite parts
  
  Updated result file
mysql-test/suite/parts/r/partition_int_myisam.result:
  Bug#36732: many disabled ndb tests in test suite parts
  
  Updated result file
mysql-test/suite/parts/r/partition_int_ndb.result:
  Bug#36732: many disabled ndb tests in test suite parts
  
  Updated result file
mysql-test/suite/parts/r/rpl_ndb_dd_partitions.result:
  Bug#36732: many disabled ndb tests in test suite parts
  
  Removing this duplicate test since it already
  exists (and updated) in suite/rpl_ndb
mysql-test/suite/parts/t/disabled.def:
  Bug#36732: many disabled ndb tests in test suite parts
  
  Removed some duplicate tests, fixed some tests.
  Removed the 'runs too long on PB' test from
  disabled.def and made them to require 'big-test'.
mysql-test/suite/parts/t/ndb_blob_partition.test:
  Bug#36732: many disabled ndb tests in test suite parts
  
  Removing this duplicate test since it already
  exists (and updated) in suite/ndb
mysql-test/suite/parts/t/ndb_dd_backuprestore.test:
  Bug#36732: many disabled ndb tests in test suite parts
  
  Added new=on for allowing test of
  hash/range and list partitioning.
mysql-test/suite/parts/t/ndb_partition_error.test:
  Bug#36732: many disabled ndb tests in test suite parts
  
  Removing this duplicate test since it already
  exists (and updated) in suite/ndb
mysql-test/suite/parts/t/ndb_partition_key.test:
  Bug#36732: many disabled ndb tests in test suite parts
  
  Removing this duplicate test since it already
  exists (and updated) in suite/ndb
mysql-test/suite/parts/t/ndb_partition_list.test:
  Bug#36732: many disabled ndb tests in test suite parts
  
  Removing this duplicate test since it already
  exists (and updated) in suite/ndb
mysql-test/suite/parts/t/ndb_partition_range.test:
  Bug#36732: many disabled ndb tests in test suite parts
  
  Removing this duplicate test since it already
  exists (and updated) in suite/ndb
mysql-test/suite/parts/t/part_supported_sql_func_ndb.test:
  Bug#36732: many disabled ndb tests in test suite parts
  
  Added new=on for allowing test of
  hash/range and list partitioning.
  Added ndb restriction variables.
mysql-test/suite/parts/t/partition_alter1_1_2_ndb.test:
  Bug#36732: many disabled ndb tests in test suite parts
  
  requiring big-test instead of disable it.
mysql-test/suite/parts/t/partition_alter1_1_ndb.test:
  Bug#36732: many disabled ndb tests in test suite parts
  
  requiring big-test instead of disable it.
mysql-test/suite/parts/t/partition_alter1_2_ndb.test:
  Bug#36732: many disabled ndb tests in test suite parts
  
  requiring big-test instead of disable it.
mysql-test/suite/parts/t/partition_alter2_ndb.test:
  Bug#36732: many disabled ndb tests in test suite parts
  
  Added new=on for allowing test of
  hash/range and list partitioning.
mysql-test/suite/parts/t/partition_basic_ndb.test:
  Bug#36732: many disabled ndb tests in test suite parts
  
  Added new=on for allowing test of
  hash/range and list partitioning.
mysql-test/suite/parts/t/partition_bit_ndb.test:
  Bug#36732: many disabled ndb tests in test suite parts
  
  Added new=on for allowing test of
  hash/range and list partitioning.
mysql-test/suite/parts/t/partition_engine_ndb.test:
  Bug#36732: many disabled ndb tests in test suite parts
  
  Added new=on for allowing test of
  hash/range and list partitioning.
mysql-test/suite/parts/t/partition_int_ndb.test:
  Bug#36732: many disabled ndb tests in test suite parts
  
  Added new=on for allowing test of
  hash/range and list partitioning.
mysql-test/suite/parts/t/partition_syntax_ndb.test:
  Bug#36732: many disabled ndb tests in test suite parts
  
  Added new=on for allowing test of
  hash/range and list partitioning.
mysql-test/suite/parts/t/partition_value_ndb.test:
  Bug#36732: many disabled ndb tests in test suite parts
  
  Added new=on for allowing test of
  hash/range and list partitioning.
mysql-test/suite/parts/t/rpl_ndb_dd_partitions.test:
  Bug#36732: many disabled ndb tests in test suite parts
  
  Removing this duplicate test since it already
  exists (and updated) in suite/rpl_ndb
2008-07-01 20:38:15 +02:00
Matthias Leich
2ed83dd95f Upmerge 5.0 -> 5.1 2008-07-01 14:21:50 +02:00
Matthias Leich
52fee16e88 Fix for
Bug#36787 Test funcs_1.charset_collation_1 failing
Details:
1. Skip charset_collation_1 if charset "ucs2_bin" is
   missing (property which distincts "vanilla" builds
   from the others)
2. Let builds with version_comment LIKE "%Advanced%"
   (found them for 5.1) execute charset_collation_3.
3. Update comments charset_collation.inc so that they
   reflect the current experiences.
2008-06-30 22:16:06 +02:00
Mats Kindahl
711305e2c5 BUG#37426: RBR breaks for CHAR() UTF-8 fields > 85 chars
In order to handle CHAR() fields, 8 bits were reserved for
the size of the CHAR field. However, instead of denoting the
number of characters in the field, field_length was used which
denotes the number of bytes in the field.

Since UTF-8 fields can have three bytes per character (and
has been extended to have four bytes per character in 6.0),
an extra two bits have been encoded in the field metadata
work for fields of type Field_string (i.e., CHAR fields).

Since the metadata word is filled, the extra bits have been
encoded in the upper 4 bits of the real type (the most 
significant byte of the metadata word) by computing the
bitwise xor of the extra two bits. Since the upper 4 bits
of the real type always is 1111 for Field_string, this 
means that for fields of length <256, the encoding is
identical to the encoding used in pre-5.1.26 servers, but
for lengths of 256 or more, an unrecognized type is formed,
causing an old slave (that does not handle lengths of 256
or more) to stop.


mysql-test/extra/rpl_tests/rpl_row_basic.test:
  Adding test cases for replicating UTF-8 fields of lengths
  of 256 or more (bytes).
mysql-test/suite/binlog/r/binlog_base64_flag.result:
  Result file change.
mysql-test/suite/binlog/t/binlog_base64_flag.test:
  Adding tests to trigger check that an error is generated when replicating from a
  5.1.25 server for tables with a CHAR(128) but not when replicating a table with a
  CHAR(63). Although the bug indicates that the limit is 83, we elected to use CHAR(63)
  since 6.0 uses 4-byte UTF-8, and anything exceeding 63 would then cause the test to fail
  when the patch is merged to 6.0.
mysql-test/suite/bugs/combinations:
  Adding combinations file to run all bug reports in all binlog modes (where
  applicable).
mysql-test/suite/bugs/r/rpl_bug37426.result:
  Result file change.
mysql-test/suite/bugs/t/rpl_bug37426.test:
  Added test for reported bug.
mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result:
  Result file change.
mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result:
  Result file change.
sql/field.cc:
  Encoding an extra two bits in the most significant nibble (4 bits)
  of the metadata word. Adding assertions to ensure that no attempt
  is made to use lengths longer than supported.
  
  Extending compatible_field_size() function with an extra parameter
  holding a Relay_log_instace for error reporting.
  
  Field_string::compatible_field_size() now reports an error if field
  size for a CHAR is >255.
sql/field.h:
  Field length is now computed from most significant 4 bits
  of metadata word, or is equal to the row pack length if
  there is no metadata.
  
  Extending compatible_field_size() function with an extra parameter
  holding a Relay_log_instace for error reporting.
sql/rpl_utility.cc:
  Adding relay log parameter to compatible_field_size().
  
  Minor refactoring to eliminate duplicate code.
sql/slave.cc:
  Extending rpl_master_has_bug() with a single-argument predicate function and
  a parameter to the predicate function. The predicate function can be used to
  test for extra conditions for the bug before writing an error message.
sql/slave.h:
  Extending rpl_master_has_bug() with a single-argument predicate function and
  a parameter to the predicate function. The predicate function can be used to
  test for extra conditions for the bug before writing an error message.
  
  Also removing gratuitous default argument.
sql/sql_insert.cc:
  Changing calls to rpl_master_has_bug() to adapt to changed signature.
2008-06-30 22:11:18 +02:00
Sven Sandberg
0a60bd2243 BUG#37200: rpl_switch_stm_row_mixed fails sporadically in pushbuild
Problem: rpl_switch_stm_row_mixed did not wait until row events generated by
INSERT DELAYED were written to the master binlog before it synchronized slave
with master. This caused sporadic errors where these rows were missing on
slave.
Fix: wait until all rows appear on the slave.
This is a backport, applying the same to 5.1-bugteam as was previously
applied to 6.0-rpl
2008-06-30 13:06:41 +02:00
Gleb Shchepa
89f06e9d6c auto merge from local tree 2008-06-27 23:54:16 +05:00
Gleb Shchepa
a8067140e8 Fixed bug #36632: SELECT DISTINCT from a simple view on an
InnoDB table, where all selected columns
                  belong to the same unique index key, returns
                  incorrect results

Server executes some queries via QUICK_GROUP_MIN_MAX_SELECT
(MIN/MAX optimization for queries with GROUP BY or DISTINCT
clause) and that optimization implies loose index scan, so all
grouping is done by the QUICK_GROUP_MIN_MAX_SELECT::get_next
method.

The server does not set the precomputed_group_by flag for some
QUICK_GROUP_MIN_MAX_SELECT queries and duplicates grouping by
call to the end_send_group function.

Fix: when the test_if_skip_sort_order function selects loose 
index scan as a best way to satisfy an ORDER BY/GROUP BY type
of query, the precomputed_group_by flag has been set to use 
end_send/end_write functions instead of end_send_group/
end_write_group functions.


mysql-test/r/group_min_max_innodb.result:
  Fixed bug #36632: SELECT DISTINCT from a simple view on an
                    InnoDB table, where all selected columns
                    belong to the same unique index key, returns
                    incorrect results
mysql-test/t/group_min_max_innodb.test:
  Fixed bug #36632: SELECT DISTINCT from a simple view on an
                    InnoDB table, where all selected columns
                    belong to the same unique index key, returns
                    incorrect results
sql/sql_select.cc:
  Fixed bug #36632: SELECT DISTINCT from a simple view on an
                    InnoDB table, where all selected columns
                    belong to the same unique index key, returns
                    incorrect results
2008-06-27 23:50:53 +05:00
Gleb Shchepa
b83b4697d2 backport from 6.0
Bug#35658 (An empty binary value leads to mysqld crash)
        
Before this fix, the following token
  b''
caused the parser to crash when reading the binary value from the empty string.
The crash was caused by:
  ptr+= max_length - 1;
because max_length is unsigned and was 0, causing an overflow.
        
With this fix, an empty binary literal b'' is parsed as a binary value 0,
in Item_bin_string.

mysql-test/r/varbinary.result:
  Bug#35658 (An empty binary value leads to mysqld crash)
mysql-test/t/varbinary.test:
  Bug#35658 (An empty binary value leads to mysqld crash)
sql/item.cc:
  Bug#35658 (An empty binary value leads to mysqld crash)
2008-06-27 20:56:41 +05:00
Gleb Shchepa
dc0e959a30 buckport to 5.1.26 from 6.0
Bug#35658 (An empty binary value leads to mysqld crash)
  
Before this fix, the following token
  b''
caused the parser to crash when reading the binary value from the empty string.
The crash was caused by:
  ptr+= max_length - 1;
because max_length is unsigned and was 0, causing an overflow.
  
With this fix, an empty binary literal b'' is parsed as a binary value 0,
in Item_bin_string.

mysql-test/r/varbinary.result:
  Bug#35658 (An empty binary value leads to mysqld crash)
mysql-test/t/varbinary.test:
  Bug#35658 (An empty binary value leads to mysqld crash)
sql/item.cc:
  Bug#35658 (An empty binary value leads to mysqld crash)
2008-06-27 18:22:23 +05:00
Gleb Shchepa
cb72f09cfa backport to 5.1 from 6.0
Bug#35658 (An empty binary value leads to mysqld crash)
  
Before this fix, the following token
  b''
caused the parser to crash when reading the binary value from the empty string.
The crash was caused by:
  ptr+= max_length - 1;
because max_length is unsigned and was 0, causing an overflow.
  
With this fix, an empty binary literal b'' is parsed as a binary value 0,
in Item_bin_string.

mysql-test/r/varbinary.result:
  Bug#35658 (An empty binary value leads to mysqld crash)
mysql-test/t/varbinary.test:
  Bug#35658 (An empty binary value leads to mysqld crash)
sql/item.cc:
  Bug#35658 (An empty binary value leads to mysqld crash)
2008-06-27 15:23:40 +05:00
Matthias Leich
e72132a5b0 Upmerge 5.0 -> 5.1 2008-06-25 19:01:17 +02:00
Matthias Leich
49417ad7c8 Fix for
Bug#37492 timing bug in subselect.test
+ similar weaknesses found during testing
+ replace error numbers by error names
2008-06-25 16:59:38 +02:00
Gleb Shchepa
696c03e47c auto merge 5.1-main --> 5.1-bugteam 2008-06-25 14:44:55 +05:00
Gleb Shchepa
e948f6a9b7 auto merge 5.0-bugteam --> 5.1-bugteam 2008-06-24 21:15:00 +05:00
Gleb Shchepa
2c77798c74 back-port from 5.1.
Bug#33812: mysql client incorrectly parsing DELIMITER
      
Remove unnecessary and incorrect code that tried
to pull delimiter commands out of the middle of
statements.
2008-06-24 21:03:17 +05:00
Gleb Shchepa
6eb2e76abd Bug #36244: MySQL CLI doesn't recognize standalone --
as a commentary

mysql client has been modified to interpret EOL after
standalone -- commentary strings like whitespace
character (according to
http://dev.mysql.com/doc/refman/5.0/en/ansi-diff-comments.html)


mysql-test/t/mysql_delimiter.sql:
  Added test case for bug #36244.
2008-06-24 19:32:06 +05:00
Tatiana A. Nurnberg
32089863c0 auto merge
configure.in:
  auto-merge
mysql-test/suite/bugs/r/rpl_bug33029.result:
  auto-merge
mysql-test/suite/bugs/t/rpl_bug33029.test:
  auto-merge
sql/slave.cc:
  auto-merge
sql/sql_class.cc:
  auto-merge
sql/structs.h:
  auto-merge
2008-06-21 11:12:41 +02:00
Tatiana A. Nurnberg
574c57ccec Bug#33812: mysql client incorrectly parsing DELIMITER
Remove unnecessary and incorrect code that tried
to pull delimiter commands out of the middle of
statements.

client/mysql.cc:
  Remove unnecessary and incorrect code that tried
  to pull delimiter commands out of the middle of
  statements.
mysql-test/r/mysql.result:
  show we no longer parse DELIMITER when
  we shouldn't.
mysql-test/t/mysql_delimiter.sql:
  show we no longer parse DELIMITER when
  we shouldn't.
2008-06-20 18:58:14 +02:00
Georgi Kodinov
98cf483064 Bug#33812: mysql client incorrectly parsing DELIMITER
Remove unnecessary and incorrect code that tried to pull delimiter commands out of the
middle of statements

client/mysql.cc:
  Bug#33812: remove incorrect code
mysql-test/r/mysql.result:
  Bug#33812: test case
mysql-test/t/mysql_delimiter.sql:
  Bug#33812: test case
2008-06-20 18:08:24 +03:00
Matthias Leich mleich@mysql.com
0969405012 Automatic merge 2008-06-20 14:55:17 +02:00
Andrei Elkin
edc787333f merging prior to push Bug #36443 2008-06-20 13:57:25 +03:00
Andrei Elkin
e66ba2a74b Bug#36443 Server crashes when executing insert when insert trigger on table
The crash appeared to be a result of allocating an instance of Discrete_interval 
      automatically that that was referred in out-of-declaration scope.
                        
      Fixed with correcting backing up and restoring scheme of
      auto_inc_intervals_forced, introduced by bug#33029, by means of shallow copying;
      added simulation code that forces executing those fixes of the former bug that
      targeted at master-and-slave having incompatible bug#33029-prone versions.

mysql-test/suite/bugs/r/rpl_bug33029.result:
  new results file
mysql-test/suite/bugs/t/rpl_bug33029.test:
  test merely checks no crash happens on slave.
sql/slave.cc:
  forcing to execute special logics implemented for bug#33029 if
  simulate_bug33029 the debug option is set.
sql/sql_class.cc:
  swaps of backed and the actual auto_inc_intervals_forced basing on shallow coping.
sql/structs.h:
  Removing the deep _copy() and methods associated with it;
  adding methods to Discrete_intervals_list:
      
  private `=', copy constructor to prevent using;
  private set_members();
  public  copy_shallow(), swap(), get_{head, tail, current}();
          empty_no_free() through set_members().
2008-06-19 21:47:59 +03:00
Gleb Shchepa
b870be7be3 auto merge with local tree (bug #37076) 2008-06-19 18:32:14 +05:00
Gleb Shchepa
c8bc6a5d1b Fixed bug #37076: TIMESTAMP/DATETIME/DATE values are not
replicated correctly between machines with
                  mixed endiannes


mysql-test/extra/rpl_tests/rpl_row_basic.test:
  Added regression test for bug#37076.
mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result:
  Added regression test for bug#37076.
mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result:
  Added regression test for bug#37076.
mysql-test/suite/rpl_ndb/r/rpl_row_basic_7ndb.result:
  Added regression test for bug#37076.
sql/field.h:
  Fixed bug #37076: TIMESTAMP/DATETIME/DATE values are not
                    replicated correctly between machines with
                    mixed endiannes
  
  pack and unpack virtual methods have been overloaded for
  Field_timestamp (TIMESTAMP domain), Field_datetime (DATETIME
  domain) and Field_date (DATE domain) classes to replicate data
  between platforms with different endiannes in a correct way
  like in Field_long and Field_longlong classes.
  
  Common code have been moved to private handle_int32 and 
  handle_int64 private methods.
2008-06-19 18:02:04 +05:00
Tatiana A. Nurnberg
b4a45a7121 re 36818: rpl_server_id1 fails expecting slave has stopped
On a slow environment like valgrind the test is vulnerable
because it does not check if slave has stopped at time
of the new session is requested `start slave;' -- disabling
test till it is fixed.

mysql-test/suite/rpl/t/disabled.def:
  disable rpl_server_id1 until test is fixed.
2008-06-19 12:39:48 +02:00
Tatiana A. Nurnberg
f13393db22 Fixed bug #37004.
The value of JOIN::tables must be set to 0 when there
is no matching min/max row.

mysql-test/r/subselect.result:
  Added a test case for bug #37004.
mysql-test/t/subselect.test:
  Added a test case for bug #37004.
2008-06-19 05:08:41 +02:00
Kristofer Pettersson
681236e100 Bug#30087 Set query_cache_size, if the value is too small, get a unclear warning
This bugs clarifies a warning message issued when the query cache data
size becomes smaller than the minium allowed size.



mysql-test/r/query_cache.result:
  New warning message when a too small value has been set for query cache
  size.
sql/set_var.cc:
  To avoid poluting the QC API the warning messages are moved into the 
  QC module.
sql/share/errmsg.txt:
  Changed error message so that minimal cache size always is hinted.
sql/sql_cache.cc:
  Modified the warning message so that the minimal cache size always is
  hinted.
      
  Added interface method Query_cache::get_minimal_size_limit().
sql/sql_cache.h:
  Modified the warning message so that the minimal cache size always is
  hinted.
      
  Added interface method Query_cache::get_minimal_size_limit().
2008-06-19 02:40:35 +02:00
Matthias Leich mleich@mysql.com
672cb2c950 1. Upmerge of fix for the bugs
37167 funcs_1: Many tests fail if the embedded
                  server is used.
   37164 funcs_1: Some tests fail if an optional
                  character set is missing.
   + some cleanup within the testsuite related to the
     fixes above
   + some adjustments to open bugs on Mac OS X
2. Skip tests which suffer from bug
   37456 funcs_1: Several tests crash when used
                  with embedded server
3. Minor cleanup in some tests
2008-06-18 19:23:55 +02:00
Davi Arnaut
fb8f32d077 Bug#37003 Tests sporadically crashes with embedded server
The problem was that when a embedded linked version of mysqltest
crashed there was no way to obtain a stack trace if no core file
is available. Another problem is that the embedded version of
libmysql was not behaving (crash) the same as the non-embedded with
respect to sending commands to a explicitly closed connection.

The solution is to generate a mysqltest's stack trace on crash
and to enable "reconnect" if the connection handle was explicitly
closed so the behavior matches the non-embedded one.

client/CMakeLists.txt:
  Link mysys to mysqltest.
client/Makefile.am:
  Link mysys to mysqltest.
client/mysqltest.c:
  Add fatal signal handling with backtracing for Unix and Windows.
configure.in:
  Add check for weak symbols support and remove a spurious word.
include/Makefile.am:
  Add new header with prototype for stack tracing functions.
include/my_stacktrace.h:
  Add new header with prototype for stack tracing functions.
libmysqld/CMakeLists.txt:
  stack tracing is now part of mysys.
libmysqld/Makefile.am:
  stack tracing is now part of mysys.
libmysqld/lib_sql.cc:
  Re-connect if connection was explicitly closed. This is
  done to match the behavior of the non-embeded libmysql.
mysql-test/t/sql_low_priority_updates_func.test:
  Test expects parallelism between queries that cannot be
  guaranteed under embedded.
mysys/CMakeLists.txt:
  Add stacktrace to mysys.
mysys/Makefile.am:
  Add stacktrace to mysys.
mysys/stacktrace.c:
  Move stacktrace to mysys and add weak symbol for the
  C++ name de-mangling function so that it can later be
  overridden in C++ code. Also add my_ prefix to exported
  functions.
sql/CMakeLists.txt:
  stacktrace was moved to mysys.
sql/Makefile.am:
  stacktrace was moved to mysys.
sql/mysqld.cc:
  Add my_ prefix to mysys functions.
2008-06-18 13:17:15 -03:00
Matthias Leich mleich@mysql.com
2356d4f54a Fix for
Bug#37167 funcs_1: Many tests fail if the embedded server is used.
     Bug#37164 funcs_1: Some tests fail if an optional character set is missing.
+ some cleanup within the testsuite related to the fixes above
+ some adjustments to open bugs on Mac OS X
2008-06-18 17:02:19 +02:00
Timothy Smith
c9a854ac0b Merge changes from mysql 5.1.25 release clone (BK), applied manually into bzr. 2008-06-17 19:20:09 -06:00
Timothy Smith
211e9c08ae fix typo
This change was committed to the 5.1.25 release clone, but never
made it to the mysql-5.1 BK tree.  I'm committing it to mysql-5.1
bzr now.
2008-06-17 19:05:56 -06:00
Davi Arnaut
5d237db6f6 Bug#33873: Fast ALTER TABLE doesn't work with multibyte character sets
The problem was that when comparing tables for a possible
fast alter table, the comparison was being performed using
the parsed information and not the final definition.
      
The solution is to use the possible final table layout to
compare if a fast alter is possible or not.

mysql-test/include/mix1.inc:
  Disable test case for Bug 21704 as it hasn't been fixed.
mysql-test/r/alter_table.result:
  Add test case result for Bug#33873
mysql-test/r/innodb_mysql.result:
  Update test case result
mysql-test/t/alter_table.test:
  Add test case for Bug#33873
sql/sql_table.cc:
  Use updated (final) information to compare fields.
2008-06-17 11:12:21 -03:00
Mattias Jonsson
fab820e660 auto merge 2008-06-17 14:09:33 +02:00
Mattias Jonsson
06f3c43478 Bug#35931 Index search of partitioned MyISAM table
returns erroneous results

Used the wrong function when fixing 30480 which lead to
no stop on end_key resulting in duplicate results from index scan

Includes test cases for the duplicates 37327 and 37329,
Duplicate rows and bad performance/High Handler_read_next values

Recommit after merge issues

mysql-test/r/partition.result:
  Bug#35931 List partition MyISAM table returns erroneous results
  
  added test results.
mysql-test/t/partition.test:
  Bug#35931 List partition MyISAM table returns erroneous results
  
  added test for 35931, 37327 and 37329.
sql/ha_partition.cc:
  Bug#35931 List partition MyISAM table returns erroneous results
  
  HA_READ_ORDER is a index_flag, not a table_flag.
  Error made in 30480.
2008-06-17 12:41:06 +02:00
Georgi Kodinov
07350a6c93 auto merge 2008-06-17 11:42:17 +03:00
Georgi Kodinov
d57d6bf56a merge 5.1 -> 5.1-bugteam 2008-06-17 11:33:16 +03:00
Tatiana A. Nurnberg
8342336f3d merge
configure.in:
  Raise version number after cloning 5.0.64
mysql-test/r/federated_disabled.result:
  Bug#37069 (5.0): implement --skip-federated
mysql-test/t/federated_disabled-master.opt:
  Bug#37069 (5.0): implement --skip-federated
mysql-test/t/federated_disabled.test:
  Bug#37069 (5.0): implement --skip-federated
mysys/errors.c:
  Fix for Bug#16902.
sql/mysqld.cc:
  Bug#37069 (5.0): implement --skip-federated
2008-06-17 10:09:25 +02:00
Tatiana A. Nurnberg
91534e822d Bug#36492: make dist and make install fails
Ignore BitKeeper SCCS folders in make-dist
2008-06-17 09:44:14 +02:00
Tatiana A. Nurnberg
b1132821af Bug#36492: make dist and make install fails
Ignore BitKeeper SCCS folders in make-dist

mysql-test/Makefile.am:
  Ignore BitKeeper SCCS folders in make-dist
  (copy only .txt files).
2008-06-17 09:31:29 +02:00
Matthias Leich mleich@mysql.com
28f9704737 Fix for
Bug#37167 funcs_1: Many tests fail if the embedded server is used.
   Bug#37164 funcs_1: Some tests fail if an optional character set is missing.
+ some cleanup within the testsuite related to the fixes above
+ some adjustments to open bugs on Mac OS X

Details:
- Remove the initial loading of data from tests if these data
  are not somewhere retrieved
- Remove any use of columns with attribute unicode
  (-> UCS2 is no more needed) from tests where unicode
  properties are not checked or somehow required
- Create a separate branch of the Character maximum length test
  (CML). If UCS2 is available than this test gets applied to
  every available type of string column with attribute unicode
  This prevents any loss of coverage by the points above.
- Disable the execution of is_tables_ndb which gives wrong
  results because of a bug. Correct the exepected results of
  this test.
- In case of tests failing when applied to the embedded server
    1) Create a variant of this test for the embedded server
  or
    2) Skip the test in case of embedded server
  depending on purpose and complexity of test.
- Skip the tests which could suffer from
  Bug 28309 First insert violates unique constraint - was "memory" table empty ?
  Bug 37380 Test funcs_1.is_columns_myisam_embedded fails on OS X
  (both bugs Mac OS X, embedded server, MySQL 5.0 only)
- Minor improvements like remove typos
2008-06-16 20:39:58 +02:00
Joerg Bruehe
5a39831f8f Merging the bug fixes for 34995 and 35543 (both of 5.0) up to 5.1,
also the 5.0.62 build tag.
2008-06-13 15:48:17 +02:00
Joerg Bruehe
3b5c3df201 Merging bug fixes for 34995 and 35543 into the main tree,
and the build tag for 5.0.62.
2008-06-13 15:22:58 +02:00
Georgi Kodinov
1e17f242f3 atuomatically merged 5.0 main to 5.0-bugteam 2008-06-12 17:32:31 +03:00
Mattias Jonsson
41c80004ff merge before pushing 2008-06-04 11:08:44 +02:00
Davi Arnaut
2100ec9ec9 Bug#33362: Query cache invalidation (truncate) may hang
if cached query uses many tables

The problem was that query cache would not properly cache
queries which used 256 or more tables but yet would leave
behind query cache blocks pointing to freed (destroyed)
data. Later when invalidating (due to a truncate) query cache
would attempt to grab a lock which resided in the freed data,
leading to hangs or undefined behavior.

This was happening due to a improper return value from the
function responsible for registering the tables used in the
query (so the cache can be invalidated later if one of the
tables is modified). The function expected a return value of
type boolean (char, 8 bits) indicating success (1) or failure
(0) but the number of tables registered (unsigned int, 32 bits)
was being returned instead. This caused the function to return
failure for cases where it had actually succeed because when
a type (unsigned int) is converted to a narrower type (char),
the excess bits on the left are discarded. Thus if the 8
rightmost bits are zero, the return value will be 0 (failure).

The solution is to simply return true (1) only if the number of
registered table is greater than zero and false (0) otherwise.

mysql-test/r/query_cache_merge.result:
  Add test case result for Bug#33362
mysql-test/t/query_cache_merge.test:
  Add test case for Bug#33362
sql/sql_cache.cc:
  Return 1 or 0 depending on the number of registered tables.
2008-06-03 10:59:46 -03:00
Mattias Jonsson
a8af693b50 Bug#31210: INSERT DELAYED crashes server when used on partitioned tables
Problem was an unclear error message since it could suggest that
MyISAM did not support INSERT DELAYED.
Changed the error message to say that DELAYED is not supported by the
table, instead of the table's storage engine.
The confusion is that a partitioned table is in somewhat sense using
the partitioning storage engine, which in turn uses the ordinary
storage engine. By saying that the table does not support DELAYED we
do not give any extra informantion about the storage engine or if it
is partitioned.

mysql-test/r/innodb-replace.result:
  Bug#31210: INSERT DELAYED crashes server when used on partitioned tables
  
  changed error message
mysql-test/t/innodb-replace.test:
  Bug#31210: INSERT DELAYED crashes server when used on partitioned tables
  
  changed error message
mysql-test/t/merge.test:
  Bug#31210: INSERT DELAYED crashes server when used on partitioned tables
  
  changed error message
mysql-test/t/partition_hash.test:
  Bug#31210: INSERT DELAYED crashes server when used on partitioned tables
  
  changed error message
sql/share/errmsg.txt:
  Bug#31210: INSERT DELAYED crashes server when used on partitioned tables
  
  added error message for tables not supporting DELAYED
sql/sql_insert.cc:
  Bug#31210: INSERT DELAYED crashes server when used on partitioned tables
  
  changed error message
2008-06-03 13:25:41 +02:00
Matthias Leich mleich@mysql.com
8d7fcad196 Upmerge of fix for
Bug 36788 Multiple funcs_1 'trig' tests are failing on vanilla builds
2008-06-03 12:21:48 +02:00
Georgi Kodinov
da4cfa6d1e Bug#37069 (5.0): implement --skip-federated
mysql-test/r/federated_disabled.result:
  Bug#37069 (5.0): test case
mysql-test/t/federated_disabled-master.opt:
  Bug#37069 (5.0): test case
mysql-test/t/federated_disabled.test:
  Bug#37069 (5.0): test case
2008-06-03 13:12:37 +03:00
Matthias Leich mleich@mysql.com
1544026443 Bug#36788 Multiple funcs_1 'trig' tests are failing on vanilla builds
Fix for this bug and additional improvements/fixes
In detail:
- Remove unicode attribute from several columns
  (unicode properties were nowhere needed/tested)
  of the table tb3
  -> The runnability of these tests depends no more on
     the availibility of some optional collations.
- Use a table tb3 with the same layout for all
  engines to be tested and unify the engine name
  within the protocols.
  -> <engine>_trig_<abc>.result have the same content
- Do not load data into tb3 if these rows have no
  impact on result sets
- Add tests for NDB (they exist already in 5.1)
- "--replace_result" at various places because
  NDB variants of tests failed with "random" row
  order in results
  This fixes a till now unknown weakness within the
  funcs_1 NDB tests existing in 5.1 and 6.0
- Fix the expected result of ndb_trig_1011ext
  which suffered from Bug 32656
  + disable this test
- funcs_1 could be executed with the mysql-test-run.pl
  option "--reorder", which saves some runtime by
  optimizing server restarts.
  Runtimes on tmpfs (one attempt only):
  with    reorder 132 seconds
  without reorder 183 seconds
- Adjust two "check" statements within func_misc.test
  which were incorrect (We had one run with result set
  difference though the server worked good.)
- minor fixes in comments
2008-06-02 21:57:11 +02:00
Patrick Crews
c392457f7c automatically merged 2008-05-30 12:10:32 -04:00
Georgi Kodinov
ea120c56f5 Bug#37069: Make federated disabled by default
The federated storage engine is now disabled by default.
mysql-test-run.pl is updated to enable it whenever it's required and available.

mysql-test/lib/mtr_cases.pl:
  Bug#37069: mysql-test-run.pl automatically enables federated 
  for federated related tests
sql/sql_plugin.cc:
  Bug#37069: federated is disabled by default
2008-05-30 13:21:45 +03:00
Matthias Leich mleich@mysql.com
b371ba2e14 Bug#36345 Test 'func_misc' fails on RHAS3 x86_64
Upmerge of fix for this bug and a second similar problem
found during experimenting.

This replaces the first fix (already pushed to 5.1
and merged to 6.0) which
- failed in runs with the embedded server
- cannot be ported back to 5.0
2008-05-29 22:16:22 +02:00
Matthias Leich mleich@mysql.com
200a93632e Bug#36345 Test 'func_misc' fails on RHAS3 x86_64
Fix for this bug and a second similar problem
found during experimenting.

This replaces the first fix (already pushed to 5.1
and merged to 6.0) which
- failed in runs with the embedded server
- cannot be ported back to 5.0
2008-05-29 18:38:10 +02:00
Patrick Crews
914bb34b38 Bug#36721 - Test funcs1.<engine>_func_view failing for multiple engines
Bug#36724 - Test funcs_1.<engine>_storedproc_02 needs to be updated
Bug#36726 - Test funcs_1.<engine>_storedproc failing - Needs to be updated on 5.1+

func_view bug:  re-records .result files to account for addition of charset and collation data 
                to SHOW CREATE VIEW output
storedproc bugs:  Added expected errors for those storedprocs that use SQLSTATE:00000
                  in their handlers.  re-recorded .result files to account for these
                  expected errors.

mysql-test/suite/funcs_1/r/innodb_func_view.result:
  Update result set for changes to SHOW CREATE VIEW output
mysql-test/suite/funcs_1/r/memory_func_view.result:
  Updated result set due to changes in SHOW CREATE VIEW output
mysql-test/suite/funcs_1/r/myisam_func_view.result:
  Updated result set due to changes in SHOW CREATE VIEW output
2008-05-27 19:30:07 -04:00
Sven Sandberg
605ba6867f BUG#36826: rpl_slave_status fails sporadically in pushbuild
rpl_slave_status failed on pushbuild. The slave stopped with an
error. Adding sync_slave_with_master fixes the problem. Updated
test case. 

mysql-test/suite/rpl/r/rpl_slave_status.result:
  Updated result file.
mysql-test/suite/rpl/t/rpl_slave_status.test:
  - Added comment explaining what the test does.
  - Added sync_slave_with_master in two places where it was missing. This
    caused sporadic pushbuild errors.
  - Added wait_for_slave_to_{start,stop} after {START,STOP} SLAVE queries.
  - Removed 'drop table if exists' from setup code.
  - Replaced save_master_pos;connection slave;sync_with_master by
    sync_slave_with_master.
  - Replaced 'delete from mysql.user' by 'drop user'.
  - Wrapped 'show slave status' inside query_get_value(), so that only what
    we test is in the output.
2008-05-26 15:06:49 +02:00
unknown
02ef24f778 Merge trift-lap.fambruehe:/MySQL/M50/mysql-5.0
into  trift-lap.fambruehe:/MySQL/M50/work-5.0


mysql-test/mysql-test-run.pl:
  Auto merged
2008-05-25 15:13:30 +02:00
Chad MILLER
0a0bf2d875 Merged from trunk. 2008-05-23 18:45:04 +02:00
Chad MILLER
3e9c477a60 Merge from bk tree. Resolved addition of same files in both trees. 2008-05-23 18:42:54 +02:00
First_name Last_name mleich@mysql.com
8bd3bcf5a1 Fix for
Bug#36345 Test 'func_misc' fails on RHAS3 x86_64
and a second similar problem within this test found
during experimenting.
2008-05-23 17:23:55 +02:00
Kristofer Pettersson
f6b7e7e411 Reverted merging misstake.
mysql-test/r/status.result:
  reverted merging misstake
mysql-test/t/status.test:
  reverted merging misstake
2008-05-21 17:34:14 +02:00
Kristofer Pettersson
8d07122aff Bug#32966 main.status fails
The failing test case is depending on unnecessary status variable output
which changes based on build configuration. By reducing the output the test
becomes more stable.

mysql-test/r/status.result:
  Modified test case
mysql-test/t/disabled.def:
  Enabled status.test
mysql-test/t/status.test:
  Modified test case.
2008-05-21 09:50:54 +02:00
unknown
3433706a12 Update test coverage for Bug#27430 "Crash in subquery code when in PS
and table DDL changed after PREPARE" to pass in embedded mode.


mysql-test/r/ps.result:
  Update results (Bug#27430)
mysql-test/r/ps_ddl.result:
  Update results (Bug#27430)
mysql-test/t/ps.test:
  Add a test case for Bug#27430. ps.test is not run in --embedded-server,
  thus it now contains the part of the test for Bug#27430 that
  doesn't work in embedded server.
mysql-test/t/ps_ddl.test:
  Move a part of the test for Bug#27430 that doesn't work
  in embedded server to ps.test, that includes not_embedded.inc.
2008-05-20 22:43:26 +04:00
unknown
7ce32c91ba A number of fixes after a merge from the main 5.1 tree:
the local tree contains a fix for 
Bug#32748 "Inconsistent handling of assignments to 
general_log_file/slow_query_log_file",
which changes output of a number of tests.


mysql-test/r/general_log_file_basic.result:
  Update results (Bug#32748)
mysql-test/r/log_output_basic.result:
  Update the test with results of the fix for Bug#32748
mysql-test/r/slow_query_log_file_basic.result:
  Update the test with results of the fix for Bug#32748
mysql-test/t/general_log_file_basic.test:
  Adjust to take into account the fix for Bug#32748 
  (a port from 6.0-bugteam)
mysql-test/t/log_output_basic.test:
  Adjust to take into account the fix for Bug#32748 
  (a port from 6.0-bugteam)
mysql-test/t/slow_query_log_file_basic.test:
  Adjust to take into account the fix for Bug#32748 
  (a port from 6.0-bugteam)
tests/mysql_client_test.c:
  Fix a compilation warning.
2008-05-20 22:23:58 +04:00
unknown
3587539f22 Bug#27430 "Crash in subquery code when in PS and table DDL changed
after PREPARE"
Update test results after a merge with the main tree: the new minimum for 
the table definition cache is 256.


mysql-test/r/table_definition_cache_basic.result:
  Update test results: the new minimum for table definition cache is 256
2008-05-20 21:07:11 +04:00
Chad MILLER
78cda882ae Bug#36818: rpl_server_id1 fails expecting slave has stopped
The test is vulnerable because it does not check if slave has stopped at time
of the new session is requested `start slave;'

Fixed with deploying explicitly wait_for_slave_to_stop synchronization macro.
2008-05-20 11:14:03 -04:00
unknown
4175806efc Merge bk-internal.mysql.com:/home/bk/mysql-5.1
into  bodhi.(none):/opt/local/work/mysql-5.1-27430


Makefile.am:
  Auto merged
include/my_global.h:
  Auto merged
mysql-test/include/mix1.inc:
  Auto merged
sql/item.cc:
  Auto merged
sql/my_decimal.h:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/set_var.h:
  Auto merged
sql/sp.cc:
  Auto merged
sql/sp_head.cc:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
sql/sql_update.cc:
  Auto merged
sql/share/errmsg.txt:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
libmysqld/CMakeLists.txt:
  Manual merge.
libmysqld/lib_sql.cc:
  Manual merge.
mysql-test/t/disabled.def:
  Manual merge.
2008-05-20 11:38:17 +04:00
unknown
4111616625 Merge abotchkov@bk-internal.mysql.com:/home/bk/mysql-5.1-bugteam
into  mysql.com:/d2/hf/mysql-5.1-bugteam
2008-05-19 11:39:30 +05:00
unknown
ee4e10c7fc disabled.def:
rpl_innodb_bug28430 disabled


mysql-test/suite/rpl/t/disabled.def:
  rpl_innodb_bug28430 disabled
2008-05-19 11:38:53 +05:00
unknown
c5865cfdb6 Merge host.loc:/work/bk/5.0-bugteam
into  host.loc:/work/bk/5.1-bugteam


sql/sql_update.cc:
  Auto merged
2008-05-18 14:27:44 +05:00
unknown
8bc987ab5b Merge host.loc:/work/bugs/5.0-bugteam-36676
into  host.loc:/work/bk/5.0-bugteam
2008-05-18 14:27:17 +05:00
unknown
29e7fa258d Fixed bug#36676: multiupdate using LEFT JOIN updates only
first row or fails with an error:
  ERROR 1022 (23000): Can't write; duplicate key in table ''

The server uses intermediate temporary table to store updated
row data.  The first column of this table contains rowid.
Current server implementation doesn't reset NULL flag of that
column even if the server fills a column with rowid.
To keep each rowid unique, there is an unique index.
An insertion into an unique index takes into account NULL
flag of key value and ignores real data if NULL flag is set.
So, insertion of actually different rowids may lead to two
kind of problems.  Visible effect of each of these problems
depends on an initial engine type of temporary table:

1. If multiupdate initially creates temporary table as
a MyISAM table (a table contains blob columns, and the
create_tmp_table function assumes, that this table is
large), it inserts only one single row and updates
only rows with one corresponding rowid. Other rows are
silently ignored. 

2. If multiupdate initially creates MEMORY temporary
table, fills it with data and reaches size limit for
MEMORY tables (max_heap_table_size), multiupdate
converts MEMORY table into MyISAM table and fails
with an error:
  ERROR 1022 (23000): Can't write; duplicate key in table ''


Multiupdate has been fixed to update the NULL flag of
temporary table rowid columns.



mysql-test/r/multi_update_tiny_hash.result:
  Added test case for bug#36676.
mysql-test/t/multi_update_tiny_hash-master.opt:
  Added test case for bug#36676.
mysql-test/t/multi_update_tiny_hash.test:
  Added test case for bug#36676.
sql/sql_update.cc:
  Fixed bug#36676: multiupdate using LEFT JOIN updates only
                   first row or fails with an error:
    ERROR 1022 (23000): Can't write; duplicate key in table ''
  
  The multi_update::send_data method has been modified to reset null bits of
  fields containing rowids.
2008-05-18 14:21:25 +05:00
unknown
eee5b97258 Merge bk-internal.mysql.com:/home/bk/mysql-5.0-bugteam
into  zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0-bugteam
2008-05-16 17:48:07 -04:00