Bug #82713 ExecuteScalar throws error Expected end of data packet
Submitted: 24 Aug 2016 17:51 Modified: 25 Sep 2016 13:15
Reporter: Louise Eggleton Email Updates:
Status: No Feedback Impact on me:
Category:Connector / NET Severity:S1 (Critical)
Version:5.7.12 Community OS:Windows (2012 R2)
Assigned to: Assigned Account CPU Architecture:Any
Tags: connector.net, ExecuteScalar, query cache

[24 Aug 2016 17:51] Louise Eggleton
On pages with lots of separate read queries, we frequently get the error: "Expected end of data packet". This is happening on 3 separate dashboard style pages and the failed queries are different, but all are of the type ExecuteScalar with one parameter. 
For example:

SELECT name FROM t_company WHERE ID = 3
SELECT CarrierName FROM t_carrier WHERE ID = 5

If I restart the database server the problem goes away for a few days, but always returns. This leads me to suspect the issue has to do with caching. query_cache_size was set to default 1M any query_cache_type = 1. Database is large-ish (267 tables, 82 views, 55 Stored Procs, 19 Triggers). Medium traffic, read/write mix roughly 65/35.  Same app ran without issue 5.7.10 with same configuration. Have disabled the query cache for the next few days to see if the problem goes away, then I will re-enable and do some monitoring.

Issue seems to be related to the number of queries not volume of data. After restarting mySQL, affected pages return quickly with no lag time.

Seems similar to a an old bug http://bugs.mysql.com/bug.php?id=7439 in that the error message is the same and it involves ExecuteScalar. 

How to repeat:
Create database with lots of tables. 200+. Set query_cache_size to 1M any query_cache_type = 1. Issue several separate queries including one or more ExecuteScalar requests all at once from application (20-30 queries). 

Suggested fix:
Check ExecuteScalar for issues with caching.
[25 Aug 2016 13:15] Chiranjeevi Battula
Hello Louise Eggleton,

Thank you for the bug report.
I could not repeat the issue at our end using with Visual Studio 2013, Connector/NET 6.9.9 and MySQL 5.7.14 version.
Could you please provide repeatable test case (exact steps/sample project, screenshot, create table statements/database etc. - please make it as private if you prefer) to confirm this issue at our end?

[26 Sep 2016 1:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".