Debian Codegraph @

mysql-test/suite/gcol_ndb/r/gcol_ndb_record_layout.result

raw
1 SET @@session.default_storage_engine = 'ndbcluster';
2 CREATE TABLE gcol_after_blob (
3 i int primary key,
4 b blob,
5 k int as (i+2)
6 );
7 insert into gcol_after_blob(i,b) values (1, "ABCD");
8 select i from gcol_after_blob;
9 i
10 1
11 select b from gcol_after_blob;
12 b
13 ABCD
14 select k from gcol_after_blob;
15 k
16 3
17 select * from gcol_after_blob;
18 i b k
19 1 ABCD 3
20 select k,b from gcol_after_blob where i = 1;
21 k b
22 3 ABCD
23 select b,i from gcol_after_blob where k = 3;
24 b i
25 ABCD 1
26 select b,i from gcol_after_blob where k = 1;
27 b i
28 update gcol_after_blob set b = "ABCDEFGHIJK" where i = 1;
29 insert into gcol_after_blob(i,b) values (2, "ABCD");
30 select b,i from gcol_after_blob where k = 4;
31 b i
32 ABCD 2
33 update gcol_after_blob set b = "LMNOPQRST" where k = 4;
34 select b,i from gcol_after_blob where k = 4;
35 b i
36 LMNOPQRST 2
37 DROP TABLE gcol_after_blob;
38 CREATE TABLE stored_blob_gcol (
39 i int primary key,
40 j varchar(20),
41 k text as (repeat(j,i)) stored
42 );
43 insert into stored_blob_gcol(i,j) values (1,"c__"), (2,"b__"), (3,"a__");
44 select i from stored_blob_gcol order by i;
45 i
46 1
47 2
48 3
49 select j from stored_blob_gcol order by j;
50 j
51 a__
52 b__
53 c__
54 select k from stored_blob_gcol order by i;
55 k
56 c__
57 b__b__
58 a__a__a__
59 select * from stored_blob_gcol order by j;
60 i j k
61 3 a__ a__a__a__
62 2 b__ b__b__
63 1 c__ c__
64 delete from stored_blob_gcol where length(j) = length(k);
65 select * from stored_blob_gcol where i < 3;
66 i j k
67 2 b__ b__b__
68 DROP TABLE stored_blob_gcol;
69 CREATE TABLE virtual_blob_gcol (
70 i int primary key,
71 j varchar(20),
72 k text as (repeat(j,i)) virtual
73 );
74 insert into virtual_blob_gcol(i,j) values (1,"c__"), (2,"b__"), (3,"a__");
75 select i from virtual_blob_gcol order by i;
76 i
77 1
78 2
79 3
80 select j from virtual_blob_gcol order by j;
81 j
82 a__
83 b__
84 c__
85 select k from virtual_blob_gcol order by i;
86 k
87 c__
88 b__b__
89 a__a__a__
90 select * from virtual_blob_gcol order by j;
91 i j k
92 3 a__ a__a__a__
93 2 b__ b__b__
94 1 c__ c__
95 delete from virtual_blob_gcol where length(j) = length(k);
96 select * from virtual_blob_gcol where i < 3;
97 i j k
98 2 b__ b__b__
99 DROP TABLE virtual_blob_gcol;
100 CREATE TABLE virtual_blob_gcol_hid_pk (
101 i int,
102 j varchar(20),
103 k text as (repeat(j,i)) virtual
104 );
105 insert into virtual_blob_gcol_hid_pk(i,j) values (2,"a__"), (2,"b__"), (2,"c__");
106 select * from virtual_blob_gcol_hid_pk order by j;
107 i j k
108 2 a__ a__a__
109 2 b__ b__b__
110 2 c__ c__c__
111 DROP TABLE virtual_blob_gcol_hid_pk;
112 CREATE TABLE gcol_char0 (
113 i int primary key,
114 c char(0),
115 v int as (i % 2),
116 z varchar(30)
117 );
118 insert into gcol_char0(i,c) values(1, NULL), (2, NULL), (3, ""), (4, "");
119 select * from gcol_char0 order by i;
120 i c v z
121 1 NULL 1 NULL
122 2 NULL 0 NULL
123 3 1 NULL
124 4 0 NULL
125 select c,v from gcol_char0 where i = 3;
126 c v
127 1
128 select * from gcol_char0 where c is null and v = 0;
129 i c v z
130 2 NULL 0 NULL
131 select * from gcol_char0 where c is not null and v = 1;
132 i c v z
133 3 1 NULL
134 update gcol_char0 set z = repeat("ABC_", i);
135 select * from gcol_char0 order by i;
136 i c v z
137 1 NULL 1 ABC_
138 2 NULL 0 ABC_ABC_
139 3 1 ABC_ABC_ABC_
140 4 0 ABC_ABC_ABC_ABC_
141 DROP TABLE gcol_char0;
142 CREATE TABLE gcol_first(
143 v int as (i+j),
144 i int primary key,
145 j int
146 );
147 insert into gcol_first (i,j) values (1, 1), (2, null), (3, 3);
148 select v from gcol_first;
149 v
150 2
151 6
152 NULL
153 select * from gcol_first where v is null;
154 v i j
155 NULL 2 NULL
156 select i from gcol_first where j is null;
157 i
158 2
159 DROP TABLE gcol_first;