mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-18 12:35:59 +00:00
fixed importing mysql dump #702
This commit is contained in:
@@ -60,7 +60,7 @@ const drivers = driverBases.map(driverBase => ({
|
||||
async close(dbhan) {
|
||||
return dbhan.client.close();
|
||||
},
|
||||
query(dbhan, sql) {
|
||||
query(dbhan, sql, options) {
|
||||
if (sql == null) {
|
||||
return {
|
||||
rows: [],
|
||||
@@ -68,6 +68,14 @@ const drivers = driverBases.map(driverBase => ({
|
||||
};
|
||||
}
|
||||
|
||||
if (options?.importSqlDump && sql.trim().startsWith('/*!') && sql.includes('character_set_client')) {
|
||||
// skip this in SQL dumps
|
||||
return {
|
||||
rows: [],
|
||||
columns: [],
|
||||
};
|
||||
}
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
dbhan.client.query(sql, function (error, results, fields) {
|
||||
if (error) reject(error);
|
||||
|
||||
Reference in New Issue
Block a user