mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-05-02 06:43:59 +00:00
fix: normalize type name for mysql params
This commit is contained in:
@@ -15,6 +15,11 @@ function quoteDefaultValue(value) {
|
|||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function normalizeTypeName(typeName) {
|
||||||
|
if (/int\(\d+\)/.test(typeName)) return 'int';
|
||||||
|
return typeName;
|
||||||
|
}
|
||||||
|
|
||||||
function getColumnInfo(
|
function getColumnInfo(
|
||||||
{
|
{
|
||||||
isNullable,
|
isNullable,
|
||||||
@@ -132,7 +137,10 @@ class Analyser extends DatabaseAnalyser {
|
|||||||
const functionNameToParameters = functionParameters.reduce((acc, row) => {
|
const functionNameToParameters = functionParameters.reduce((acc, row) => {
|
||||||
if (!acc[`${row.schemaName}.${row.pureName}`]) acc[`${row.schemaName}.${row.pureName}`] = [];
|
if (!acc[`${row.schemaName}.${row.pureName}`]) acc[`${row.schemaName}.${row.pureName}`] = [];
|
||||||
|
|
||||||
acc[`${row.schemaName}.${row.pureName}`].push(row);
|
acc[`${row.schemaName}.${row.pureName}`].push({
|
||||||
|
...row,
|
||||||
|
dataType: normalizeTypeName(row.dataType),
|
||||||
|
});
|
||||||
return acc;
|
return acc;
|
||||||
}, {});
|
}, {});
|
||||||
|
|
||||||
@@ -140,7 +148,10 @@ class Analyser extends DatabaseAnalyser {
|
|||||||
const procedureNameToParameters = procedureParameters.reduce((acc, row) => {
|
const procedureNameToParameters = procedureParameters.reduce((acc, row) => {
|
||||||
if (!acc[`${row.schemaName}.${row.pureName}`]) acc[`${row.schemaName}.${row.pureName}`] = [];
|
if (!acc[`${row.schemaName}.${row.pureName}`]) acc[`${row.schemaName}.${row.pureName}`] = [];
|
||||||
|
|
||||||
acc[`${row.schemaName}.${row.pureName}`].push(row);
|
acc[`${row.schemaName}.${row.pureName}`].push({
|
||||||
|
...row,
|
||||||
|
dataType: normalizeTypeName(row.dataType),
|
||||||
|
});
|
||||||
return acc;
|
return acc;
|
||||||
}, {});
|
}, {});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user