Skip to content

Commit ecf7a25

Browse files
authored
fix(schema): function and procedure list is not ordered by their name in ob-mysql (#2636)
1 parent 58bf321 commit ecf7a25

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

libs/db-browser/src/main/java/com/oceanbase/tools/dbbrowser/schema/doris/DorisSchemaAccessor.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ public List<DBPLObjectIdentity> listFunctions(String schemaName) {
368368
sb.append(
369369
"select ROUTINE_NAME as name, ROUTINE_SCHEMA as schema_name, ROUTINE_TYPE as type from `information_schema`.`routines` where ROUTINE_SCHEMA=");
370370
sb.value(schemaName);
371-
sb.append(" and ROUTINE_TYPE = 'FUNCTION';");
371+
sb.append(" and ROUTINE_TYPE = 'FUNCTION' order by name asc;");
372372

373373
return jdbcOperations.query(sb.toString(), new BeanPropertyRowMapper<>(DBPLObjectIdentity.class));
374374
}
@@ -379,7 +379,7 @@ public List<DBPLObjectIdentity> listProcedures(String schemaName) {
379379
sb.append(
380380
"select ROUTINE_NAME as name, ROUTINE_SCHEMA as schema_name, ROUTINE_TYPE as type from `information_schema`.`routines` where ROUTINE_SCHEMA=");
381381
sb.value(schemaName);
382-
sb.append(" and ROUTINE_TYPE = 'PROCEDURE';");
382+
sb.append(" and ROUTINE_TYPE = 'PROCEDURE' order by name asc;");
383383

384384
return jdbcOperations.query(sb.toString(), new BeanPropertyRowMapper<>(DBPLObjectIdentity.class));
385385
}

libs/db-browser/src/main/java/com/oceanbase/tools/dbbrowser/schema/mysql/MySQLNoLessThan5700SchemaAccessor.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ public List<DBPLObjectIdentity> listFunctions(String schemaName) {
364364
sb.append(
365365
"select ROUTINE_NAME as name, ROUTINE_SCHEMA as schema_name, ROUTINE_TYPE as type from `information_schema`.`routines` where ROUTINE_SCHEMA=");
366366
sb.value(schemaName);
367-
sb.append(" and ROUTINE_TYPE = 'FUNCTION';");
367+
sb.append(" and ROUTINE_TYPE = 'FUNCTION' order by name asc;");
368368

369369
return jdbcOperations.query(sb.toString(), new BeanPropertyRowMapper<>(DBPLObjectIdentity.class));
370370
}
@@ -375,7 +375,7 @@ public List<DBPLObjectIdentity> listProcedures(String schemaName) {
375375
sb.append(
376376
"select ROUTINE_NAME as name, ROUTINE_SCHEMA as schema_name, ROUTINE_TYPE as type from `information_schema`.`routines` where ROUTINE_SCHEMA=");
377377
sb.value(schemaName);
378-
sb.append(" and ROUTINE_TYPE = 'PROCEDURE';");
378+
sb.append(" and ROUTINE_TYPE = 'PROCEDURE' order by name asc;");
379379

380380
return jdbcOperations.query(sb.toString(), new BeanPropertyRowMapper<>(DBPLObjectIdentity.class));
381381
}

0 commit comments

Comments
 (0)