VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Sub-task
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.19.0
    • Component/s: core

      Description

      The data in json can be =, <, <=, >, >=, <>,! =, and <=>. But the data types in json can be diverse, so when you compare different types, you have a priority, and the high priority is greater than the low priority (you can view the types with the JSON_TYPE() function). The priorities are as follows:
      BOOLEAN,ARRAY,OBJECT,STRING,INTEGE,DOUBLE,NULL

      Example Sql::

      {"a":[10,true]}

      SELECT JSON_TYPE(v) AS c1
      ,JSON_TYPE(JSON_VALUE(v, 'lax $.b' ERROR ON ERROR)) AS c2
      ,JSON_TYPE(JSON_VALUE(v, 'strict $.a[0]' ERROR ON ERROR)) AS c3
      ,JSON_TYPE(JSON_VALUE(v, 'strict $.a[1]' ERROR ON ERROR)) AS c4
      FROM (VALUES ('

      {"a": [10, true],"b": "[10, true]"}

      ')) AS t(v)
      limit 10;

      Result:

      c1 c2 c3 c4
      ======= ======= ======= =======
      OBJECT ARRAY INTEGER BOOLEAN

        Attachments

          Activity

            People

            • Assignee:
              x1q1j1 Forward Xu
              Reporter:
              x1q1j1 Forward Xu

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 3h 20m
                3h 20m

                  Issue deployment