~ubuntu-branches/ubuntu/trusty/drizzle/trusty

« back to all changes in this revision

Viewing changes to plugin/haildb/tests/t/rnd_pos.test

  • Committer: Package Import Robot
  • Author(s): Clint Byrum
  • Date: 2012-06-19 10:46:49 UTC
  • mfrom: (1.1.6)
  • mto: This revision was merged to the branch mainline in revision 29.
  • Revision ID: package-import@ubuntu.com-20120619104649-e2l0ggd4oz3um0f4
Tags: upstream-7.1.36-stable
ImportĀ upstreamĀ versionĀ 7.1.36-stable

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
 
2
 
#
3
 
# test case for #570
4
 
#
5
 
 
6
 
# This failed because of syntax. Changed int(5) to int.
7
 
CREATE TABLE t1 (
8
 
  aufnr varchar(12) NOT NULL default '',
9
 
  plnfl varchar(6) NOT NULL default '',
10
 
  vornr varchar(4) NOT NULL default '',
11
 
  xstatus_vor int NOT NULL default '0'
12
 
);
13
 
 
14
 
INSERT INTO t1 VALUES ('40004712','000001','0010',9);
15
 
INSERT INTO t1 VALUES ('40004712','000001','0020',0);
16
 
 
17
 
UPDATE t1 SET t1.xstatus_vor = Greatest(t1.xstatus_vor,1) WHERE t1.aufnr =
18
 
"40004712" AND t1.plnfl = "000001" AND t1.vornr > "0010" ORDER BY t1.vornr
19
 
ASC LIMIT 1;
20
 
 
21
 
drop table t1;
22
 
 
23
 
# and again with a primary key
24
 
 
25
 
CREATE TABLE t1 (
26
 
  aufnr varchar(12) NOT NULL default '',
27
 
  plnfl varchar(6) NOT NULL default '',
28
 
  vornr varchar(4) NOT NULL default '' primary key,
29
 
  xstatus_vor int NOT NULL default '0'
30
 
);
31
 
 
32
 
INSERT INTO t1 VALUES ('40004712','000001','0010',9);
33
 
INSERT INTO t1 VALUES ('40004712','000001','0020',0);
34
 
 
35
 
UPDATE t1 SET t1.xstatus_vor = Greatest(t1.xstatus_vor,1) WHERE t1.aufnr =
36
 
"40004712" AND t1.plnfl = "000001" AND t1.vornr > "0010" ORDER BY t1.vornr
37
 
ASC LIMIT 1;
38
 
 
39
 
drop table t1;
40
 
 
41
 
# and again with a unique key that becomes the clustered key
42
 
 
43
 
create table t1 (a int, b int, c int);
44
 
 
45
 
alter table t1 add unique(a,b);
46
 
 
47
 
drop table t1;