diff --git a/packages/nc-gui/components/cell/MultiSelect.vue b/packages/nc-gui/components/cell/MultiSelect.vue index 7b7d69c191..8565067e67 100644 --- a/packages/nc-gui/components/cell/MultiSelect.vue +++ b/packages/nc-gui/components/cell/MultiSelect.vue @@ -224,7 +224,7 @@ async function addIfMissingAndSave() { // todo: refactor and avoid repetition if (updatedColMeta.cdf) { // Postgres returns default value wrapped with single quotes & casted with type so we have to get value between single quotes to keep it unified for all databases - if (isPg.value) { + if (isPg(column.value.base_id)) { updatedColMeta.cdf = updatedColMeta.cdf.substring( updatedColMeta.cdf.indexOf(`'`) + 1, updatedColMeta.cdf.lastIndexOf(`'`), @@ -232,7 +232,7 @@ async function addIfMissingAndSave() { } // Mysql escapes single quotes with backslash so we keep quotes but others have to unescaped - if (!isMysql.value) { + if (!isMysql(column.value.base_id)) { updatedColMeta.cdf = updatedColMeta.cdf.replace(/''/g, "'") } } diff --git a/packages/nc-gui/components/cell/SingleSelect.vue b/packages/nc-gui/components/cell/SingleSelect.vue index 521b1e3657..149e9764c9 100644 --- a/packages/nc-gui/components/cell/SingleSelect.vue +++ b/packages/nc-gui/components/cell/SingleSelect.vue @@ -147,7 +147,7 @@ async function addIfMissingAndSave() { // todo: refactor and avoid repetition if (updatedColMeta.cdf) { // Postgres returns default value wrapped with single quotes & casted with type so we have to get value between single quotes to keep it unified for all databases - if (isPg.value) { + if (isPg(column.value.base_id)) { updatedColMeta.cdf = updatedColMeta.cdf.substring( updatedColMeta.cdf.indexOf(`'`) + 1, updatedColMeta.cdf.lastIndexOf(`'`), @@ -155,7 +155,7 @@ async function addIfMissingAndSave() { } // Mysql escapes single quotes with backslash so we keep quotes but others have to unescaped - if (!isMysql.value) { + if (!isMysql(column.value.base_id)) { updatedColMeta.cdf = updatedColMeta.cdf.replace(/''/g, "'") } } diff --git a/packages/nc-gui/composables/useMultiSelect/index.ts b/packages/nc-gui/composables/useMultiSelect/index.ts index 37a350379c..0ac516f42e 100644 --- a/packages/nc-gui/composables/useMultiSelect/index.ts +++ b/packages/nc-gui/composables/useMultiSelect/index.ts @@ -295,7 +295,7 @@ export function useMultiSelect( from: clipboardContext.uidt, to: columnObj.uidt as UITypes, }, - isMysql.value, + isMysql(meta.value?.base_id), ) e.preventDefault() @@ -327,7 +327,7 @@ export function useMultiSelect( from: clipboardContext.uidt, to: columnObj.uidt as UITypes, }, - isMysql.value, + isMysql(meta.value?.base_id), ) e.preventDefault() syncCellData?.(activeCell)