Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

osTicket v1.10 (stable) and Maintenance Release v1.9.15 are now available! Go get it now

Received this error the other day in our production.

This hasn't caused any noticable problems as far as i have seen.  Anyone else seeing the same thing?  Our setup is almost pure stock with no .php changes made to the system.  The only thing we did do was import some data via mysql scripts.

[SELECT DISTINCT COALESCE(B1.ticket_id, B2.ticket_id, B3.ticket_id, B4.ticket_id) FROM (select ticket_id as ticket_id from ost_ticket

            ) B1 ON (B1.ticket_id = search.object_id and search.object_type = 'T') LEFT JOIN (select A2.id as thread_id, A1.ticket_id from ost_ticket A1

                join ost_ticket_thread A2 on (A1.ticket_id = A2.ticket_id)

            ) B2 ON (B2.thread_id = search.object_id and search.object_type = 'H') LEFT JOIN (select A3.id as user_id, A1.ticket_id from ost_user A3

                join ost_ticket A1 on (A1.user_id = A3.id)

            ) B3 ON (B3.user_id = search.object_id and search.object_type = 'U') LEFT JOIN (select A4.id as org_id, A1.ticket_id from ost_organization A4

                join ost_user A3 on (A3.org_id = A4.id) join ost_ticket A1 on (A1.user_id = A3.id)

            ) B4 ON (B4.org_id = search.object_id and search.object_type = 'O') LEFT JOIN ost_ticket A1 ON (A1.ticket_id = COALESCE(B1.ticket_id, B2.ticket_id, B3.ticket_id, B4.ticket_id)) LEFT JOIN ost_ticket_status A2 ON (A1.status_id = A2.id) WHERE A2.id = 2 AND ((A1.staff_id=20 AND A2.state="open") OR A1.dept_id IN (1) OR A1.team_id IN (2) AND A2.state="open") LIMIT 500]

 

You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'ON (B1.ticket_id = search.object_id and search.object_type = 'T') LEFT JOIN (sel' at line 2<br /> <br />

---- Backtrace ----<br />

#0 (root)/include/mysqli.php(177): osTicket->logDBError('DB Error #1064', '[SELECT DISTINC...')<br />

#1 (root)/include/class.search.php(418): db_query('SELECT DISTINCT...', Object(Closure))<br />

#2 (root)/include/class.search.php(66): MysqlSearchBackend->find('', Array, 'Ticket', Array)<br />

#3 (root)/include/ajax.tickets.php(239): SearchInterface->find(' ', Array, 'Ticket')<br />

#4 (root)/include/ajax.tickets.php(261): TicketsAjaxAPI->_search(Array)<br />

#5 [internal function]: TicketsAjaxAPI->search()<br />

#6 (root)/include/class.dispatcher.php(145): call_user_func_array(Array, Array)<br />

#7 (root)/include/class.dispatcher.php(38): UrlMatcher->dispatch('search', Array)<br />

#8 (root)/include/class.dispatcher.php(120): Dispatcher->resolve('search', Array)<br />

#9 (root)/include/class.dispatcher.php(38): UrlMatcher->dispatch('/tickets/search', NULL)<br />

#10 (root)/scp/ajax.php(186): Dispatcher->resolve('/tickets/search')<br />

#11 {main}

Tagged:

Comments

  • we are running Version 1.94 on Centos 7 with a mariadb.  
  • This does not appear to be a MariaDB issue, as when I run the query that you provided I get the same error.

    [Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ON (B1.ticket_id = search.object_id and search.object_type = 'T') LEFT JOIN (sel' at line 3

    It would appear what query is generating the error.  Where is the query from?
  • I am not sure exactly what the error is being generated from.  This happened yesterday andI didn't get the error until the following morning via email from the osticket alert.  We have  a number of users in the system and it is hard to pinpoint exactly what users were doing.  
  • Hi,
    I got same error. It comes from class searchInterface->find when it receives empty on $query parameter. Resolving...
Sign In or Register to comment.