Bug #930 Restriction of merge table size when using query caching
Submitted: 25 Jul 2003 23:24 Modified: 30 Jul 2003 8:26
Reporter: Scott Muller Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: MyISAM storage engine Severity:S3 (Non-critical)
Version:4.0.12-max-log OS:Linux (Redhat 8.0)
Assigned to: Oleksandr Byelkin

[25 Jul 2003 23:24] Scott Muller
Description:
There appears to be a limit of 255 member tables in a merge table when you have query_cache_size > 0. If query caching is off and number of table > 255 there are no problems. If query caching is on and number of member tables <= 255 - no probs. It is when query_cache_size > 0 and the unioned tables of the merge table number >= 256 that the connection dies with a SIGNAL 11.

How to repeat:
1) Create a merge table (say 'tmerge') with 255 member tables
2) Set query_cache_size > 0 (say 1M)
3) query merge table (eg SELECT COUNT(*) FROM tmerge;):

mysql> select count(*) from tmerge;
+----------+
| count(*) |
+----------+
|  5463827 |
+----------+

4) Create tmerge with > 255 tables
5) Repeat query:

mysql> select count(*) from tmerge;
ERROR 2013: Lost connection to MySQL server during query
[29 Jul 2003 16:13] Scott Muller
I have uploaded a PHP script to generate the tables. Just enter user and password in the appropriate lines.
[29 Jul 2003 16:14] Scott Muller
Generate merge table

Attachment: mergetest.php (application/octet-stream, text), 933 bytes.

[30 Jul 2003 1:24] Lenz Grimmer
Sanja, could you take a look at this please?
[30 Jul 2003 5:03] Oleksandr Byelkin
ChangeSet 
  1.1552 03/07/30 14:59:56 bell@sanja.is.com.ua +3 -0 
  support of more then 255 tables dependence in query cache (fixed BUG#930)