Uploaded image for project: 'Realm Core'
  1. Realm Core
  2. RCORE-1485

Sync: Fix query.get_description() to work with unicode symbols

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Core
    • None

      Actual:

      Creating subscriptions with queries having unicode parameters causes a server error:
      query from client: "{\"Product\":\"(stringQueryField BEGINSWITH B64\\\"2KzZhdi52Kpz\\\" )\"}" could not be parsed: unsupported query for table "Product": can't use BEGINSWITH operator on a non-string constant (ProtocolErrorCode=300)
      Generated query is:

      Query:{
        "Product": "(stringQueryField BEGINSWITH B64\"2KzZhdi52Kpz\" )"
      } 

      This is because the base64 encoding in serializer.cpp: https://github.com/realm/realm-core/blob/master/src/realm/util/serializer.cpp#L116

      Expected:

      The query should be generated without base64 encoding like this:

       

       

      Query:
      {
        "Product": "(stringQueryField BEGINSWITH \"جمعتs\" )"
      } 

      Note: The issue is reproduced for queries with BEGINSWITH and CONTAINS, but it should be fixed for all the queries.

       

            Assignee:
            jorgen.edelbo@mongodb.com Jørgen Edelbo
            Reporter:
            desislava.stefanova@mongodb.com Desislava Stefanova (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: