Bug #30341 Test suite "parts" needs to be adapted to the new rules disallowing many functio
Submitted: 9 Aug 2007 17:47 Modified: 29 Aug 2007 18:47
Reporter: Joerg Bruehe Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Tests Severity:S3 (Non-critical)
Version:5.1.21 OS:Any
Assigned to: Timothy Smith CPU Architecture:Any
Tags: sr5_1

[9 Aug 2007 17:47] Joerg Bruehe
Description:
Found in the tests when building version 5.1.21

Several tests in the "parts" suite fail with error 
   1561: This partition function is not allowed
at places where this is not expected.

It seems that the discussion in bug#18198 contains the valid restrictions,
the fix for this bug is contained in the sources of 5.1.21

-------------------------------------------------------
*** /PATH/mysql-test/suite/parts/r/part_blocked_sql_func_innodb.result
--- /PATH/mysql-test/suite/parts/r/part_blocked_sql_func_innodb.reject
***************
*** 15,27
--- 15,30
  partition by range(greatest(col1,15))
  (partition p0 values less than (15),
  partition p1 values less than (31));
+ ERROR HY000: This partition function is not allowed
  create table t2 (col1 int) engine='INNODB'
  partition by list(greatest(col1,15))
  (partition p0 values in (1,2,3,4,5,6,7,8,9,10),
  partition p1 values in (11,12,13,14,15,16,17,18,19,20),
  partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+ ERROR HY000: This partition function is not allowed
  create table t3 (col1 int) engine='INNODB'
  partition by hash(greatest(col1,15));
+ ERROR HY000: This partition function is not allowed
  create table t4 (colint int, col1 int) engine='INNODB'
  partition by range(colint)
  subpartition by hash(greatest(col1,15)) subpartitions 2
***************
.....

-------------------------------------------------------
*** /PATH/mysql-test/suite/parts/r/part_blocked_sql_func_myisam.result
--- /PATH/mysql-test/suite/parts/r/part_blocked_sql_func_myisam.reject
***************
((similar))

parts.partition_alter3_innodb  [ fail ]

Errors are (from /PATH/mysqltest-time) :
mysqltest: In included file "./suite/parts/inc/partition_alter3.inc": At line 46: query 'ALTER TABLE t1 PARTITION BY HASH(CAST(YEAR(f_date) AS SIGNED INTEGER))' failed: 1561: This partition function is not allowed
(the last lines may be the most important ones)

parts.partition_alter3_myisam  [ fail ]
((similar))

parts.partition_datetime_innodb [ fail ]

Errors are (from /PATH/mysqltest-time) :
mysqltest: In included file "./suite/parts/inc/partition_timestamp.inc": At line 48: query 'create table t3 (a timestamp not null, primary key(a)) engine=$engine
partition by range (cast(month(a) as unsigned)) subpartition by key (a)
subpartitions 3 (
partition quarter1 values less than (4),
partition quarter2 values less than (7),
partition quarter3 values less than (10),
partition quarter4 values less than (13)
)' failed: 1561: This partition function is not allowed
(the last lines may be the most important ones)

parts.partition_datetime_myisam [ fail ]
((similar))

parts.partition_decimal_innodb [ fail ]

Errors are (from /PATH/mysqltest-time) :
mysqltest: In included file "./suite/parts/inc/partition_decimal.inc": At line 50: query 'create table t3 (a decimal(18,9)
not null, primary key(a)) engine=$engine
partition by range (cast(floor(a) as signed)) subpartition by key (a) subpartitions 2 (
partition pa2 values less than (2),
partition pa4 values less than (4),
partition pa6 values less than (6),
partition pa8 values less than (8),
partition pa10 values less than (10)
)' failed: 1561: This partition function is not allowed
(the last lines may be the most important ones)

parts.partition_decimal_myisam [ fail ]
((similar))

parts.partition_float_innodb   [ fail ]

Errors are (from /PATH/mysqltest-time) :
mysqltest: In included file "./suite/parts/inc/partition_float.inc": At line 54: query 'create table t3 (a float not null,
primary key(a)) engine=$engine
partition by range (cast(floor(a) as signed)) subpartition by key (a) subpartitions 3 (
partition pa1 values less than (3),
partition pa3 values less than (6),
partition pa10 values less than (10)
)' failed: 1561: This partition function is not allowed
(the last lines may be the most important ones)

parts.partition_float_myisam   [ fail ]
((similar))

parts.partition_syntax_innodb  [ fail ]

Errors are (from /PATH/mysqltest-time) :
mysqltest: In included file "./suite/parts/inc/partition_syntax.inc": At line 336: query 'CREATE TABLE t1 (
$column_list
)
PARTITION BY RANGE(f_int1)
( PARTITION part1 VALUES LESS THAN (CAST(NULL AS SIGNED INTEGER)),
PARTITION part2 VALUES LESS THAN (1000))' failed with wrong errno 1561: 'This partition function is not allowed', instead of 1064...
(the last lines may be the most important ones)

parts.partition_syntax_myisam  [ fail ]
((similar))

parts.partition_value_innodb   [ fail ]

Errors are (from /PATH/mysqltest-time) :
mysqltest: In included file "./suite/parts/inc/partition_value.inc": At line 26: query 'CREATE TABLE t1 (
$column_list
)
PARTITION BY HASH(CAST(f_char1 AS SIGNED INTEGER) * CAST(5.0E+18 AS SIGNED INTEGER)) PARTITIONS 8' failed: 1561: This partition function is not allowed
(the last lines may be the most important ones)

parts.partition_value_myisam   [ fail ]
((similar))

How to repeat:
Found by running the "parts" suite in the release build.

Suggested fix:
Check bug#18198 and modify the tests.
[22 Aug 2007 21:40] Timothy Smith
I am modifying the test case:

- Test ORD, ASCII, WEEKOFYEAR as disallowed functions (bug #30189)
- Disable FLOOR() and CEILING() tests, due to bug #30577
- Change MOD() test to use an int column instead of a float (same problem as FLOOR() and CEILING(), but my subjective opinion is that it makes sense to use MOD() on an int column)

With these changes, the test is usable.
[23 Aug 2007 20:28] Timothy Smith
ChangeSet isn't showing up in commits list for some reason.  Here it is:

https://intranet.mysql.com/~tsmith/tmp/suite-parts-1.diff
[27 Aug 2007 18:38] Trudy Pelzer
Horst has verified Tim's patch fixes this and 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
[28 Aug 2007 18:37] Timothy Smith
Queued to target-5.1.22
[29 Aug 2007 18:47] Timothy Smith
Test case changes only, no need to document
[4 Sep 2007 17:12] Bugs System
Pushed into 5.1.23-beta