~stewart/drizzle/embedded-innodb-create-select-transaction-arrgh

« back to all changes in this revision

Viewing changes to mysql-test/suite/parts/t/ndb_blob_partition.test

  • 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
--source include/have_ndb.inc
 
2
-- source include/not_embedded.inc
 
3
 
 
4
--disable_warnings
 
5
drop table if exists t1;
 
6
--enable_warnings
 
7
 
 
8
#
 
9
# Minimal NDB blobs test with range partitions.
 
10
#
 
11
 
 
12
create table t1 (
 
13
  a mediumint not null,
 
14
  b text not null,
 
15
  c int not null,
 
16
  d longblob,
 
17
  primary key using hash (a,c),
 
18
  unique key (c)
 
19
)
 
20
  engine=ndb
 
21
  partition by range (c)
 
22
  partitions 3
 
23
  ( partition p1 values less than (200),
 
24
    partition p2 values less than (300),
 
25
    partition p3 values less than (400));
 
26
 
 
27
--disable_query_log
 
28
sleep 1;
 
29
 
 
30
# length 61
 
31
set @s0 = 'rggurloniukyehuxdbfkkyzlceixzrehqhvxvxbpwizzvjzpucqmzrhzxzfau';
 
32
set @s1 = 'ykyymbzqgqlcjhlhmyqelfoaaohvtbekvifukdtnvcrrjveevfakxarxexomz';
 
33
set @s2 = 'dbnfqyzgtqxalcrwtfsqabknvtfcbpoonxsjiqvmhnfikxxhcgoexlkoezvah';
 
34
 
 
35
set @v1 = repeat(@s0, 100); -- 1d42dd9090cf78314a06665d4ea938c35cc760f4
 
36
set @v2 = repeat(@s1, 200); -- 10d3c783026b310218d10b7188da96a2401648c6
 
37
set @v3 = repeat(@s2, 300); -- a33549d9844092289a58ac348dd59f09fc28406a
 
38
set @v4 = repeat(@s0, 400); -- daa61c6de36a0526f0d47dc29d6b9de7e6d2630c
 
39
set @v5 = repeat(@s1, 500); -- 70fc9a7d08beebc522258bfb02000a30c77a8f1d
 
40
set @v6 = repeat(@s2, 600); -- 090565c580809efed3d369481a4bbb168b20713e
 
41
set @v7 = repeat(@s0, 700); -- 1e0070bec426871a46291de27b9bd6e4255ab4e5
 
42
set @v8 = repeat(@s1, 800); -- acbaba01bc2e682f015f40e79d9cbe475db3002e
 
43
set @v9 = repeat(@s2, 900); -- 9ee30d99162574f79c66ae95cdf132dcf9cbc259
 
44
--enable_query_log
 
45
 
 
46
# -- insert --
 
47
insert into t1 values (1, @v1, 101, @v2);
 
48
insert into t1 values (1, @v2, 102, @v3);
 
49
insert into t1 values (1, @v3, 103, @v4);
 
50
insert into t1 values (2, @v4, 201, @v5);
 
51
insert into t1 values (2, @v5, 202, @v6);
 
52
insert into t1 values (2, @v6, 203, @v7);
 
53
insert into t1 values (3, @v7, 301, @v8);
 
54
insert into t1 values (3, @v8, 302, @v9);
 
55
insert into t1 values (3, @v9, 303, @v1);
 
56
select a, sha1(b), c, sha1(d) from t1 order by a;
 
57
 
 
58
# -- pk read --
 
59
select a, sha1(b), c, sha1(d) from t1 where a = 1 and c = 101;
 
60
select a, sha1(b), c, sha1(d) from t1 where a = 2 and c = 201;
 
61
select a, sha1(b), c, sha1(d) from t1 where a = 3 and c = 301;
 
62
 
 
63
# -- pk update --
 
64
update t1 set b = @v3, d = @v4 where a = 1 and c = 102;
 
65
update t1 set b = @v6, d = @v7 where a = 2 and c = 202;
 
66
update t1 set b = @v9, d = @v1 where a = 3 and c = 302;
 
67
select a, sha1(b), c, sha1(d) from t1 order by a;
 
68
 
 
69
# -- hash index update --
 
70
update t1 set b = @v4, d = @v5 where c = 103;
 
71
update t1 set b = @v7, d = @v8 where c = 203;
 
72
update t1 set b = @v1, d = @v2 where c = 303;
 
73
select a, sha1(b), c, sha1(d) from t1 order by a;
 
74
 
 
75
# -- full scan update --
 
76
update t1 set b = @v5, d = @v6;
 
77
select a, sha1(b), c, sha1(d) from t1 order by a;
 
78
 
 
79
# -- range scan update
 
80
update t1 set b = @v1, d = @v2 where 100 < c and c < 200;
 
81
update t1 set b = @v4, d = @v5 where 200 < c and c < 300;
 
82
update t1 set b = @v7, d = @v8 where 300 < c and c < 400;
 
83
select a, sha1(b), c, sha1(d) from t1 order by a;
 
84
 
 
85
# -- delete --
 
86
delete from t1 where a = 1 and c = 101;
 
87
delete from t1 where c = 102;
 
88
# delete from t1 where c < 300; # XXX coredump
 
89
delete from t1;
 
90
select a, sha1(b), c, sha1(d) from t1 order by a;
 
91
 
 
92
# -- clean up --
 
93
drop table t1;