Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    bug in SQL query generated by server side advancedCriteria

    SmartClient Version: v13.0p_2025-01-25/Enterprise Deployment (built 2025-01-25)

    Hi, I just noticed that in the latest 13.0, a server-side criteria constructed like this:

    Code:
     DSRequest dsRequest = new DSRequest("SC_REPORT_ATTIVITA", DataSource.OP_FETCH, rpcManager);
            dsRequest.setAdvancedCriteria(new AdvancedCriteria(DefaultOperators.And, new Criterion[]{
                    new SimpleCriterion("ID_ATTIVITA_FK", DefaultOperators.Equals, DataTools.buildList(1,2)),
                    new SimpleCriterion("TIPO_MANIFESTAZIONE", DefaultOperators.Equals, DataTools.buildList("foo", "bar"))
            }));
            DSResponse dsResponse = dsRequest.execute();
    produces an incorrect query:

    Code:
    SELECT SC_REPORT_ATTIVITA.ID_REC,
           SC_REPORT_ATTIVITA.ID_ATTIVITA_FK,
           SC_REPORT_ATTIVITA.TIPO_MANIFESTAZIONE
    FROM DBJAS.SC_REPORT_ATTIVITA
    WHERE ('0' = '1' AND
           (SC_REPORT_ATTIVITA.TIPO_MANIFESTAZIONE = '[foo, bar]' AND SC_REPORT_ATTIVITA.TIPO_MANIFESTAZIONE IS NOT NULL))
    Last edited by claudiobosticco; 28 Jan 2025, 01:57.

    #2
    Hi claudiobosticco,
    why are you using Equals with a list?
    Shouldn’t it be the InSet then?

    Best regards
    Blama

    Comment


      #3
      Hello Blama, this was previously working, and in the SQL it became (field = 1 OR field = 2), and it's still working like this if the criteria comes from the client, while in 13.1 now I see it's automatically generated with a in clause

      Comment


        #4
        Just a note that a developer is scheduled to look into this. We will report back on this thread soon.

        Comment


          #5
          This issue is now fixed; the fix will be present in 13.0 builds as of tomorrow, February 13. As you note above, the problem is solved in a different way in version 13.1 and greater (the list is converted to an IN () clause), so this is a 13.0-only change. Please let us know if you still see an issue after updating to the fixed build.

          Comment


            #6
            SmartClient Version: v13.0p_2025-02-14/Enterprise Deployment (built 2025-02-14)

            I see it's fixed, thank you very much

            Comment

            Working...
            X