~drizzle-trunk/drizzle/development

« back to all changes in this revision

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

  • Committer: brian
  • Date: 2008-06-25 05:29:13 UTC
  • Revision ID: brian@localhost.localdomain-20080625052913-6upwo0jsrl4lnapl
clean slate

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
################################################################################
 
2
# inc/partition_check_read.inc                                                 #
 
3
#                                                                              #
 
4
# Purpose:                                                                     #
 
5
#   Read table t1 row by row                                                   #
 
6
#   This routine is only useful for the partition_<feature>_<engine> tests.    #
 
7
#                                                                              #
 
8
# Note: If this routine is successful, at least the following is fullfilled    #
 
9
#       - select single row via $col_to_check basically works -- no crash      #
 
10
#       - the table contains all expected rows                                 #
 
11
#                                                                              #
 
12
#------------------------------------------------------------------------------#
 
13
# Original Author: mleich                                                      #
 
14
# Original Date: 2006-03-05                                                    #
 
15
# Change Author:                                                               #
 
16
# Change Date:                                                                 #
 
17
# Change:                                                                      #
 
18
################################################################################
 
19
 
 
20
let $success= 1;
 
21
 
 
22
## Read all existing records
 
23
let $num= `SELECT @max_row`;
 
24
while ($num)
 
25
{
 
26
   if ($no_debug)
 
27
   {
 
28
   --disable_query_log
 
29
   }
 
30
   eval SELECT COUNT(*) <> 1 INTO @aux FROM t1 WHERE $col_to_check = $num;
 
31
   --enable_query_log
 
32
   let $run= `SELECT @aux`;
 
33
   if ($run)
 
34
   {
 
35
      --echo #      Unexpected result on SELECT
 
36
      eval SELECT COUNT(*) <> 1 FROM t1 WHERE $col_to_check = $num;
 
37
      let $success= 0;
 
38
   }
 
39
   dec $num;
 
40
}
 
41
## Read some not existing records
 
42
let $num= `SELECT @max_row_div2`;
 
43
while ($num)
 
44
{
 
45
   if ($no_debug)
 
46
   {
 
47
   --disable_query_log
 
48
   }
 
49
   eval SELECT COUNT(*) = 1 INTO @aux FROM t1 WHERE $col_to_check = @max_row + $num;
 
50
   --enable_query_log
 
51
   let $run= `SELECT @aux`;
 
52
   if ($run)
 
53
   {
 
54
      --echo #      Unexpected result on SELECT
 
55
      eval SELECT COUNT(*) <> 1 FROM t1 WHERE $col_to_check = @max_row + $num;
 
56
      let $success= 0;
 
57
   }
 
58
   dec $num;
 
59
}
 
60
let $num= `SELECT @max_row_div2`;
 
61
while ($num)
 
62
{
 
63
   if ($no_debug)
 
64
   {
 
65
   --disable_query_log
 
66
   }
 
67
   eval SELECT COUNT(*) = 1 INTO @aux FROM t1 WHERE $col_to_check = 1 - $num;
 
68
   --enable_query_log
 
69
   let $run= `SELECT @aux`;
 
70
   if ($run)
 
71
   {
 
72
      --echo #      Unexpected result on SELECT
 
73
      eval SELECT COUNT(*) <> 1 FROM t1 WHERE $col_to_check = 1 - $num;
 
74
      let $success= 0;
 
75
   }
 
76
   dec $num;
 
77
}
 
78
if ($no_debug)
 
79
{
 
80
--disable_query_log
 
81
}
 
82
--echo # check read via $col_to_check success: $success
 
83
# mleich: The following is omitted because of not reported mysqltest bug
 
84
#     (@max_row time the success message)
 
85
if (0)
 
86
{
 
87
eval SELECT '# check read via $col_to_check success: ' AS "", $success AS "" FROM t1;
 
88
}
 
89
--enable_query_log