Zabbix installation was upgraded from 5.0.8 to 5.0.14 and an issue appeared when we try to import a template, linked to many hosts.
We tried to upgrade/downgrade frontend back and forth and it seems it's reproducible on 5.0.14 only, but it's not guaranteed. Anyway, an issue is there.
Attached is 2 long SQLs on 5.0.14 5014-sqls-wrapped
It formatted using sed, to add \n after each OR, for better readability.
It contains ~30K "OR f.functionid BETWEEN 4286266 AND 4286270..." repeats.
And also ~50 "OR f.functionid IN(less than 1000)..." repeats, which ONLY were seen in debug in 5.0.8 and they were successful.
So, looks like new 30K repeats supposedly cause an issue.
Attaching also similar? import attempt SQLs from debug on 5.0.8 (formatted too) 508-sqls-wrapped
Note also how these 2 SQLs are slow on 5.0.14 (270 seconds each) - not acceptable.