~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mysql-test/suite/parts/inc/partition_check_read2.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_read2.inc                                                #
 
3
#                                                                              #
 
4
# Purpose:                                                                     #
 
5
#   Read rows from table t1 in different ways                                  #
 
6
#   This routine is only useful for the partition_<feature>_<engine> tests.    #
 
7
#                                                                              #
 
8
#------------------------------------------------------------------------------#
 
9
# Original Author: mleich                                                      #
 
10
# Original Date: 2006-04-11                                                    #
 
11
# Change Author:                                                               #
 
12
# Change Date:                                                                 #
 
13
# Change:                                                                      #
 
14
################################################################################
 
15
 
 
16
## EXPLAIN PARTITIONS SELECT for one single row
 
17
EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3;
 
18
 
 
19
## Check SELECT for one single row
 
20
let $success= 1;
 
21
if ($no_debug)
 
22
{
 
23
--disable_query_log
 
24
}
 
25
SELECT COUNT(*) <> 1 INTO @aux FROM t1 WHERE f_int1 = 3;
 
26
--enable_query_log
 
27
let $run= `SELECT @aux`;
 
28
if ($run)
 
29
{
 
30
   --echo #      Unexpected result on SELECT
 
31
   eval SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3;
 
32
   let $success= 0;
 
33
}
 
34
--echo # check read single success: $success
 
35
 
 
36
## Read all existing records in one step
 
37
let $success= 1;
 
38
if ($no_debug)
 
39
{
 
40
--disable_query_log
 
41
}
 
42
eval SELECT COUNT(*) <> @max_row INTO @aux FROM t1;
 
43
--enable_query_log
 
44
let $run= `SELECT @aux`;
 
45
if ($run)
 
46
{
 
47
   --echo #      Unexpected result on SELECT
 
48
   eval SELECT COUNT(*) <> @max_row FROM t1;
 
49
   let $success= 0;
 
50
}
 
51
--echo # check read all success: $success
 
52
 
 
53
## Read all existing records row by row
 
54
let $success= 1;
 
55
let $num= `SELECT @max_row`;
 
56
while ($num)
 
57
{
 
58
   if ($no_debug)
 
59
   {
 
60
   --disable_query_log
 
61
   }
 
62
   eval SELECT COUNT(*) <> 1 INTO @aux FROM t1
 
63
        WHERE f_int1 = 3;
 
64
   --enable_query_log
 
65
   let $run= `SELECT @aux`;
 
66
   if ($run)
 
67
   {
 
68
      --echo #      Unexpected result on SELECT
 
69
      eval SELECT COUNT(*) <> 1 FROM t1
 
70
           WHERE f_int1 = 3;
 
71
      let $success= 0;
 
72
   }
 
73
   dec $num;
 
74
}
 
75
--echo # check read row by row success: $success