~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mysql-test/suite/parts/inc/partition_20.inc

  • Committer: brian
  • Date: 2008-06-29 12:50:19 UTC
  • mfrom: (12.1.4 drizzle)
  • Revision ID: brian@localhost.localdomain-20080629125019-qxk9qma8esphwwus
Committing merge

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
################################################################################
2
 
# inc/partition_20.inc                                                         #
3
 
#                                                                              #
4
 
# Purpose:                                                                     #
5
 
#   Auxiliary script, only useful when sourced by                              #
6
 
#   suite/parts/inc/partition_check.inc.                                       #
7
 
#                                                                              #
8
 
# 1. Check if the preceding statement caused that the expected number of       #
9
 
#    records was                                                               #
10
 
#    - inserted                                                                #
11
 
#    - updated or deleted+inserted                                             #
12
 
# 2. Revert the modifications                                                  #
13
 
#                                                                              #
14
 
#    The parameters                                                            #
15
 
#       @try_count = total number of inserted and updated or deleted+inserted  #
16
 
#                    records                                                   #
17
 
#       @clash_count = number of records where a DUPLICATE KEY appears         #
18
 
#    must be set before sourcing this routine.                                 #
19
 
#                                                                              #
20
 
#------------------------------------------------------------------------------#
21
 
# Original Author: mleich                                                      #
22
 
# Original Date: 2006-03-05                                                    #
23
 
# Change Author:                                                               #
24
 
# Change Date:                                                                 #
25
 
# Change:                                                                      #
26
 
################################################################################
27
 
 
28
 
if ($no_debug)
29
 
{
30
 
  --disable_query_log
31
 
}
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');
36
 
--enable_query_log
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';
43
 
inc $num;