Browse Source

chore: date/datetime comparison correction - MySQL

pull/6507/head
Pranav C 1 year ago
parent
commit
e40830954e
  1. 6
      packages/nc-gui/components/smartsheet/toolbar/ColumnFilter.vue
  2. 6
      packages/nocodb/src/db/conditionV2.ts

6
packages/nc-gui/components/smartsheet/toolbar/ColumnFilter.vue

@ -10,11 +10,11 @@ import {
computed,
iconMap,
inject,
onMounted,
ref,
useNuxtApp,
useViewFilters,
watch,
onMounted
} from '#imports'
import type { Filter } from '#imports'
@ -89,7 +89,7 @@ const addFiltersRowDomRef = ref<HTMLElement>()
const columns = computed(() => meta.value?.columns)
const getColumn = (filter: Filter) => {
// extract looked up column if available
// extract looked up column if available
return btLookupTypesMap.value[filter.fk_column_id] || columns.value?.find((col: ColumnType) => col.id === filter.fk_column_id)
}
@ -295,7 +295,7 @@ onMounted(() => {
})
onMounted(async () => {
await loadBtLookupTypes()
await loadBtLookupTypes()
})
</script>

6
packages/nocodb/src/db/conditionV2.ts

@ -460,7 +460,11 @@ const parseConditionV2 = async (
].includes(column.uidt)
) {
qb = qb.where(field, val);
} else if (column.ct === 'timestamp' || column.ct === 'date' || column.ct === 'datetime') {
} else if (
column.ct === 'timestamp' ||
column.ct === 'date' ||
column.ct === 'datetime'
) {
qb = qb.where(knex.raw('DATE(??) = DATE(?)', [field, val]));
} else {
// mysql is case-insensitive for strings, turn to case-sensitive

Loading…
Cancel
Save