read.sim 10.9 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335
system sh/stop_dnodes.sh

system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c wallevel -v 2
system sh/cfg.sh -n dnode1 -c numOfMnodes -v 1

print ========= start dnode1 as leader
system sh/exec.sh -n dnode1 -s start
sleep 2000
sql connect

sql create database abc1 vgroups 2;
sql use abc1;
sql create table st1 (ts timestamp, k int, x int, y int, z binary(12), u nchar(12)) tags(a int, b nchar(12), c varchar(24), d bool) sma(x);
sql create table tu using st1 tags(1, 'abc', 'binary1', true);
sql create table tu1 using st1 tags(2, '水木', 'binary2', false);
sql create table tu2 using st1 tags(3, '水木1', 'binary3', true);
sql create table tu3 using st1 tags(4, 'abc', '12', false);
sql insert into tu values('2022-01-01 1:1:1', 1, 10, 9, 'a', '水3木') ('2022-07-02 22:46:53.294', 2, 10, 8, 'a', '水1木') ('2022-07-02 22:47:53.294', 1, 10, 7, 'b', '水2木')('2022-07-02 22:48:53.294', 1, 10, null, 'd', '3')('2022-07-02 22:50:53.294', 1, 10, null, null, '322');
sql insert into tu1 values('2022-01-01 1:1:1', 11, 101, 91, 'aa', '3水木');
sql insert into tu2 values('2022-01-01 1:1:1', 111, 1010, 919, 'aaa', '3水木3');

sql select * from tu;
if $rows != 5 then
  return -1
endi

sql select * from tu order by ts desc;
if $rows != 5 then
  return -1
endi

sql create table st2 (ts timestamp, k int, x int, y int, z binary(12), u nchar(12)) tags(a int) sma(x);
sql create table tuu1 using st2 tags(2);
sql insert into tuu1 values('2022-01-01 1:1:1', 11, 101, 911, 'aa', '3水木33');
sql insert into tuu1 values('2022-01-01 1:1:2', NULL, 101, 911, 'aa', '3水木33');
sql insert into tu values('2022-01-01 1:1:1', NULL, NULL, NULL, NULL, '水3木');
sql insert into tu values('2022-01-01 1:1:1', NULL, 911, NULL, NULL, '');
sql flush database abc1;

sql insert into tu values('2021-12-1 1:1:1', 1,1,1,'a', 12);
sql insert into tu values('2022-6-1 1:1:1', 1,1,1,'a', 12);
sql insert into tu values('2022-6-1 1:1:2', 1,1,1,'a', 12);
sql insert into tu values('2022-6-1 1:1:3', 1,1,1,'a', 12);

sql select * from tu order by ts desc;
if $rows != 9 then
  return -1
endi

sql select * from tu order by ts asc;
if $rows != 9 then
  return -1
endi

sql select * from tu where ts>='2021-12-31 1:1:1' and ts<'2022-1-1 1:1:0' order by ts asc;
if $rows != 0 then
  return -1
endi

sql select * from tu where ts>='2021-12-31 1:1:1' and ts<'2022-1-1 1:1:0' order by ts desc;
if $rows != 0 then
    return -1
endi

sql select * from tu where ts>='2021-12-31 1:1:1' and ts<'2022-1-1 1:1:2' order by ts asc;
if $rows != 1 then
  return -1
endi

sql select * from tu where ts>='2021-12-31 1:1:1' and ts<'2022-1-1 1:1:2' order by ts desc;
if $rows != 1 then
  return -1
endi

sql select * from tu where ts>='2021-12-31 1:1:1' and ts<'2022-1-1 1:1:2' order by ts asc;
if $rows != 1 then
  return -1
endi

sql select * from tu where ts>='2021-12-31 1:1:1' and ts<'2022-1-1 1:10:2' order by ts desc;
if $rows != 1 then
  return -1
endi

sql select * from tu where ts>='2021-12-31 1:1:1' and ts<'2022-1-1 1:10:2' order by ts asc;
if $rows != 1 then
  return -1
endi

sql select * from tu where ts>='2021-12-31 1:1:1' and ts<'2022-1-9 1:10:2' order by ts desc;
if $rows != 1 then
  return -1
endi

sql select * from tu where ts>='2021-12-31 1:1:1' and ts<'2022-1-9 1:10:2' order by ts asc;
if $rows != 1 then
  return -1
endi

sql select * from tu where ts>='2021-12-31 1:1:1' and ts<='2022-1-9 1:10:2' order by ts asc;
if $rows != 1 then
  return -1
endi

sql select * from tu where ts>='2021-12-31 1:1:1' and ts<='2022-1-9 1:10:2' order by ts desc;
if $rows != 1 then
  return -1
endi

sql select * from tu where ts>='2021-12-31 1:1:1' and ts<='2022-6-9 1:10:2' order by ts asc;
if $rows != 4 then
  return -1
endi

sql select * from tu where ts>='2021-12-31 1:1:1' and ts<='2022-6-9 1:10:2' order by ts desc;
if $rows != 4 then
  return -1
endi

sql select * from tu where ts>='2021-12-31 1:1:1' and ts<='2022-6-1 1:10:2' order by ts asc;
if $rows != 4 then
  return -1
endi

sql select * from tu where ts>='2021-12-31 1:1:1' and ts<='2022-6-1 1:10:2' order by ts desc;
if $rows != 4 then
  return -1
endi

sql select * from tu where ts>='2021-12-31 1:1:1' and ts<='2022-6-1 1:1:1' order by ts asc;
if $row != 2 then
  return -1
endi

sql select * from tu where ts>='2021-12-31 1:1:1' and ts<='2022-6-1 1:1:1' order by ts desc;
if $row != 2 then
  return -1
endi

sql select * from tu where ts>='2021-12-31 1:1:1' order by ts asc;
if $rows != 8 then
  return -1
endi

sql select * from tu where ts>='2021-12-31 1:1:1' order by ts desc;
if $rows != 8 then
  return -1
endi

sql select * from tu where ts>='2021-12-1 1:1:1' order by ts asc;
if $rows != 9 then
  return -1
endi

sql select * from tu where ts>='2021-12-1 1:1:1' order by ts desc;
if $rows != 9 then
  return -1
endi

sql select * from tu where ts>='2021-12-31 1:1:1' and ts<='2022-6-1 1:1:2' order by ts asc;
if $rows != 3 then
  return -1
endi

sql select * from tu where ts>='2021-12-31 1:1:1' and ts<='2022-6-1 1:1:2' order by ts desc;
if $rows != 3 then
  return -1
endi

sql select * from tu where ts>='2021-12-31 1:1:1' and ts<='2022-6-1 1:1:1' order by ts asc;
if $rows != 2 then
  return -1
endi

sql select * from tu where ts>='2021-12-31 1:1:1' and ts<='2022-6-1 1:1:1' order by ts desc;
if $rows != 2 then
  return -1
endi

sql select * from tu where ts>='2021-12-31 1:1:1' and ts<='2022-6-1 1:1:0' order by ts asc;
if $rows != 1 then
  return -1
endi

sql select * from tu where ts>='2021-12-31 1:1:1' and ts<='2022-6-1 1:1:0' order by ts desc;
if $rows != 1 then
  return -1
endi

sql select * from tu where ts>='2021-12-1 1:1:1' and ts<='2022-6-1 1:1:0' order by ts asc;
if $rows != 2 then
  return -1
endi

sql select * from tu where ts>='2021-12-1 1:1:1' and ts<='2022-6-1 1:1:0' order by ts desc;
if $rows != 2 then
  return -1
endi

sql select * from tu where ts>='2021-12-1 1:1:1' and ts<='2022-7-1 1:1:0' order by ts asc;
if $rows != 5 then
  return -1
endi

sql select * from tu where ts>='2021-12-1 1:1:1' and ts<='2022-7-1 1:1:0' order by ts desc;
if $rows != 5 then
  return -1
endi

sql select * from tu where ts>='2021-12-1 1:1:1' and ts<='2022-7-7 1:1:0' order by ts desc;
if $rows != 9 then
  return -1
endi

sql select * from tu where ts>='2021-12-1 1:1:1' and ts<='2022-7-7 1:1:0' order by ts asc;
if $rows != 9 then
  return -1
endi

sql select * from tu where ts>='2021-12-1 1:1:1' and ts<='2022-7-2 1:1:0' order by ts desc;
if $rows != 5 then
  return -1
endi

sql select * from tu where ts>='2021-12-1 1:1:1' and ts<='2022-7-2 1:1:0' order by ts asc;
if $rows != 5 then
  return -1
endi

sql select * from tu where ts>='2021-12-1 1:1:1' and ts<='2022-7-2 22:47:0' order by ts desc;
if $rows != 6 then
  return -1
endi

sql select * from tu where ts>='2021-12-1 1:1:1' and ts<='2022-7-2 22:47:0' order by ts asc;
if $rows != 6 then
  return -1
endi

sql select * from tu where ts>='2022-7-1 1:1:1' and ts<='2022-7-2 22:47:0' order by ts asc;
if $rows != 1 then
  return -1
endi

sql select * from tu where ts>='2022-7-1 1:1:1' and ts<='2022-7-2 22:47:0' order by ts desc;
if $rows != 1 then
  return -1
endi

sql select * from tu where ts>='2022-7-1 1:1:1' and ts<='2022-8-2 22:47:0' order by ts asc;
if $rows != 4 then
  return -1
endi

sql select * from tu where ts>='2022-7-1 1:1:1' and ts<='2022-8-2 22:47:0' order by ts desc;
if $rows != 4 then
  return -1
endi

sql select * from tu where ts>='2022-7-1 1:1:1' and ts<='2022-7-2 22:48:53.299' order by ts asc;
if $rows != 3 then
  return -1
endi

sql select * from tu where ts>='2022-7-1 1:1:1' and ts<='2022-7-2 22:48:53.299' order by ts desc;
if $rows != 3 then
  return -1
endi

sql select * from tu where ts>='2022-7-1 1:1:1' and ts<='2022-7-2 22:48:53.293';
if $rows != 2 then
  return -1
endi

sql select * from tu where ts>='2022-7-1 1:1:1' and ts<='2022-7-2 22:48:53.293' order by ts desc;
if $rows != 2 then
  return -1
endi

sql select * from tu where ts>='2022-7-1 1:1:1' and ts<='2022-7-2 22:48:53.292' order by ts asc;
if $rows != 2 then
  return -1
endi

sql select * from tu where ts>='2022-7-1 1:1:1' and ts<='2022-7-2 22:48:53.292' order by ts desc;
if $rows != 2 then
  return -1
endi

sql select * from tu where ts>='2022-7-1 1:1:1' and ts<='2022-7-2 22:48:53.294';
sql select * from tu where ts>='2022-7-1 1:1:1' and ts<'2022-7-2 22:48:53.294';
sql select * from tu where ts>='2022-7-2 22:46:55' and ts<'2022-7-2 22:48:53.294';
sql select * from tu where ts>='2022-7-2 22:46:55' and ts<='2022-7-2 22:47:53.294';

sql select * from tu where ts>='2022-7-2 22:46:55' and ts<='2022-7-2 22:47:53.293' order by ts asc;

sql select * from tu where ts>='2022-7-2 22:46:55' and ts<='2022-7-2 22:47:53.293' order by ts desc;

sql select * from tu where ts>='2022-7-2 22:46:55' and ts<='2022-7-2 22:48:53.293' order by ts asc;
sql select * from tu where ts>='2022-7-2 22:46:55' and ts<='2022-7-2 22:48:53.293' order by ts desc;
sql select * from tu where ts>='2022-7-2 22:46:55' and ts<='2022-7-2 22:48:53.293' order by ts desc;
sql select * from tu where ts>='2022-7-1 22:46:55' and ts<='2022-7-2 22:48:53.293' order by ts desc;
sql select * from tu where ts>='2022-7-1 22:46:55' and ts<='2022-7-2 22:48:53.293' order by ts asc;
sql select * from tu where ts>='2022-7-1 22:46:55' and ts<='2022-7-2 22:48:53.293' order by ts desc;

sql select * from tu where ts>='2022-7-2 22:46:55' and ts<'2022-7-2 22:47:53.294';

sql select * from tu where ts>='2022-7-2 22:46:55' and ts<'2022-7-2 22:48:53.294';
sql select * from tu where ts>='2022-7-2 22:46:55' and ts<'2022-7-2 22:48:53.294' order by ts desc;

sql select * from tu where ts>='2022-7-1 22:46:55' and ts<'2022-7-2 22:48:53.294' order by ts desc;
sql select * from tu where ts>='2021-12-2 22:46:55' and ts<'2022-7-2 22:48:53.294' order by ts desc;

sql select * from tu where ts>='2021-12-2 22:46:55' and ts<'2022-7-2 22:48:53.294' order by ts asc;
sql select * from tu where ts>='2022-7-2 22:46:55' and ts<'2022-7-2 22:46:59.294' order by ts asc;

sql select * from tu where ts>='2022-7-2 22:46:55' and ts<'2022-7-2 22:46:59.294' order by ts asc;
sql select * from tu where ts>='2022-7-2 22:46:55' and ts<'2022-7-2 22:46:59.294' order by ts asc;
sql select * from tu where ts>='2022-7-2 22:46:55' and ts<'2022-7-2 22:46:59.294' order by ts desc;

sql select * from tu where ts>='2022-7-2 22:46:55' and ts<'2022-7-2 22:46:59.294' order by ts desc;

sql select * from tu where ts>='2021-7-2 22:46:55' and ts<'2022-7-2 22:46:54.294' order by ts desc;

sql select * from tu where ts>='2021-12-2 22:46:55' and ts<'2022-7-2 22:46:54.294' order by ts desc;
sql select * from tu where ts>='2022-7-2 22:46:55' and ts<'2022-7-2 22:46:54.294' order by ts desc;

sql select * from tu where ts>='2022-7-2 22:46:51' and ts<'2022-7-2 22:48:54.294' order by ts desc;
sql select * from tu where ts>='2022-7-2 22:46:51' and ts<'2022-7-2 22:48:54.294' order by ts asc;
sql select * from tu where ts>='2022-7-2 22:46:51' and ts<'2022-7-2 22:58:54.294' order by ts asc;

sql select * from tu where ts>='2022-7-2 22:46:51' and ts<'2022-7-2 22:58:54.294' order by ts asc;

sql select * from tu where ts>='2022-7-2 22:46:51' and ts<'2022-7-2 22:58:54.294' order by ts desc;