Skip to content

Commit 53bc68c

Browse files
author
Mattias Jonsson
committed
Bug#54483: valgrind errors when making warnings for multiline inserts into partition
Bug#57071: EXTRACT(WEEK from date_col) cannot be allowed as partitioning function There were functions allowed as partitioning functions that implicit allowed cast. That could result in unacceptable behaviour. Solution was to check that the arguments of date and time functions have allowed types (field and date/datetime/time depending on function). --BZR-- revision-id: [email protected] property-branch-nick: b54483-51-bt_2 property-file-info: ld7:file_id69:sp1f-partition.result-20050718113029-xlmjyugiq5h2b5wjp236ipsmkmej7i627:message14:Updated result4:path29:mysql-test/r/partition.resulted7:file_id73:sp1f-partition_error.resu-20050720124221-iacosg62tkflqhizuvhtiem5oeicwjit7:message14:Updated result4:path35:mysql-test/r/partition_error.resulted7:file_id73:sp1f-partition_supported_-20070206122235-d4lujt63rfn3kiaeuhhhj2d3oggxxewh7:message41:disabled test with not allowed arguments.4:path60:mysql-test/suite/parts/inc/part_supported_sql_funcs_main.inced7:file_id73:sp1f-partition_supported_-20070206122237-o7rr33pphmqy4asfttem5wxdgba7z3e57:message14:Updated result4:path62:mysql-test/suite/parts/r/part_supported_sql_func_innodb.resulted7:file_id73:sp1f-partition_supported_-20070206122237-dm76phwsi4svmc4msli2bdj6ltdtofnw7:message14:Updated result4:path62:mysql-test/suite/parts/r/part_supported_sql_func_myisam.resulted7:file_id67:sp1f-partition.test-20050718113034-pbo3ht3bf4gfa3mz44on3sqafyctwo357:message72:Fixed typo in bug number and removed non allowed function (bad argument)4:path27:mysql-test/t/partition.tested7:file_id73:sp1f-partition_error.test-20050720124214-od2aou4vzloggrqktgmbjzvuhajiukpm7:message47:Added tests to verify correct type of argument.4:path33:mysql-test/t/partition_error.tested7:file_id59:sp1f-item.h-19700101030959-rrkb43htudd62batmoteashkebcwykpa7:message57:Renamed processor since it is no longer only for timezone4:path10:sql/item.hed7:file_id64:sp1f-item_func.h-19700101030959-fbjcbwkg66qubbzptqwh5w5evhnpukze7:message63:Added help functions for checking date/time/datetime arguments.4:path15:sql/item_func.hed7:file_id68:sp1f-item_timefunc.h-19700101030959-o34ypz6ggolzqmhgsjnqh6inkvgugi467:message41:Added processors for argument correctness4:path19:sql/item_timefunc.hed7:file_id69:sp1f-sql_partition.cc-20050718113038-57h5bzswps6cel2y7k7qideue3ghbg3u7:message45:renamed the processor for checking arguments.4:path20:sql/sql_partition.ccee testament3-sha1: 13fc4192acde2db3fba98d6ce41daa66538574db
1 parent 7ba7817 commit 53bc68c

11 files changed

+4637
-7286
lines changed

mysql-test/r/partition.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1778,7 +1778,7 @@ c1 bigint,
17781778
c2 set('sweet'),
17791779
key (c2,c1,c0),
17801780
key(c0)
1781-
) engine=myisam partition by hash (month(c0)) partitions 5;
1781+
) engine=myisam partition by hash (c0) partitions 5;
17821782
insert ignore into t1 set c0 = -6502262, c1 = 3992917, c2 = 35019;
17831783
insert ignore into t1 set c0 = 241221, c1 = -6862346, c2 = 56644;
17841784
select c1 from t1 group by (select c0 from t1 limit 1);

mysql-test/r/partition_error.result

Lines changed: 638 additions & 0 deletions
Large diffs are not rendered by default.

mysql-test/suite/parts/inc/part_supported_sql_funcs_main.inc

Lines changed: 26 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,9 @@ let $val2 = '2006-01-17';
8888
let $val3 = '2006-02-25';
8989
let $val4 = '2006-02-05';
9090
--source suite/parts/inc/partition_supported_sql_funcs.inc
91-
let $coltype = char(30);
92-
--source suite/parts/inc/partition_supported_sql_funcs.inc
91+
# Disabled after fixing bug#54483.
92+
#let $coltype = char(30);
93+
#--source suite/parts/inc/partition_supported_sql_funcs.inc
9394

9495
let $sqlfunc = extract(month from col1);
9596
let $valsqlfunc = extract(year from '1998-11-23');
@@ -139,8 +140,9 @@ let $val2 = '14:30:20';
139140
let $val3 = '21:59:22';
140141
let $val4 = '10:22:33';
141142
--source suite/parts/inc/partition_supported_sql_funcs.inc
142-
let $coltype = char(30);
143-
--source suite/parts/inc/partition_supported_sql_funcs.inc
143+
# second(non_time_col) is disabled after bug#54483.
144+
#let $coltype = char(30);
145+
#--source suite/parts/inc/partition_supported_sql_funcs.inc
144146

145147
let $sqlfunc = month(col1);
146148
let $valsqlfunc = month('2006-10-14');
@@ -172,26 +174,28 @@ let $val3 = '21:59:22';
172174
let $val4 = '10:33:11';
173175
--source suite/parts/inc/partition_supported_sql_funcs.inc
174176

175-
let $sqlfunc = to_days(col1)-to_days('2006-01-01');
176-
let $valsqlfunc = to_days('2006-02-02')-to_days('2006-01-01');
177-
let $coltype = date;
178-
let $infile = part_supported_sql_funcs_int_date.inc;
179-
let $val1 = '2006-02-03';
180-
let $val2 = '2006-01-17';
181-
let $val3 = '2006-01-25';
182-
let $val4 = '2006-02-06';
183-
--source suite/parts/inc/partition_supported_sql_funcs.inc
177+
# to_days(non_date_col) is disabled after bug#54483.
178+
#let $sqlfunc = to_days(col1)-to_days('2006-01-01');
179+
#let $valsqlfunc = to_days('2006-02-02')-to_days('2006-01-01');
180+
#let $coltype = date;
181+
#let $infile = part_supported_sql_funcs_int_date.inc;
182+
#let $val1 = '2006-02-03';
183+
#let $val2 = '2006-01-17';
184+
#let $val3 = '2006-01-25';
185+
#let $val4 = '2006-02-06';
186+
#--source suite/parts/inc/partition_supported_sql_funcs.inc
184187

188+
# to_days(non_date_col) is disabled after bug#54483.
185189
# DATEDIFF() is implemented as (TO_DAYS(d1) - TO_DAYS(d2))
186-
let $sqlfunc = datediff(col1, '2006-01-01');
187-
let $valsqlfunc = datediff('2006-02-02', '2006-01-01');
188-
let $coltype = date;
189-
let $infile = part_supported_sql_funcs_int_date.inc;
190-
let $val1 = '2006-02-03';
191-
let $val2 = '2006-01-17';
192-
let $val3 = '2006-01-25';
193-
let $val4 = '2006-02-06';
194-
--source suite/parts/inc/partition_supported_sql_funcs.inc
190+
#let $sqlfunc = datediff(col1, '2006-01-01');
191+
#let $valsqlfunc = datediff('2006-02-02', '2006-01-01');
192+
#let $coltype = date;
193+
#let $infile = part_supported_sql_funcs_int_date.inc;
194+
#let $val1 = '2006-02-03';
195+
#let $val2 = '2006-01-17';
196+
#let $val3 = '2006-01-25';
197+
#let $val4 = '2006-02-06';
198+
#--source suite/parts/inc/partition_supported_sql_funcs.inc
195199

196200
let $sqlfunc = weekday(col1);
197201
let $valsqlfunc = weekday('2006-10-14');

0 commit comments

Comments
 (0)