MantisBT - TestLink
View Issue Details
0005464TestLinkDatabase MS-SQLpublic2013-01-11 23:132013-05-26 18:50
aostad 
fman 
normalmajoralways
closedfixed 
WindowsServer 2008R2
1.9.5 (2012 Q4 - bug fixing) 
1.9.6 (2013 Q1 - bug fixing) 
SQL Server 2008
any
5.3.13
READY FOR TESTING
0005464: DB Access error after deleting events from Event view (SQL server 2008)
I've tried to delete events from event viewer without selecting any level (i.e. All). As a result I got "DB Access Error" (attached file).

Now, every time people go to login page or when log out from Testlink, the error shows up.

Just go to Event viewer page as admin.
Click on "Clear Events" without selecting any log level or user.
I have attached the log file generated by Testlink and a screenshot.
No tags attached.
child of 0005406closed fman Availables hot-fixes for 1.9.5 & How To get full fixed package from gitorious 
txt Deleting Events error.txt (152,702) 2013-01-11 23:13
http://mantis.testlink.org/file_download.php?file_id=3084&type=bug
jpg Deleting Events error-screenshot.jpg (51,361) 2013-01-11 23:15
http://mantis.testlink.org/file_download.php?file_id=3085&type=bug
jpg
Issue History
2013-01-11 23:13aostadNew Issue
2013-01-11 23:13aostadFile Added: Deleting Events error.txt
2013-01-11 23:15aostadFile Added: Deleting Events error-screenshot.jpg
2013-01-12 09:12fmanDescription Updatedbug_revision_view_page.php?rev_id=2312#r2312
2013-01-19 15:50fmanNote Added: 0018192
2013-01-19 15:52fmanNote Edited: 0018192bug_revision_view_page.php?bugnote_id=18192#r2341
2013-01-19 16:24fmanNote Edited: 0018192bug_revision_view_page.php?bugnote_id=18192#r2342
2013-01-19 16:26fmanNote Edited: 0018192bug_revision_view_page.php?bugnote_id=18192#r2343
2013-01-19 17:17fmanNote Added: 0018193
2013-01-19 17:17fmanAssigned To => fman
2013-01-19 17:17fmanStatusnew => feedback
2013-01-19 17:17fmanQA Team - Task Workflow StatusTBD => READY FOR TESTING
2013-01-19 17:17fmanRelationship addedchild of 0005406
2013-01-20 02:45aostadNote Added: 0018195
2013-01-20 02:45aostadStatusfeedback => assigned
2013-01-20 03:01aostadNote Added: 0018196
2013-01-20 11:02fmanNote Deleted: 0018195
2013-01-20 16:15fmanNote Added: 0018197
2013-01-20 21:11fmanNote Edited: 0018197bug_revision_view_page.php?bugnote_id=18197#r2348
2013-02-12 20:40fmanStatusassigned => resolved
2013-02-12 20:40fmanFixed in Version => 1.9.6 (2013 Q1 - bug fixing)
2013-02-12 20:40fmanResolutionopen => fixed
2013-05-26 18:50fmanStatusresolved => closed

Notes
(0018192)
fman   
2013-01-19 15:50   
(edited on: 2013-01-19 16:26)
Issue seems related to logic used to do the delete ( SQL with IN CLAUSE).
As found by user (see forum) in this particular situation qty of elements on IN was over the limit impossed and managed by MSSQL

On attached error file this is indicated by this message to some extend

The query processor ran out of internal resources and could not produce a query plan. This is a rare event and only expected for extremely complex queries or queries that reference a very large number of tables or partitions.


Some references that can be useful to understand a little bit more

http://stackoverflow.com/questions/1869753/maximum-size-for-a-sql-server-query-in-clause-is-there-a-better-approach [^]

http://stackoverflow.com/questions/1069415/t-sql-where-col-in [^]

(0018193)
fman   
2013-01-19 17:17   
http://gitorious.org/testlink-ga/testlink-code/commit/bc12e84411952e2c846e26e7958b9a142ec99538 [^]

Please replace the file pointed by the commit, retest and provide feedback
(0018196)
aostad   
2013-01-20 03:01   
I've replaced the original logger.class.php with the new one. To test it, I need time until events are pile up, so I prefer to wait for a week or more then clean events.
(0018197)
fman   
2013-01-20 16:15   
(edited on: 2013-01-20 21:11)
Proposed solution has issue with MySQL while working with Postgres, need to find an alternative.

This seems to work
http://gitorious.org/testlink-ga/testlink-code/commit/fba0b575407e6c95909f833d57faf60f907b1690 [^]