[#2958] Error when the code-generation database user has insufficient grants to read the "mysql" meta schema
This commit is contained in:
parent
a1b6996990
commit
b84a45a234
@ -65,7 +65,9 @@ import org.jooq.Record5;
|
||||
import org.jooq.Record6;
|
||||
import org.jooq.Result;
|
||||
import org.jooq.SQLDialect;
|
||||
import org.jooq.exception.DataAccessException;
|
||||
import org.jooq.impl.DSL;
|
||||
import org.jooq.tools.JooqLogger;
|
||||
import org.jooq.tools.csv.CSVReader;
|
||||
import org.jooq.util.AbstractDatabase;
|
||||
import org.jooq.util.ArrayDefinition;
|
||||
@ -93,6 +95,8 @@ import org.jooq.util.mysql.mysql.tables.Proc;
|
||||
*/
|
||||
public class MySQLDatabase extends AbstractDatabase {
|
||||
|
||||
private static final JooqLogger log = JooqLogger.getLogger(MySQLDatabase.class);
|
||||
|
||||
@Override
|
||||
protected void loadPrimaryKeys(DefaultRelations relations) throws SQLException {
|
||||
for (Record record : fetchKeys("PRIMARY KEY")) {
|
||||
@ -323,6 +327,14 @@ public class MySQLDatabase extends AbstractDatabase {
|
||||
protected List<RoutineDefinition> getRoutines0() throws SQLException {
|
||||
List<RoutineDefinition> result = new ArrayList<RoutineDefinition>();
|
||||
|
||||
try {
|
||||
create().fetchCount(PROC);
|
||||
}
|
||||
catch (DataAccessException e) {
|
||||
log.warn("Table unavailable", "The `mysql`.`proc` table is unavailable. Stored procedures cannot be loaded. Check if you have sufficient grants");
|
||||
return result;
|
||||
}
|
||||
|
||||
Result<Record6<String, String, String, byte[], byte[], ProcType>> records =
|
||||
create().select(
|
||||
Proc.DB,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user