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
################################################################################
20
## EXPLAIN PARTITIONS SELECT for one single row
21
EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10';
23
## Check SELECT for one single row
29
SELECT COUNT(*) <> 1 INTO @aux FROM t1 WHERE f_date = '1000-02-10';
31
let $run= `SELECT @aux`;
34
--echo # Unexpected result on SELECT
35
eval SELECT COUNT(*) <> 1 FROM t1 WHERE f_date = '1000-02-10';
38
--echo # check read single success: $success
40
## Read all existing records in one step
46
eval SELECT COUNT(*) <> @exp_row_count INTO @aux FROM t1;
48
let $run= `SELECT @aux`;
51
--echo # Unexpected result on SELECT
52
eval SELECT COUNT(*) <> @exp_row_count FROM t1;
55
--echo # check read all success: $success
57
## Read all existing records row by row
59
let $num= `SELECT @exp_row_count`;
66
eval SELECT COUNT(*) <> 1 INTO @aux FROM t1
67
WHERE f_date = CONCAT(CAST(999 + $num AS CHAR),'-02-10');
69
let $run= `SELECT @aux`;
72
--echo # Unexpected result on SELECT
73
eval SELECT COUNT(*) <> 1 FROM t1
74
WHERE f_date = CONCAT(CAST(999 + $num AS CHAR),'-02-10');
79
--echo # check read row by row success: $success