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

JSON can not be implemented as a alias for longtext

    Details

    • Type: Task
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Fix Version/s: None
    • Component/s: JSON
    • Labels:

      Description

      JSON support.

      1. json_object('name', json_column )
      2. json_object('name',longtext_column)

      These two SHOULD give different results, because the longtext_column is a string so it gets quoted and quotes inside it get escaped, whereas the json_column is SEMANTICALLY a not necessarily a string and should not get quoted when it is an json object or json array.

      Mariadb's support for JSON uses 'json' as a alias for longtext and therefore produces the same result for 1 & 2.

      I know you are going to close this as a duplicate! BUT every discussion I have started or seen with MariaDB folk gets the answer "Our tests show that there is no performance difference between storing json internally as binary or a string", which has NOTHING to do with the problem. [I'd prefer you remain file-compatible with MySQL, but the internal representation is INTERNAL]. The problem here is that the JSON SEMANTICS.

      Isn't it possible for you to implement the semantics correctly? (independently of your decision on internal representation). It would require functions like json_object to be sensitive to whether a column or expression is typed "json".

      (I have a ton of procedures and functions that use JSON on MySQL5.7 and a ton of servers that I'd like to get to MariaDB), but I cant because if this problem. You have so much more good stuff I want to be able to use!)

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                anel Anel Husakovic
                Reporter:
                davep Dave Pullin
              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated: