1 ################################################################################
2 # inc/partition_check_read1.inc #
5 # Read rows from table t1 in different ways #
6 # This routine is only useful for the partition_<feature>_<engine> tests. #
9 # @exp_row_count -- expected number of rows within t1 #
10 # must be set before sourcing this routine. #
12 #------------------------------------------------------------------------------#
13 # Original Author: mleich #
14 # Original Date: 2006-04-11 #
18 ################################################################################
26 ## EXPLAIN PARTITIONS SELECT for one single row
27 EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10';
29 ## Check SELECT for one single row
35 SELECT COUNT(*) <> 1 INTO @aux FROM t1 WHERE f_date =
'1000-02-10';
37 let $run= `SELECT @aux`;
40 --echo # Unexpected result on SELECT
41 eval SELECT COUNT(*) <> 1 FROM t1 WHERE f_date =
'1000-02-10';
44 --echo # check read single success: $success
46 ## Read all existing records in one step
52 eval SELECT COUNT(*) <> @exp_row_count INTO @aux FROM t1;
54 let $run= `SELECT @aux`;
57 --echo # Unexpected result on SELECT
58 eval SELECT COUNT(*) <> @exp_row_count FROM t1;
61 --echo # check read all success: $success
63 ## Read all existing records row by row
65 let $num= `SELECT @exp_row_count`;
72 eval SELECT COUNT(*) <> 1 INTO @aux FROM t1
73 WHERE f_date = CONCAT(CAST(999 + $num AS CHAR),
'-02-10');
75 let $run= `SELECT @aux`;
78 --echo # Unexpected result on SELECT
79 eval SELECT COUNT(*) <> 1 FROM t1
80 WHERE f_date = CONCAT(CAST(999 + $num AS CHAR),
'-02-10');
85 --echo # check read row by row success: $success