Uploaded image for project: 'InvoicePlane'
  1. InvoicePlane
  2. IP-757

When having a large number of clients, a large query results in failure in Codeignitor query builder : preg_match(): Compilation failed: regular expression is too large

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: v1.5.9
    • Fix Version/s: None
    • Component/s: Clients / Users
    • Labels:
      None
    • Environment:

      Tested on LAMP

      PHP 7.2

       

      Description

      When a large number of clients exists. the system generates a large query that results in a error when using the CI query builder.

      To reproduce the problem

      • Create a large number of clients (about 4000 to 5000)
      • Create a new quest user and assign all clients to the user
      • From the main menu, add a new customer.

       

      The issue arises in the function get_not_assigned_to_user() in the file application/modules/clients/models/Mdl_clients.php

      The variable $assigned_clients, with a few thousand client ids are passed to the query builder function where_not_in()

      This effectively builds a large query with  a few thousand WHERE clauses

       

       {{  SELECT ... .. }}
       {{ WHERE client_id <> 2 }}
       {{ AND client_id <> 6 }}
       {{ AND client_id <> 11 }}
       {{ AND client_id <> 12 }}
       {{ ...}}
       {{ ...}}
       {{ AND client_id = 5000 }}
       {{ ,,,}}

       

       

       

       

       

       

       

       

        Gliffy Diagrams

          Attachments

            Structure

              Activity

                People

                • Assignee:
                  Chanderpaul Pradesh
                  Reporter:
                  Chanderpaul Pradesh
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  1 Start watching this issue

                  Dates

                  • Created:
                    Updated:

                    Structure Helper Panel