exist icon indicating copy to clipboard operation
exist copied to clipboard

[BUG] xs:dateTimeStamp should promote to xs:dateTime (base type)

Open pherk opened this issue 4 months ago • 5 comments

Describe the bug I'm upgrading an app from existdb 4.11 to 6.2 Comparing database values with fn:current-dateTime() produces an error: XPTY0004.

Expected behavior I'm not an expert in XSD1.1, but type promotion should be expectable in my eyes. I don't have Saxon or BaseX.

To Reproduce eval in eXide:

xquery version "3.1";

declare function local:less($a as xs:string, $b as xs:dateTime) as xs:boolean
{
  if ($a="")
  then true()
  else xs:dateTime($a) <= $b
};
local:less("2024-01-01T00:00:00Z", fn:current-dateTime())

or eval

local:less("2024-01-01T00:00:00Z", xs:dateTimeStamp("2024-02-01T00:00:00.000Z"))

Context (please always complete the following information)

  • Build: [eXist-6.2.0 master]
  • Java: [1.8.0_352]
  • OS: [Ubuntu 24.0.1]

Additional context

  • How is eXist-db installed? [e.g. JAR installer, DMG, … ]
  • Any custom changes in e.g. conf.xml?

pherk avatar Oct 07 '24 08:10 pherk