# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
#   2008/01/28 22:05:25+01:00 mikael@dator6.(none) 
#   BUG#33182: Disallow division due to div_precision_increment problems
# 
# mysql-test/r/partition.result
#   2008/01/28 22:05:22+01:00 mikael@dator6.(none) +3 -0
#   New test case to validate that '/' is no longer allowed,
#   only integer division is allowed
# 
# mysql-test/t/partition.test
#   2008/01/28 22:05:22+01:00 mikael@dator6.(none) +4 -0
#   New test case to validate that '/' is no longer allowed,
#   only integer division is allowed
# 
# sql/item_func.h
#   2008/01/28 22:05:22+01:00 mikael@dator6.(none) +3 -1
#   +,-,*, mod is allowed
#   / is disallowed
# 
diff -Nru a/mysql-test/r/partition.result b/mysql-test/r/partition.result
--- a/mysql-test/r/partition.result	2008-01-28 22:06:14 +01:00
+++ b/mysql-test/r/partition.result	2008-01-28 22:06:14 +01:00
@@ -1,4 +1,7 @@
 drop table if exists t1;
+create table t1 (a int) partition by list ((a/3)*10 div 1)
+(partition p0 values in (0), partition p1 values in (1));
+ERROR HY000: This partition function is not allowed
 CREATE TABLE t1 (
 d DATE NOT NULL
 )
diff -Nru a/mysql-test/t/partition.test b/mysql-test/t/partition.test
--- a/mysql-test/t/partition.test	2008-01-28 22:06:14 +01:00
+++ b/mysql-test/t/partition.test	2008-01-28 22:06:14 +01:00
@@ -14,6 +14,10 @@
 drop table if exists t1;
 --enable_warnings
 
+--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
+create table t1 (a int) partition by list ((a/3)*10 div 1)
+(partition p0 values in (0), partition p1 values in (1));
+
 #
 # Bug #30695: An apostrophe ' in the comment of the ADD PARTITION causes the Server to crash.
 #
diff -Nru a/sql/item_func.h b/sql/item_func.h
--- a/sql/item_func.h	2008-01-28 22:06:14 +01:00
+++ b/sql/item_func.h	2008-01-28 22:06:14 +01:00
@@ -296,7 +296,6 @@
   void print(String *str) { print_op(str); }
   void find_num_type();
   String *str_op(String *str) { DBUG_ASSERT(0); return 0; }
-  bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
 };
 
 
@@ -382,6 +381,7 @@
 public:
   Item_func_additive_op(Item *a,Item *b) :Item_num_op(a,b) {}
   void result_precision();
+  bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
 };
 
 
@@ -416,6 +416,7 @@
   double real_op();
   my_decimal *decimal_op(my_decimal *);
   void result_precision();
+  bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
 };
 
 
@@ -456,6 +457,7 @@
   const char *func_name() const { return "%"; }
   void result_precision();
   void fix_length_and_dec();
+  bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
 };
 
 
