Debian Codegraph @

mysql-test/suite/storage_engine/update_with_keys.result

raw
1 DROP TABLE IF EXISTS t1;
2 CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>, INDEX(b)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>;
3 INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'),(6,'x'),(7,'y'),(8,'z');
4 UPDATE t1 SET a=100, b='f' WHERE b IN ('b','c');
5 UPDATE t1 SET b='m' WHERE b = 'f';
6 UPDATE t1 SET b='z' WHERE a < 2;
7 UPDATE t1 SET b='';
8 SELECT a,b FROM t1;
9 a b
10 1
11 100
12 100
13 4
14 5
15 6
16 7
17 8
18 DROP TABLE t1;
19 CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>, UNIQUE INDEX(a)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>;
20 INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'),(0,'f'),(100,'a');
21 UPDATE t1 SET a=a+200;
22 UPDATE t1 SET a=0 WHERE a > 250;
23 UPDATE t1 SET a=205 WHERE a=200;
24 ERROR 23000: Duplicate entry '205' for key 'a'
25 # Statement ended with one of expected results (ER_DUP_ENTRY,ER_DUP_KEY).
26 # If you got a difference in error message, just add it to rdiff file
27 UPDATE t1 SET a=12345 ORDER BY a, b LIMIT 1;
28 SELECT a,b FROM t1;
29 a b
30 12345 a
31 200 f
32 201 a
33 202 b
34 203 c
35 204 d
36 205 e
37 UPDATE t1 SET a=80 WHERE a IN (202,203);
38 ERROR 23000: Duplicate entry '80' for key 'a'
39 # Statement ended with one of expected results (ER_DUP_ENTRY,ER_DUP_KEY).
40 # If you got a difference in error message, just add it to rdiff file
41 DROP TABLE t1;
42 CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>, UNIQUE INDEX(a,b)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>;
43 INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'),(100,'a'),(6,'f');
44 UPDATE t1 SET a=6 WHERE a=3;
45 UPDATE t1 SET a=100 WHERE a=1;
46 ERROR 23000: Duplicate entry '100-a' for key 'a'
47 # Statement ended with one of expected results (ER_DUP_ENTRY,ER_DUP_KEY).
48 # If you got a difference in error message, just add it to rdiff file
49 UPDATE t1 SET a=4, b='d' WHERE b='f';
50 ERROR 23000: Duplicate entry '4-d' for key 'a'
51 # Statement ended with one of expected results (ER_DUP_ENTRY,ER_DUP_KEY).
52 # If you got a difference in error message, just add it to rdiff file
53 UPDATE t1 SET a=a+1;
54 SELECT a,b FROM t1;
55 a b
56 101 a
57 2 a
58 3 b
59 5 d
60 6 e
61 7 c
62 7 f
63 UPDATE t1 SET b='z';
64 ERROR 23000: Duplicate entry '7-z' for key 'a'
65 # Statement ended with one of expected results (ER_DUP_ENTRY,ER_DUP_KEY).
66 # If you got a difference in error message, just add it to rdiff file
67 DROP TABLE t1;
68 CREATE TABLE t1 (a <INT_COLUMN> PRIMARY KEY, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>;
69 INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'),(0,'f'),(100,'a');
70 UPDATE t1 SET a=a+200;
71 UPDATE t1 SET a=0 WHERE a > 250;
72 UPDATE t1 SET a=205 WHERE a=200;
73 ERROR 23000: Duplicate entry '205' for key 'PRIMARY'
74 # Statement ended with one of expected results (ER_DUP_ENTRY,ER_DUP_KEY).
75 # If you got a difference in error message, just add it to rdiff file
76 UPDATE t1 SET a=12345 ORDER BY a DESC, b LIMIT 1;
77 SELECT a,b FROM t1;
78 a b
79 0 a
80 12345 e
81 200 f
82 201 a
83 202 b
84 203 c
85 204 d
86 UPDATE t1 SET a=80 WHERE a IN (202,203);
87 ERROR 23000: Duplicate entry '80' for key 'PRIMARY'
88 # Statement ended with one of expected results (ER_DUP_ENTRY,ER_DUP_KEY).
89 # If you got a difference in error message, just add it to rdiff file
90 DROP TABLE t1;