Commit graph

83 commits

Author SHA1 Message Date
Sergei Golubchik
c9801135c1 Merge branch '10.1' into 10.2 2017-07-08 09:56:28 +02:00
Sergei Golubchik
9e11e055ce Merge branch '10.0' into 10.1 2017-07-07 11:30:03 +02:00
Sergei Golubchik
89dc445a55 Merge branch '5.5' into 10.0 2017-07-06 23:47:33 +02:00
Sergei Golubchik
e1093e2464 cleanup: part_func_string and subpart_func_string
Remove now-unused part_func_string and subpart_func_string
from partition_info.
2017-07-05 17:15:59 +02:00
Sergei Golubchik
9bcfd27b7a cleanup: remove dead (half-merged) code from partition_info.* 2016-12-12 20:27:27 +01:00
Sergei Golubchik
0bef3bb8d0 cleanup: remove Item::intro_version
and partition_info::set_show_version_string - they were
already broken and impossible to maintain
2016-12-12 20:27:25 +01:00
Monty
8be53a389c MDEV-6112 multiple triggers per table
This is similar to MysQL Worklog 3253, but with
a different implementation. The disk format and
SQL syntax is identical with MySQL 5.7.

Fetures supported:
- "Any" ammount of any trigger
- Supports FOLLOWS and PRECEDES to be
  able to put triggers in a certain execution order.

Implementation details:
- Class Trigger added to hold information about a trigger.
  Before this trigger information was stored in a set of lists in
  Table_triggers_list and in Table_triggers_list::bodies
- Each Trigger has a next field that poinst to the next Trigger with the
  same action and time.
- When accessing a trigger, we now always access all linked triggers
- The list are now only used to load and save trigger files.
- MySQL trigger test case (trigger_wl3253) added and we execute these
  identically.
- Even more gracefully handling of wrong trigger files than before. This
  is useful if a trigger file uses functions or syntax not provided by
  the server.
- Each trigger now has a "Created" field that shows when the trigger was
  created, with 2 decimals.

Other comments:
- Many of the changes in test files was done because of the new "Created"
  field in the trigger file. This shows up in SHOW ... TRIGGER and when
  using information_schema.trigger.
- Don't check if all memory is released if on uses --gdb;  This is needed
  to be able to get a list from safemalloc of not freed memory while
  debugging.
- Added option to trim_whitespace() to know how many prefix characters
  was skipped.
- Changed a few ulonglong sql_mode to sql_mode_t, to find some wrong usage
  of sql_mode.
2016-10-05 01:11:07 +03:00
Oleksandr Byelkin
4ec088f2e7 MDEV-8348: Add catchall to all table partitioning for list partitions
DEFAULT partition support added to LIST and LIST COLUMN partitioning.
Partitions Prunning added for DEFAULT partititon.
2016-09-07 17:26:36 +02:00
Sergey Vojtovich
753d1f868c MDEV-8716 - Obsolete sql_calloc() in favor of THD::calloc() and thd_calloc() 2015-11-26 11:34:16 +04:00
Sergey Vojtovich
13af8650a8 MDEV-8719 - Obsolete sql_memdup() in favor of THD::memdup() and thd_memdup() 2015-11-26 11:34:15 +04:00
Monty
3bca8db4f9 MDEV-6152: Remove calls to current_thd while creating Item
- Part 4: Removing calls to sql_alloc() and sql_calloc()

Other things:
- Added current_thd in some places to make it clear that it's called (easier to remove later)
- Move memory allocation from Item_func_case::fix_length_and_dec() to Item_func_case::fix_fields()
- Added mem_root to some new calls
- Fixed some wrong UNINIT_VAR() calls
- Fixed a bug in generate_partition_syntax() in case of errors
- Added mem_root to argument to new thread_info
- Simplified my_parse_error() call in sql_yacc.yy
2015-08-27 22:29:11 +03:00
Monty
3cb578c001 MDEV-6152: Remove calls to current_thd while creating Item
- Part 3: Adding mem_root to push_back() and push_front()

Other things:
- Added THD as an argument to some partition functions.
- Added memory overflow checking for XML tag's in read_xml()
2015-08-27 22:21:08 +03:00
Sergei Golubchik
0dc23679c8 10.0-base merge 2014-02-26 15:28:07 +01:00
Sergei Golubchik
0b9a0a3517 5.5 merge 2014-02-25 16:04:35 +01:00
Sergei Golubchik
84651126c0 MySQL-5.5.36 merge
(without few incorrect bugfixes and with 1250 files where only a copyright year was changed)
2014-02-17 11:00:51 +01:00
Sergei Golubchik
72c20282db 10.0-base merge 2014-02-03 15:22:39 +01:00
Sergei Golubchik
59d9d08e2b 5.5 merge 2014-02-01 00:54:03 +01:00
Sergei Golubchik
0cdf1573b6 MDEV-5421 Assertion `! is_set()' fails on INSERT IGNORE when a table has no partition for a value
make print_no_partition_found() to respect MYF(errflag)

mysql-test/suite/parts/t/insert_ignore-5421.test:
  mdev:5421
2014-01-23 00:03:05 +01:00
Murthy Narkedimilli
c92223e198 Updated/added copyright headers 2014-01-06 10:52:35 +05:30
Sergei Golubchik
1387e71531 MDEV-5281 Partitioning issue after upgrade from 10.0.3-1 to 10.0.5-1
merged from 5.6:
Bug#14521864: MYSQL 5.1 TO 5.5 BUGS PARTITIONING
Bug#16589511: MYSQL_UPGRADE FAILS TO WRITE OUT ENTIRE ALTER TABLE ... ALGORITHM= ... STATEMENT
Bug#16274455: CAN NOT ACESS PARTITIONED TABLES WHEN DOWNGRADED FROM 5.6.11 TO 5.6.10

plus minor changes from 5.6, mainly comments
2013-11-28 12:10:44 +01:00
Sergei Golubchik
62b658a405 MDEV-4786 merge 10.0-monty -> 10.0
remove half-applied "Bug#14521864: MYSQL 5.1 TO 5.5 BUGS PARTITIONING"
2013-08-12 20:56:35 +02:00
Sergei Golubchik
b7b5f6f1ab 10.0-monty merge
includes:
* remove some remnants of "Bug#14521864: MYSQL 5.1 TO 5.5 BUGS PARTITIONING"
* introduce LOCK_share, now LOCK_ha_data is strictly for engines
* rea_create_table() always creates .par file (even in "frm-only" mode)
* fix a 5.6 bug, temp file leak on dummy ALTER TABLE
2013-07-21 16:39:19 +02:00
Michael Widenius
5f1f2fc0e4 Applied all changes from Igor and Sanja 2013-06-15 18:32:08 +03:00
Sergei Golubchik
4749d40c63 5.5 merge 2013-06-06 17:51:28 +02:00
Alexey Botchkov
d8dccde6df MDEV-318 IF (NOT) EXIST clauses for ALTER TABLE (MWL #252).
Syntax modified to allow statements:
               ALTER TABLE ADD/DROP COLUMN
               ALTER TABLE ADD/DROP INDEX
               ALTER TABLE ADD/DROP FOREIGN KEY
               ALTER TABLE ADD/DROP PARTITION
               ALTER TABLE CHANGE COLUMN
               ALTER TABLE MODIFY COLUMN
               DROP INDEX
         to have IF (NOT) EXISTS options.
         Appropriate implementations added to mysql_alter_table().
      
      per-file comments:
        mysql-test/r/alter_table.result
      MDEV-318 IF (NOT) EXIST clauses for ALTER TABLE (MWL #252).
              test result updated.
        mysql-test/r/fulltext.result
      MDEV-318 IF (NOT) EXIST clauses for ALTER TABLE (MWL #252).
        mysql-test/r/partition.result
              test result updated.
      MDEV-318 IF (NOT) EXIST clauses for ALTER TABLE (MWL #252).
        mysql-test/t/alter_table.test
              tests added.
      MDEV-318 IF (NOT) EXIST clauses for ALTER TABLE (MWL #252).
        mysql-test/t/fulltext.test
      MDEV-318 IF (NOT) EXIST clauses for ALTER TABLE (MWL #252).
              tests added.
        mysql-test/t/partition.test
      MDEV-318 IF (NOT) EXIST clauses for ALTER TABLE (MWL #252).
              tests added.
        sql/field.cc
      MDEV-318 IF (NOT) EXIST clauses for ALTER TABLE (MWL #252).
              create_if_not_exists field added.
        sql/field.h
      MDEV-318 IF (NOT) EXIST clauses for ALTER TABLE (MWL #252).
              create_if_not_exists field added.
        sql/partition_info.h
      MDEV-318 IF (NOT) EXIST clauses for ALTER TABLE (MWL #252).
              has_unique_name made public.
        sql/sp_head.cc
      MDEV-318 IF (NOT) EXIST clauses for ALTER TABLE (MWL #252).
        sql/sql_class.cc
      MDEV-318 IF (NOT) EXIST clauses for ALTER TABLE (MWL #252).
              create_if_not_exists inited.
        sql/sql_class.h
      MDEV-318 IF (NOT) EXIST clauses for ALTER TABLE (MWL #252).
              create_if_not_exists inited.
        sql/sql_lex.cc
      MDEV-318 IF (NOT) EXIST clauses for ALTER TABLE (MWL #252).
              check_exists inited.
        sql/sql_lex.h
      MDEV-318 IF (NOT) EXIST clauses for ALTER TABLE (MWL #252).
              check_exists inited.
        sql/sql_parse.cc
      MDEV-318 IF (NOT) EXIST clauses for ALTER TABLE (MWL #252).
        check_exists inited.
        sql/sql_table.cc
      MDEV-318 IF (NOT) EXIST clauses for ALTER TABLE (MWL #252).
              handle_if_exists_options() added.
              it's called in mysql_alter_table().
        sql/sql_trigger.cc
      MDEV-318 IF (NOT) EXIST clauses for ALTER TABLE (MWL #252).
              check_exists instead of drop_if_exists.
        sql/sql_view.cc
      MDEV-318 IF (NOT) EXIST clauses for ALTER TABLE (MWL #252).
              check_exists instead of drop_if_exists.
        sql/sql_yacc.yy
      MDEV-318 IF (NOT) EXIST clauses for ALTER TABLE (MWL #252).
              sintax modified.
2013-04-13 11:59:16 +05:00
Mattias Jonsson
d92a7cb76a Bug#14521864: MYSQL 5.1 TO 5.5 BUGS PARTITIONING
Due to an internal change in the server code in between 5.1 and 5.5
(wl#2649) the hash function used in KEY partitioning changed
for numeric and date/time columns (from binary hash calculation
to character based hash calculation).

Also enum/set changed from latin1 ci based hash calculation to
binary hash between 5.1 and 5.5. (bug#11759782).

These changes makes KEY [sub]partitioned tables on any of
the affected column types incompatible with 5.5 and above,
since the calculation of partition id differs.

Also since InnoDB asserts that a deleted row was previously
read (positioned), the server asserts on delete of a row that
is in the wrong partition.

The solution for this situation is:

1) The partitioning engine will check that delete/update will go to the
partition the row was read from and give an error otherwise, consisting
of the rows partitioning fields. This will avoid asserts in InnoDB and
also alert the user that there is a misplaced row. A detailed error
message will be given, including an entry to the error log consisting
of both table name, partition and row content (PK if exists, otherwise
all partitioning columns).


2) A new optional syntax for KEY () partitioning in 5.5 is allowed:
[SUB]PARTITION BY KEY [ALGORITHM = N] (list_of_cols)
Where N = 1 uses the same hashing as 5.1 (Numeric/date/time fields uses
binary hashing, ENUM/SET uses charset hashing) N = 2 uses the same
hashing as 5.5 (Numeric/date/time fields uses charset hashing,
ENUM/SET uses binary hashing). If not set on CREATE/ALTER it will
default to 2.

This new syntax should probably be ignored by NDB.


3) Since there is a demand for avoiding scanning through the full
table, during upgrade the ALTER TABLE t PARTITION BY ... command is
considered a no-op (only .frm change) if everything except ALGORITHM
is the same and ALGORITHM was not set before, which allows manually
upgrading such table by something like:
ALTER TABLE t PARTITION BY KEY ALGORITHM = 1 () or
ALTER TABLE t PARTITION BY KEY ALGORITHM = 2 ()


4) Enhanced partitioning with CHECK/REPAIR to also check for/repair
misplaced rows. (Also works for ALTER TABLE t CHECK/REPAIR PARTITION)

CHECK FOR UPGRADE:
If the .frm version is < 5.5.3
and uses KEY [sub]partitioning
and an affected column type
then it will fail with an message:
KEY () partitioning changed, please run:
ALTER TABLE `test`.`t1`  PARTITION BY KEY ALGORITHM = 1 (a)
PARTITIONS 12
(i.e. current partitioning clause, with the addition of
ALGORITHM = 1)

CHECK without FOR UPGRADE:
if MEDIUM (default) or EXTENDED options are given:
Scan all rows and verify that it is in the correct partition.
Fail for the first misplaced row.

REPAIR:
if default or EXTENDED (i.e. not QUICK/USE_FRM):
Scan all rows and every misplaced row is moved into its correct
partitions.


5) Updated mysqlcheck (called by mysql_upgrade) to handle the
new output from CHECK FOR UPGRADE, to run the ALTER statement
instead of running REPAIR.

This will allow mysql_upgrade (or CHECK TABLE t FOR UPGRADE) to upgrade
a KEY [sub]partitioned table that has any affected field type
and a .frm version < 5.5.3 to ALGORITHM = 1 without rebuild.


Also notice that if the .frm has a version of >= 5.5.3 and ALGORITHM
is not set, it is not possible to know if it consists of rows from
5.1 or 5.5! In these cases I suggest that the user does:
(optional)
LOCK TABLE t WRITE;
SHOW CREATE TABLE t;
(verify that it has no ALGORITHM = N, and to be safe, I would suggest
backing up the .frm file, to be used if one need to change to another
ALGORITHM = N, without needing to rebuild/repair)
ALTER TABLE t <old partitioning clause, but with ALGORITHM = N>;
which should set the ALGORITHM to N (if the table has rows from
5.1 I would suggest N = 1, otherwise N = 2)
CHECK TABLE t;
(here one could use the backed up .frm instead and change to a new N
and run CHECK again and see if it passes)
and if there are misplaced rows:
REPAIR TABLE t;
(optional)
UNLOCK TABLES;
2013-01-30 17:51:52 +01:00
Kent Boortz
68f00a5686 Updated/added copyright headers 2011-06-30 17:37:13 +02:00
Kent Boortz
02e07e3b51 Updated/added copyright headers 2011-06-30 17:46:53 +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
47906997c7 Bug#51851: Server with SBR locks mutex twice on LOAD DATA
into partitioned MyISAM table

Problem was that the ha_data structure was introduced in 5.1
and only used for partitioning first, but with the intention
of be of use for others engines as well, and when used by other
engines it would clash if it also was partitioned.

Solution is to move the partitioning specific data to a separate
structure, with its own mutex (which is used for auto_increment).

Also did rename PARTITION_INFO to PARTITION_STATS since there
already exist a class named partition_info, also cleaned up
some related variables.

mysql-test/r/partition_binlog_stmt.result:
  Bug#51851: Server with SBR locks mutex twice on LOAD DATA
  into partitioned MyISAM table
  
  New result file
mysql-test/t/partition_binlog_stmt.test:
  Bug#51851: Server with SBR locks mutex twice on LOAD DATA
  into partitioned MyISAM table
  
  New result file
sql/ha_ndbcluster.cc:
  Bug#51851: Server with SBR locks mutex twice on LOAD DATA
  into partitioned MyISAM table
  
  Rename of PARTITION_INFO to PARTITION_STATS to better
  match the use (and there is also a class named
  partition_info...)
sql/ha_ndbcluster.h:
  Bug#51851: Server with SBR locks mutex twice on LOAD DATA
  into partitioned MyISAM table
  
  Rename of PARTITION_INFO to PARTITION_STATS to better
  match the use (and there is also a class named
  partition_info...)
sql/ha_partition.cc:
  Bug#51851: Server with SBR locks mutex twice on LOAD DATA
  into partitioned MyISAM table
  
  Removed the partitioning engines use of ha_data in
  TABLE_SHARE and added ha_part_data instead, since
  they collide if used in the same time.
  
  Rename of PARTITION_INFO to PARTITION_STATS to better
  match the use (and there is also a class named
  partition_info...)
  
  Removed some dead code.
sql/ha_partition.h:
  Bug#51851: Server with SBR locks mutex twice on LOAD DATA
  into partitioned MyISAM table
  
  Removed some dead code.
  
  Rename of PARTITION_INFO to PARTITION_STATS to better
  match the use (and there is also a class named
  partition_info...)
  
  Removed the partitioning engines use of ha_data in
  TABLE_SHARE and added ha_part_data instead, since
  they collide if used in the same time.
sql/handler.cc:
  Bug#51851: Server with SBR locks mutex twice on LOAD DATA
  into partitioned MyISAM table
  
  Rename of PARTITION_INFO to PARTITION_STATS to better
  match the use (and there is also a class named
  partition_info...)
sql/handler.h:
  Bug#51851: Server with SBR locks mutex twice on LOAD DATA
  into partitioned MyISAM table
  
  Rename of PARTITION_INFO to PARTITION_STATS to better
  match the use (and there is also a class named
  partition_info...)
sql/mysql_priv.h:
  Bug#51851: Server with SBR locks mutex twice on LOAD DATA
  into partitioned MyISAM table
  
  Removed the partitioning engines use of ha_data in
  TABLE_SHARE and added ha_part_data instead, since
  they collide if used in the same time.
  
  Added key_PARTITION_LOCK_auto_inc for instrumentation.
sql/mysqld.cc:
  Bug#51851: Server with SBR locks mutex twice on LOAD DATA
  into partitioned MyISAM table
  
  Removed the partitioning engines use of ha_data in
  TABLE_SHARE and added ha_part_data instead, since
  they collide if used in the same time.
  
  Added key_PARTITION_LOCK_auto_inc for instrumentation.
sql/partition_info.h:
  Bug#51851: Server with SBR locks mutex twice on LOAD DATA
  into partitioned MyISAM table
  
  Removed part_state* since it was not in use.
sql/sql_partition.cc:
  Bug#51851: Server with SBR locks mutex twice on LOAD DATA
  into partitioned MyISAM table
  
  Removed part_state* since it was not in use.
sql/sql_partition.h:
  Bug#51851: Server with SBR locks mutex twice on LOAD DATA
  into partitioned MyISAM table
  
  Cleaned up old commented out code.
  
  Removed part_state* since it was not in use.
sql/sql_show.cc:
  Bug#51851: Server with SBR locks mutex twice on LOAD DATA
  into partitioned MyISAM table
  
  Rename of PARTITION_INFO to PARTITION_STATS to better
  match the use (and there is also a class named
  partition_info...)
  
  Renamed partition_info to partition_info_str, since
  partition_info is a name of a class.
sql/sql_table.cc:
  Bug#51851: Server with SBR locks mutex twice on LOAD DATA
  into partitioned MyISAM table
  
  Renamed partition_info to partition_info_str, since
  partition_info is a name of a class.
sql/table.cc:
  Bug#51851: Server with SBR locks mutex twice on LOAD DATA
  into partitioned MyISAM table
  
  Removed the partitioning engines use of ha_data in
  TABLE_SHARE and added ha_part_data instead, since
  they collide if used in the same time.
  
  Renamed partition_info to partition_info_str, since
  partition_info is a name of a class.
  
  removed part_state* since it was not in use.
sql/table.h:
  Bug#51851: Server with SBR locks mutex twice on LOAD DATA
  into partitioned MyISAM table
  
  Removed the partitioning engines use of ha_data in
  TABLE_SHARE and added ha_part_data instead, since
  they collide if used in the same time.
  
  Renamed partition_info to partition_info_str, since
  partition_info is a name of a class.
  
  removed part_state* since it was not in use.
2010-03-30 22:52:45 +02:00
Mikael Ronstrom
7548f142c3 BUG#49591, Fixed version string in SHOW CREATE TABLE to accomodate for column list partitioning and new function to_seconds 2009-12-17 18:39:10 +01:00
Mikael Ronstrom
072c13d939 Merged WL#3352 into mysql-next-mr 2009-10-28 18:22:36 +01:00
Mikael Ronstrom
10fed1aca0 BUG#48165, needed to introduce length restrictions on partitioning fields to ensure that no stack overruns occur 2009-10-28 01:11:17 +01:00
Mikael Ronstrom
fbac636380 Upped size limit on varchar/char from 512 to 2048 2009-10-23 09:36:45 +02:00
Mikael Ronstrom
6f27ad15b2 A lot of fixes to make character set work ok, first step to fixing BUG#48163 2009-10-22 16:15:06 +02:00
Mikael Ronstrom
10210bfef2 Merge 2009-10-21 13:59:11 +02:00
Mikael Ronstrom
bbd922b09c Removed column_list and fixed all issues relating to this change 2009-10-21 12:40:21 +02:00
Mattias Jonsson
93e02adcfa Manual merge mysql-trunk -> mysql-trunk-wl3352 2009-10-19 12:09:52 +02:00
Mikael Ronstrom
760dd08d97 Merged in latest changes 2009-10-16 17:44:49 +02:00
Mikael Ronstrom
975c1ff808 Fixed review comments 2009-10-16 17:08:34 +02:00
Mikael Ronstrom
c90669c4d4 Fixed removal of column_list keyword for VALUES part, retained for PARTITION BY RANGE/LIST COLUMN_LIST, not entirely working yet 2009-10-16 16:16:06 +02:00
Mikael Ronstrom
576dd76aa8 BUG#47837, Duplicate field names were allowed in both column list partitioning and key partitioning, added check to give error in this case 2009-10-06 17:01:59 +02:00
Mikael Ronstrom
dc97402c11 Changed all no_ to num_ to avoid strange names like no_list_values which is not expected to be number of list values, rather a boolea indicating no list values 2009-10-01 15:04:42 +02:00
Mats Kindahl
d47710c8dc WL#5016: Fix header file include guards
Adding header include file guards to files that are missing such.
2009-09-23 23:32:31 +02:00
Mikael Ronstrom
6942c25e73 WL#3352, Introducing Column list partitioning, makes it possible to partition on most data types, makes it possible to prune on multi-field partitioning 2009-09-15 17:07:52 +02:00
Georgi Kodinov
b64e7fb5be fixed a valgrind warning in partition_pruning 2009-09-02 18:42:08 +03:00
Mattias Jonsson
67214ef433 Bug#20577: Partitions: use of to_days() function leads to selection failures
Problem was that the partition containing NULL values
was pruned away, since '2001-01-01' < '2001-02-00' but
TO_DAYS('2001-02-00') is NULL.

Added the NULL partition for RANGE/LIST partitioning on TO_DAYS()
function to be scanned too.

Also fixed a bug that added ALLOW_INVALID_DATES to sql_mode
(SELECT * FROM t WHERE date_col < '1999-99-99' on a RANGE/LIST
partitioned table would add it).

mysql-test/include/partition_date_range.inc:
  Bug#20577: Partitions: use of to_days() function leads to selection failures
  
  Added include file to decrease test code duplication
mysql-test/r/partition_pruning.result:
  Bug#20577: Partitions: use of to_days() function leads to selection failures
  
  Added test results
mysql-test/r/partition_range.result:
  Bug#20577: Partitions: use of to_days() function leads to selection failures
  
  Updated test result.
  This fix adds the partition containing NULL values to
  the list of partitions to be scanned.
mysql-test/t/partition_pruning.test:
  Bug#20577: Partitions: use of to_days() function leads to selection failures
  
  Added test case
sql/item.h:
  Bug#20577: Partitions: use of to_days() function leads to selection failures
  
  Added MONOTONIC_*INCREASE_NOT_NULL values to be used by TO_DAYS.
sql/item_timefunc.cc:
  Bug#20577: Partitions: use of to_days() function leads to selection failures
  
  Calculate the number of days as return value even for invalid dates.
  This is so that pruning can be used even for invalid dates.
sql/opt_range.cc:
  Bug#20577: Partitions: use of to_days() function leads to selection failures
  
  Fixed a bug that added ALLOW_INVALID_DATES to sql_mode
  (SELECT * FROM t WHERE date_col < '1999-99-99' on a RANGE/LIST
  partitioned table would add it).
sql/partition_info.h:
  Bug#20577: Partitions: use of to_days() function leads to selection failures
  
  Resetting ret_null_part when a single partition is to be used, this
  to avoid adding the NULL partition.
sql/sql_partition.cc:
  Bug#20577: Partitions: use of to_days() function leads to selection failures
  
  Always include the NULL partition if RANGE or LIST.
  Use the returned value for the function for pruning, even if
  it is marked as NULL, so that even '2000-00-00' can be
  used for pruning, even if TO_DAYS('2000-00-00') is NULL.
  
  Changed == to >= in get_next_partition_id_list to avoid
  crash if part_iter->part_nums is not correctly setup.
2009-08-26 12:59:49 +02:00
Build Team
e85fe79430 Added "Sun Microsystems, Inc." to copyright headers on files modified
since Oct 1st
2008-11-10 21:21:49 +01:00
Alexey Botchkov
a66e58daee Bug#38083 Error-causing row inserted into partitioned table despite error 2008-10-06 17:22:38 +05:00
unknown
e79249f81b Manual merge
configure.in:
  Auto merged
mysql-test/r/func_misc.result:
  Auto merged
mysql-test/r/myisam.result:
  Auto merged
mysql-test/r/partition.result:
  Auto merged
mysql-test/r/partition_symlink.result:
  Auto merged
mysql-test/t/func_misc.test:
  Auto merged
mysql-test/t/partition.test:
  Auto merged
sql/field.cc:
  Auto merged
sql/field.h:
  Auto merged
sql/item.cc:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/item_func.h:
  Auto merged
sql/log.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/partition_info.cc:
  Auto merged
sql/partition_info.h:
  Auto merged
sql/rpl_rli.cc:
  Auto merged
sql/sql_plugin.cc:
  Auto merged
sql/sql_show.cc:
  Auto merged
sql/sql_parse.cc:
  Manual merge. Needs later fix. New code in create table was not
  accepted. Needs to be added to mysql_create_table_no_lock().
2008-03-14 12:02:11 +01:00