Commit graph

6 commits

Author SHA1 Message Date
Mattias Jonsson
fbb49d80eb merge 2010-10-01 15:32:03 +02:00
Mattias Jonsson
86327002fe Bug#50036: Inconsistent errors when using TIMESTAMP columns/expressions
It was hard to understand what the error really meant.

The error checking in partitioning is done in several different
parts during the execution of a query which can make it
hard to return useful errors.

Added a new error for bad VALUES part in the per PARTITION clause.
Using the more verbose error that a column is not allowed in
the partitioning function instead of just that the function is
not allowed.

mysql-test/r/partition.result:
  changed error to be more specific
mysql-test/r/partition_error.result:
  updated result
mysql-test/std_data/parts/t1TIMESTAMP.frm:
  .frm file of CREATE TABLE t1 (a TIMESTAMP) PARTITION BY HASH(TO_DAYS(a));
mysql-test/t/partition.test:
  changed error to be more specific
mysql-test/t/partition_error.test:
  Added test (also for verifying behaviour of previously
  created tables which is no longer allowed).
  
  Updated expected errors in other places
sql/partition_info.cc:
  Added function report_part_expr_error to
  be able to return a more specific error.
  
  Renamed fix_func_partition to fix_partition_values
  since the function really fixes/checks the VALUES clause.
sql/partition_info.h:
  removed part_result_type, since it was unused.
  renamed fix_funk_partition->fix_partition_values
  added report_part_expr_error
sql/share/errmsg-utf8.txt:
  Added a more specific error.
sql/sql_partition.cc:
  made use of report_part_expr_error to get a more specific error.
sql/sql_yacc.yy:
  Changed error message to be more specific. And return an other error code.
2010-08-30 17:33:55 +02:00
Mattias Jonsson
b7ad17d06a Bug#46086: crash when dropping a partitioned table
and the original engine is disabled

Missing check that engine is available.

mysql-test/include/not_blackhole.inc:
  new include file
mysql-test/r/partition_not_blackhole.result:
  new result file
mysql-test/std_data/parts/t1_blackhole.frm:
  blackhole partitioned table .frm file:
  create table `t1` (`id` int primary key) engine=blackhole
  partition by key () partitions 1;
mysql-test/std_data/parts/t1_blackhole.par:
  .par file matching blackhole partitioned .frm
mysql-test/t/partition_not_blackhole-master.opt:
  new master-opt to disable blackhole if compiled in.
mysql-test/t/partition_not_blackhole.test:
  New test
sql/ha_partition.cc:
  Added check that engine is available.
2010-07-08 14:36:55 +02:00
Mattias Jonsson
48e0325c5e Bug#39893: Crash if select on a partitioned table, when partitioning is disabled
Problem was that it tried to run partitioning function calls when
opening a partitioned table, when it was explicitly disabled.

Solution is to check if the partitioning plugin is ready to use before
using any partitioning specific calls.

mysql-test/r/disabled_partition.require:
  Bug#39893: Crash if select on a partitioned table, when partitioning is disabled
  
  New require file to use when partitioning is disabled (but compiled in)
mysql-test/r/not_partition.result:
  Bug#39893: Crash if select on a partitioned table, when partitioning is disabled
  
  Updated testcase
mysql-test/r/partition_disabled.result:
  Bug#39893: Crash if select on a partitioned table, when partitioning is disabled
  
  New result file
mysql-test/std_data/parts/t1.frm:
  Bug#39893: Crash if select on a partitioned table, when partitioning is disabled
  
  frm file for 'create table t1 (a int) partition by hash (a)'
mysql-test/t/not_partition.test:
  Bug#39893: Crash if select on a partitioned table, when partitioning is disabled
  
  Updated test cases
mysql-test/t/partition_disabled-master.opt:
  Bug#39893: Crash if select on a partitioned table, when partitioning is disabled
  
  New opt file
mysql-test/t/partition_disabled.test:
  Bug#39893: Crash if select on a partitioned table, when partitioning is disabled
  
  New test file (looks like not_partition.test, but with different errors)
sql/sql_yacc.yy:
  Bug#39893: Crash if select on a partitioned table, when partitioning is disabled
  
  Better error message (it is already built with partitioning, but is explicitly
  disabled).
sql/table.cc:
  Bug#39893: Crash if select on a partitioned table, when partitioning is disabled
  
  If the partitioning plugin is not ready, fail to open the table.
2009-01-08 15:16:44 +01: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
unknown
bfed329e17 Fixes for the following bugs:
Bug #30316: Some "parts" tests fail because the server uses "--secure-file-priv"
Bug #30341: Test suite "parts" needs to be adapted to the new rules disallowing many functio
Bug #30408: Suite "parts" needs bug numbers updated
Bug #30411: Suite "parts" needs bug numbers updated: ER_UNIQUE_KEY_NEED_ALL_FIELDS_IN_PF
Bug #30576: part_supported_sql_func_innodb.test tries to LOAD DATA outside of var dir
Bug #30581: partition_value tests use disallowed CAST() function

Included are some general fixes to allow the "parts" test suite to be run
successfully.  This includes disabling a few tests or parts of tests,
cleaning up the test cases and their results, etc.  Basically, these tests
have not been run for some time, and had suffered some bit rot.

The bugs were fixed as a single changeset, because in some ways they depend
on each other.  I couldn't be sure I'd updated all the error codes (for
bugs 30408 and 30411) without also adapting to the new allowed functions
rules (bug 30341), and vice versa.


mysql-test/include/partition_layout.inc:
  Ensure that the contents of $MYSQLTEST_VARDIR are not in the result file
mysql-test/suite/parts/inc/part_blocked_sql_funcs_main.inc:
  Add ASCII(), ORD() and WEEKOFYEAR() as blocked functions (they depend
  too much on character set, etc.).
  
  Remove DATEDIFF() as a blocked function (it is implemented in terms
  of TO_DAYS() and the minus operator).
mysql-test/suite/parts/inc/part_supported_sql_funcs_main.inc:
  Remove ASCII(), ORD() and WEEKOFYEAR(), which are not allowed functions.
  
  Remove uses of CAST() in partitioning functions - it is not allowed.
  
  Disable testing of FLOOR() and CEILING on non-integer fields, due to
  Bug 30577.
  
  Test MOD() with an integer field instead of floating point (it has a
  hybrid result type, like FLOOR() and CEILING(), but makes sense to use
  with an integer field).
  
  Add DATEDIFF() as an allowed function, because it is implemented in
  terms of TO_DAYS() and the minus operator.
mysql-test/suite/parts/inc/partition_alter3.inc:
  Remove use of disallowed CAST() function in partitioning
mysql-test/suite/parts/inc/partition_blocked_sql_funcs.inc:
  The blocked functions are actually blocked now, so expect errors.
  
  This is a result of the fix for bug 18198.
mysql-test/suite/parts/inc/partition_date.inc:
  Remove uses of CAST() in partitioning functions - it is not allowed.
mysql-test/suite/parts/inc/partition_datetime.inc:
  Remove uses of CAST() in partitioning functions - it is not allowed.
mysql-test/suite/parts/inc/partition_decimal.inc:
  Remove uses of CAST() in partitioning functions - it is not allowed.
  
  Disable testing of FLOOR() and CEILING(), due to Bug 30577.
mysql-test/suite/parts/inc/partition_directory.inc:
  Ensure that the contents of $MYSQLTEST_VARDIR are not in the result file
mysql-test/suite/parts/inc/partition_double.inc:
  Remove uses of CAST() in partitioning functions - it is not allowed.
  
  Disable testing of FLOOR() and CEILING(), due to Bug 30577.
mysql-test/suite/parts/inc/partition_enum.inc:
  Remove use of CAST(), which is disallowed.
  
  Remove test which relies on CAST().
mysql-test/suite/parts/inc/partition_float.inc:
  Remove uses of CAST() in partitioning functions - it is not allowed.
  
  Disable testing of FLOOR() and CEILING(), due to Bug 30577.
mysql-test/suite/parts/inc/partition_layout_check1.inc:
  Ensure that the contents of $MYSQLTEST_VARDIR are not in the result file
mysql-test/suite/parts/inc/partition_layout_check2.inc:
  Ensure that the contents of $MYSQLTEST_VARDIR are not in the result file
mysql-test/suite/parts/inc/partition_methods1.inc:
  Ensure that the contents of $MYSQLTEST_VARDIR are not in the result file
mysql-test/suite/parts/inc/partition_set.inc:
  Remove test which relies on CAST(), which is disallowed.
mysql-test/suite/parts/inc/partition_supported_sql_funcs.inc:
  Fix Bug #30576: part_supported_sql_func_innodb.test tries to LOAD DATA outside of var dir
  
  Move data files into std_data/parts/*, so they can be used with LOAD
  DATA INFILE '../std_data_ln/parts/*' while --secure-file-priv is in
  force.
mysql-test/suite/parts/inc/partition_syntax.inc:
  Remove use of CAST(), which is disallowed.
mysql-test/suite/parts/inc/partition_time.inc:
  Remove use of CAST(), which is disallowed.
mysql-test/suite/parts/inc/partition_timestamp.inc:
  Remove use of CAST(), which is disallowed.
mysql-test/suite/parts/inc/partition_value.inc:
  Disable this entire test file, because it relies on using CAST() as
  a partitioning function, which is disallowed.  See Bug 30581,
  "partition_value tests use disallowed CAST() function".
mysql-test/suite/parts/r/part_blocked_sql_func_innodb.result:
  Update test case results
mysql-test/suite/parts/r/part_blocked_sql_func_myisam.result:
  Update test case results
mysql-test/suite/parts/r/part_supported_sql_func_innodb.result:
  Update test case results
mysql-test/suite/parts/r/part_supported_sql_func_myisam.result:
  Update test case results
mysql-test/suite/parts/r/partition_alter3_innodb.result:
  Update test case results
mysql-test/suite/parts/r/partition_alter3_myisam.result:
  Update test case results
mysql-test/suite/parts/r/partition_basic_innodb.result:
  Update test case results
mysql-test/suite/parts/r/partition_basic_myisam.result:
  Update test case results
mysql-test/suite/parts/r/partition_datetime_innodb.result:
  Update test case results
mysql-test/suite/parts/r/partition_datetime_myisam.result:
  Update test case results
mysql-test/suite/parts/r/partition_decimal_innodb.result:
  Update test case results
mysql-test/suite/parts/r/partition_decimal_myisam.result:
  Update test case results
mysql-test/suite/parts/r/partition_float_myisam.result:
  Update test case results
mysql-test/suite/parts/r/partition_syntax_innodb.result:
  Update test case results
mysql-test/suite/parts/r/partition_syntax_myisam.result:
  Update test case results
mysql-test/suite/parts/t/disabled.def:
  Mark several more tests as disabled: partition_value_myisam,
  partition_value_innodb, part_supported_sql_func_ndb,
  rpl_ndb_dd_partitions, and partition_float_innodb
mysql-test/std_data/parts/part_supported_sql_funcs_int_ch1.inc:
  Rename: mysql-test/suite/parts/inc/part_supported_sql_funcs_int_ch1.inc -> mysql-test/std_data/parts/part_supported_sql_funcs_int_ch1.inc
mysql-test/std_data/parts/part_supported_sql_funcs_int_date.inc:
  Rename: mysql-test/suite/parts/inc/part_supported_sql_funcs_int_date.inc -> mysql-test/std_data/parts/part_supported_sql_funcs_int_date.inc
mysql-test/std_data/parts/part_supported_sql_funcs_int_float.inc:
  Rename: mysql-test/suite/parts/inc/part_supported_sql_funcs_int_float.inc -> mysql-test/std_data/parts/part_supported_sql_funcs_int_float.inc
mysql-test/std_data/parts/part_supported_sql_funcs_int_int.inc:
  Rename: mysql-test/suite/parts/inc/part_supported_sql_funcs_int_int.inc -> mysql-test/std_data/parts/part_supported_sql_funcs_int_int.inc
mysql-test/std_data/parts/part_supported_sql_funcs_int_time.inc:
  Rename: mysql-test/suite/parts/inc/part_supported_sql_funcs_int_time.inc -> mysql-test/std_data/parts/part_supported_sql_funcs_int_time.inc
mysql-test/suite/parts/inc/partition_alter_1.inc:
  Correct expected error codes, which changed due to bug 29245.
mysql-test/suite/parts/inc/partition_check.inc:
  Correct expected error codes, which changed due to bug 29245.
mysql-test/suite/parts/inc/partition_syntax_1.inc:
  Correct expected error codes, which changed due to bug 29245.
2007-08-27 14:08:32 -06:00