1
################################################################################
2
# inc/partition_check_read.inc #
5
# Read table t1 row by row #
6
# This routine is only useful for the partition_<feature>_<engine> tests. #
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 #
12
#------------------------------------------------------------------------------#
13
# Original Author: mleich #
14
# Original Date: 2006-03-05 #
18
################################################################################
22
## Read all existing records
23
let $num= `SELECT @max_row`;
30
eval SELECT COUNT(*) <> 1 INTO @aux FROM t1 WHERE $col_to_check = $num;
32
let $run= `SELECT @aux`;
35
--echo # Unexpected result on SELECT
36
eval SELECT COUNT(*) <> 1 FROM t1 WHERE $col_to_check = $num;
41
## Read some not existing records
42
let $num= `SELECT @max_row_div2`;
49
eval SELECT COUNT(*) = 1 INTO @aux FROM t1 WHERE $col_to_check = @max_row + $num;
51
let $run= `SELECT @aux`;
54
--echo # Unexpected result on SELECT
55
eval SELECT COUNT(*) <> 1 FROM t1 WHERE $col_to_check = @max_row + $num;
60
let $num= `SELECT @max_row_div2`;
67
eval SELECT COUNT(*) = 1 INTO @aux FROM t1 WHERE $col_to_check = 1 - $num;
69
let $run= `SELECT @aux`;
72
--echo # Unexpected result on SELECT
73
eval SELECT COUNT(*) <> 1 FROM t1 WHERE $col_to_check = 1 - $num;
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)
87
eval SELECT '# check read via $col_to_check success: ' AS "", $success AS "" FROM t1;