Current source code sets page size = 4096 by default.
If "a priori" page size of backup is unknown and if it is not set (right) this could lead to error during restore. For example: "key size for index exceeds limit" can happen because limit for key size depends on page size
Imho, optional parameters such as page size and page buffers should not be passed to Spb if they are not specified.
fix is simple:
1) remove initialization of pageBuffers and pageSize from constructor FbRestore()
2) update setter of PageSize to allow 0 value
3) replace in FbRestore.Execute()
this.StartSpb.Append(IscCodes.isc_spb_res_buffers, this.pageBuffers);
this.StartSpb.Append(IscCodes.isc_spb_res_page_size, this.pageSize);
with
if (pageBuffers!=0)
this.StartSpb.Append(IscCodes.isc_spb_res_buffers, this.pageBuffers);
if (pageSize!=0)
this.StartSpb.Append(IscCodes.isc_spb_res_page_size, this.pageSize);
Submitted by: Konstantin Dombrugov (abracadabra)
Current source code sets page size = 4096 by default. If "a priori" page size of backup is unknown and if it is not set (right) this could lead to error during restore. For example: "key size for index exceeds limit" can happen because limit for key size depends on page size
Imho, optional parameters such as page size and page buffers should not be passed to Spb if they are not specified.
fix is simple: 1) remove initialization of pageBuffers and pageSize from constructor FbRestore() 2) update setter of PageSize to allow 0 value
3) replace in FbRestore.Execute() this.StartSpb.Append(IscCodes.isc_spb_res_buffers, this.pageBuffers); this.StartSpb.Append(IscCodes.isc_spb_res_page_size, this.pageSize); with if (pageBuffers!=0) this.StartSpb.Append(IscCodes.isc_spb_res_buffers, this.pageBuffers); if (pageSize!=0) this.StartSpb.Append(IscCodes.isc_spb_res_page_size, this.pageSize);
Commits: FirebirdSQL/NETProvider@c979db172e03eeb357a00ab09759a11c02dfcccd