1 ################################################################################
2 # inc/partition_20.inc #
5 # Auxiliary script, only useful when sourced by #
6 # suite/parts/inc/partition_check.inc. #
8 # 1. Check if the preceding statement caused that the expected number of #
11 # - updated or deleted+inserted #
12 # 2. Revert the modifications #
15 # @try_count = total number of inserted and updated or deleted+inserted #
17 # @clash_count = number of records where a DUPLICATE KEY appears #
18 # must be set before sourcing this routine. #
20 #------------------------------------------------------------------------------#
21 # Original Author: mleich #
22 # Original Date: 2006-03-05 #
26 ################################################################################
32 eval SELECT
'# check unique-$num-a success: ' AS
"", COUNT(*) = @clash_count AS
""
33 FROM t1 WHERE f_charbig =
'was updated';
34 eval SELECT
'# check unique-$num-b success: ' AS
"", COUNT(*) =
@try_count AS
""
35 FROM t1 WHERE f_charbig IN (
'was updated',
'was inserted');
37 # Revert the modification
38 DELETE FROM t1 WHERE f_charbig =
'was inserted';
39 UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
40 f_int2 = CAST(f_char1 AS SIGNED INT),
41 f_charbig = CONCAT(
'===',f_char1,
'===')
42 WHERE f_charbig = 'was updated';