Skip to content

Commit 7972dd8

Browse files
authored
Fix authentication related CI
1 parent f431f05 commit 7972dd8

File tree

3 files changed

+45
-45
lines changed

3 files changed

+45
-45
lines changed

integration-test/src/test/java/org/apache/iotdb/db/it/auth/IoTDBAuthIT.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1579,8 +1579,8 @@ public void testPasswordHistoryAlter(Statement statement) throws SQLException {
15791579
public void testChangeBackPassword() {
15801580
try (Connection connection = EnvFactory.getEnv().getConnection();
15811581
Statement statement = connection.createStatement()) {
1582-
statement.execute("ALTER USER root SET PASSWORD 'newPassword'");
1583-
statement.execute("ALTER USER root SET PASSWORD 'root'");
1582+
statement.execute("ALTER USER root SET PASSWORD 'newPassword666888'");
1583+
statement.execute("ALTER USER root SET PASSWORD 'rootHasANewPassword123'");
15841584
} catch (SQLException e) {
15851585
e.printStackTrace();
15861586
fail(e.getMessage());

integration-test/src/test/java/org/apache/iotdb/db/it/auth/IoTDBTemplateAuthIT.java

Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -70,15 +70,15 @@ public void manageDataBaseTest() {
7070
adminStmt.execute("create device template t1 (temperature1 FLOAT, status1 BOOLEAN)");
7171
adminStmt.execute("create device template t2 (temperature2 FLOAT, status2 BOOLEAN)");
7272
adminStmt.execute("create device template t3 (temperature3 FLOAT, status3 BOOLEAN)");
73-
adminStmt.execute("create user tytyty1 'tytytyty'");
74-
adminStmt.execute("create user tytyty2 'tytytyty'");
75-
adminStmt.execute("create user tytyty3 'tytytyty'");
73+
adminStmt.execute("create user tytyty1 'tytytytytytytyty'");
74+
adminStmt.execute("create user tytyty2 'tytytytytytytyty'");
75+
adminStmt.execute("create user tytyty3 'tytytytytytytyty'");
7676

7777
assertNonQueryTestFail(
7878
"create device template t4 (temperature4 FLOAT, status4 BOOLEAN)",
7979
"803: No permissions for this operation, please add privilege SYSTEM",
8080
"tytyty1",
81-
"tytytyty");
81+
"tytytytytytytyty");
8282

8383
assertNonQueryTestFail(
8484
adminStmt,
@@ -102,7 +102,7 @@ public void manageDataBaseTest() {
102102
assertEquals(retSet.size(), cnt);
103103
}
104104

105-
try (Connection userCon = EnvFactory.getEnv().getConnection("tytyty1", "tytytyty");
105+
try (Connection userCon = EnvFactory.getEnv().getConnection("tytyty1", "tytytytytytytyty");
106106
Statement userStmt = userCon.createStatement();
107107
ResultSet resultSet = userStmt.executeQuery("show device templates")) {
108108
while (resultSet.next()) {
@@ -121,13 +121,13 @@ public void manageDataBaseTest() {
121121
"set device template t1 to root.sg3",
122122
"803: No permissions for this operation, please add privilege SYSTEM",
123123
"tytyty1",
124-
"tytytyty");
124+
"tytytytytytytyty");
125125

126126
adminStmt.execute("set device template t1 to root.sg3");
127127
adminStmt.execute("create timeseries using device template on root.sg1.d1");
128128
adminStmt.execute("create timeseries using device template on root.sg3");
129129

130-
try (Connection userCon = EnvFactory.getEnv().getConnection("tytyty1", "tytytyty");
130+
try (Connection userCon = EnvFactory.getEnv().getConnection("tytyty1", "tytytytytytytyty");
131131
Statement userStmt = userCon.createStatement();
132132
ResultSet resultSet = userStmt.executeQuery("show device templates")) {
133133
while (resultSet.next()) {
@@ -137,7 +137,7 @@ public void manageDataBaseTest() {
137137

138138
adminStmt.execute("grant read_schema on root.sg1.d2.** to user tytyty1");
139139

140-
try (Connection userCon = EnvFactory.getEnv().getConnection("tytyty1", "tytytyty");
140+
try (Connection userCon = EnvFactory.getEnv().getConnection("tytyty1", "tytytytytytytyty");
141141
Statement userStmt = userCon.createStatement();
142142
ResultSet resultSet = userStmt.executeQuery("show device templates")) {
143143
while (resultSet.next()) {
@@ -147,7 +147,7 @@ public void manageDataBaseTest() {
147147

148148
adminStmt.execute("grant read_schema on root.sg1.d1.** to user tytyty1");
149149
retSet = Collections.singleton("t1");
150-
try (Connection userCon = EnvFactory.getEnv().getConnection("tytyty1", "tytytyty");
150+
try (Connection userCon = EnvFactory.getEnv().getConnection("tytyty1", "tytytytytytytyty");
151151
Statement userStmt = userCon.createStatement();
152152
ResultSet resultSet = userStmt.executeQuery("show device templates")) {
153153
int cnt = 0;
@@ -160,7 +160,7 @@ public void manageDataBaseTest() {
160160
}
161161

162162
adminStmt.execute("grant read_schema on root.sg1.** to user tytyty2");
163-
try (Connection userCon = EnvFactory.getEnv().getConnection("tytyty2", "tytytyty");
163+
try (Connection userCon = EnvFactory.getEnv().getConnection("tytyty2", "tytytytytytytyty");
164164
Statement userStmt = userCon.createStatement();
165165
ResultSet resultSet = userStmt.executeQuery("show device templates")) {
166166
int cnt = 0;
@@ -174,7 +174,7 @@ public void manageDataBaseTest() {
174174

175175
adminStmt.execute("grant read_schema on root.** to user tytyty3");
176176
retSet = new HashSet<>(Arrays.asList("t1", "t2"));
177-
try (Connection userCon = EnvFactory.getEnv().getConnection("tytyty3", "tytytyty");
177+
try (Connection userCon = EnvFactory.getEnv().getConnection("tytyty3", "tytytytytytytyty");
178178
Statement userStmt = userCon.createStatement();
179179
ResultSet resultSet = userStmt.executeQuery("show device templates")) {
180180
int cnt = 0;
@@ -197,7 +197,7 @@ public void manageDataBaseTest() {
197197
}
198198
assertEquals(retSet.size(), cnt);
199199
}
200-
try (Connection userCon = EnvFactory.getEnv().getConnection("tytyty1", "tytytyty");
200+
try (Connection userCon = EnvFactory.getEnv().getConnection("tytyty1", "tytytytytytytyty");
201201
Statement userStmt = userCon.createStatement();
202202
ResultSet resultSet = userStmt.executeQuery("show nodes in device template t1")) {
203203
int cnt = 0;
@@ -208,7 +208,7 @@ public void manageDataBaseTest() {
208208
}
209209
assertEquals(retSet.size(), cnt);
210210
}
211-
try (Connection userCon = EnvFactory.getEnv().getConnection("tytyty2", "tytytyty");
211+
try (Connection userCon = EnvFactory.getEnv().getConnection("tytyty2", "tytytytytytytyty");
212212
Statement userStmt = userCon.createStatement();
213213
ResultSet resultSet = userStmt.executeQuery("show nodes in device template t1")) {
214214
int cnt = 0;
@@ -219,7 +219,7 @@ public void manageDataBaseTest() {
219219
}
220220
assertEquals(retSet.size(), cnt);
221221
}
222-
try (Connection userCon = EnvFactory.getEnv().getConnection("tytyty3", "tytytyty");
222+
try (Connection userCon = EnvFactory.getEnv().getConnection("tytyty3", "tytytytytytytyty");
223223
Statement userStmt = userCon.createStatement();
224224
ResultSet resultSet = userStmt.executeQuery("show nodes in device template t1")) {
225225
int cnt = 0;
@@ -241,21 +241,21 @@ public void manageDataBaseTest() {
241241
}
242242
assertEquals(retSet.size(), cnt);
243243
}
244-
try (Connection userCon = EnvFactory.getEnv().getConnection("tytyty1", "tytytyty");
244+
try (Connection userCon = EnvFactory.getEnv().getConnection("tytyty1", "tytytytytytytyty");
245245
Statement userStmt = userCon.createStatement();
246246
ResultSet resultSet = userStmt.executeQuery("show nodes in device template t2")) {
247247
while (resultSet.next()) {
248248
fail("should see nothing.");
249249
}
250250
}
251-
try (Connection userCon = EnvFactory.getEnv().getConnection("tytyty2", "tytytyty");
251+
try (Connection userCon = EnvFactory.getEnv().getConnection("tytyty2", "tytytytytytytyty");
252252
Statement userStmt = userCon.createStatement();
253253
ResultSet resultSet = userStmt.executeQuery("show nodes in device template t2")) {
254254
while (resultSet.next()) {
255255
fail("should see nothing.");
256256
}
257257
}
258-
try (Connection userCon = EnvFactory.getEnv().getConnection("tytyty3", "tytytyty");
258+
try (Connection userCon = EnvFactory.getEnv().getConnection("tytyty3", "tytytytytytytyty");
259259
Statement userStmt = userCon.createStatement();
260260
ResultSet resultSet = userStmt.executeQuery("show nodes in device template t2")) {
261261
int cnt = 0;
@@ -277,21 +277,21 @@ public void manageDataBaseTest() {
277277
}
278278
assertEquals(retSet.size(), cnt);
279279
}
280-
try (Connection userCon = EnvFactory.getEnv().getConnection("tytyty1", "tytytyty");
280+
try (Connection userCon = EnvFactory.getEnv().getConnection("tytyty1", "tytytytytytytyty");
281281
Statement userStmt = userCon.createStatement();
282282
ResultSet resultSet = userStmt.executeQuery("show nodes in device template t3")) {
283283
while (resultSet.next()) {
284284
fail("should see nothing.");
285285
}
286286
}
287-
try (Connection userCon = EnvFactory.getEnv().getConnection("tytyty2", "tytytyty");
287+
try (Connection userCon = EnvFactory.getEnv().getConnection("tytyty2", "tytytytytytytyty");
288288
Statement userStmt = userCon.createStatement();
289289
ResultSet resultSet = userStmt.executeQuery("show nodes in device template t3")) {
290290
while (resultSet.next()) {
291291
fail("should see nothing.");
292292
}
293293
}
294-
try (Connection userCon = EnvFactory.getEnv().getConnection("tytyty3", "tytytyty");
294+
try (Connection userCon = EnvFactory.getEnv().getConnection("tytyty3", "tytytytytytytyty");
295295
Statement userStmt = userCon.createStatement();
296296
ResultSet resultSet = userStmt.executeQuery("show nodes in device template t3")) {
297297
while (resultSet.next()) {
@@ -310,7 +310,7 @@ public void manageDataBaseTest() {
310310
}
311311
assertEquals(retSet.size(), cnt);
312312
}
313-
try (Connection userCon = EnvFactory.getEnv().getConnection("tytyty3", "tytytyty");
313+
try (Connection userCon = EnvFactory.getEnv().getConnection("tytyty3", "tytytytytytytyty");
314314
Statement userStmt = userCon.createStatement();
315315
ResultSet resultSet = userStmt.executeQuery("show paths set device template t1")) {
316316
int cnt = 0;
@@ -322,7 +322,7 @@ public void manageDataBaseTest() {
322322
assertEquals(retSet.size(), cnt);
323323
}
324324
retSet = new HashSet<>(Arrays.asList("root.sg1.d1"));
325-
try (Connection userCon = EnvFactory.getEnv().getConnection("tytyty1", "tytytyty");
325+
try (Connection userCon = EnvFactory.getEnv().getConnection("tytyty1", "tytytytytytytyty");
326326
Statement userStmt = userCon.createStatement();
327327
ResultSet resultSet = userStmt.executeQuery("show paths set device template t1")) {
328328
int cnt = 0;
@@ -333,7 +333,7 @@ public void manageDataBaseTest() {
333333
}
334334
assertEquals(retSet.size(), cnt);
335335
}
336-
try (Connection userCon = EnvFactory.getEnv().getConnection("tytyty2", "tytytyty");
336+
try (Connection userCon = EnvFactory.getEnv().getConnection("tytyty2", "tytytytytytytyty");
337337
Statement userStmt = userCon.createStatement();
338338
ResultSet resultSet = userStmt.executeQuery("show paths set device template t1")) {
339339
int cnt = 0;
@@ -355,21 +355,21 @@ public void manageDataBaseTest() {
355355
}
356356
assertEquals(retSet.size(), cnt);
357357
}
358-
try (Connection userCon = EnvFactory.getEnv().getConnection("tytyty1", "tytytyty");
358+
try (Connection userCon = EnvFactory.getEnv().getConnection("tytyty1", "tytytytytytytyty");
359359
Statement userStmt = userCon.createStatement();
360360
ResultSet resultSet = userStmt.executeQuery("show paths set device template t2")) {
361361
while (resultSet.next()) {
362362
fail("should see nothing.");
363363
}
364364
}
365-
try (Connection userCon = EnvFactory.getEnv().getConnection("tytyty2", "tytytyty");
365+
try (Connection userCon = EnvFactory.getEnv().getConnection("tytyty2", "tytytytytytytyty");
366366
Statement userStmt = userCon.createStatement();
367367
ResultSet resultSet = userStmt.executeQuery("show paths set device template t2")) {
368368
while (resultSet.next()) {
369369
fail("should see nothing.");
370370
}
371371
}
372-
try (Connection userCon = EnvFactory.getEnv().getConnection("tytyty3", "tytytyty");
372+
try (Connection userCon = EnvFactory.getEnv().getConnection("tytyty3", "tytytytytytytyty");
373373
Statement userStmt = userCon.createStatement();
374374
ResultSet resultSet = userStmt.executeQuery("show paths set device template t2")) {
375375
int cnt = 0;
@@ -386,21 +386,21 @@ public void manageDataBaseTest() {
386386
fail("should see nothing.");
387387
}
388388
}
389-
try (Connection userCon = EnvFactory.getEnv().getConnection("tytyty1", "tytytyty");
389+
try (Connection userCon = EnvFactory.getEnv().getConnection("tytyty1", "tytytytytytytyty");
390390
Statement userStmt = userCon.createStatement();
391391
ResultSet resultSet = userStmt.executeQuery("show paths set device template t3")) {
392392
while (resultSet.next()) {
393393
fail("should see nothing.");
394394
}
395395
}
396-
try (Connection userCon = EnvFactory.getEnv().getConnection("tytyty2", "tytytyty");
396+
try (Connection userCon = EnvFactory.getEnv().getConnection("tytyty2", "tytytytytytytyty");
397397
Statement userStmt = userCon.createStatement();
398398
ResultSet resultSet = userStmt.executeQuery("show paths set device template t3")) {
399399
while (resultSet.next()) {
400400
fail("should see nothing.");
401401
}
402402
}
403-
try (Connection userCon = EnvFactory.getEnv().getConnection("tytyty3", "tytytyty");
403+
try (Connection userCon = EnvFactory.getEnv().getConnection("tytyty3", "tytytytytytytyty");
404404
Statement userStmt = userCon.createStatement();
405405
ResultSet resultSet = userStmt.executeQuery("show paths set device template t3")) {
406406
while (resultSet.next()) {
@@ -419,7 +419,7 @@ public void manageDataBaseTest() {
419419
}
420420
assertEquals(retSet.size(), cnt);
421421
}
422-
try (Connection userCon = EnvFactory.getEnv().getConnection("tytyty3", "tytytyty");
422+
try (Connection userCon = EnvFactory.getEnv().getConnection("tytyty3", "tytytytytytytyty");
423423
Statement userStmt = userCon.createStatement();
424424
ResultSet resultSet = userStmt.executeQuery("show paths using device template t1")) {
425425
int cnt = 0;
@@ -431,7 +431,7 @@ public void manageDataBaseTest() {
431431
assertEquals(retSet.size(), cnt);
432432
}
433433
retSet = new HashSet<>(Arrays.asList("root.sg1.d1"));
434-
try (Connection userCon = EnvFactory.getEnv().getConnection("tytyty1", "tytytyty");
434+
try (Connection userCon = EnvFactory.getEnv().getConnection("tytyty1", "tytytytytytytyty");
435435
Statement userStmt = userCon.createStatement();
436436
ResultSet resultSet = userStmt.executeQuery("show paths using device template t1")) {
437437
int cnt = 0;
@@ -442,7 +442,7 @@ public void manageDataBaseTest() {
442442
}
443443
assertEquals(retSet.size(), cnt);
444444
}
445-
try (Connection userCon = EnvFactory.getEnv().getConnection("tytyty2", "tytytyty");
445+
try (Connection userCon = EnvFactory.getEnv().getConnection("tytyty2", "tytytytytytytyty");
446446
Statement userStmt = userCon.createStatement();
447447
ResultSet resultSet = userStmt.executeQuery("show paths using device template t1")) {
448448
int cnt = 0;
@@ -459,13 +459,13 @@ public void manageDataBaseTest() {
459459
"alter device template t1 add (speed FLOAT)",
460460
"803: No permissions for this operation, please add privilege SYSTEM",
461461
"tytyty1",
462-
"tytytyty");
462+
"tytytytytytytyty");
463463

464464
adminStmt.execute("grant SYSTEM on root.** to user tytyty1");
465-
executeNonQuery("alter device template t1 add (speed FLOAT)", "tytyty1", "tytytyty");
465+
executeNonQuery("alter device template t1 add (speed FLOAT)", "tytyty1", "tytytytytytytyty");
466466

467467
retSet = new HashSet<>(Arrays.asList("t1", "t2", "t3"));
468-
try (Connection userCon = EnvFactory.getEnv().getConnection("tytyty1", "tytytyty");
468+
try (Connection userCon = EnvFactory.getEnv().getConnection("tytyty1", "tytytytytytytyty");
469469
Statement userStmt = userCon.createStatement();
470470
ResultSet resultSet = userStmt.executeQuery("show device templates")) {
471471
int cnt = 0;
@@ -478,7 +478,7 @@ public void manageDataBaseTest() {
478478
}
479479

480480
retSet = new HashSet<>(Arrays.asList("temperature1", "status1", "speed"));
481-
try (Connection userCon = EnvFactory.getEnv().getConnection("tytyty1", "tytytyty");
481+
try (Connection userCon = EnvFactory.getEnv().getConnection("tytyty1", "tytytytytytytyty");
482482
Statement userStmt = userCon.createStatement();
483483
ResultSet resultSet = userStmt.executeQuery("show nodes in device template t1")) {
484484
int cnt = 0;
@@ -490,7 +490,7 @@ public void manageDataBaseTest() {
490490
assertEquals(retSet.size(), cnt);
491491
}
492492
retSet = new HashSet<>(Arrays.asList("temperature2", "status2"));
493-
try (Connection userCon = EnvFactory.getEnv().getConnection("tytyty1", "tytytyty");
493+
try (Connection userCon = EnvFactory.getEnv().getConnection("tytyty1", "tytytytytytytyty");
494494
Statement userStmt = userCon.createStatement();
495495
ResultSet resultSet = userStmt.executeQuery("show nodes in device template t2")) {
496496
int cnt = 0;
@@ -503,7 +503,7 @@ public void manageDataBaseTest() {
503503
}
504504

505505
retSet = new HashSet<>(Arrays.asList("temperature3", "status3"));
506-
try (Connection userCon = EnvFactory.getEnv().getConnection("tytyty1", "tytytyty");
506+
try (Connection userCon = EnvFactory.getEnv().getConnection("tytyty1", "tytytytytytytyty");
507507
Statement userStmt = userCon.createStatement();
508508
ResultSet resultSet = userStmt.executeQuery("show nodes in device template t3")) {
509509
int cnt = 0;
@@ -516,7 +516,7 @@ public void manageDataBaseTest() {
516516
}
517517

518518
retSet = new HashSet<>(Arrays.asList("root.sg1.d1", "root.sg3"));
519-
try (Connection userCon = EnvFactory.getEnv().getConnection("tytyty1", "tytytyty");
519+
try (Connection userCon = EnvFactory.getEnv().getConnection("tytyty1", "tytytytytytytyty");
520520
Statement userStmt = userCon.createStatement();
521521
ResultSet resultSet = userStmt.executeQuery("show paths set device template t1")) {
522522
int cnt = 0;
@@ -528,7 +528,7 @@ public void manageDataBaseTest() {
528528
assertEquals(retSet.size(), cnt);
529529
}
530530
retSet = new HashSet<>(Arrays.asList("root.sg2"));
531-
try (Connection userCon = EnvFactory.getEnv().getConnection("tytyty1", "tytytyty");
531+
try (Connection userCon = EnvFactory.getEnv().getConnection("tytyty1", "tytytytytytytyty");
532532
Statement userStmt = userCon.createStatement();
533533
ResultSet resultSet = userStmt.executeQuery("show paths set device template t2")) {
534534
int cnt = 0;
@@ -540,7 +540,7 @@ public void manageDataBaseTest() {
540540
assertEquals(retSet.size(), cnt);
541541
}
542542

543-
try (Connection userCon = EnvFactory.getEnv().getConnection("tytyty1", "tytytyty");
543+
try (Connection userCon = EnvFactory.getEnv().getConnection("tytyty1", "tytytytytytytyty");
544544
Statement userStmt = userCon.createStatement();
545545
ResultSet resultSet = userStmt.executeQuery("show paths set device template t3")) {
546546
while (resultSet.next()) {
@@ -549,7 +549,7 @@ public void manageDataBaseTest() {
549549
}
550550

551551
retSet = new HashSet<>(Arrays.asList("root.sg1.d1"));
552-
try (Connection userCon = EnvFactory.getEnv().getConnection("tytyty1", "tytytyty");
552+
try (Connection userCon = EnvFactory.getEnv().getConnection("tytyty1", "tytytytytytytyty");
553553
Statement userStmt = userCon.createStatement();
554554
ResultSet resultSet = userStmt.executeQuery("show paths using device template t1")) {
555555
int cnt = 0;

iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/analyze/AnalyzeVisitor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3316,7 +3316,7 @@ public Analysis visitSeriesSchemaFetch(
33163316
SchemaPartition schemaPartition =
33173317
partitionFetcher.getSchemaPartition(
33183318
seriesSchemaFetchStatement.getPatternTree(),
3319-
context.getSession().getUserName(),
3319+
context.getSession() != null ? context.getSession().getUserName() : null,
33203320
seriesSchemaFetchStatement.isCanSeeAuditDB());
33213321
analysis.setSchemaPartitionInfo(schemaPartition);
33223322

0 commit comments

Comments
 (0)