Show SQL detailed errors when performing API

XMLWordPrintable

    • Type: Change Request
    • Resolution: Unresolved
    • Priority: Trivial
    • None
    • Affects Version/s: None
    • Component/s: API (A)
    • None
    • Environment:
      Frontend version 5.x

      Could you, please, consider returning an actual SQL error when performing API calls which fail on SQL query execution?

      So, for example, instead of "SQL statement execution has failed":

      SQL statement execution has failed \"INSERT INTO hosts (host,proxy_hostid,name,description,hostid) VALUES ('ABC-ABCDEFGHIJ-KL1234-Mnop-3-QRUVW','11723','ABC-ABCDEFGHIJ-KL1234-Mnop-3-QRUVW','','21722')

      An actual detailed error:

      ERROR 1452 (23000): Cannot add or update a child row: a foreign key constraint fails (`zabbix`.`hosts`, CONSTRAINT `c_hosts_1` FOREIGN KEY (`proxy_hostid`) REFERENCES `hosts` (`hostid`))

      Would be returned if the SQL query is being executed anyway.

            Assignee:
            Zabbix Development Team
            Reporter:
            Antons Sincovs
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: