Skip to content

numtodsinterval error names wrong function; ora_ascii returns first byte of multibyte chars #1668

Description

@Aias00

Bug Report

IvorySQL Version

master at c3529ba4789ee220caefc858e58bbe6f1563ad14

Current Behavior

  1. numtodsinterval error message (contrib/ivorysql_ora/src/builtin_functions/datetime_datatype_functions.c:1557): NUMTODSINTERVAL(1, 'xxx') reports "illegal argument for function numtoyminterval" — a copy-paste from the sibling function (line 1489 has the correct message).

  2. ora_ascii returns the first byte of a multibyte character (character_datatype_functions.c:2379-2385, 2434): in a UTF-8 database, ASCII('日') (via sys.ascii(sys.oravarcharchar)) returns 230 (the leading byte) instead of the code point 26085. The core ascii() in oracle_compat.c:950 already decodes the code point correctly; the two are inconsistent. Empty string handling (NULL, matching Oracle) must be preserved.

Expected behavior/code

  1. "illegal argument for function numtodsinterval"
  2. For the string cases, keep the empty-string NULL behavior and otherwise delegate to the core ascii() (with an extern declaration)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions