Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[QUESTION] Inquiry About Issue Resolution Timeline for Issue #394 #421

Open
INNORAON opened this issue Dec 3, 2024 · 0 comments
Open

[QUESTION] Inquiry About Issue Resolution Timeline for Issue #394 #421

INNORAON opened this issue Dec 3, 2024 · 0 comments
Labels
question Further information is requested

Comments

@INNORAON
Copy link

INNORAON commented Dec 3, 2024

Question

I hope this message finds you well. I am reaching out to inquire about the estimated timeline for resolving the issue outlined in the following link:
#394

This issue appears to have been introduced in versions after 1.3, as it was not present in that version.

Currently, we are using the following setup:

Python: 3.12
Django: 4.2.16
mssql-django: 1.3
pyodbc: 5.1.0
Due to the complexity of our database schema, which includes composite primary keys and high complexity, we use raw queries without relying on Django's ORM.

Below is an example of one of our queries:
(This query is obfuscated and edited, so it may not work as-is. However, it represents the structure and logic of the type of query we are using.)

DECLARE @A1 INT  = %s,
        @A2 VARCHAR(100) = %s,
        @A3 VARCHAR(100) = %s,
        @A4 INT = %s;
        
WITH C1 AS (
     SELECT A, B, C,
            STRING_AGG(D, ', ') AS E
       FROM (
            SELECT A, B, C, D
              FROM T1
             WHERE A = @A1
               AND @A2 = @A2
            ) AS C1
       GROUP BY A, B, C
 ),
 C2 AS (
      SELECT A, B, C, COUNT(*) AS F
        FROM T2
       WHERE A = @A1
         AND G = 'a'
       GROUP BY A, B, C
 ),
 C4 AS (
      SELECT a.A
           , a.B
           , a.Z
           , CASE WHEN b.AA = 'a' THEN 1
                  WHEN b.AA = 'b' THEN 5
                  WHEN ISNULL(b.AA, '') = '' AND c.AB  LIKE '%%someword1' THEN 2
                  WHEN ISNULL(b.AA, '') = '' AND c.AB  LIKE '%%someword2' THEN 3
                  ELSE 4 END AS AC
        FROM T3 a
        LEFT JOIN T4 b 
          ON b.AD = 'a' 
         AND b.AE = 'b'
         AND a.B = b.AF
       WHERE a.A = @A1
         AND a.AH = @A2 
 )
 SELECT a.*
      , b.E AS AJ
   FROM C4 a
   LEFT JOIN C1 b
     ON a.A = b.A
    AND a.B = b.B
    AND a.C = b.C
   ORDER BY AC, B, C; 

In version 1.3, the query executes correctly, including LIKE '%%someword1' and LIKE '%%someword2'. However, in version 1.5, an error occurs:
('Replacement index 4 out of range for positional args tuple',)
This indicates an issue with escape handling for %% in the LIKE clause.

Could you please provide any updates or an estimated timeline for resolving this issue? Your assistance is greatly appreciated.

Thank you for your hard work on this project, and I look forward to your response.

Best regards,

Relevant Issues and Pull Requests

ISSUES : #394

@INNORAON INNORAON added the question Further information is requested label Dec 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant