Add chunked file data support
This will remove the upper limit of BLOB sizes imposed by MySQL with the max_allowed_packet setting completely. This adds a new table %file_chunk which will contain the filedata in smaller chunks (256kB). It also includes a new class, AttachmentChunkedData, which will handle reading and writing the data, abstracting away the chunks. This is done by migrating data from the %file table to the %file_chunk table. One must beware that this must safely (the migration that is) plug into the both the live osTicket developers as well as the users doing a full upgrade from osTicket-1.6*. For this, the AttachmentFile::save method was patched to use the new AttachmentChunkedData class to write the attachment data to the database in chunks. That is, the migrater will use the new code on the major upgrade and bypass the filedata column of the %file table altogether. Therefore, the patch associated with this commit will not migrate any data for the major upgrade. For developers doing incremental upgrades, the patch included in this commit will transfer the data from the %file data to the new %file_chunk table by chunking it. As written, only the first 16MB of the attachment is migrated. This could easily be adjusted, but it seems like a reasonable limit for now.
Showing
- include/class.file.php 76 additions, 59 deletionsinclude/class.file.php
- include/upgrader/sql/15b30765-dd0022fb.patch.sql 39 additions, 0 deletionsinclude/upgrader/sql/15b30765-dd0022fb.patch.sql
- main.inc.php 2 additions, 1 deletionmain.inc.php
- setup/inc/sql/osTicket-mysql.sql 12 additions, 3 deletionssetup/inc/sql/osTicket-mysql.sql
- setup/inc/sql/osTicket-mysql.sql.md5 1 addition, 1 deletionsetup/inc/sql/osTicket-mysql.sql.md5
Loading
Please register or sign in to comment