Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-19487

JSON_TYPE doesnt detect the type of String Values (returns NULL) and for Date/DateTime returns "INTEGER"

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 10.2.22, 10.3.15
    • Fix Version/s: 10.2, 10.3
    • Component/s: JSON
    • Labels:
      None
    • Environment:
      Windows 10 64 bit

      Description

      Hi this sentence:

      select JSON_TYPE(json_value(JSON_OBJECT("id", 1, "name", 'Monty', "date", Cast('2019-01-01' as Date) ), '$.date'));
      

      Returns INTEGER, at least it should say 'STRING'

      select JSON_TYPE(json_value(JSON_OBJECT("id", 1, "name", 'Monty', "date", Cast('2019-01-01' as Date) ), '$.name'));
      

      returns NULL, if you apply JSON_QUOTE for the JSON_VALUE returned value, it returns STRING.

        Attachments

          Activity

            People

            • Assignee:
              holyfoot Alexey Botchkov
              Reporter:
              fduenas Francisco Dueñas
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: