Browse Source

Merge pull request #7232 from nocodb/fix/7231-maria

fix: support function calls for default timestamp
pull/7234/head
Pranav C 9 months ago committed by GitHub
parent
commit
540bfa2816
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      packages/nocodb/src/db/sql-client/lib/KnexClient.ts

7
packages/nocodb/src/db/sql-client/lib/KnexClient.ts

@ -3044,7 +3044,12 @@ class KnexClient extends SqlClient {
if (/^\w+\(\)$/.test(value)) return value;
// if value is a CURRENT_TIMESTAMP, return as is
if (/^CURRENT_TIMESTAMP[\w ]*$/.test(value.toUpperCase())) return value;
if (
/^\s*current_timestamp(?:\(\))?(?:\s+on\s+update\s+current_timestamp(?:\(\))?)?\s*$/i.test(
value,
)
)
return value;
// if value wrapped in single/double quotes, then extract value and sanitise
const m = value.match(/^(['"])(.*)\1$/);

Loading…
Cancel
Save